/* Concept : une scène plongée dans le noir, un seul projecteur tungstène.
   Le test se joue sous la lumière ; le reste du site est blanc, calme, très aéré. */
:root {
  --night: #16110E;      /* la scène */
  --night-2: #221B16;    /* bords de scène, surfaces sombres */
  --tungsten: #F2DDB3;   /* la lumière du projecteur */
  --paper: #FBFAF8;      /* le reste du site */
  --ink: #1C1714;
  --mute: #716A63;
  --hair: #E6E1DA;
  --display: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --body: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 400; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3.5rem; padding: 0 2.25rem;
  border: 0; border-radius: 999px; cursor: pointer;
  font: 500 1.0625rem var(--body); text-decoration: none;
  transition: transform .2s ease, background-color .2s ease;
}
.btn:active { transform: scale(.98); }
.btn-light { background: var(--tungsten); color: var(--night); }
.btn-light:hover { background: #F8E8C8; }
.btn-dark { background: var(--ink); color: var(--paper); }
.btn-dark:hover { background: #3A322C; }
.btn:focus-visible, .text-btn:focus-visible, .answer:focus-visible, summary:focus-visible {
  outline: 2px solid currentColor; outline-offset: 4px;
}
.text-btn {
  background: none; border: 0; padding: .25rem 0; cursor: pointer;
  font: 400 .9375rem var(--body); color: inherit; opacity: .7;
  text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px;
}
.text-btn:hover { opacity: 1; }

/* ─── La scène ─── */
.stage {
  position: relative; overflow: hidden;
  background: var(--night); color: var(--tungsten);
  min-height: min(100svh, 52rem);
  display: grid; place-items: center;
  padding-block: max(4rem, env(safe-area-inset-top, 0px)) 4.5rem;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.beam {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 34% 9% at 50% 88%, rgba(242,221,179,.16), transparent 70%),
    radial-gradient(ellipse 30% 70% at 50% -8%, rgba(242,221,179,.30), rgba(242,221,179,.06) 55%, transparent 75%);
  animation: lights-up 2.2s cubic-bezier(.3,.1,.2,1) both;
}
.beam::after {
  content: ""; position: absolute; left: 50%; top: -5%; width: 70%; height: 100%;
  transform: translateX(-50%);
  background: linear-gradient(to bottom, rgba(242,221,179,.10), rgba(242,221,179,0) 85%);
  clip-path: polygon(44% 0, 56% 0, 100% 100%, 0 100%);
  filter: blur(18px);
}
.grain {
  position: absolute; inset: -50%; pointer-events: none; opacity: .09; mix-blend-mode: screen;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@keyframes lights-up { from { opacity: .25; } to { opacity: 1; } }

.stage-inner { position: relative; width: 100%; max-width: 40rem; }
.scene { display: grid; justify-items: center; text-align: center; gap: 1.5rem; }

.brand { font: italic 400 1.0625rem var(--display); opacity: .75; }
h1 {
  font: 500 clamp(2.75rem, 10.5vw, 5.5rem)/0.98 var(--display);
  font-variation-settings: "opsz" 36;
  letter-spacing: -0.02em;
  max-width: 11ch;
}
.sub { font-size: 1.125rem; opacity: .82; max-width: 26ch; }
.tiny { font-size: .875rem; opacity: .55; }
#intro .btn { margin-top: .75rem; }

/* Le test */
.quiz { text-align: left; justify-items: stretch; gap: 1.25rem; }
.progress { height: 2px; background: rgba(242,221,179,.15); }
.progress span { display: block; height: 100%; width: 25%; background: var(--tungsten); transition: width .45s cubic-bezier(.3,.1,.2,1); }
.count { font-size: .875rem; opacity: .55; }
.question { font: 500 clamp(1.85rem, 6.5vw, 2.75rem)/1.08 var(--display); font-variation-settings: "opsz" 28; letter-spacing: -0.01em; margin-bottom: .5rem; }
.answers { display: grid; gap: .625rem; }
.answer {
  appearance: none; width: 100%; text-align: left; cursor: pointer;
  padding: 1.05rem 1.25rem; border-radius: 14px;
  background: rgba(242,221,179,.04); color: var(--tungsten);
  border: 1px solid rgba(242,221,179,.18);
  font: 400 1.0625rem/1.35 var(--body);
  transition: background-color .18s ease, border-color .18s ease;
}
.answer:hover { background: rgba(242,221,179,.09); border-color: rgba(242,221,179,.45); }
.answer.picked { background: var(--tungsten); color: var(--night); border-color: var(--tungsten); }
.quiz .text-btn { justify-self: start; margin-top: .5rem; }

/* Le résultat */
.result { gap: 1.25rem; }
.verdict { font: 500 clamp(2.4rem, 9vw, 4.25rem)/1.0 var(--display); font-variation-settings: "opsz" 36; letter-spacing: -0.02em; max-width: 12ch; }
.reading { margin: 1.25rem 0 0; width: 100%; text-align: left; display: grid; gap: 0; border-top: 1px solid rgba(242,221,179,.16); }
.reading > div { display: grid; grid-template-columns: 11rem 1fr; gap: 1.25rem; padding: 1.15rem 0; border-bottom: 1px solid rgba(242,221,179,.16); }
.reading dt { font-size: .9375rem; opacity: .55; }
.reading dd { margin: 0; line-height: 1.5; min-width: 0; }
.reading dd strong { font: italic 400 1.3rem/1.25 var(--display); display: block; margin-bottom: .25rem; }
.age { font-size: .9375rem; opacity: .7; max-width: 34rem; }
.result .btn { margin-top: .75rem; }

.reveal { animation: appear .5s cubic-bezier(.3,.1,.2,1) both; }
@keyframes appear { from { opacity: .001; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ─── Le guide ─── */
.guide {
  padding-block: 6rem;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.guide-inner { max-width: 64rem; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2.5rem, 7vw, 6rem); align-items: center; }

.book { perspective: 1400px; display: flex; justify-content: center; }
.book-cover {
  width: min(100%, 19rem); aspect-ratio: 210 / 297;
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(242,221,179,.22), transparent 70%),
    var(--night);
  color: var(--tungsten);
  border-radius: 3px 8px 8px 3px;
  padding: 12% 11%;
  display: flex; flex-direction: column; justify-content: space-between;
  transform: rotateY(-14deg) rotateX(2deg);
  box-shadow: 1px 0 0 rgba(255,255,255,.06) inset, 6px 0 0 #0E0A08 inset,
              -24px 34px 50px -18px rgba(28,23,20,.45), -4px 6px 12px -4px rgba(28,23,20,.3);
}
.book-title { font: 500 clamp(2.5rem, 6vw, 3.25rem)/0.92 var(--display); letter-spacing: -0.02em; }
.book-title em { font-style: italic; }
.book-foot { font-size: .8125rem; opacity: .65; }

.pitch { display: grid; gap: 1.5rem; min-width: 0; }
.pitch h2 { font: 500 clamp(2.5rem, 6vw, 3.5rem)/1 var(--display); font-variation-settings: "opsz" 36; letter-spacing: -0.02em; }
.lede { font-size: 1.25rem; line-height: 1.45; color: var(--ink); max-width: 30ch; }
.paths { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--hair); }
.paths li { padding: 1.1rem 1.25rem 1.1rem 0; border-bottom: 1px solid var(--hair); min-width: 0; }
.paths li:nth-child(odd) { border-right: 1px solid var(--hair); }
.paths li:nth-child(even) { padding-left: 1.25rem; padding-right: 0; }
.paths h3 { font: italic 400 1.35rem/1.2 var(--display); margin-bottom: .3rem; }
.paths p { font-size: .9375rem; color: var(--mute); line-height: 1.45; }
.also { color: var(--mute); font-size: 1rem; max-width: 40ch; }
.checkout { display: grid; justify-items: start; gap: .9rem; margin-top: .5rem; }
.amount { font: 500 2.5rem/1 var(--display); font-variation-settings: "opsz" 28; }
.tiny-dark { font-size: .875rem; color: var(--mute); }

/* ─── FAQ ─── */
.faq {
  border-top: 1px solid var(--hair);
  padding-block: 5rem 6rem;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.faq-inner { max-width: 40rem; margin: 0 auto; }
.faq h2 { font: 400 clamp(1.9rem, 5vw, 2.5rem)/1.1 var(--display); margin-bottom: 1.75rem; }
.faq details { border-bottom: 1px solid var(--hair); }
.faq details:first-of-type { border-top: 1px solid var(--hair); }
.faq summary {
  cursor: pointer; list-style: none; padding: 1.2rem 2.5rem 1.2rem 0; position: relative;
  font-weight: 500;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: .25rem; top: 50%; width: .6rem; height: .6rem;
  border-right: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink);
  transform: translateY(-70%) rotate(45deg); transition: transform .2s ease;
}
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details p { padding: 0 0 1.3rem; color: var(--mute); max-width: 60ch; }

.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem;
  max-width: 64rem; margin: 0 auto;
  padding-block: 2rem max(2.5rem, env(safe-area-inset-bottom, 0px));
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
  font-size: .875rem; color: var(--mute);
}

/* ─── Mobile ─── */
@media (max-width: 760px) {
  .guide { padding-block: 4.5rem; }
  .guide-inner { grid-template-columns: 1fr; }
  .book-cover { width: 13rem; transform: rotateY(-10deg); }
  .reading > div { grid-template-columns: 1fr; gap: .35rem; }
}
@media (max-width: 420px) {
  .paths { grid-template-columns: 1fr; }
  .paths li, .paths li:nth-child(odd), .paths li:nth-child(even) { padding: 1rem 0; border-right: 0; }
  .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .beam, .reveal { animation: none; }
  .progress span, .btn, .answer { transition: none; }
}

/* ─── Pages secondaires (merci, légal) ─── */
.page { max-width: 40rem; margin: 0 auto; padding-block: 5rem 6rem;
  padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.page h1 { color: inherit; }
.page h2 { font: 400 1.75rem/1.15 var(--display); margin: 2.5rem 0 .75rem; }
.page p, .page li { color: var(--mute); }
.page p + p { margin-top: .75rem; }
.fill { background: #FFF3D6; color: var(--ink); padding: 0 .25rem; border-radius: 3px; }
.stage.thanks { min-height: auto; padding-block: max(5rem, env(safe-area-inset-top, 0px)) 5rem; }
.stage.thanks h1 { max-width: 13ch; }

/* ─── Ce que tu vas apprendre ─── */
.learn { list-style: none; margin: .25rem 0 0; padding: 0; display: grid; gap: .7rem; }
.learn li { position: relative; padding-left: 1.6rem; line-height: 1.45; }
.learn li::before { content: ""; position: absolute; left: 0; top: .55em; width: .7rem; height: 1px; background: var(--ink); }

/* ─── Barre d'achat mobile ─── */
.sticky {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .75rem max(16px, env(safe-area-inset-right, 0px)) max(.75rem, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: var(--night); color: var(--tungsten);
  box-shadow: 0 -8px 24px -12px rgba(0,0,0,.4);
}
.sticky strong { font: italic 500 1.1rem var(--display); margin-right: .4rem; }
.sticky .btn { min-height: 2.9rem; padding: 0 1.4rem; width: auto; font-size: 1rem; }
@media (min-width: 761px) { .sticky { display: none !important; } }

/* ─── Effets 3D au défilement (piloté par --p, 0 → 1 ; repos = 1) ─── */
.book-cover[data-3d] {
  transform:
    translateY(calc((1 - var(--p, 1)) * 60px))
    rotateY(calc(-8deg - (1 - var(--p, 1)) * 34deg))
    rotateX(calc((1 - var(--p, 1)) * 16deg))
    scale(calc(.84 + var(--p, 1) * .16));
  will-change: transform;
}
.learn li[data-3d], .paths li[data-3d] {
  transform-origin: 50% 0;
  transform: perspective(800px) rotateX(calc((1 - var(--p, 1)) * 38deg)) translateY(calc((1 - var(--p, 1)) * 22px));
  opacity: calc(.5 + var(--p, 1) * .5);
}
.paths li[data-3d] { transform-origin: 0 50%; transform: perspective(800px) rotateY(calc((1 - var(--p, 1)) * -32deg)) translateX(calc((1 - var(--p, 1)) * 18px)); }
.checkout[data-3d] { transform: perspective(900px) rotateX(calc((1 - var(--p, 1)) * 24deg)) scale(calc(.94 + var(--p, 1) * .06)); transform-origin: 50% 100%; }
.stage-inner { transform: translateY(calc(var(--h, 0) * -48px)) scale(calc(1 - var(--h, 0) * .07)); transform-origin: 50% 0; }
.beam { transform: translateY(calc(var(--h, 0) * 70px)); }

/* ─── Fenêtre d'achat ─── */
body.locked { overflow: hidden; }
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgba(12,9,7,.62);
  display: flex; align-items: flex-end; justify-content: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(0px, env(safe-area-inset-right, 0px)) 0 max(0px, env(safe-area-inset-left, 0px));
  animation: fade .2s ease both;
}
.sheet-panel {
  position: relative; width: 100%; max-width: 30rem; max-height: 100%; overflow-y: auto;
  background: var(--paper); color: var(--ink); border-radius: 22px 22px 0 0;
  padding: 1.6rem max(1.4rem, env(safe-area-inset-right, 0px)) max(1.4rem, env(safe-area-inset-bottom, 0px)) max(1.4rem, env(safe-area-inset-left, 0px));
  display: grid; gap: 1.1rem; animation: rise .32s cubic-bezier(.2,.8,.2,1) both;
}
@media (min-width: 640px) { .sheet-backdrop { align-items: center; padding: 24px; } .sheet-panel { border-radius: 22px; padding: 2rem; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { transform: translateY(40px); } to { transform: none; } }
.sheet-close { position: absolute; top: .6rem; right: .7rem; width: 2.5rem; height: 2.5rem; border: 0; background: none; font-size: 1.6rem; line-height: 1; color: var(--mute); cursor: pointer; border-radius: 50%; }
.sheet-close:hover { background: var(--hair); color: var(--ink); }
.sheet-head { display: flex; gap: 1.1rem; align-items: center; }
.mini-book { flex: none; width: 4.4rem; aspect-ratio: 210/297; background: radial-gradient(ellipse 70% 40% at 50% 0%, rgba(242,221,179,.25), transparent 70%), var(--night); color: var(--tungsten); border-radius: 2px 5px 5px 2px; display: flex; align-items: center; justify-content: center; text-align: center; font: 500 .8rem/1 var(--display); box-shadow: -8px 12px 18px -8px rgba(0,0,0,.45); transform: rotate(-4deg); }
.sheet-k { font-size: .85rem; color: var(--mute); margin: 0; }
.sheet-head h2 { font: 500 1.8rem/1.05 var(--display); margin: .1rem 0 .3rem; }
.sheet-price { margin: 0; font: 500 1.35rem var(--display); }
.sheet-price span + span { font: 400 .85rem var(--body); color: var(--mute); margin-left: .3rem; }
.sheet-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; font-size: .95rem; }
.sheet-list li { padding-left: 1.5rem; position: relative; }
.sheet-list li::before { content: ""; position: absolute; left: .1rem; top: .45em; width: .55rem; height: .3rem; border-left: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(-45deg); }
.consent { display: grid; grid-template-columns: 1.4rem 1fr; gap: .7rem; align-items: start; font-size: .86rem; line-height: 1.45; color: var(--mute); background: var(--wash, #F3EFE8); padding: .9rem; border-radius: 12px; cursor: pointer; }
.consent input { width: 1.25rem; height: 1.25rem; margin: .1rem 0 0; accent-color: var(--ink); cursor: pointer; }
.consent a { color: var(--ink); }
.pay { width: 100%; }
.pay.is-off { opacity: .4; }
.sheet-hint { margin: -.5rem 0 0; font-size: .85rem; color: var(--mute); text-align: center; }
.sheet-secure { margin: -.4rem 0 0; font-size: .8rem; color: var(--mute); text-align: center; }
.foot-links { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ─── Performance et confort ─── */
@media (max-width: 760px) { .grain { display: none; } .beam::after { filter: blur(10px); } }
.faq { content-visibility: auto; contain-intrinsic-size: 1px 700px; }
@media (prefers-reduced-motion: reduce) {
  .book-cover[data-3d], .learn li[data-3d], .paths li[data-3d], .checkout[data-3d], .stage-inner, .beam { transform: none !important; opacity: 1 !important; }
  .sheet-backdrop, .sheet-panel { animation: none; }
}
@media (min-width: 761px) {
  .guide-inner { align-items: start; }
  .book { position: sticky; top: 14vh; align-self: start; }
}
