/* SPDX-License-Identifier: CC-BY-4.0
 * Copyright (c) 2026 Emmanuelle Poncin */

:root {
  --bg: #fdfbf5;
  --surface: #ffffff;
  --border: #ece6d6;
  --text: #2a3140;
  --muted: #6c6f7a;
  --accent: #3d7ea8;
  --accent-soft: #d7eaf6;
  --accent-hover: #2c5f80;
  --yellow: #f0c862;
  --yellow-soft: #fbe9b1;
  --yellow-deep: #6b4f10;
  --radius: 10px;
  --max: 880px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  max-width: var(--max);
  margin: 0 auto;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.brand:hover { text-decoration: none; }

.logo { width: 32px; height: 32px; display: block; }
.brand-name { font-size: 1.05rem; }

.site-nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }

.nav-link {
  padding: 0.25rem 0;
  color: var(--muted);
  font-size: 0.95rem;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.nav-link:hover {
  color: var(--accent);
  text-decoration: none;
  border-bottom-color: var(--yellow-soft);
}
.nav-link.active {
  color: var(--accent);
  border-bottom-color: var(--yellow);
}

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
}

h1 {
  font-size: 1.9rem;
  line-height: 1.25;
  margin: 0 0 1rem;
  color: var(--accent);
  font-weight: 600;
  position: relative;
}
main h1::after {
  content: "";
  display: block;
  width: 2.4rem;
  height: 4px;
  background: var(--yellow);
  border-radius: 2px;
  margin-top: 0.7rem;
}

h2 { font-size: 1.15rem; margin: 0 0 0.5rem; color: var(--accent); font-weight: 600; }
h3 { font-size: 1.05rem; margin: 0 0 0.35rem; color: var(--text); font-weight: 600; }

p { margin: 0 0 1rem; }
.lede { font-size: 1.1rem; color: var(--muted); max-width: 60ch; }

.hero { padding: 1rem 0 2rem; }
.hero h1 { font-size: 2.2rem; max-width: 22ch; }

.intro { padding: 0.5rem 0 1rem; }
.intro h1 { font-size: 2.1rem; }
.prose { margin-top: 2rem; }
.prose h2 { font-size: 1.3rem; margin-bottom: 0.6rem; }
.prose p { color: var(--text); max-width: 70ch; }

.button {
  display: inline-block;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-weight: 500;
  margin: 0.4rem 0.4rem 0 0;
  border: 1px solid var(--accent);
}
.button:hover { background: var(--accent-hover); color: #fff; text-decoration: none; }

.button-ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent-soft);
}
.button-ghost:hover {
  background: var(--yellow-soft);
  color: var(--yellow-deep);
  border-color: var(--yellow);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
}
.card p { margin-bottom: 0; color: var(--muted); }

.steps {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.steps li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
}
.steps li p { margin: 0; color: var(--muted); }
.steps li h3 { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.steps li.step-expand { border-left-color: var(--yellow); }
.steps li.step-compress { border-left-color: var(--accent); }

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  background: var(--yellow);
  color: var(--yellow-deep);
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 700;
  flex-shrink: 0;
  line-height: 1;
}
.steps em { font-style: italic; color: var(--text); }

.phase {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  margin-left: 0.5rem;
  vertical-align: middle;
  line-height: 1.6;
}
.phase-expand { background: var(--yellow-soft); color: #6b4f10; }
.phase-compress { background: var(--accent); color: #fff; }

.resource-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.resource-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
}
.resource-list li p { margin: 0; color: var(--muted); }

.note {
  color: var(--muted);
  font-size: 0.95rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  margin-top: 2rem;
}

.section-title {
  font-size: 1.35rem;
  margin-top: 2.4rem;
  margin-bottom: 0.4rem;
  color: var(--accent);
}

.qa-group { margin: 1.2rem 0 1.6rem; }
.qa-group-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 0.6rem;
}

.qa {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  overflow: hidden;
}
.qa summary {
  cursor: pointer;
  padding: 0.85rem 1.1rem;
  font-weight: 500;
  color: var(--text);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: background 0.15s;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after {
  content: "+";
  color: var(--yellow-deep);
  background: var(--yellow);
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.qa summary:hover { background: var(--bg); }
.qa[open] summary {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.qa[open] summary::after {
  content: "−";
  background: var(--accent);
  color: #fff;
}
.qa-body {
  padding: 0.9rem 1.1rem 1rem;
}
.qa-body p {
  margin: 0;
  color: var(--muted);
}

.contact-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--yellow);
  border-radius: var(--radius);
  padding: 1.8rem 2rem;
  margin-top: 1.2rem;
  box-shadow: 0 1px 2px rgba(40, 40, 40, 0.04);
}
.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.contact-form label.full {
  grid-column: 1 / -1;
}
.contact-form label span {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.contact-form input,
.contact-form textarea {
  font: inherit;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  width: 100%;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 70%, transparent);
}
.contact-form input:hover,
.contact-form textarea:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.contact-form textarea { resize: vertical; min-height: 160px; }
.contact-form .actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1rem;
  margin-top: 0.2rem;
}
.contact-form .actions .hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin-right: auto;
}
.contact-form button {
  cursor: pointer;
  font: inherit;
  margin: 0;
}

@media (max-width: 640px) {
  .contact-form {
    grid-template-columns: 1fr;
    padding: 1.4rem;
  }
}

.site-footer {
  max-width: var(--max);
  margin: 2rem auto 0;
  padding: 1.8rem 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
  position: relative;
}
.site-footer::before {
  content: "";
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 3rem;
  height: 3px;
  background: var(--yellow);
  border-radius: 2px;
}

.site-footer p { margin: 0.25rem 0; }
.site-footer .license { font-size: 0.8rem; }
.site-footer .license a { color: var(--accent); text-decoration: underline; }

.citation {
  border-left: 3px solid var(--yellow);
  padding: 0.4rem 0 0.4rem 1rem;
  margin: 0.6rem 0 0;
  color: var(--text);
  font-size: 0.95rem;
}

/* ===== Tools and Templates ===== */

.subsection-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 600;
  margin: 1.6rem 0 0.6rem;
}

.download-card {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--yellow);
  border-radius: var(--radius);
  padding: 1.3rem 1.5rem;
  margin: 1rem 0 1.5rem;
}
.download-card-info { flex: 1; min-width: 0; }
.download-card h3 {
  margin: 0 0 0.3rem;
  color: var(--accent);
  font-size: 1.05rem;
}
.download-card p {
  margin: 0;
  color: var(--muted);
}
.download-card .button { flex-shrink: 0; margin: 0; }

.glossary-search-wrap { margin: 1rem 0; }
.glossary-search {
  width: 100%;
  font: inherit;
  color: var(--text);
  background-color: var(--surface);
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%236c6f7a' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='M11 11 L14 14'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0.9rem center;
  background-size: 16px 16px;
  padding: 0.7rem 0.9rem 0.7rem 2.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s, background-color 0.15s;
}
.glossary-search:focus {
  outline: none;
  border-color: var(--accent);
  background-color: #fff;
}

.glossary { display: flex; flex-direction: column; gap: 0.55rem; }
.glossary-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
}
.glossary-term {
  font-size: 1rem;
  color: var(--accent);
  margin: 0 0 0.3rem;
  font-weight: 600;
}
.glossary-def {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.glossary-no-results {
  display: none;
  text-align: center;
  color: var(--muted);
  font-style: italic;
  padding: 1.5rem 0;
  margin: 0;
}

.qualities {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.7rem;
  margin: 0.8rem 0 1.5rem;
}
.quality-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--yellow);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
}
.quality-card h3 {
  margin: 0 0 0.35rem;
  color: var(--accent);
  font-size: 1rem;
}
.quality-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
}

.probes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.8rem 0 1rem;
}
.probe {
  background: var(--yellow-soft);
  color: var(--yellow-deep);
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-style: italic;
  font-size: 0.93rem;
}

@media (max-width: 600px) {
  .hero h1 { font-size: 1.7rem; }
  h1 { font-size: 1.5rem; }
  .site-header { padding: 0.9rem 1rem; }
  main { padding: 1.8rem 1rem 2rem; }
  .download-card { flex-direction: column; align-items: flex-start; }
  .download-card .button { align-self: stretch; text-align: center; }
}
