/* ============================================================================
 * hero-scroll.css — Studio 72 canvas scroll-scrub hero
 * Pair with assets/hero-scroll.js. Swap the tokens for the site's own.
 * ========================================================================== */

:root {
  --hero-bg: #07070a;
  --hero-text: #f5f5f0;
  --hero-muted: #6b6b6b;
  --hero-stroke: #1c1c21;
  --hero-accent: #c9a24b;
  --hero-accent-rgb: 201, 162, 75;
}

/* --- THE ONE RULE THAT BREAKS STICKY ---------------------------------------
   overflow-x:hidden on html/body (or ANY ancestor of .hero-stage) silently
   creates a scroll container and kills position:sticky. Zero console errors —
   the stage just scrolls away and the hero looks broken. Use clip. */
html, body { overflow-x: clip; }

/* --- track + stage --------------------------------------------------------- */
.hero-film {
  position: relative;
  /* Height = scroll distance. ~3–3.5vh per frame. 200 frames -> 700vh.
     Set this from the frame count, not by feel. */
  height: 700vh;
  background: var(--hero-bg);
}

.hero-stage {
  position: sticky;
  top: 0;
  height: 100svh;              /* svh, not vh — mobile URL bar */
  overflow: hidden;
  isolation: isolate;
  background: var(--hero-bg);
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity .6s ease;
}
.hero-canvas.is-on { opacity: 1; }

/* Instant-hero splash: the preloaded f_001 painted as a background so the LCP
   element exists before any JS runs. Removed by the engine on first decode. */
.hero-instant {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--hero-bg) center/cover no-repeat;
  pointer-events: none;
}

.hero-poster {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1s ease;
}
.hero-poster.is-on { opacity: 1; }

.hero-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(0,0,0,.55) 100%),
    linear-gradient(rgba(0,0,0,.55), transparent 30%, transparent 72%, rgba(0,0,0,.5));
}

/* --- scroll-linked copy bands ---------------------------------------------
   <div class="hero-band" data-hero-band="0.04" data-hero-half="0.05" data-hero-fade="0.04">
   center / plateau half-width / ramp, all in track-progress units. */
.hero-band {
  position: absolute;
  z-index: 4;
  left: 50%;
  transform: translateX(-50%);
  width: min(1100px, 90vw);
  text-align: center;
  padding: 0 1.2rem;
  pointer-events: none;              /* the block is decoration… */
  will-change: opacity, transform;
}
.hero-band .hero-cta,
.hero-band a,
.hero-band button { pointer-events: auto; }   /* …its controls are not */

.hero-band[data-pos="top"]    { top: clamp(5rem, 12vh, 9rem); }
.hero-band[data-pos="center"] { top: 50%; }
.hero-band[data-pos="center"] { transform: translate(-50%, -50%); }
.hero-band[data-pos="bottom"] { bottom: clamp(5rem, 12vh, 9rem); }

.hero-wordmark {
  width: min(600px, 78vw);
  height: auto;
  filter: drop-shadow(0 4px 30px rgba(0,0,0,.5));
}
.hero-eyebrow {
  font-size: clamp(.62rem, .8vw, .72rem);
  letter-spacing: .38em;
  text-transform: uppercase;
  color: var(--hero-accent);
}
.hero-headline {
  font-size: clamp(2.4rem, 6.5vw, 6rem);
  line-height: .95;
  color: var(--hero-text);
  margin: .6em 0 .4em;
}

/* --- scroll cue ------------------------------------------------------------ */
.hero-cue {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: calc(2rem + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  font-size: .62rem;
  letter-spacing: .35em;
  text-transform: uppercase;
  color: var(--hero-muted);
  opacity: 0;
  transition: opacity .5s ease;
  pointer-events: none;
}
.hero-cue.is-on { opacity: 1; }

/* --- entry gate ------------------------------------------------------------ */
.hero-gate {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-content: center;
  gap: 1.4rem;
  justify-items: center;
  background: var(--hero-bg);
  transition: opacity .7s ease;
}
.hero-gate.is-gone { opacity: 0; pointer-events: none; }

.hero-gate__btn {
  position: relative;
  width: 116px; height: 116px;
  border-radius: 50%;
  border: 1px solid rgba(var(--hero-accent-rgb), .5);
  background: transparent;
  color: var(--hero-text);
  font: inherit;
  font-size: .6rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: .35;
  transition: opacity .4s ease;
}
.hero-gate.is-ready .hero-gate__btn { opacity: 1; }
.hero-gate__btn[disabled] { cursor: progress; }
.hero-gate.is-ready .hero-gate__meta { opacity: .5; }
.hero-gate__btn::after {
  content: "";
  position: absolute; inset: -14px;
  border-radius: 50%;
  border: 1px solid rgba(var(--hero-accent-rgb), .28);
  animation: hero-gate-ring 2.6s ease-out infinite;
}
@keyframes hero-gate-ring {
  0%   { transform: scale(.9);  opacity: .8; }
  100% { transform: scale(1.25); opacity: 0; }
}

.hero-gate__meta {
  font-size: .6rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--hero-muted);
}
.hero-gate__track {
  width: min(280px, 60vw);
  height: 1px;
  background: var(--hero-stroke);
  overflow: hidden;
}
.hero-gate__bar {
  height: 100%;
  background: var(--hero-accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .25s linear;
}

/* --- static tier: reduced-motion, save-data, no canvas --------------------- */
body.hero-static .hero-film   { height: 100svh; }
body.hero-static .hero-stage  { position: relative; }
body.hero-static .hero-cue    { display: none; }
body.hero-static .hero-band   { opacity: 1 !important; visibility: visible !important; }
body.hero-static .hero-band:not([data-hero-static="keep"]) { display: none; }
body.hero-static .hero-band[data-hero-static="keep"] {
  position: absolute; top: 50%; transform: translate(-50%, -50%) !important;
}

@media (prefers-reduced-motion: reduce) {
  .hero-canvas, .hero-poster, .hero-gate, .hero-cue { transition: none; }
  .hero-gate__btn::after { animation: none; }
}
