/* PROJECTDARV immersive v2 — motion layer styles. Everything here either applies only with the JS motion
   classes (html.fx, set by v2.js) or is harmless without them. Content is never hidden by CSS alone. */

/* GSAP owns reveals in v2: neutralise the cinematic CSS reveal so nothing waits on IntersectionObserver */
html.motion .rv{opacity:1;transform:none;filter:none;transition:none}
html.motion .hero__title{animation:none}
html.lenis,html.lenis body{height:auto;scroll-behavior:auto}
.lenis.lenis-smooth [data-lenis-prevent]{overscroll-behavior:contain}

/* word split (headings): words stay inline text for screen readers */
.w{display:inline-block;will-change:transform,filter,opacity}

/* ring: pointer parallax on desktop */
.scene__ring{translate:var(--rx,0px) var(--ry,0px)}

/* ---------- Story: one stage, lines light up in sequence ---------- */
html.fx .story{min-height:100vh;min-height:100svh;display:flex;flex-direction:column;justify-content:center;padding:96px 22px 48px}
html.fx .story__title{margin-bottom:5vh}
html.fx .story__lines li{font-size:clamp(28px,4.2vw,56px);max-width:22ch;margin:0 auto 3.2vh}
html.fx .story__turn{margin-top:2vh}
html.fx .story__turn b{font-size:clamp(30px,4.6vw,60px);margin-bottom:12px}
html.fx .help{padding-top:8vh;padding-bottom:12vh}
@media (min-width:900px){
  html.fx .help{padding-top:8px;padding-bottom:8vh}
  html.fx .help__head{margin-bottom:3.2vh}
  html.fx .help__grid{row-gap:5vh;column-gap:120px}
  html.fx .help__grid .feat:nth-child(2),
  html.fx .help__grid .feat:nth-child(4){margin-top:3.2vh}
}
/* Body copy over the film: lift contrast, drop the heavy black bloom that muddied the letters */
html.fx .feat p,html.fx .help__head .sub{color:#f0ecf8;text-shadow:0 1px 2px rgba(0,0,0,.7)}

/* ---------- Top 3: plinths rise from the floor ---------- */
.top3__plinth{transform-origin:50% 100%}
.top3__avatar{transform-style:preserve-3d}
html.fx .top3__card--first .top3__avatar{animation:crown 3.2s ease-in-out infinite}
@keyframes crown{50%{box-shadow:0 22px 70px -8px rgba(254,44,85,.85)}}

/* ---------- Tilt + spotlight surfaces ---------- */
[data-tilt]{position:relative;transform-style:preserve-3d}
html.fx [data-tilt]::before{content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;opacity:0;transition:opacity .35s;
  background:radial-gradient(420px circle at var(--mx,50%) var(--my,50%),rgba(255,255,255,.10),transparent 45%)}
html.fx [data-tilt]:hover::before{opacity:1}

/* ---------- Programs: horizontal sequence on wide screens (html.hz), stacked cards on phones (html.stack) ---------- */
html.hz .programs{overflow:hidden}
html.hz .programs .wrap{max-width:none;padding:0}
html.hz .programs .head{max-width:1180px;margin:0 auto 36px;padding:0 56px 28px}
html.hz .programs__list{display:flex;gap:28px;width:max-content;padding:0 max(56px,calc((100vw - 1180px)/2 + 56px))}
html.hz .prog{width:min(460px,38vw);min-height:420px;grid-template-columns:none;grid-template-rows:auto 1fr auto;gap:16px;padding:36px 34px 28px;border:1px solid var(--rule-2);border-radius:16px;
  background:linear-gradient(160deg,rgba(255,255,255,.06),rgba(255,255,255,.01) 60%),var(--void-2)}
html.hz .prog:first-child{padding-top:36px}
html.hz .prog h3{font-size:30px}
html.hz .prog__link{justify-self:start;text-align:left}
html.hz .programs__disclaimer{max-width:1180px;margin:30px auto 0;padding:0 56px}
html.hz .programs__progress{display:block}
.programs__progress{display:none;max-width:1180px;margin:28px auto 0;padding:0 56px}
.programs__progress span{display:block;height:2px;background:linear-gradient(90deg,var(--pink),var(--cyan));transform-origin:0 50%;transform:scaleX(0)}

html.stack .prog{position:relative;background:var(--void-2);border:1px solid var(--rule-2);border-radius:16px;padding:24px 20px 14px;margin-bottom:18px}
html.stack .prog:first-child{padding-top:24px}
html.stack .prog:last-child{margin-bottom:0}
html.stack .programs__disclaimer{margin-top:18px}

/* ---------- Bonus table rows wipe in ---------- */
.bonus__table tbody tr{position:relative}
html.fx .bonus__table tbody tr:first-child td{text-shadow:0 0 24px rgba(254,44,85,.45)}

/* ---------- About: clip reveal + inner parallax ---------- */
html.fx .about__photo img{scale:1.12}

/* ---------- Apply: glow + magnetic CTA, slow ring ---------- */
.mag{will-change:transform}
html.fx .apply .cta .btn{animation:glow 2.6s ease-in-out infinite}
@keyframes glow{0%,100%{box-shadow:0 12px 32px -12px rgba(254,44,85,.75),0 0 0 0 rgba(254,44,85,.0)}50%{box-shadow:0 18px 44px -10px rgba(254,44,85,.95),0 0 0 8px rgba(254,44,85,.12)}}
html.fx .apply__ring{--ap:1;scale:calc(.6 + .4*var(--ap));opacity:calc(.55*var(--ap))}
html.fx .apply__ring{animation:spin 60s linear infinite}
@keyframes spin{to{rotate:360deg}}

/* scroll progress hairline */
.progress{position:fixed;left:0;top:0;height:2px;width:100%;z-index:70;transform-origin:0 50%;transform:scaleX(0);background:linear-gradient(90deg,var(--pink),var(--cyan));pointer-events:none}
html:not(.fx) .progress{display:none}

@media (prefers-reduced-motion:reduce){
  html.fx .top3__card--first .top3__avatar,html.fx .apply .cta .btn,html.fx .apply__ring{animation:none}
}
html.stack .prog__link{min-height:48px}


/* ---------- Header + phone Apply-bar clearance ---------- */
:root{
  --bar-h:64px;
  --clear-top:calc(var(--bar-h) + env(safe-area-inset-top, 0px) + 28px);
  --dock-space:0px;
}
/* .sec already pads enough to clear the header; only tight blocks (help, howto) get a scroll-margin */
html{scroll-padding-top:0;scroll-padding-bottom:var(--dock-space)}
/* Tight sections whose own padding is smaller than the header (help, howto, apply) */
#help,#how-to-join,.howto,.help,.story,#apply{scroll-margin-top:var(--clear-top)}
/* When a .sec sits at the top of the viewport, its heading still starts below the header */
.sec{padding-top:max(clamp(84px,11vw,150px),var(--clear-top))}

@media (max-width:899px){
  :root{--dock-space:calc(78px + env(safe-area-inset-bottom, 0px))}
  .sec{padding-bottom:max(clamp(84px,11vw,150px),calc(var(--dock-space) + 24px))}
  /* Podium: all three spots and their links fit between the header and the Apply bar */
  .top3 .head{padding-bottom:8px;margin-bottom:10px;gap:8px}
  .top3__list{gap:10px 12px}
  .top3__avatar{width:76px}
  .top3__card--first .top3__avatar{width:96px}
  .top3__plinth{height:36px}
  .top3__card--first .top3__plinth{height:48px}
  .top3__card--third .top3__plinth{height:28px}
  .top3__name{font-size:18px}
  .top3__card--first .top3__name{font-size:24px}
  .top3__body{padding:6px 0 4px;gap:1px}
  .top3__badge{white-space:nowrap;margin-top:4px;padding:3px 9px;font-size:11.5px}
  .top3__rank{font-size:26px;padding-top:4px}
  .top3__card--first .top3__rank{font-size:36px}
  .top3__note{margin:10px 0 0}
  /* About: fit the photo, copy, and "See my TikTok" link above the Apply bar on first landing.
     The photo file and crop are unchanged; only the on-screen size and gaps tighten. */
  .about__grid{gap:16px}
  .about__photo{width:68%}
  .about__copy h2{margin-bottom:12px}
  .about__copy p{margin:0 0 10px}
  .about__solo{margin-bottom:12px}
  .faq-sec .head{padding-bottom:16px;margin-bottom:20px}
}

/* ---------- Ring film: iOS-safe painting + moving-poster fallback ---------- */
.scene__video.is-probing{opacity:.01;transition:none}
.scene__video{-webkit-transform:translateZ(0);transform:translateZ(0)}
/* Until the film is proven to repaint on seek, the poster turns with the scroll so the ring still moves. */
.scene[data-ring="poster"] .scene__ring picture{rotate:var(--spin,0deg);transition:none}
/* Frame-set fallback: a canvas the same size as the film. It sits under the video and hides once the video is live. */
.scene__canvas{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:0;pointer-events:none}
.scene[data-ring="frames"] .scene__canvas{opacity:1}
.scene[data-ring="video"] .scene__canvas{opacity:0;transition:opacity 0s .7s}
@media (max-width:899px){
  /* A masked, transformed container can make iOS Safari skip repainting a paused video's seeks.
     On phones the soft edge is drawn by an overlay instead (same look: the page background is the void colour). */
  .scene__ring{-webkit-mask-image:none;mask-image:none}
  .scene__ring::after{content:"";position:absolute;inset:-1px;pointer-events:none;background:radial-gradient(ellipse 50% 50% at 50% 50%,transparent 82%,var(--void) 100%)}
}


/* v7: the idle spin turns this layer (rotate + scale, set from v2.js). The ring box, its soft edge and the tint stay put. */
.scene__media{position:absolute;inset:0;will-change:transform;transform-origin:50% 50%}
/* The turned, zoomed picture must never show outside the ring box (the soft edge is only drawn inside it, on phones as an overlay).
   The box edge is already fully faded to the page colour, so clipping 2px inside it changes nothing visible. */
.scene__ring{overflow:hidden;clip-path:inset(2px)}
