/* ========================================================================
   Hucheor : thème "Le Héraut", parchemin, encre, terracotta, laiton.
   Priorité absolue à la lisibilité (public malvoyant) : contrastes forts,
   tailles généreuses, jamais de texte porté par une image.
   ======================================================================== */

:root {
  --parchment: #f3e8d2;
  --parchment-deep: #e9d9b6;
  --ink: #241708;
  --ink-soft: #4a3420;
  --terracotta: #b1451f;
  --terracotta-deep: #8a3417;
  --brass: #a9782f;
  --brass-ink: #7a5722; /* variante foncee du laiton : seule utilisee en texte sur fond clair (ratio >= 4.5:1 AA), --brass reste reserve au decoratif (bordures, anneaux) */
  --brass-light: #e7c77a;
  --night: #241708;
  --night-panel: #2f2013;

  --font-display: "IM Fell English SC", Georgia, serif;
  --font-body: "General Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --radius: 14px;
  --max: 1180px;
  --shadow-soft: 0 18px 40px -20px rgba(36, 23, 8, 0.45);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--parchment);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 19px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  letter-spacing: 0.01em;
  line-height: 1.1;
  color: var(--ink);
  margin: 0;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--terracotta);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Lien d'évitement : invisible tant qu'il n'a pas le focus clavier */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  background: var(--ink);
  color: var(--parchment);
  font-weight: 700;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 1rem;
}

/* Grain overlay : texture papier subtile, jamais au-dessus du texte */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image:
    radial-gradient(rgba(36, 23, 8, 0.05) 1px, transparent 1px),
    radial-gradient(rgba(36, 23, 8, 0.04) 1px, transparent 1px);
  background-size: 3px 3px, 5px 5px;
  background-position: 0 0, 1px 2px;
}

/* ---------------------------------- Topbar ---------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.1rem clamp(1.25rem, 4vw, 3rem);
  background: rgba(243, 232, 210, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(36, 23, 8, 0.12);
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-size: 1.6rem;
  text-decoration: none;
  color: var(--ink);
}

.wordmark-glyph {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.topnav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2rem);
  font-size: 0.98rem;
}

.topnav-links {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2rem);
}

.topnav-links a {
  text-decoration: none;
  color: var(--ink-soft);
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.topnav-links a:hover { color: var(--terracotta-deep); border-color: var(--terracotta); }

.topnav-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--ink);
  color: var(--parchment) !important;
  padding: 0.7rem 1.5rem;
  border-radius: 999px;
  border-bottom: none !important;
  line-height: 1.2;
  text-decoration: none;
}

.topnav-cta:hover { background: var(--terracotta-deep); }

.external-icon {
  width: 0.85em;
  height: 0.85em;
  flex-shrink: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Bouton burger "sceau" : cache sur desktop, visible sous 720px */
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 50%;
}

.menu-toggle-seal {
  width: 42px;
  height: 42px;
}

.menu-toggle-seal circle {
  fill: var(--ink);
  stroke: none;
  transition: fill 0.2s ease;
}

.menu-toggle:hover .menu-toggle-seal circle { fill: var(--terracotta-deep); }

.menu-toggle-burger path,
.menu-toggle-cross path {
  fill: none;
  stroke: var(--parchment);
  stroke-width: 3;
  stroke-linecap: round;
}

.menu-toggle-burger,
.menu-toggle-cross {
  transform-origin: 22px 22px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.menu-toggle-cross {
  opacity: 0;
  transform: scale(0.6);
}

.menu-toggle[aria-expanded="true"] .menu-toggle-burger {
  opacity: 0;
  transform: scale(0.6);
}

.menu-toggle[aria-expanded="true"] .menu-toggle-cross {
  opacity: 1;
  transform: scale(1);
}

@media (max-width: 720px) {
  .menu-toggle { display: inline-flex; }

  .topnav-links {
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--parchment);
    border-bottom: 1px solid rgba(36, 23, 8, 0.12);
    box-shadow: 0 16px 24px -16px rgba(36, 23, 8, 0.35);
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    transition: max-height 0.25s ease;
  }

  .topnav-links.is-open {
    max-height: 60vh;
    visibility: visible;
  }

  .topnav-links a {
    padding: 1rem clamp(1.25rem, 4vw, 3rem);
    border-bottom: 1px solid rgba(36, 23, 8, 0.08);
  }
}

/* ---------------------------------- Layout ------------------------------ */

main { position: relative; z-index: 2; }

section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 7rem) clamp(1.25rem, 4vw, 3rem);
}

.section-head {
  max-width: 720px;
  margin-bottom: clamp(2rem, 5vw, 3rem);
}

.section-kicker {
  font-family: var(--font-body);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.85rem;
  color: var(--terracotta-deep);
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.section-kicker::before {
  content: '';
  display: block;
  width: 1.5rem;
  height: 2px;
  background: var(--brass);
  flex-shrink: 0;
  opacity: 0.8;
}

.section-head h2 {
  font-size: clamp(1.9rem, 4vw, 2.7rem);
}

/* ---------------------------------- Hero -------------------------------- */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  padding-top: clamp(3rem, 10vw, 6rem);
  padding-bottom: clamp(4rem, 10vw, 7rem);
  overflow: hidden;
  min-height: 78vh;
}

.hero-rings {
  position: absolute;
  right: clamp(-140px, 4vw, 40px);
  top: 50%;
  transform: translateY(-50%);
  width: min(560px, 60vw);
  height: min(560px, 60vw);
  z-index: 0;
}

.hero-rings .ring {
  position: absolute;
  inset: 0;
  border: 2px solid var(--brass);
  border-radius: 50%;
  opacity: 0;
  animation: pulse-ring 5.6s ease-out infinite;
}

.ring-1 { animation-delay: 0s; }
.ring-2 { animation-delay: 1.4s; }
.ring-3 { animation-delay: 2.8s; }
.ring-4 { animation-delay: 4.2s; }

@keyframes pulse-ring {
  0%   { transform: scale(0.28); opacity: 0.75; }
  70%  { opacity: 0.12; }
  100% { transform: scale(1); opacity: 0; }
}

.hero-rings .bell {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 52%;
  height: auto;
  filter: drop-shadow(0 10px 18px rgba(138, 52, 23, 0.35));
}

/* En dessous de 860px, les anneaux passent sous le texte au lieu de le chevaucher :
   le positionnement absolu centre sur .hero (qui grandit avec le texte), pas sur la
   place restante, donc le texte long finit par passer derriere le motif. */
@media (max-width: 860px) {
  .hero {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .hero-content { order: 1; }

  .hero-rings {
    order: 2;
    position: relative;
    inset: auto;
    right: auto;
    top: auto;
    transform: none;
    width: min(280px, 70vw);
    height: min(280px, 70vw);
    margin: 2.5rem auto 0;
  }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 680px;
}

.eyebrow {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.85rem;
  color: var(--brass);
  background: var(--night);
  display: inline-block;
  padding: 0.75rem 1.4rem;
  line-height: 1.5;
  border-radius: 999px;
  margin-bottom: 1.6rem;
}

.hero h1 {
  font-size: clamp(3.8rem, 11vw, 7.5rem);
  color: var(--terracotta-deep);
  margin-bottom: 0.15em;
}

.baseline {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  font-style: italic;
  color: var(--ink-soft);
  margin-bottom: 1.4rem;
}

.hero-text {
  font-size: 1.15rem;
  max-width: 560px;
  color: var(--ink-soft);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.2rem;
}

/* ---------------------------------- Boutons ------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.02rem;
  text-decoration: none;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  border: 2px solid transparent;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.btn-primary {
  background: var(--terracotta);
  color: var(--parchment);
  box-shadow: var(--shadow-soft);
}

.btn-primary:hover {
  background: var(--terracotta-deep);
  transform: translateY(-2px);
}

.btn-ghost {
  border-color: var(--ink);
  color: var(--ink);
}

.btn-ghost:hover {
  background: var(--ink);
  color: var(--parchment);
  transform: translateY(-2px);
}

/* ---------------------------------- Problème ----------------------------- */

.compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: clamp(1.5rem, 3vw, 2.2rem);
}

.compare-card {
  background: var(--parchment-deep);
  border-radius: var(--radius);
  padding: clamp(1.6rem, 3vw, 2.2rem);
  border: 1px solid rgba(36, 23, 8, 0.12);
  position: relative;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.compare-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 28px 52px -20px rgba(36, 23, 8, 0.32);
}

.compare-card--works { border-top: 6px solid var(--brass); }
.compare-card--missing { border-top: 6px solid var(--terracotta); }

.compare-tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 0.9rem;
}

.compare-card--works .compare-tag { background: rgba(169, 120, 47, 0.18); color: var(--brass-ink); }
.compare-card--missing .compare-tag { background: rgba(177, 69, 31, 0.16); color: var(--terracotta-deep); }

.compare-card h3 {
  font-size: 1.4rem;
  margin-bottom: 0.7rem;
}

/* ---------------------------------- Étapes -------------------------------- */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: clamp(1.5rem, 3vw, 2rem);
  counter-reset: step;
  position: relative;
}

.step {
  position: relative;
  padding-top: 0.4rem;
}

.step-index {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--ink);
  color: var(--brass-light);
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 1.1rem;
  box-shadow: var(--shadow-soft);
}

.step h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.step p { color: var(--ink-soft); }

@media (min-width: 861px) {
  .steps {
    grid-template-columns: repeat(4, 1fr);
  }
  .steps::before {
    content: "";
    position: absolute;
    top: 1.5rem;
    left: 6%;
    right: 6%;
    height: 2px;
    background-image: repeating-linear-gradient(to right, var(--brass) 0 10px, transparent 10px 20px);
    z-index: 0;
  }
}

/* ---------------------------------- Open source --------------------------- */

.opensource {
  max-width: none;
  background: var(--night);
  color: var(--parchment);
  padding: 0;
}

.opensource-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 7rem) clamp(1.25rem, 4vw, 3rem);
}

.section-head--dark h2 { color: var(--brass-light); }
.section-head--dark .section-kicker { color: var(--brass); }

.opensource-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
}

@media (max-width: 860px) {
  .opensource-grid { grid-template-columns: 1fr; }
}

.opensource-text p {
  font-size: 1.1rem;
  color: rgba(243, 232, 210, 0.88);
}

.opensource-card {
  background: var(--night-panel);
  border: 1px solid rgba(231, 199, 122, 0.25);
  border-radius: var(--radius);
  padding: clamp(1.6rem, 3vw, 2.2rem);
}

.opensource-card h3 {
  color: var(--brass-light);
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

.opensource-card ul {
  margin: 0;
  padding-left: 1.2rem;
  color: rgba(243, 232, 210, 0.85);
}

.opensource-card li { margin-bottom: 0.6rem; }
.opensource-card li:last-child { margin-bottom: 0; }

/* ---------------------------------- Feuille de route ----------------------- */

.roadmap-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: clamp(1.5rem, 3vw, 2.2rem);
}

.roadmap-item {
  background: var(--parchment-deep);
  border-radius: var(--radius);
  padding: clamp(1.6rem, 3vw, 2.2rem);
  border: 1px solid rgba(36, 23, 8, 0.12);
  border-top: 6px solid var(--ink-soft);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.roadmap-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 28px 52px -20px rgba(36, 23, 8, 0.28);
}

.roadmap-item--current { border-top-color: var(--terracotta); }

.roadmap-tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 0.9rem;
  background: rgba(36, 23, 8, 0.1);
  color: var(--ink-soft);
}

.roadmap-item--current .roadmap-tag {
  background: rgba(177, 69, 31, 0.16);
  color: var(--terracotta-deep);
}

.roadmap-item h3 {
  font-size: 1.4rem;
  margin-bottom: 0.7rem;
}

.roadmap-item p { color: var(--ink-soft); }

/* ---------------------------------- Statut -------------------------------- */

.status {
  text-align: center;
  max-width: 720px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--parchment-deep);
  border: 1px solid rgba(177, 69, 31, 0.35);
  color: var(--terracotta-deep);
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  margin-bottom: 1.6rem;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--terracotta);
  animation: dot-breathe 2.4s ease-in-out infinite;
}

@keyframes dot-breathe {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.status h2 {
  font-size: clamp(1.9rem, 4vw, 2.5rem);
  margin-bottom: 1rem;
}

.status p {
  color: var(--ink-soft);
  font-size: 1.1rem;
  margin-bottom: 1.8rem;
}

/* ---------------------------------- Footer -------------------------------- */

.faq-list {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.faq-item {
  background: var(--parchment-deep);
  border: 1px solid rgba(36, 23, 8, 0.15);
  border-radius: var(--radius);
  padding: 1.1rem 1.4rem;
}

.faq-item summary {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::marker { content: ''; }

.faq-item summary::after {
  content: '+';
  font-family: var(--font-body);
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--terracotta-deep);
  flex-shrink: 0;
  line-height: 1;
  transition: transform 0.25s ease;
  transform-origin: center;
}

details[open].faq-item > summary::after {
  transform: rotate(45deg);
}

.faq-item p {
  margin: 0.8rem 0 0.1rem;
  color: var(--ink-soft);
  line-height: 1.7;
}

.faq-item a {
  color: var(--terracotta-deep);
}

.site-footer {
  border-top: 1px solid rgba(36, 23, 8, 0.15);
  text-align: center;
  padding: 2.2rem 1.5rem 2.6rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
  position: relative;
  z-index: 2;
}

.site-footer a { color: inherit; }

.site-footer p + p { margin-top: 0.5rem; }

/* ---------------------------------- Reveal on load ------------------------- */

.hero-content > * {
  opacity: 0;
  transform: translateY(14px);
  animation: reveal 0.7s ease forwards;
}

.hero-content > *:nth-child(1) { animation-delay: 0.05s; }
.hero-content > *:nth-child(2) { animation-delay: 0.18s; }
.hero-content > *:nth-child(3) { animation-delay: 0.32s; }
.hero-content > *:nth-child(4) { animation-delay: 0.46s; }
.hero-content > *:nth-child(5) { animation-delay: 0.6s; }

@keyframes reveal {
  to { opacity: 1; transform: translateY(0); }
}
