/* ============================================================
   Homepage scroll-scrubbed hero ("Before Seven")
   ============================================================ */

:root {
  --tshadow: 0 1px 2px rgba(5,10,18,.95), 0 3px 12px rgba(5,10,18,.78), 0 10px 44px rgba(5,10,18,.8);
}

.cine-hero { position: relative; height: 560vh; background: var(--ink); }
.cine-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; isolation: isolate; }
.cine-poster, .cine-video, .cine-scrim { position: absolute; inset: 0; }
.cine-poster { z-index: 1; background-color: var(--ink); background-size: cover; background-position: center; }
.cine-video { z-index: 2; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.2s var(--ease-soft); will-change: transform; transform: translateZ(0); }
.cine-stage.video-ready .cine-video { opacity: 1; }
.cine-stage.video-failed .cine-video { display: none; }
/* Daylight footage is bright: a firmer base vignette so no frame is ever raw behind the edges where text lives. */
.cine-scrim { z-index: 3; pointer-events: none; background: linear-gradient(to bottom, rgba(5,10,18,.62) 0, rgba(5,10,18,.28) 110px, rgba(5,10,18,0) 190px), radial-gradient(ellipse 120% 90% at 50% 45%, rgba(10,16,26,.08) 25%, rgba(10,16,26,.7) 100%); }

/* Dust motes in the atrium light: sparse, slow, whisper level. */
.motes { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.motes i { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: rgba(255,244,226,.55); filter: blur(.4px); animation: mote 26s linear infinite; }
@keyframes mote { from { transform: translate3d(0, -4vh, 0); opacity: 0 } 12% { opacity: .8 } 88% { opacity: .6 } to { transform: translate3d(3vw, 104vh, 0); opacity: 0 } }

.ring-wrap { position: absolute; right: 1.6rem; bottom: 1.6rem; z-index: 6; width: 44px; height: 44px; color: var(--pewter-light); }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { transition: stroke-dashoffset .2s linear; }
.cine-stage.video-ready .ring-wrap, .cine-stage.video-failed .ring-wrap { opacity: 0; transition: opacity .6s var(--ease-soft); }
.scroll-cue { position: absolute; left: 50%; bottom: 1.4rem; transform: translateX(-50%); z-index: 6; display: flex; flex-direction: column; align-items: center; gap: .45rem; font-family: var(--mono); font-size: .66rem; letter-spacing: .24em; text-transform: uppercase; color: rgba(255,255,255,.78); }
.scroll-cue::after { content: ""; width: 1px; height: 32px; background: linear-gradient(to bottom, #fff, transparent); animation: cue 2.6s var(--ease-soft) -1.3s infinite; }
@keyframes cue { 0% { transform: scaleY(0); transform-origin: top } 50% { transform: scaleY(1); transform-origin: top } 51% { transform-origin: bottom } 100% { transform: scaleY(0); transform-origin: bottom } }

/* ---------- Caption bands ---------- */
/* Container caps are rem-based: a ch here would resolve against the body font, not the display face inside. */
.band { position: absolute; z-index: 4; opacity: 0; color: #fff; text-shadow: var(--tshadow); max-width: min(32rem, 44vw); }
/* The scrim box is much larger than the text and its gradient reaches zero well inside it: no visible edge. */
.band::before { content: ""; position: absolute; inset: -85% -55%; z-index: -1; pointer-events: none; opacity: calc(.25 + .75 * var(--k, 0));
  background: radial-gradient(ellipse 52% 46% at 50% 50%, rgba(5,10,18,var(--scrim-a,.62)) 0%, rgba(5,10,18,calc(var(--scrim-a,.62)*.78)) 38%, rgba(5,10,18,calc(var(--scrim-a,.62)*.34)) 60%, rgba(5,10,18,0) 78%); }
.band .line { font-family: var(--display); font-stretch: 112%; font-weight: 600; color: #fff; font-size: clamp(1.6rem, 3.2vw, 2.7rem); line-height: 1.14; letter-spacing: -0.01em; margin: 0; max-width: 17ch; }
.band .band-kicker { display: block; font-family: var(--mono); font-size: .72rem; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--pewter-light); margin-bottom: .9rem; }
#band1 { left: clamp(1.2rem, 7vw, 7rem); bottom: 16vh; --scrim-a: .8; }
#band2 { right: clamp(1.2rem, 7vw, 7rem); top: 30vh; text-align: right; --scrim-a: .9; }
#band2 .line { margin-left: auto; }
#band3 { left: clamp(1.2rem, 7vw, 7rem); top: 34vh; --scrim-a: .88; }

/* Band 4 is the page's only H1. It is the settle on desktop and the static hero on phones. */
#band4 { left: 50%; top: clamp(6.5rem, 16vh, 10rem); transform: translateX(-50%); text-align: center; width: max-content; max-width: min(52rem, 92vw); --scrim-a: .72; }
#band4::before { inset: -70% -45%; background: radial-gradient(ellipse 58% 52% at 50% 46%, rgba(5,10,18,.94) 0%, rgba(5,10,18,.84) 40%, rgba(5,10,18,.42) 62%, rgba(5,10,18,0) 80%); }
#band4 h1 { margin: 0; color: #fff; }
#band4 .h1-small { display: block; font-family: var(--mono); font-stretch: 100%; font-size: .78rem; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--pewter-light); margin-bottom: 1rem; }
#band4 .h1-big { display: block; font-size: clamp(2.5rem, 6.4vw, 5.2rem); line-height: 1.02; letter-spacing: -0.02em; }
#band4 .sub { font-size: clamp(1rem, 1.5vw, 1.18rem); color: #e6ebf0; margin: 1.1rem auto 0; max-width: 46ch; opacity: var(--ks, 0); }
#band4 .ctas { margin-top: 1.7rem; display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; opacity: var(--kb, 0); transform: translateY(calc((1 - var(--kb, 0)) * 14px)); }
#band4 .ctas .btn { text-shadow: none; }
/* Buttons over footage carry their own blurred chip rather than the band's radial. */
#band4 .ctas .btn--light { background: rgba(10,16,26,.62); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
#band4 .ctas .btn--light:hover { background: #fff; }

/* ---------- Word machinery and entrances (transform and opacity only, scrubbed off --k) ---------- */
.tsplit .w { display: inline-block; white-space: pre; }
.band[data-fx="drift"] .w { --kc: clamp(0, calc((var(--k,0) - var(--th,0)) * 2.8), 1); opacity: var(--kc); transform: translateY(calc((1 - var(--kc)) * -26px)); }
.band[data-fx="snap"] .w { --kc: clamp(0, calc((var(--k,0) - var(--th,0)) * 3.2), 1); opacity: var(--kc); transform: translateX(calc((1 - var(--kc)) * -34px)); }
.band[data-fx="rise"] .w { --kc: clamp(0, calc((var(--k,0) - var(--th,0)) * 2.8), 1); opacity: var(--kc); transform: translateY(calc((1 - var(--kc)) * 22px)); }
/* Blur to sharp: two stacked copies crossfaded; the soft copy's blur is static, never animated. */
.band[data-fx="focus"] .line { position: relative; }
.band[data-fx="focus"] .soft { position: absolute; inset: 0; filter: blur(9px); opacity: calc(1 - var(--k, 0)); }
.band[data-fx="focus"] .sharp { opacity: var(--k, 0); }

.static-still { display: none; }

/* ---------- The five gates. MUST match the GATES list in hero.js character for character. ---------- */
@media (max-width: 720px),
       (orientation: portrait) and (max-width: 1024px),
       (orientation: portrait) and (pointer: coarse),
       (orientation: landscape) and (pointer: coarse) and (max-height: 560px),
       (prefers-reduced-motion: reduce) {
  .cine-hero { height: auto; min-height: 100vh; min-height: 100svh; }
  .cine-stage { position: relative; height: auto; min-height: 100vh; min-height: 100svh; display: flex; align-items: flex-end; }
  .cine-video, .cine-poster, .ring-wrap, .scroll-cue, .motes, #band1, #band2, #band3 { display: none; }
  /* The arrival frame as a designed still. It sits on an element that only exists here, so desktop never fetches it. */
  .static-still { display: block; position: absolute; inset: 0; z-index: 1; background-image: url("../img/hero-poster.jpg"); background-size: cover; background-position: center 40%; }
  /* Near-solid through the text zone, so flat shapes in the photo (like the stone wall behind the desk) never read as a box behind the words. */
  .cine-scrim { background: linear-gradient(to top, rgba(10,16,26,.97) 0%, rgba(10,16,26,.95) 50%, rgba(10,16,26,.62) 64%, rgba(10,16,26,.28) 82%, rgba(10,16,26,.45) 100%); }
  #band4 {
    position: relative; left: auto; top: auto; transform: none; width: auto; max-width: none;
    text-align: left; opacity: 1 !important; --k: 1 !important; --ks: 1 !important; --kb: 1 !important;
    padding: calc(var(--header-h) + 5rem) var(--gutter) 3.2rem;
  }
  #band4::before { display: none; }
  #band4 { text-shadow: none; }             /* the gradient scrim carries legibility here; a shadow only smears */
  #band4 .sub { margin-left: 0; }
  #band4 .ctas { justify-content: flex-start; }
}
@media (max-width: 720px) {
  #band4 .h1-small { font-size: .7rem; letter-spacing: .1em; }
  #band4 .ctas { display: grid; grid-template-columns: 1fr; }
  #band4 .ctas .btn { width: 100%; }
}
@media (max-height: 560px) { .scroll-cue, .motes { display: none; } }

/* Hand-off from the dusk of the hero to the stone canvas of the page. */
.settle-seam { height: clamp(3rem, 8vw, 6rem); background: linear-gradient(to bottom, var(--ink), var(--canvas)); }
@media (max-width: 720px) { .settle-seam { height: 2.5rem; } }
.no-js #band4 { opacity: 1; --k: 1; --ks: 1; --kb: 1; }
