/* ============================================================
   Leviathan overlay — the HTML layer that sits on the film.
   Replaces the engine's default copy blocks (.sw-copylayer is hidden).
   Two kinds of thing live here:
     .ov-copy      editorial copy, composed against each frame
     .ov-inst      diegetic instrumentation that belongs to the image
   ============================================================ */

.sw-copylayer { display: none !important; }

#hud {
  position: fixed; inset: 0; z-index: 200;
  pointer-events: none;
  font-family: var(--sans);
  opacity: 1;
  transition: opacity .25s linear;
}
#hud[data-past="1"] { opacity: 0; }

.ov {
  position: absolute; inset: 0;
  opacity: 0; visibility: hidden;
  will-change: opacity;
}
.ov[data-on="1"] { visibility: visible; }

/* ---- placement: composed against where each frame is empty ---- */
.ov-copy {
  position: absolute;
  max-width: min(36rem, 46vw);
  display: grid; gap: .55rem;
  padding: clamp(1rem, 2vw, 1.4rem) clamp(1.1rem, 2.2vw, 1.6rem);
  --edge: clamp(1.6rem, 6vw, 6rem);
}
.pos-bl { left: var(--edge); bottom: clamp(4.5rem, 12vh, 9rem); }
.pos-tl { left: var(--edge); top: clamp(5rem, 16vh, 10rem); }
.pos-l  { left: var(--edge); top: 50%; transform: translateY(-50%); }
.pos-br { right: var(--edge); bottom: clamp(4.5rem, 12vh, 9rem); text-align: right; justify-items: end; }
.pos-c  { left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; justify-items: center; max-width: min(42rem, 78vw); }

/* soft directional scrim — legibility without a visible box */
.ov-copy::before {
  content: ""; position: absolute; inset: -14% -22% -22% -22%;
  background: radial-gradient(ellipse at 30% 60%, rgba(3,9,14,.78) 0%, rgba(3,9,14,.55) 42%, rgba(3,9,14,0) 76%);
  z-index: -1; pointer-events: none;
}
.ov-copy.pos-c::before {
  background: radial-gradient(ellipse at 50% 50%, rgba(3,9,14,.8) 0%, rgba(3,9,14,.5) 48%, rgba(3,9,14,0) 78%);
}

/* ---- type ---- */
.ov-eyebrow {
  font-family: var(--mono); font-size: clamp(.68rem, 1.1vw, .8rem);
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--leg-accent, var(--cyan));
  display: flex; align-items: center; gap: .6rem;
}
.ov-eyebrow i {
  display: block; width: clamp(14px, 3vw, 28px); height: 1px;
  background: currentColor; opacity: .55;
}
.ov-title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2.5rem, 6.2vw, 5.2rem); line-height: 1.0;
  letter-spacing: -.02em; margin: 0; color: #F2F7FA;
  text-wrap: balance; text-shadow: 0 1px 30px rgba(0,0,0,.5);
}
.ov-body {
  margin: 0; font-size: clamp(1.05rem, 1.85vw, 1.32rem); line-height: 1.5;
  color: rgba(226,238,244,.82); max-width: 32ch;
}
.pos-c .ov-body { max-width: 46ch; }
.ov-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin: .35rem 0 0; padding: 0; list-style: none; }
.ov-tags li {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .13em; text-transform: uppercase;
  color: rgba(226,238,244,.72);
  border: 1px solid rgba(226,238,244,.22); border-radius: 2px;
  padding: .3rem .55rem; backdrop-filter: blur(3px);
}

/* staggered reveal — each line rides its own delay off --p */
.ov-line { opacity: 0; transform: translateY(14px); }

/* ---- diegetic instrumentation ---- */
.ov-inst { position: absolute; opacity: 0; }

/* targeting bracket that locks onto the blow */
.ov-bracket {
  left: 50%; top: 46%; width: clamp(90px, 11vw, 150px); aspect-ratio: 1;
  transform: translate(-50%, -50%);
}
.ov-bracket i {
  position: absolute; width: 26%; height: 26%;
  border: 1.5px solid var(--cyan);
}
.ov-bracket i:nth-child(1){ left:0; top:0; border-right:0; border-bottom:0; }
.ov-bracket i:nth-child(2){ right:0; top:0; border-left:0; border-bottom:0; }
.ov-bracket i:nth-child(3){ left:0; bottom:0; border-right:0; border-top:0; }
.ov-bracket i:nth-child(4){ right:0; bottom:0; border-left:0; border-top:0; }
.ov-bracket b {
  position: absolute; left: 50%; bottom: -1.6rem; transform: translateX(-50%);
  font-family: var(--mono); font-size: .62rem; letter-spacing: .18em;
  color: var(--cyan); white-space: nowrap; font-weight: 400;
}

/* readout panel — values move with scroll */
.ov-readout {
  right: clamp(1.6rem, 6vw, 6rem); top: 50%; transform: translateY(-50%);
  min-width: min(15rem, 34vw);
  border: 1px solid rgba(79,216,228,.25);
  background: rgba(4,12,18,.62);
  backdrop-filter: blur(8px);
  padding: .9rem 1rem;
  display: grid; gap: .5rem;
}
.ov-readout .hd {
  font-family: var(--mono); font-size: .62rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--cyan); display: flex; justify-content: space-between; gap: 1rem;
  border-bottom: 1px solid rgba(79,216,228,.18); padding-bottom: .5rem;
}
.ov-readout dl { margin: 0; display: grid; gap: .32rem; }
.ov-readout .row { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.ov-readout dt {
  font-family: var(--mono); font-size: .6rem; letter-spacing: .13em; text-transform: uppercase;
  color: rgba(226,238,244,.5);
}
.ov-readout dd {
  margin: 0; font-family: var(--mono); font-size: .8rem; color: #E9F3F7;
  font-variant-numeric: tabular-nums;
}
.ov-meter { height: 2px; background: rgba(226,238,244,.14); margin-top: .2rem; }
.ov-meter i { display: block; height: 100%; background: var(--cyan); width: 0%; }

/* node labels along the coast */
.ov-nodes { inset: 0; }
.ov-node {
  position: absolute; display: flex; align-items: center; gap: .5rem;
  opacity: 0; transform: translateY(6px);
}
.ov-node s {
  width: 7px; height: 7px; border-radius: 50%; background: var(--cyan);
  box-shadow: 0 0 0 4px rgba(79,216,228,.18); text-decoration: none; flex: none;
}
.ov-node span {
  font-family: var(--mono); font-size: .62rem; letter-spacing: .16em; text-transform: uppercase;
  color: #EAF3F7; white-space: nowrap; text-shadow: 0 1px 10px rgba(0,0,0,.8);
}
.ov-node em {
  font-family: var(--mono); font-style: normal; font-size: .55rem; letter-spacing: .14em;
  text-transform: uppercase; color: rgba(226,238,244,.55);
  border: 1px solid rgba(226,238,244,.24); padding: .12rem .34rem; border-radius: 2px;
}

/* persistent thin instrument bar */
.ov-stamp {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(1.1rem + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: .85rem;
  font-family: var(--mono); font-size: .58rem; letter-spacing: .18em; text-transform: uppercase;
  color: rgba(226,238,244,.42); pointer-events: none; white-space: nowrap;
}
.ov-stamp b { color: var(--cyan); font-weight: 400; }
.ov-stamp u { text-decoration: none; opacity: .5; }

/* CTA on the last leg becomes interactive */
.ov-cta { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: .8rem; pointer-events: auto; justify-content: center; }
.ov-cta a {
  font-size: .86rem; text-decoration: none; padding: .72rem 1.35rem; border-radius: 2px;
  border: 1px solid var(--cyan); background: var(--cyan); color: #04121a; font-weight: 600;
  transition: transform .15s ease, background .15s ease;
}
.ov-cta a.ghost { background: transparent; color: #EAF3F7; border-color: rgba(226,238,244,.3); font-weight: 400; }
.ov-cta a:hover { transform: translateY(-1px); }
.ov-cta a:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

@media (max-width: 820px) {
  .ov-copy { max-width: 78vw; }
  .pos-br { text-align: left; justify-items: start; right: auto; left: var(--edge); }
  .ov-readout { display: none; }
  .pos-l { top: auto; bottom: clamp(4.5rem, 14vh, 9rem); transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ov-line, .ov-node { transition: none !important; }
}

/* ---- wordmark on the final leg ---- */
.ov-logo {
  display: block; width: min(30rem, 62vw); height: auto;
  margin: 0 auto .6rem; opacity: .96;
  filter: drop-shadow(0 2px 24px rgba(0,0,0,.55));
}
.pos-c .ov-title.is-tagline {
  font-size: clamp(1.5rem, 3.2vw, 2.4rem);
  letter-spacing: .02em; color: #EAF3F7;
}
/* ---- opening title card: wordmark large on arrival, hands off to leg 01 ---- */
.ov-intro {
  position: fixed; inset: 0; z-index: 210;
  display: grid; place-content: center; justify-items: center;
  text-align: center; padding: 0 6vw;
  pointer-events: none;
}
.ov-intro img {
  display: block; width: min(46rem, 82vw); height: auto;
  opacity: .97; filter: drop-shadow(0 4px 40px rgba(0,0,0,.6));
}
.ov-intro .sub {
  margin: 1.4rem 0 0;
  font-family: var(--mono); font-size: clamp(.7rem, 1.35vw, .92rem);
  letter-spacing: .34em; text-transform: uppercase;
  color: rgba(233,243,247,.82);
  text-shadow: 0 1px 20px rgba(0,0,0,.7);
}
.ov-intro .tag {
  margin: .9rem 0 0; font-family: var(--serif);
  font-size: clamp(1.05rem, 2.1vw, 1.5rem); color: rgba(226,238,244,.72);
  text-shadow: 0 1px 20px rgba(0,0,0,.7);
}
.ov-intro .scrollcue {
  margin-top: 2.6rem; font-family: var(--mono);
  font-size: .64rem; letter-spacing: .28em; text-transform: uppercase;
  color: rgba(226,238,244,.5); display: flex; align-items: center; gap: .7rem;
}
.ov-intro .scrollcue i {
  display: block; width: 1px; height: 26px;
  background: linear-gradient(rgba(226,238,244,.6), rgba(226,238,244,0));
}
.ov-intro::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(ellipse at 50% 46%, rgba(3,9,14,.62) 0%, rgba(3,9,14,.34) 46%, rgba(3,9,14,0) 76%);
}

/* ---- system line: names the Leviathan component behind each leg ---- */
.ov-system {
  margin: .55rem 0 0; display: flex; align-items: center; gap: .55rem;
  font-family: var(--mono); font-size: clamp(.66rem, 1.05vw, .76rem);
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--leg-accent, var(--cyan));
}
.pos-c .ov-system { justify-content: center; }
.ov-system s {
  width: 6px; height: 6px; border-radius: 50%; background: currentColor;
  text-decoration: none; flex: none; box-shadow: 0 0 0 4px rgba(79,216,228,.14);
}

/* ---- Leg 05: the tool chain draws itself, then resolves ---- */
.ov-query {
  left: clamp(1.6rem, 6vw, 6rem); bottom: clamp(4.5rem, 13vh, 9rem);
  display: grid; gap: .42rem; min-width: min(17rem, 40vw);
}
.pos-l ~ .ov-query { left: auto; right: clamp(1.6rem, 6vw, 6rem); }
.ov-step {
  display: flex; align-items: center; gap: .6rem;
  font-family: var(--mono); font-size: .68rem; letter-spacing: .16em; text-transform: uppercase;
  color: rgba(226,238,244,.62); opacity: 0;
  border-left: 1px solid rgba(79,216,228,.35); padding: .28rem 0 .28rem .7rem;
}
.ov-step s {
  width: 5px; height: 5px; border-radius: 50%; background: var(--cyan);
  text-decoration: none; flex: none; opacity: .35;
}
.ov-step.done { color: rgba(233,243,247,.9); }
.ov-step.done s { opacity: 1; box-shadow: 0 0 0 3px rgba(79,216,228,.18); }
.ov-result {
  margin-top: .5rem; opacity: 0;
  border: 1px solid rgba(79,216,228,.3); background: rgba(4,12,18,.62);
  backdrop-filter: blur(8px); padding: .7rem .85rem;
}
.ov-result b {
  display: block; font-family: var(--mono); font-size: .7rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--cyan); font-weight: 400; margin-bottom: .3rem;
}
.ov-result span {
  font-family: var(--mono); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase;
  color: rgba(226,238,244,.6);
}

/* ---- skip control during the film ---- */
.ov-skip {
  position: fixed; right: clamp(1rem, 3vw, 2rem);
  bottom: calc(1.05rem + env(safe-area-inset-bottom, 0px));
  z-index: 260; pointer-events: auto;
  font-family: var(--mono); font-size: .62rem; letter-spacing: .2em; text-transform: uppercase;
  color: rgba(226,238,244,.6); text-decoration: none;
  border: 1px solid rgba(226,238,244,.22); padding: .5rem .8rem; border-radius: 2px;
  background: rgba(4,12,18,.45); backdrop-filter: blur(6px);
  transition: color .2s ease, border-color .2s ease, opacity .25s ease;
}
.ov-skip:hover { color: var(--cyan); border-color: rgba(79,216,228,.5); }
.ov-skip:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
#hud[data-past="1"] .ov-skip { opacity: 0; pointer-events: none; }

/* screen-reader / crawler mirror of the film copy */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* =========================================================
   Chrome pass: neutralise the engine's own furniture, then
   build ours. Unlayered rules beat the engine's @layer sw.
   ========================================================= */
.sw-topbar    { display: none; }
.sw-hint      { display: none !important; }  /* engine writes .style.opacity every frame */
.sw-scrollbar { display: none; }

/* route dots stay in the DOM (they own jumpTo) but are ours to style */
.sw-route { right: clamp(14px, 2.2vw, 26px); }
.sw-route__dot i {
  width: 12px !important; height: 1px !important; border-radius: 0 !important;
  background: rgba(230,238,243,.26) !important;
}
.sw-route__dot.is-active i {
  width: 22px !important; height: 2px !important;
  background: var(--leg-accent, var(--cyan)) !important;
}
.sw-route__label {
  opacity: .34 !important; font-family: var(--mono) !important;
  font-size: .58rem !important; letter-spacing: .18em !important;
  text-transform: uppercase; color: rgba(230,238,243,.85) !important;
}
.sw-route__dot.is-active .sw-route__label { opacity: 1 !important; }

/* ---- persistent wordmark: hero on arrival, docked for the whole film ---- */
#brandlayer { position: fixed; inset: 0; z-index: 420; pointer-events: none; }
.lev-mark {
  position: absolute; display: block; pointer-events: auto;
  top: clamp(18px, 2.2vw, 28px); left: clamp(20px, 4vw, 44px);
  width: clamp(104px, 11vw, 148px);
  transform-origin: 0 0; will-change: transform, opacity;
}
.lev-mark img { display: block; width: 100%; height: auto; }
.lev-mark.is-hero img { filter: drop-shadow(0 4px 40px rgba(0,0,0,.6)); }
.lev-mark:focus-visible { outline: 2px solid var(--cyan); outline-offset: 6px; }

/* ---- one scroll affordance ---- */
.ov-descend {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(clamp(28px, 5vh, 48px) + env(safe-area-inset-bottom, 0px));
  z-index: 240; pointer-events: none;
  display: grid; justify-items: center; gap: 12px;
}
.ov-descend .rule {
  position: relative; width: 1px; height: 52px;
  background: linear-gradient(180deg, rgba(230,238,243,0), rgba(230,238,243,.32) 45%, rgba(230,238,243,0));
}
.ov-descend .cursor {
  position: absolute; left: 0; top: 0; width: 1px; height: 14px;
  background: rgba(230,238,243,.66);
  animation: lev-descend 2.4s cubic-bezier(.4,0,.2,1) infinite;
}
.ov-descend.ack .cursor { background: var(--cyan); box-shadow: 0 0 8px rgba(79,216,228,.7); }
.ov-descend .lbl {
  font-family: var(--mono); font-size: .6rem; letter-spacing: .3em;
  text-transform: uppercase; color: rgba(230,238,243,.46);
}
@keyframes lev-descend {
  0%   { transform: translateY(-2px); opacity: 0; }
  18%  { opacity: 1; }
  82%  { opacity: 1; }
  100% { transform: translateY(40px); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .ov-descend .cursor { animation: none; top: 20px; opacity: .5; }
  .lev-mark { transition: none !important; }
}

/* ---- mobile ---- */
@media (max-width: 860px) {
  .sw-route { display: none; }
  .lev-mark { width: 96px; top: calc(14px + env(safe-area-inset-top, 0px)); left: 16px; }
  .ov-stamp { font-size: .54rem; gap: .55rem; }
  .ov-stamp .drop { display: none; }
  .ov-descend .rule { height: 40px; }
  .ov-copy { max-width: 86vw; }
  .ov-title { font-size: clamp(2.1rem, 8.6vw, 3.2rem); }
  .ov-body  { font-size: clamp(1rem, 4.2vw, 1.15rem); max-width: 32ch; }
  .ov-system { font-size: .62rem; letter-spacing: .16em; }
  .ov-query { left: 5vw; right: auto; bottom: clamp(7rem, 20vh, 12rem); }
  .ov-intro img { width: min(24rem, 76vw); }
}

/* live vs planned nodes must not look identical: it is a colour rule and a
   claims rule at once. Only a real station gets the filled cyan dot. */
.ov-node.is-planned s {
  background: transparent;
  border: 1px solid rgba(226,238,243,.5);
  box-shadow: none;
}
.ov-copy.pos-c { max-width: min(46rem, 82vw); }

/* ---- final leg: give the close room to breathe ---- */
.ov-copy.pos-c { gap: .8rem; }
.ov-copy.pos-c .ov-logo { width: min(34rem, 74vw); margin-bottom: .2rem; }
.ov-copy.pos-c .ov-title.is-tagline { font-size: clamp(1.7rem, 3.6vw, 2.7rem); }
.ov-copy.pos-c .ov-body { max-width: 42ch; }
.ov-cta { margin-top: 1.3rem; }

/* ---- mobile collisions measured at 375x812 ---- */
@media (max-width: 860px) {
  /* leg 03: bracket sat on top of the copy block */
  .ov-bracket { top: 30%; width: clamp(76px, 22vw, 108px); }
  /* leg 05: the tool chain overlapped the body copy by ~240px */
  .ov-query { position: static; margin-top: 1rem; min-width: 0; }
  .ov-copy.pos-l { bottom: auto; top: 50%; transform: translateY(-50%); }
  .ov-step { font-size: .6rem; letter-spacing: .12em; padding-left: .55rem; }
  .ov-result { padding: .55rem .7rem; }
  .ov-result b { font-size: .64rem; }
  .ov-result span { font-size: .56rem; }
  /* the close */
  .ov-copy.pos-c .ov-logo { width: min(20rem, 72vw); }
  .ov-copy.pos-c .ov-title.is-tagline { font-size: clamp(1.4rem, 6.4vw, 1.9rem); }
  .ov-cta a { font-size: .8rem; padding: .7rem 1.1rem; }
}

/* ---- right rail: was unreadable at .34 opacity over video ---- */
:root { --rail-w: 132px; }

.sw-route {
  right: clamp(16px, 2.4vw, 30px);
  padding: 14px 10px 14px 18px;
}
.sw-route::after {
  content: ""; position: absolute; inset: -10px -14px; z-index: -1;
  background: linear-gradient(270deg, rgba(3,9,14,.62) 0%, rgba(3,9,14,.34) 55%, rgba(3,9,14,0) 100%);
  pointer-events: none;
}
.sw-route__label {
  opacity: 1 !important;
  font-family: var(--mono) !important;
  font-size: .68rem !important;
  letter-spacing: .16em !important;
  text-transform: uppercase;
  color: rgba(233,243,247,.78) !important;
  text-shadow: 0 1px 10px rgba(3,9,14,.95), 0 0 22px rgba(3,9,14,.7);
  transition: color .2s ease;
}
.sw-route__dot:hover .sw-route__label { color: #F4FAFD !important; }
.sw-route__dot.is-active .sw-route__label {
  color: var(--leg-accent, var(--cyan)) !important;
  opacity: 1 !important;
}
.sw-route__dot i { background: rgba(233,243,247,.42) !important; }
.sw-route__dot:focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; }

/* keep the leg 03 readout clear of the rail */
.ov-readout { right: calc(var(--rail-w) + clamp(1rem, 2vw, 2.2rem)); }

@media (max-width: 860px) {
  .sw-route { display: none; }
  .ov-readout { right: auto; }
}

/* =========================================================
   COLD OPEN. Nothing here is scroll driven. It runs on time
   from first paint, so arrival has a sequence instead of
   six finished objects appearing at once.
   ========================================================= */
.ov-blackout {
  position: fixed; inset: 0; z-index: 250; background: #04090E;
  pointer-events: none; opacity: 1;
}
body.booted .ov-blackout {
  opacity: 0; transition: opacity 1s cubic-bezier(.22,.61,.36,1) .35s;
}

/* the mark fades via its parent: JS owns the mark's own transform+opacity */
#brandlayer { opacity: 0; }
body.booted #brandlayer {
  opacity: 1; transition: opacity 1.1s cubic-bezier(.16,1,.3,1) .75s;
}

.ov-intro .rule {
  display: block; width: 132px; height: 1px; margin: 1.5rem auto .2rem;
  background: rgba(233,243,247,.42);
  transform: scaleX(0); transform-origin: 50% 50%;
}
body.booted .ov-intro .rule {
  transform: scaleX(1); transition: transform .9s cubic-bezier(.65,0,.35,1) 1.5s;
}
.ov-intro .sub { opacity: 0; transform: translateY(6px); }
body.booted .ov-intro .sub {
  opacity: .78; transform: none;
  transition: opacity .8s ease-out 1.85s, transform .8s ease-out 1.85s;
}
.ov-intro .meta {
  margin: .9rem 0 0; opacity: 0; transform: translateY(6px);
  display: flex; gap: 1.4rem; justify-content: center; flex-wrap: wrap;
  font-family: var(--mono); font-size: .62rem; letter-spacing: .2em;
  text-transform: uppercase; color: rgba(233,243,247,.44);
}
body.booted .ov-intro .meta {
  opacity: 1; transform: none;
  transition: opacity .8s ease-out 2.15s, transform .8s ease-out 2.15s;
}
.ov-intro .meta b { color: var(--sun); font-weight: 400; }

.ov-descend { opacity: 0; }
body.booted .ov-descend { opacity: 1; transition: opacity .9s ease-out 2.5s; }

@media (prefers-reduced-motion: reduce) {
  body.booted .ov-blackout { transition: opacity .22s linear; }
  body.booted #brandlayer,
  body.booted .ov-intro .sub,
  body.booted .ov-intro .meta,
  body.booted .ov-descend { transition: opacity .22s linear .1s; }
  body.booted .ov-intro .rule { transition: none; transform: scaleX(1); }
}

/* ---- cinematic vignette across the whole film ---- */
.lev-vignette {
  position: fixed; inset: 0; z-index: 150; pointer-events: none;
  background:
    radial-gradient(ellipse 130% 100% at 50% 44%, rgba(3,9,14,0) 38%, rgba(3,9,14,.34) 78%, rgba(3,9,14,.62) 100%),
    linear-gradient(180deg, rgba(3,9,14,.34) 0%, rgba(3,9,14,0) 22%);
  opacity: 0; transition: opacity .8s ease-out;
}
body.booted .lev-vignette { opacity: 1; }
#hud[data-past="1"] ~ .lev-vignette,
body[data-past="1"] .lev-vignette { opacity: 0; }

/* ---- title card refinements ---- */
.ov-intro .sub {
  font-size: clamp(.74rem, 1.45vw, .96rem);
  letter-spacing: .38em; color: rgba(238,246,250,.9);
}
.ov-intro .meta {
  gap: 0; align-items: center;
}
.ov-intro .meta span + span::before {
  content: "·"; margin: 0 .85rem; opacity: .4;
}
.ov-intro .rule { width: 168px; }
.ov-descend .lbl { font-size: .64rem; letter-spacing: .32em; color: rgba(233,243,247,.56); }
.ov-descend .rule { height: 58px; }

@media (max-width: 860px) {
  .ov-intro .meta { flex-direction: column; gap: .45rem; line-height: 1.5; }
  .ov-intro .meta span + span::before { content: ""; margin: 0; }
  .ov-intro .sub { letter-spacing: .26em; }
  .ov-intro .rule { width: 108px; }
}

/* =========================================================
   CHROME BAR. Persistent, clickable, ours.
   ========================================================= */
.lev-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 500;
  height: 62px; display: flex; align-items: center; justify-content: flex-end;
  gap: clamp(.6rem, 1.6vw, 1.6rem);
  padding: 0 clamp(1rem, 3vw, 2.4rem);
  pointer-events: none;
}
.lev-bar::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(3,9,14,.62), rgba(3,9,14,.14) 62%, transparent);
  opacity: 1; transition: opacity .3s ease;
}
body[data-past="1"] .lev-bar::before {
  background: rgba(6,14,21,.9); opacity: 1;
  border-bottom: 1px solid var(--rule);
  backdrop-filter: blur(14px) saturate(1.06);
}
.lev-bar a, .lev-bar button { pointer-events: auto; }

.lev-nav { display: flex; align-items: center; gap: clamp(.5rem, 1.5vw, 1.5rem); }
.lev-nav a {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .18em; text-transform: uppercase;
  color: rgba(233,243,247,.72); text-decoration: none;
  padding: .55rem .2rem; position: relative;
  transition: color .2s ease;
  text-shadow: 0 1px 10px rgba(3,9,14,.9);
}
.lev-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: .28rem; height: 1px;
  background: var(--cyan); transform: scaleX(0); transform-origin: 50%;
  transition: transform .22s cubic-bezier(.2,.7,.2,1);
}
.lev-nav a:hover { color: #F4FAFD; }
.lev-nav a:hover::after { transform: scaleX(1); }
.lev-nav a:focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; }

.lev-cta {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .16em; text-transform: uppercase;
  text-decoration: none; padding: .66rem 1.05rem; border-radius: 2px;
  border: 1px solid rgba(79,216,228,.5); color: var(--cyan);
  background: rgba(4,12,18,.5); backdrop-filter: blur(6px);
  transition: background .2s ease, color .2s ease, transform .15s ease;
  white-space: nowrap;
}
.lev-cta:hover { background: var(--cyan); color: #04121A; transform: translateY(-1px); }
.lev-cta:focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; }
body[data-past="1"] .lev-cta { background: var(--cyan); color: #04121A; border-color: var(--cyan); font-weight: 600; }
body[data-past="1"] .lev-cta:hover { background: #6BE2EC; }

@media (max-width: 700px) {
  .lev-bar { height: 56px; padding: 0 1rem; }
  .lev-nav { display: none; }
  .lev-cta { font-size: .62rem; padding: .6rem .8rem; }
}

/* =========================================================
   CONTACT: three doors, not one mailto
   ========================================================= */
.doors { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.door {
  background: var(--ground); padding: clamp(1.6rem, 3vw, 2.4rem);
  display: grid; align-content: start; gap: .7rem; text-decoration: none;
  transition: background .22s ease;
}
.door:hover { background: var(--surface); }
.door:focus-visible { outline: 2px solid var(--cyan); outline-offset: -2px; }
.door .k {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--cyan);
}
.door h3 { margin: 0; }
.door p { margin: 0; color: var(--ink-soft); font-size: 1rem; }
.door .go {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink); margin-top: .5rem; display: flex; align-items: center; gap: .5rem;
}
.door .go i { display: block; width: 18px; height: 1px; background: var(--cyan); transition: width .22s ease; }
.door:hover .go i { width: 34px; }

.mailrow {
  margin-top: 2.4rem; display: flex; flex-wrap: wrap; align-items: center; gap: 1rem;
  font-family: var(--mono); font-size: .9rem; color: var(--ink-soft);
}
.mailrow a { color: var(--ink); text-decoration: underline; text-decoration-color: rgba(79,216,228,.5); text-underline-offset: .2em; }
.copybtn {
  font-family: var(--mono); font-size: .62rem; letter-spacing: .16em; text-transform: uppercase;
  background: transparent; color: var(--ink-soft); border: 1px solid var(--rule);
  padding: .5rem .8rem; border-radius: 2px; cursor: pointer; transition: border-color .2s, color .2s;
}
.copybtn:hover { border-color: rgba(79,216,228,.5); color: var(--cyan); }
.copybtn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

/* =========================================================
   CREW. Portrait-ready cards that look intentional without
   photographs, and take them without a redesign.
   ========================================================= */
.crew {
  list-style: none; margin: 3rem 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(268px, 1fr));
  gap: 1px; background: var(--rule); border: 1px solid var(--rule);
}
.crew-card {
  background: var(--ground); padding: clamp(1.5rem, 2.6vw, 2.1rem);
  display: grid; gap: 1.2rem; align-content: start;
  position: relative; isolation: isolate;
  transition: background .28s ease;
}
.crew-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: var(--cyan); transform: scaleX(0); transform-origin: 0 50%;
  transition: transform .32s cubic-bezier(.2,.7,.2,1);
}
.crew-card:hover { background: var(--surface); }
.crew-card:hover::before { transform: scaleX(1); }

/* the portrait slot: monogram now, photograph later, same box */
.crew-face {
  position: relative; width: 100%; aspect-ratio: 4 / 5; overflow: hidden;
  background:
    radial-gradient(120% 90% at 30% 12%, rgba(79,216,228,.16) 0%, rgba(79,216,228,0) 58%),
    linear-gradient(168deg, #10222E 0%, #0A151D 52%, #070F16 100%);
  border: 1px solid var(--rule);
  display: grid; place-items: center;
}
.crew-face img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.crew-face span {
  font-family: var(--serif); font-size: clamp(2.4rem, 4.6vw, 3.4rem);
  letter-spacing: .04em; color: rgba(233,243,247,.34);
  line-height: 1; user-select: none;
}
.crew-face::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, var(--cyan), rgba(79,216,228,0) 72%);
  opacity: .5;
}
.crew-card:hover .crew-face span { color: rgba(233,243,247,.5); }

.crew-body { display: grid; gap: .42rem; }
.crew-body h3 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(1.22rem, 2vw, 1.44rem); line-height: 1.18;
  letter-spacing: -.012em; margin: 0; color: var(--ink);
}
.crew-role {
  margin: 0; font-family: var(--mono); font-size: .68rem;
  letter-spacing: .18em; text-transform: uppercase; color: var(--cyan);
}
.crew-bio { margin: .35rem 0 0; font-size: .98rem; line-height: 1.55; color: var(--ink-soft); }

@media (max-width: 620px) {
  .crew { grid-template-columns: 1fr; }
  .crew-card { grid-template-columns: 92px 1fr; gap: 1.1rem; align-items: start; }
  .crew-face { aspect-ratio: 1; }
  .crew-face span { font-size: 1.6rem; }
}
@media (prefers-reduced-motion: reduce) {
  .crew-card, .crew-card::before { transition: none; }
}

/* photographs sit over the monogram, which stays as the fallback */
.crew-face img {
  z-index: 1;
  filter: saturate(.86) contrast(1.04);
  transition: filter .35s ease, transform .5s cubic-bezier(.2,.7,.2,1);
}
.crew-card:hover .crew-face img { filter: saturate(1) contrast(1.06); transform: scale(1.03); }
.crew-face::after { z-index: 2; }
/* a soft ground so faces sit in the palette instead of floating on it */
.crew-face img + span { display: none; }
.crew-face:has(img)::before {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(180deg, rgba(6,14,21,0) 42%, rgba(6,14,21,.55) 100%);
}
@media (prefers-reduced-motion: reduce) {
  .crew-card:hover .crew-face img { transform: none; }
}

/* =========================================================
   MOBILE ONLY. Everything below 860px. Desktop is untouched.
   Measured at 375x812.
   ========================================================= */
@media (max-width: 860px) {

  /* the title card's text was overlapping the wordmark
     (mark 340-374, sub 362-399) */
  .ov-intro { align-content: start; padding-top: 49vh; }
  .ov-intro .sub { font-size: .7rem; letter-spacing: .24em; }
  .ov-intro .meta { font-size: .58rem; letter-spacing: .16em; gap: .35rem; }

  /* chrome CTA was 36px tall, under the 44px touch minimum */
  .lev-cta {
    min-height: 44px; display: inline-flex; align-items: center;
    padding: 0 1rem; font-size: .64rem;
  }
  .lev-bar { height: 58px; }

  /* the scroll cue and the instrument bar were 10px apart */
  .ov-descend { bottom: calc(4.4rem + env(safe-area-inset-bottom, 0px)); }
  .ov-descend .rule { height: 34px; }
  .ov-stamp { font-size: .52rem; letter-spacing: .14em; gap: .5rem; }

  /* leg 05: the tool chain was flowing to the top of the frame,
     landing underneath the chrome bar */
  .ov-query {
    position: absolute; left: 5vw; right: 5vw; bottom: calc(7.2rem + env(safe-area-inset-bottom, 0px));
    min-width: 0; gap: .3rem;
  }
  .ov-step:nth-child(4), .ov-step:nth-child(5) { display: none; }
  .ov-step { font-size: .58rem; padding: .22rem 0 .22rem .5rem; }
  .ov-result { padding: .5rem .65rem; }

  /* copy blocks: give the type room without letting them run off frame */
  .ov-copy { padding-left: 0; padding-right: 0; }
  .ov-title { font-size: clamp(2rem, 8.4vw, 2.9rem); line-height: 1.04; }
  .ov-body { font-size: 1rem; line-height: 1.5; max-width: 30ch; }
  .ov-eyebrow { font-size: .62rem; letter-spacing: .18em; }
  .ov-system { font-size: .58rem; letter-spacing: .14em; }
  .ov-tags li { font-size: .6rem; padding: .24rem .45rem; }

  /* the film's own CTA needs real touch targets */
  .ov-cta a { min-height: 44px; display: inline-flex; align-items: center; }
}

/* very small phones */
@media (max-width: 400px) {
  .ov-copy { --edge: 1.1rem; max-width: calc(100vw - 2.2rem); }
  .ov-title { font-size: 1.95rem; }
  .ov-intro .meta { flex-direction: column; }
}

/* leg 05 on mobile: the tool chain was overlapping the copy by 11px and an
   earlier desktop rule was still driving its horizontal position */
@media (max-width: 860px) {
  .ov .ov-inst.ov-query,
  .pos-l ~ .ov-query {
    position: absolute;
    left: 5vw; right: 5vw;
    bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
    top: auto; min-width: 0;
  }
}

/* the tagline grew from 31 to 43 characters, so the tracking has to come
   back or it wraps awkwardly under the wordmark */
.ov-intro .sub {
  letter-spacing: .26em;
  font-size: clamp(.68rem, 1.2vw, .84rem);
  max-width: none; white-space: nowrap;
  line-height: 1.5;
}
@media (max-width: 860px) {
  .ov-intro .sub { letter-spacing: .14em; font-size: .64rem; max-width: 86vw; }
}

/* one line on desktop, two tidy lines on small phones */
@media (max-width: 700px) {
  .ov-intro .sub { white-space: normal; max-width: 86vw; margin: 0 auto; }
}

/* =========================================================
   CHAPTERS. The six legs, reachable by tap or click.
   ========================================================= */
.lev-chapters {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .16em;
  text-transform: uppercase; color: rgba(233,243,247,.72);
  background: rgba(4,12,18,.5); border: 1px solid rgba(226,238,243,.22);
  border-radius: 2px; padding: 0 .9rem; min-height: 40px;
  display: none; align-items: center; gap: .5rem; cursor: pointer;
  backdrop-filter: blur(6px); pointer-events: auto;
}
.lev-chapters:hover { color: #F4FAFD; border-color: rgba(79,216,228,.45); }
.lev-chapters:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.lev-chapters i { display: block; width: 12px; height: 1px; background: currentColor; }

.lev-sheet {
  position: fixed; inset: 0; z-index: 620;
  background: rgba(4,9,14,.94); backdrop-filter: blur(18px);
  display: grid; align-content: center; gap: .2rem;
  padding: clamp(1.5rem, 6vw, 3rem);
  opacity: 0; visibility: hidden; transition: opacity .24s ease, visibility .24s;
}
.lev-sheet[data-open="1"] { opacity: 1; visibility: visible; }
.lev-sheet h2 {
  font-family: var(--mono); font-size: .66rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--ink-faint); margin: 0 0 1.4rem;
}
.lev-sheet button.ch {
  display: grid; grid-template-columns: 2.6rem 1fr; align-items: baseline; gap: .6rem;
  background: none; border: 0; border-bottom: 1px solid var(--rule);
  padding: 1rem .2rem; text-align: left; cursor: pointer; width: 100%;
  color: var(--ink); font-family: var(--serif); font-size: 1.42rem;
  transition: color .18s ease, background .18s ease;
}
.lev-sheet button.ch span.n {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .16em; color: var(--cyan);
}
.lev-sheet button.ch:hover { color: #fff; background: rgba(12,26,36,.6); }
.lev-sheet button.ch:focus-visible { outline: 2px solid var(--cyan); outline-offset: -2px; }
.lev-sheet .close {
  margin-top: 1.6rem; justify-self: start;
  font-family: var(--mono); font-size: .66rem; letter-spacing: .18em; text-transform: uppercase;
  background: none; border: 1px solid var(--rule); color: var(--ink-soft);
  padding: .8rem 1.2rem; border-radius: 2px; cursor: pointer; min-height: 44px;
}
.lev-sheet .close:hover { border-color: rgba(79,216,228,.5); color: var(--cyan); }

@media (max-width: 860px) {
  .lev-chapters { display: inline-flex; }
  .lev-sheet button.ch { font-size: 1.3rem; padding: 1.05rem .2rem; min-height: 44px; }
}

@media (max-width: 860px) {
  .lev-chapters { min-height: 44px; font-size: .62rem; padding: 0 .75rem; }
  .lev-bar { gap: .45rem; padding: 0 .8rem; }
}

/* =========================================================
   CONSENT BANNER. Accept and Decline carry equal visual
   weight: a decline that is harder to find is not a choice.
   ========================================================= */
.lev-consent {
  position: fixed; left: 0; right: 0; z-index: 700;
  bottom: 0; transform: translateY(110%);
  transition: transform .38s cubic-bezier(.2,.7,.2,1);
  background: rgba(6,14,21,.97);
  border-top: 1px solid var(--rule);
  backdrop-filter: blur(18px);
  box-shadow: 0 -18px 60px -30px rgba(0,0,0,.9);
}
.lev-consent[data-open="1"] { transform: translateY(0); }
.lev-consent__in {
  max-width: 1180px; margin: 0 auto;
  padding: clamp(1.1rem,2.4vw,1.6rem) clamp(1.2rem,4vw,2.8rem);
  display: flex; align-items: center; gap: clamp(1.2rem,3vw,3rem); flex-wrap: wrap;
}
.lev-consent__copy { flex: 1 1 min(34rem, 100%); }
.lev-consent__h {
  margin: 0 0 .35rem; font-family: var(--serif); font-size: 1.18rem;
  line-height: 1.25; letter-spacing: -.01em; color: var(--ink);
}
.lev-consent__b {
  margin: 0; font-size: .95rem; line-height: 1.5; color: var(--ink-soft); max-width: 74ch;
}
.lev-consent__b a {
  color: var(--ink); text-decoration: underline;
  text-decoration-color: rgba(79,216,228,.55); text-underline-offset: .18em;
}
.lev-consent__b a:hover { color: var(--cyan); }
.lev-consent__btns { display: flex; gap: .7rem; flex: 0 0 auto; }
.lev-consent__btns button {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .16em; text-transform: uppercase;
  min-height: 46px; padding: 0 1.5rem; border-radius: 2px; cursor: pointer;
  background: var(--cyan); color: #04121A; border: 1px solid var(--cyan); font-weight: 600;
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}
.lev-consent__btns button.ghost {
  background: transparent; color: var(--ink); border-color: rgba(226,238,243,.34); font-weight: 400;
}
.lev-consent__btns button:hover { background: #6BE2EC; }
.lev-consent__btns button.ghost:hover { border-color: var(--ink); background: transparent; }
.lev-consent__btns button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

@media (max-width: 700px) {
  .lev-consent__in { padding-bottom: calc(1.1rem + env(safe-area-inset-bottom, 0px)); }
  .lev-consent__btns { width: 100%; }
  .lev-consent__btns button { flex: 1; padding: 0 1rem; }
  .lev-consent__h { font-size: 1.06rem; }
  .lev-consent__b { font-size: .88rem; }
}
@media (prefers-reduced-motion: reduce) { .lev-consent { transition: none; } }

/* =========================================================
   CONTACT FORM
   ========================================================= */
.lev-form { margin: 3.2rem 0 0; display: grid; gap: 1.1rem; max-width: 44rem; }
.lev-form__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
@media (max-width: 620px) { .lev-form__grid { grid-template-columns: 1fr; } }
.lev-form__row { display: grid; gap: .45rem; }
.lev-form label {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-faint);
}
.lev-form label .opt { color: rgba(155,176,188,.55); letter-spacing: .1em; }
.lev-form input, .lev-form select, .lev-form textarea {
  font-family: var(--sans); font-size: 1rem; color: var(--ink);
  background: rgba(12,26,36,.55); border: 1px solid var(--rule);
  border-radius: 2px; padding: .85rem .95rem; min-height: 48px; width: 100%;
  transition: border-color .18s ease, background .18s ease;
  appearance: none;
}
.lev-form textarea { min-height: 140px; resize: vertical; line-height: 1.55; }
.lev-form select {
  background-image: linear-gradient(45deg, transparent 50%, rgba(155,176,188,.8) 50%),
                    linear-gradient(135deg, rgba(155,176,188,.8) 50%, transparent 50%);
  background-position: calc(100% - 20px) 22px, calc(100% - 14px) 22px;
  background-size: 6px 6px, 6px 6px; background-repeat: no-repeat;
  padding-right: 2.6rem;
}
.lev-form input:hover, .lev-form select:hover, .lev-form textarea:hover { border-color: rgba(226,238,243,.3); }
.lev-form input:focus, .lev-form select:focus, .lev-form textarea:focus {
  outline: none; border-color: var(--cyan); background: rgba(12,26,36,.85);
}
.lev-form input:focus-visible, .lev-form select:focus-visible, .lev-form textarea:focus-visible {
  outline: 2px solid var(--cyan); outline-offset: 2px;
}
.lev-form [aria-invalid="true"] { border-color: #D98E5A; }
.lev-form__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.lev-form .btn { justify-self: start; border: 0; cursor: pointer; font-family: var(--sans); }
.lev-form .btn[disabled] { opacity: .55; cursor: progress; }
.lev-form__status {
  margin: 0; font-size: .92rem; color: var(--ink-soft); min-height: 1.4em;
}
.lev-form__status[data-tone="ok"] { color: var(--cyan); }
.lev-form__status[data-tone="bad"] { color: #D98E5A; }
