/* ============================================================
   Neurotest — page d'accueil (refonte 2a)
   Blanc chaud · encre forêt · accent corail · serif éditorial
   ============================================================ */

:root {
  --paper: #f9f7f2;
  --card: #fffefb;
  --ink: #1c2b26;
  --ink-soft: #5d6b64;
  --ink-faint: #7d766a; /* contraste ≥ 4,5:1 sur le fond papier (WCAG AA) */
  --line: #ded8cc;
  --accent: #e05c3a;
  --accent-deep: #c94a2a;
  --dark: #1c2b26;
  --dark-line: #33453d;
  --dark-soft: #8fa398;

  --serif: "Source Serif 4", Georgia, serif;
  --sans: "Archivo", -apple-system, "Helvetica Neue", sans-serif;
  --mono: "IBM Plex Mono", "Courier New", monospace;

  --pad: clamp(24px, 5vw, 64px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* ---------- Transitions entre pages (View Transitions API) ----------
   Fondu croisé par défaut du navigateur : le plus robuste.
   Les animations custom (glissement, header séparé) provoquaient des sauts. */
@view-transition { navigation: auto; }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation: none !important; }
}

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  font-size: 16.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection { background: #f7ddd4; color: var(--accent-deep); }

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

a { color: var(--accent-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }

.wrap { max-width: 1200px; margin: 0 auto; padding-inline: var(--pad); }

.mono-label {
  font-family: var(--mono); font-size: 12px;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ink-faint);
}

/* Pastilles d'information */
.chip-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.chip-row-center { justify-content: center; margin-top: 28px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13.5px; font-weight: 500;
  color: var(--ink-soft);
  background: var(--card); border: 1px solid var(--line);
  padding: 7px 15px; border-radius: 100px;
  white-space: nowrap;
}
.chip svg {
  width: 15px; height: 15px; flex-shrink: 0;
  color: var(--accent);
  transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.chip:hover svg { transform: rotate(-10deg) scale(1.15); }
@keyframes click-pulse {
  0%, 100% { transform: scale(1); }
  12% { transform: scale(0.8); }
  24% { transform: scale(1.08); }
  36% { transform: scale(1); }
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(10px);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 84px;
}
.logo {
  font-family: var(--serif); font-size: 25px;
  color: var(--ink); text-decoration: none;
}
.logo em { font-style: normal; color: var(--accent); }
.header-nav { display: flex; align-items: center; gap: 34px; font-size: 14.5px; font-weight: 500; }
.header-nav > a:not(.btn) { color: var(--ink-soft); text-decoration: none; transition: color 0.15s; }
.header-nav > a:not(.btn):hover { color: var(--ink); }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--sans); font-weight: 600; font-size: 15px;
  padding: 13px 28px; border-radius: 100px;
  text-decoration: none; border: none; cursor: pointer;
  transition: background 0.18s, transform 0.15s;
}
.btn-dark { background: var(--ink); color: var(--paper); }
.btn-dark:hover { background: var(--accent); }
/* Le CTA du header n'apparaît qu'une fois le CTA du hero dépassé au scroll */
.site-header .btn-dark {
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.site-header .btn-dark.cta-hidden {
  opacity: 0; transform: translateY(-6px);
  pointer-events: none;
}
.btn-accent {
  background: var(--accent); color: #fff;
  font-weight: 700; font-size: 17px; padding: 19px 42px;
}
.btn-accent:hover { background: var(--accent-deep); transform: translateY(-2px); }
.btn .btn-arrow {
  width: 18px; height: 18px; flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.btn:hover .btn-arrow { transform: translateX(4px); }

/* ---------- Hero ---------- */
.hero { padding: clamp(56px, 8vw, 104px) 0 clamp(56px, 7vw, 96px); }
.hero .wrap {
  display: grid; grid-template-columns: 1.15fr 0.85fr;
  gap: 48px; align-items: center;
}
.hero h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(48px, 7.2vw, 92px);
  line-height: 1.04; letter-spacing: -0.02em;
  margin: 30px 0 38px;
  text-wrap: balance;
}
.hero h1 em { font-style: italic; color: var(--accent); }
.hero-lead {
  font-size: 18.5px; line-height: 1.65; color: var(--ink-soft);
  max-width: 30em; margin-bottom: 40px;
}
.hero-actions { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.hero-actions .mono-label { letter-spacing: 0.16em; }

/* Reveal au chargement */
.rise { opacity: 0; transform: translateY(22px); animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) forwards; }
/* Arrivée via une transition de page : le fondu suffit, pas de double animation */
:root.vt-nav .rise { animation: none; opacity: 1; transform: none; }
.rise.d1 { animation-delay: 0.08s; }
.rise.d2 { animation-delay: 0.16s; }
.rise.d3 { animation-delay: 0.24s; }
.rise.d4 { animation-delay: 0.32s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* Reveal au scroll */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .rise, .reveal { opacity: 1; transform: none; animation: none; transition: none; }
}

/* Reveal piloté par le scroll quand le navigateur sait le faire (sinon, IntersectionObserver via home.js) */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal {
      opacity: 1; transform: none; transition: none;
      animation: reveal-rise linear both;
      animation-timeline: view();
      animation-range: entry 5% entry 45%;
    }
  }
}
@keyframes reveal-rise {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Démo temps de réaction ---------- */
.demo-col { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.demo-circle {
  width: min(340px, 78vw); aspect-ratio: 1; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; text-align: center; padding: 30px;
  cursor: pointer; user-select: none; -webkit-user-select: none;
  transition: border-color 0.2s;
}
.demo-circle:hover { border-color: var(--accent); }
/* Curseur animé de l'état d'attente : pulsation « clic » continue */
.demo-pointer {
  width: 64px; height: 64px; color: var(--accent);
  animation: click-pulse 2s ease-in-out infinite;
  transform-origin: center;
}
.demo-title { font-size: 15.5px; font-weight: 600; }
.demo-hint { font-family: var(--mono); font-size: 11.5px; color: var(--ink-faint); max-width: 21ch; line-height: 1.5; }
.demo-cross { font-family: var(--mono); font-size: 34px; color: #c9c2b4; }
.demo-go {
  width: 130px; height: 130px; border-radius: 50%;
  background: var(--accent);
  display: grid; place-items: center;
  animation: pop 0.1s ease-out, go-halo 1.1s ease-out infinite;
}
.demo-go svg {
  width: 48px; height: 48px; color: #fff;
  animation: click-pulse 1.1s ease-in-out infinite;
  transform-origin: center;
}
@keyframes go-halo {
  0% { box-shadow: 0 0 0 0 rgba(224, 92, 58, 0.4); }
  100% { box-shadow: 0 0 0 28px rgba(224, 92, 58, 0); }
}
.demo-go-label {
  font-family: var(--serif); font-style: italic;
  font-size: 27px; color: var(--accent-deep);
  animation: pop 0.15s ease-out;
}
@keyframes pop { from { transform: scale(0.6); } to { transform: scale(1); } }
.demo-early { font-family: var(--serif); font-style: italic; font-size: 30px; color: var(--accent); }
.demo-ms { font-family: var(--serif); font-size: 64px; line-height: 1; }
.demo-ms small { font-size: 26px; color: var(--ink-faint); }
.demo-sub { font-size: 14px; color: var(--ink-soft); }
.demo-replay { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.1em; color: var(--accent); }

/* ---------- Séparateur ---------- */
.hairline { border: none; border-top: 1px solid var(--line); margin: 0 var(--pad); }
@media (min-width: 1200px) { .wrap + .hairline, .hairline { max-width: 1200px; margin-inline: auto; } }

/* ---------- Sections ---------- */
.section { padding: clamp(56px, 7vw, 88px) 0; }
.section-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 24px; flex-wrap: wrap; margin-bottom: 50px;
}
.section-head h2 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(32px, 4vw, 46px); letter-spacing: -0.01em;
}
.section-head h2 em { font-style: italic; color: var(--accent); }

/* ---------- Parcours ---------- */
.steps { display: flex; flex-direction: column; }
.step-row {
  display: grid; grid-template-columns: 110px 1fr auto auto;
  align-items: baseline; gap: 32px;
  padding: 32px 12px;
  border-top: 1px solid var(--line);
}
.step-row:last-child { border-bottom: 1px solid var(--line); }
.step-num { font-family: var(--mono); font-size: 14px; color: var(--accent); }
.step-name { font-family: var(--serif); font-size: clamp(24px, 2.6vw, 32px); line-height: 1.15; }
.step-desc { font-size: 14px; color: var(--ink-faint); }
.step-time {
  font-family: var(--mono); font-size: 12px; color: var(--ink-soft);
  white-space: nowrap;
  border: 1px solid var(--line); background: var(--card);
  padding: 5px 13px; border-radius: 100px;
  align-self: center;
}
.steps-note {
  font-size: 14px; color: var(--ink-faint);
  margin-top: 28px; text-align: center;
}

/* ---------- Bloc sombre : engagements ---------- */
.dark-block { background: var(--dark); color: var(--paper); padding: clamp(64px, 8vw, 96px) 0; }
.pledges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 56px; }
.pledge .mono-label { color: var(--accent); margin-bottom: 18px; display: block; }
.pledge p { font-family: var(--serif); font-size: 23px; line-height: 1.35; }

.dark-notice {
  border-top: 1px solid var(--dark-line);
  margin-top: 72px; padding-top: 36px;
  display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: start;
}
.dark-notice .notice-mark {
  font-family: var(--serif); font-style: italic;
  font-size: 28px; color: var(--accent); line-height: 1;
}
.dark-notice p { font-size: 14.5px; line-height: 1.65; color: var(--dark-soft); max-width: 62em; }
.dark-notice b { color: var(--paper); font-weight: 600; }

/* ---------- FAQ ---------- */
.faq { max-width: 780px; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer;
  display: flex; justify-content: space-between; align-items: baseline; gap: 24px;
  padding: 26px 12px;
  font-family: var(--serif); font-size: clamp(20px, 2.2vw, 26px);
  transition: color 0.15s;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--accent-deep); }
.faq summary .faq-mark {
  font-family: var(--mono); font-size: 18px; color: var(--accent);
  transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1);
  flex-shrink: 0;
}
.faq details[open] summary .faq-mark { transform: rotate(45deg); }
.faq .faq-body { padding: 0 12px 28px; color: var(--ink-soft); font-size: 15.5px; max-width: 56em; }
.faq .faq-body p + p { margin-top: 10px; }

/* Ouverture animée de l'accordéon (navigateurs récents ; sinon ouverture instantanée) */
@supports (interpolate-size: allow-keywords) {
  :root { interpolate-size: allow-keywords; }
}
.faq details::details-content {
  block-size: 0; overflow-y: clip;
  transition: block-size 0.4s cubic-bezier(0.2, 0.7, 0.2, 1),
              content-visibility 0.4s allow-discrete;
}
.faq details[open]::details-content { block-size: auto; }

/* ---------- CTA final ---------- */
.final-cta { text-align: center; padding: clamp(72px, 9vw, 120px) 0; }
.final-cta h2 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(38px, 5.5vw, 64px); letter-spacing: -0.02em;
  margin-bottom: 36px; text-wrap: balance;
}
.final-cta h2 em { font-style: italic; color: var(--accent); }
.final-cta .mono-label { display: block; margin-top: 24px; letter-spacing: 0.16em; }

/* ---------- Footer ---------- */
.site-footer { background: var(--dark); color: var(--dark-soft); padding: 36px 0; font-size: 12.5px; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.site-footer b { color: var(--paper); font-weight: 600; }
.site-footer a { color: var(--dark-soft); }
.site-footer a:hover { color: var(--paper); }
.site-footer .mono { font-family: var(--mono); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 40px; }
  .demo-col { order: 2; }
  .step-row { grid-template-columns: 60px 1fr auto; }
  .step-desc { display: none; }
  .pledges { grid-template-columns: 1fr; gap: 40px; }
  .header-nav .hide-mobile { display: none; }
}
