/* V2 : récit au scroll sur une scène épinglée (v2.js, GSAP ScrollTrigger). Hérite des jetons de style.css. */
:root { --gutter: max(1.5rem, (100vw - 1280px) / 2); --frame-w: min(58vw, (100dvh - 220px) * 1.5, 900px); --dial-w: min(30vw, 340px); }
/* GSAP reprend la propriété CSS `translate` dans ses transformations : tout est placé par top/left, sans translate. */


.story { position: relative; }
.stage { position: relative; height: 100dvh; overflow: hidden; }
.stage .aura { position: absolute; right: -10vw; top: 10%; width: 80vw; height: 80vh; background: radial-gradient(closest-side, var(--glow), transparent); pointer-events: none; }
.scene { position: absolute; inset: 0; visibility: hidden; }

/* légendes à gauche */
.cap { position: absolute; left: var(--gutter); top: 0; bottom: 48px; width: min(30vw, 440px); z-index: 2; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.cap h1, .cap h2 { font-size: clamp(2.3rem, 4.1vw, 3.9rem); margin-bottom: 1.2rem; }
.cap p { color: var(--muted); font-size: 1.1rem; max-width: 34ch; }
.split .wd { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .1em; margin-bottom: -.1em; }
.split .wd > span { display: inline-block; }

/* cadre de navigateur autour des captures */
.frame {
  position: absolute; right: var(--gutter); top: calc(50% - 24px - (var(--frame-w) * .625 + 30px) / 2); width: var(--frame-w); margin: 0;
  border-radius: 14px; border: 1px solid var(--line); background: var(--surface); padding-top: 30px;
  box-shadow: 0 40px 100px -40px rgb(5 10 25 / .7), 0 0 0 1px rgb(255 255 255 / .02);
}
.frame::before { content: ''; position: absolute; left: 14px; top: 11px; width: 44px; height: 8px;
  background: radial-gradient(circle 4px at 4px 4px, var(--line) 98%, transparent) 0 0 / 18px 8px repeat-x; filter: brightness(2.2); }
.screen { position: relative; aspect-ratio: 1440 / 900; overflow: hidden; border-radius: 0 0 13px 13px; }
.screen > img, .zoomer > img { width: 100%; height: 100%; }
.zoomer { position: absolute; inset: 0; }

/* éléments mis en avant, posés en % de la capture 1440 x 900 */
.ring { position: absolute; border: 2px solid var(--accent); border-radius: 9px; box-shadow: 0 0 0 5px color-mix(in oklab, var(--accent) 22%, transparent); }
.note {
  position: absolute; padding: .5rem .8rem; border-radius: 10px; background: var(--accent); color: var(--accent-ink);
  font-size: clamp(.72rem, .9vw, .88rem); font-weight: 500; white-space: nowrap; box-shadow: 0 14px 30px -12px rgb(10 30 70 / .7);
}
.spot { position: absolute; border-radius: 8px; border: 2px solid var(--accent); box-shadow: 0 0 0 200vmax rgb(4 8 16 / .62); }
.pop { position: absolute; transform-origin: 100% 100%; z-index: 3; }
.pop img { width: 100%; border-radius: 12px; box-shadow: 0 30px 70px -20px rgb(0 0 0 / .8); }
.pop .done {
  position: absolute; left: 4%; right: 4%; top: 50.5%; height: 12%; display: flex; align-items: center; gap: .4rem; padding: 0 .6rem;
  border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-size: clamp(.4rem, .5vw, .55rem); font-weight: 500; opacity: 0;
}
.pop .cursor { position: absolute; left: 20%; top: 59%; font-size: clamp(1.1rem, 1.6vw, 1.6rem); color: var(--text); filter: drop-shadow(0 3px 6px rgb(0 0 0 / .6)); opacity: 0; }
.journal { list-style: none; padding: 0; margin-top: 1.6rem; font-size: .82rem; color: var(--muted); }
.journal li { display: flex; gap: .8rem; padding: .6rem .8rem; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.journal span { color: var(--accent); }

/* outils éparpillés de l'ouverture */
.tools { position: absolute; right: var(--gutter); top: calc(50% - 40px - var(--frame-w) * .3125); width: var(--frame-w); aspect-ratio: 1.6; }
.tools i {
  position: absolute; left: var(--x); top: var(--y); display: grid; place-items: center; width: 64px; height: 64px; border-radius: 18px;
  font-size: 30px; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); box-shadow: 0 20px 40px -20px rgb(0 0 0 / .6);
}

/* éventail de modules */
.deck { position: absolute; right: var(--gutter); top: calc(50% - 24px - var(--frame-w) * .3); width: calc(var(--frame-w) * .9); aspect-ratio: 1440 / 930; }
.deck .d { top: 0; right: 0; width: 100%; }
.mods { list-style: none; padding: 0; margin-top: 1.6rem; display: flex; flex-wrap: wrap; gap: .45rem; max-width: 30rem; }
.mods li { padding: .4rem .8rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: .88rem; }

/* cadran final */
.seal { position: absolute; right: calc(var(--gutter) + var(--frame-w) / 2 - var(--dial-w) / 2); top: calc(50% - 24px - var(--dial-w) / 2); width: var(--dial-w); aspect-ratio: 1; }
.seal svg { width: 100%; height: 100%; overflow: visible; }
.trust-list { list-style: none; padding: 0; display: grid; gap: .9rem; font-size: 1.15rem; }
.trust-list li { display: flex; align-items: center; gap: .9rem; }
.trust-list i { font-size: 1.5rem; color: var(--accent); }

/* réglette des chapitres */
.ruler { position: fixed; left: 50%; bottom: 18px; translate: -50% 0; width: min(760px, 92vw); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .4s; }
.ruler.on { opacity: 1; pointer-events: auto; }
.ticks { position: relative; height: 12px; background: repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 12px) bottom / 100% 6px no-repeat; }
.ticks .fill { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; transform-origin: 0 50%; transform: scaleX(var(--p, 0)); background: var(--accent); }
.ruler ol { list-style: none; padding: 0; margin-top: .5rem; display: grid; grid-template-columns: repeat(6, 1fr); }
.ruler button { background: none; border: 0; padding: .2rem 0; cursor: pointer; font: 500 .68rem/1 'Geist Mono', monospace; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); text-align: left; transition: color .3s; }
.ruler button[aria-current='step'] { color: var(--text); }

/* repli : mobile ou mouvement réduit, scènes empilées et état final visible */
.story.static .stage { height: auto; overflow: visible; }
.story.static .scene { position: relative; visibility: visible; display: grid; gap: 2rem; padding: 12vh var(--gutter) 0; }
.story.static .scene:first-child { padding-top: 8rem; }
.story.static .cap { position: static; translate: none; width: auto; }
.story.static .frame, .story.static .deck { position: relative; right: auto; top: auto; width: 100%; }
.story.static .cap { display: block; }
.story.static .deck { aspect-ratio: auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; perspective: none; }
.story.static .deck .d { position: relative; }
.story.static .tools, .story.static .cap-b, .story.static .cursor, .story.static .ruler, .story.static .seal { display: none; }
.story.static [data-scene='ouverture'] .frame { display: none; } /* même capture que « Le matin » */
.story.static .spot { box-shadow: 0 0 0 200vmax rgb(4 8 16 / .35); }
.story.static .pop .done, .story.static .deck .d:nth-child(n+3) { display: none; } /* mobile : deux écrans suffisent */
.story.static .note { font-size: .62rem; padding: .3rem .5rem; }
@media (max-width: 899px) { .story.static .frame { order: 2; } }
