/* ============================================================
   Capte — landing
   Tokens inline (pas d'@import : évite la chaîne de requêtes).
   L'admin (/admin2ouf) garde ses tokens dans /styles/brand-tokens.css.
   ============================================================ */

:root {
  /* — couleurs — */
  --ink: #0d0f17;
  --ink-soft: rgba(13, 15, 23, 0.72);
  --ink-mute: rgba(13, 15, 23, 0.6);
  --paper: #ffffff;
  --paper-soft: #f3f5f8;
  --line: rgba(13, 15, 23, 0.1);
  --hairline: rgba(13, 15, 23, 0.065);
  --cobalt: #1a5cf0;
  --mint: #5fd6bd;
  --coral: #ff515f;
  /* variantes texte : contraste AA sur fond clair */
  --coral-text: #c92837;
  --mint-text: #0e7a63;
  --cobalt-text: #1a52d4;

  /* — typographie — */
  --serif: ui-serif, "New York", Georgia, "Times New Roman", serif;
  --sans:
    ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --text-display: clamp(2.5rem, 1.3rem + 4.6vw, 4.4rem);
  --text-title: clamp(2.05rem, 1.2rem + 3.1vw, 3.4rem);
  --text-word: clamp(2.2rem, 1.4rem + 3vw, 3.2rem);
  --text-lead: clamp(1.05rem, 0.98rem + 0.35vw, 1.19rem);
  --text-body: 1.02rem;
  --text-small: 0.94rem;
  --text-caption: 0.8rem;

  /* — espacement (échelle de 4) — */
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4rem;
  --section-pad: clamp(5.5rem, 4rem + 6vw, 8.5rem);
  --container: min(1160px, 100% - 48px);

  /* — motion — */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-reveal: cubic-bezier(0.22, 1, 0.36, 1);

  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  min-height: 100vh;
  background: linear-gradient(180deg, #ffffff 0%, #ffffff 62%, #f3f5f8 100%);
  font-size: var(--text-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 100;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  font-size: var(--text-small);
  transition: top 160ms var(--ease-out);
}

.skip-link:focus {
  top: 16px;
}

/* ---------- structure commune ---------- */

.shell {
  width: var(--container);
  margin-inline: auto;
}

.section-head {
  max-width: 640px;
}

.section-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: var(--text-title);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

.section-lead {
  margin: var(--s-5) 0 0;
  color: var(--ink-soft);
  font-size: var(--text-lead);
  font-weight: 600;
  line-height: 1.6;
  max-width: 560px;
}

.section-head-center {
  margin-inline: auto;
  text-align: center;
}

.section-head-center .section-lead {
  margin-inline: auto;
}

.eyebrow {
  margin: 0 0 var(--s-4);
  font-size: var(--text-caption);
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.eyebrow-coral {
  color: var(--coral-text);
}

.eyebrow-mint {
  color: var(--mint-text);
}

.eyebrow-cobalt {
  color: var(--cobalt-text);
}

/* ---------- animations de révélation ----------
   États cachés uniquement si JS présent + motion accepté
   (html.anim) : sans JS, tout est visible. */

html.anim [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 640ms var(--ease-reveal),
    transform 640ms var(--ease-reveal);
  transition-delay: calc(var(--rd, 0) * 90ms);
}

html.anim [data-reveal].in {
  opacity: 1;
  transform: none;
}

/* ---------- header / footer ---------- */

.site-header .shell,
.site-footer .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
}

.site-header {
  min-height: 88px;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 6;
}

.site-header nav,
.footer-links {
  display: flex;
  gap: var(--s-5);
  align-items: center;
  color: var(--ink-soft);
  font-size: var(--text-small);
  font-weight: 700;
}

.site-header nav a,
.site-footer a {
  transition: color 160ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .site-header nav a:hover,
  .site-footer a:hover {
    color: var(--ink);
  }
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 1.04rem;
  font-weight: 800;
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: block;
  box-shadow:
    0 10px 24px rgba(13, 15, 23, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* ---------- CTA App Store ---------- */

.app-store-link {
  display: inline-grid;
  grid-template-columns: 28px 1fr;
  grid-template-areas:
    "mark eyebrow"
    "mark title";
  align-items: center;
  column-gap: 10px;
  min-width: 214px;
  padding: 14px 24px 15px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  text-align: left;
  box-shadow: 0 18px 42px rgba(13, 15, 23, 0.22);
  transition:
    transform 160ms var(--ease-out),
    box-shadow 160ms var(--ease-out);
}

.app-store-link::before {
  content: "\f8ff";
  grid-area: mark;
  align-self: center;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  font-size: 2.15rem;
  font-weight: 500;
  line-height: 1;
}

@media (hover: hover) and (pointer: fine) {
  .app-store-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 48px rgba(13, 15, 23, 0.28);
  }
}

.app-store-link:active {
  transform: scale(0.98);
}

.app-store-link span {
  grid-area: eyebrow;
  font-size: 0.73rem;
  line-height: 1.1;
  opacity: 0.78;
  font-weight: 700;
}

.app-store-link strong {
  grid-area: title;
  font-size: 1.22rem;
  line-height: 1.08;
}

.cta-note {
  margin: 0;
  color: var(--ink-mute);
  font-size: var(--text-small);
  font-weight: 700;
}

/* ---------- hero ---------- */

.hero {
  padding: var(--s-6) 0 var(--section-pad);
}

.hero-grid {
  min-height: calc(100svh - 200px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 340px);
  align-items: center;
  gap: clamp(64px, 7vw, 96px);
  position: relative;
}

.hero-copy {
  min-width: 0;
  max-width: 680px;
}

.hero-copy h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: var(--text-display);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.hero-lead {
  margin: var(--s-5) 0 0;
  max-width: 580px;
  color: var(--ink-soft);
  font-size: var(--text-lead);
  font-weight: 600;
  line-height: 1.6;
}

.hero-cta {
  margin: var(--s-6) 0 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s-3);
}

.hero-visual {
  position: relative;
  justify-self: center;
}

.hero-phone {
  margin: 0;
  width: min(31vw, 340px);
  aspect-ratio: 1206 / 2622;
  border-radius: 48px;
  padding: 8px;
  background: var(--paper-soft);
  border: 1px solid rgba(13, 15, 23, 0.08);
  box-shadow:
    0 34px 80px rgba(13, 15, 23, 0.18),
    0 0 0 10px rgba(255, 255, 255, 0.82);
  overflow: hidden;
}

.hero-phone img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 40px;
}

.mascot-sticker {
  position: absolute;
  left: -42px;
  bottom: -14px;
  width: 100px;
  height: 100px;
  border-radius: 26px;
  rotate: -9deg;
  filter: drop-shadow(0 16px 30px rgba(13, 15, 23, 0.28));
  transition: rotate 200ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .hero-visual:hover .mascot-sticker {
    rotate: -4deg;
  }
}

/* ---------- défi : le test ---------- */

.defi {
  padding: var(--section-pad) 0;
  background: var(--paper-soft);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}

.defi .section-head {
  margin-bottom: var(--s-7);
}

.quiz {
  max-width: 620px;
  margin-inline: auto;
}

.quiz-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: clamp(28px, 5vw, 44px);
  box-shadow: 0 24px 60px rgba(13, 15, 23, 0.08);
}

.quiz-kicker,
.quiz-progress {
  margin: 0;
  color: var(--ink-mute);
  font-size: var(--text-caption);
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.quiz-word {
  margin: var(--s-3) 0 0;
  font-family: var(--serif);
  font-size: var(--text-word);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.01em;
}

.quiz-meta {
  margin: var(--s-3) 0 0;
  color: var(--ink-mute);
  font-size: var(--text-small);
  font-weight: 700;
}

.quiz-explain {
  margin: var(--s-5) 0 0;
  color: var(--ink-soft);
  font-size: var(--text-body);
  font-weight: 600;
  line-height: 1.6;
}

.quiz-example {
  margin: var(--s-5) 0 0;
  padding-left: var(--s-4);
  border-left: 3px solid var(--coral);
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.06rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.quiz-options {
  display: grid;
  gap: var(--s-3);
  margin-top: var(--s-6);
}

.quiz-options > button {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  width: 100%;
  min-height: 56px;
  padding: 14px 18px;
  border-radius: 16px;
  border: 1.5px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: var(--text-body);
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    opacity 200ms ease,
    transform 160ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .quiz-options > button:not(:disabled):hover {
    border-color: var(--ink);
  }
}

.quiz-options > button:not(:disabled):active {
  transform: scale(0.985);
}

.opt-key {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  border: 1px solid var(--line);
  color: var(--ink-mute);
  font-size: var(--text-caption);
  font-weight: 800;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.quiz-options > button:disabled {
  cursor: default;
}

.quiz-options > button[data-state="idle"]:disabled {
  opacity: 0.5;
}

.quiz-options > button[data-state="correct"] {
  border-color: var(--mint-text);
  background: color-mix(in srgb, var(--mint) 14%, white);
}

.quiz-options > button[data-state="correct"] .opt-key {
  background: var(--mint-text);
  border-color: var(--mint-text);
  color: #fff;
}

.quiz-options > button[data-state="wrong"] {
  border-color: var(--coral-text);
  background: color-mix(in srgb, var(--coral) 10%, white);
}

.quiz-options > button[data-state="wrong"] .opt-key {
  background: var(--coral-text);
  border-color: var(--coral-text);
  color: #fff;
}

.quiz-reveal {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 320ms var(--ease-reveal);
}

.quiz-reveal-inner {
  overflow: hidden;
  min-height: 0;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 300ms var(--ease-reveal) 80ms,
    transform 300ms var(--ease-reveal) 80ms;
}

.quiz-reveal.open {
  grid-template-rows: 1fr;
}

.quiz-reveal.open .quiz-reveal-inner {
  opacity: 1;
  transform: none;
}

.quiz-verdict {
  margin: var(--s-5) 0 0;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 800;
}

.quiz-verdict.is-correct {
  color: var(--mint-text);
}

.quiz-verdict.is-wrong {
  color: var(--coral-text);
}

.quiz-next,
.quiz-cta {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: var(--s-5);
  padding: 10px 24px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-size: var(--text-small);
  font-weight: 750;
  cursor: pointer;
  transition:
    transform 160ms var(--ease-out),
    box-shadow 160ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .quiz-next:hover,
  .quiz-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(13, 15, 23, 0.2);
  }
}

.quiz-next:active,
.quiz-cta:active {
  transform: scale(0.97);
}

.quiz-restart {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: var(--s-5);
  margin-left: var(--s-4);
  padding: 10px 8px;
  border: 0;
  background: none;
  color: var(--ink-mute);
  font: inherit;
  font-size: var(--text-small);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
  transition: color 160ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .quiz-restart:hover {
    color: var(--ink);
  }
}

.quiz-end-score {
  margin: var(--s-5) 0 0;
  font-family: var(--serif);
  font-size: var(--text-word);
  font-weight: 800;
  line-height: 1;
}

.defi-note {
  margin: var(--s-7) auto 0;
  max-width: 620px;
  text-align: center;
  color: var(--ink-soft);
  font-size: var(--text-lead);
  font-weight: 650;
}

/* ---------- manifesto : l'anatomie de la fiche ---------- */

.manifesto {
  padding: var(--section-pad) 0;
}

.fiche-anatomie {
  margin: var(--s-8) 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(28px, 4vw, 52px);
  border-top: 1px solid var(--hairline);
}

.fiche-anatomie li {
  padding-top: var(--s-6);
}

.detail-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, white);
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  margin-bottom: var(--s-4);
  box-shadow: 0 10px 22px color-mix(in srgb, var(--accent) 24%, transparent);
}

.detail-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fiche-anatomie h3 {
  margin: 0;
  color: var(--ink-mute);
  font-size: var(--text-caption);
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.fiche-anatomie p {
  margin: var(--s-3) 0 0;
  font-size: 1.14rem;
  line-height: 1.45;
  font-weight: 700;
}

.detail-blue {
  --accent: var(--cobalt);
}

.detail-mint {
  --accent: var(--mint);
}

.detail-coral {
  --accent: var(--coral);
}

/* ---------- rituel : le widget ---------- */

.rituel {
  padding: 0 0 var(--section-pad);
}

.rituel-grid {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: clamp(64px, 8vw, 104px);
  align-items: center;
}

.ios-widget {
  justify-self: start;
  width: 100%;
  min-height: 220px;
  padding: 28px;
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid var(--line);
  box-shadow:
    0 22px 50px rgba(13, 15, 23, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.widget-topline {
  color: var(--coral-text);
  font-size: var(--text-caption);
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.widget-mot {
  display: block;
  margin-top: var(--s-3);
  font-family: var(--serif);
  font-size: clamp(2.6rem, 5.4vw, 4.2rem);
  font-weight: 800;
  line-height: 0.95;
  white-space: nowrap;
}

.widget-def {
  margin: var(--s-4) 0 0;
  color: var(--ink);
  font-size: 1.2rem;
  line-height: 1.3;
  font-weight: 750;
}

.ios-widget small {
  display: block;
  margin-top: var(--s-6);
  color: var(--ink-mute);
  font-size: var(--text-caption);
  font-weight: 800;
}

/* ---------- finale ---------- */

.finale {
  padding: 0 0 clamp(6rem, 5rem + 5vw, 9rem);
}

.finale-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-7);
  text-align: center;
}

.finale-cta {
  margin-top: 0;
  align-items: center;
}

.finale-mascotte {
  position: relative;
  display: flex;
  align-items: center;
  gap: 26px;
}

.finale-mascotte img {
  width: 136px;
  height: 136px;
  border-radius: 34px;
  rotate: -7deg;
  filter: drop-shadow(0 20px 38px rgba(13, 15, 23, 0.26));
}

.bulle {
  position: relative;
  margin: 0 0 56px;
  padding: 20px 28px;
  border-radius: 26px;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 0 22px 50px rgba(13, 15, 23, 0.1);
  font-family: var(--serif);
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 800;
  line-height: 1.15;
  text-align: left;
  rotate: 2deg;
}

.bulle::after {
  content: "";
  position: absolute;
  left: -10px;
  bottom: 26px;
  width: 20px;
  height: 20px;
  background: var(--paper);
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transform: rotate(45deg);
  border-bottom-left-radius: 5px;
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--hairline);
  padding: var(--s-6) 0 var(--s-7);
}

.footer-note {
  margin: 0;
  color: var(--ink-mute);
  font-size: var(--text-small);
  font-weight: 700;
}

/* ---------- pages légales ---------- */

.legal-page {
  width: min(760px, 100% - 48px);
  margin: 0 auto;
  padding: var(--s-8) 0 var(--section-pad);
}

.legal-page h1 {
  margin: 0 0 var(--s-6);
  font-family: var(--serif);
  font-size: var(--text-display);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.015em;
}

.legal-page h2 {
  margin: var(--s-7) 0 0;
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
}

.legal-page p {
  margin: var(--s-4) 0 0;
  color: var(--ink-soft);
  font-size: 1.08rem;
  line-height: 1.75;
  font-weight: 550;
}

.legal-page a {
  color: var(--ink);
  font-weight: 750;
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

/* ---------- responsive ---------- */

@media (max-width: 980px) {
  .hero-grid {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero {
    padding-top: var(--s-5);
  }

  .hero-copy {
    max-width: 720px;
  }

  .hero-visual {
    justify-self: center;
    margin-top: var(--s-7);
  }

  .hero-phone {
    width: min(360px, 72vw);
  }

  .fiche-anatomie {
    grid-template-columns: 1fr;
    gap: 0;
    border-top: 0;
    margin-top: var(--s-6);
  }

  .fiche-anatomie li {
    border-top: 1px solid var(--hairline);
    padding: var(--s-5) 0;
  }

  .rituel-grid {
    grid-template-columns: 1fr;
    gap: var(--s-7);
  }

  .rituel-grid .section-head {
    order: -1;
  }

  .ios-widget {
    max-width: 420px;
  }
}

@media (max-width: 700px) {
  :root {
    --container: min(100% - 28px, 680px);
  }

  .site-header {
    min-height: 76px;
  }

  .site-header nav {
    gap: var(--s-4);
    font-size: 0.88rem;
  }

  .brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .legal-page {
    width: min(100% - 28px, 680px);
  }

  .hero {
    padding-top: var(--s-2);
  }

  .app-store-link {
    min-width: 188px;
    padding: 12px 18px 13px;
  }

  .app-store-link strong {
    font-size: 1.08rem;
  }

  .hero-phone {
    width: min(292px, 78vw);
  }

  .mascot-sticker {
    left: -26px;
    bottom: -12px;
    width: 88px;
    height: 88px;
    border-radius: 22px;
  }

  .quiz-options > button {
    font-size: 0.98rem;
    padding: 12px 14px;
  }

  .ios-widget {
    max-width: none;
    min-height: 200px;
    padding: 24px;
    border-radius: 30px;
  }

  .finale-mascotte {
    gap: 18px;
  }

  .finale-mascotte img {
    width: 108px;
    height: 108px;
    border-radius: 27px;
  }

  .bulle {
    margin-bottom: 40px;
    padding: 16px 20px;
  }

  .site-footer .shell {
    align-items: flex-start;
    flex-direction: column;
    gap: var(--s-4);
  }

  .footer-links {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--s-3);
  }
}

@media (max-width: 520px) {
  .site-header .brand span {
    display: none;
  }

  .site-header nav {
    gap: var(--s-3);
    font-size: 0.85rem;
  }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .quiz-reveal,
  .quiz-reveal-inner {
    transition-duration: 1ms;
  }

  .app-store-link,
  .quiz-next,
  .quiz-cta,
  .quiz-options > button {
    transition-property: border-color, background-color, opacity, box-shadow;
  }
}
