/* Living Hero: scroll-controlled sequence behind the approved hero. Scroll position drives the frame; nothing here is time-based.
   Pinning and the stage exist only for motion-capable visitors on capable connections (.lh-off is set by lh.js otherwise). */
.lh-stage { position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0; transition: opacity 300ms ease; }
.lh-stage.is-on { opacity: 1; }
/* The canvas is sized in device pixels by lh.js and shown 1:1: no CSS transform, no compositor rescale. */
.lh-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; filter: var(--lh-grade); }
.lh-connect { display: none; }

@media (prefers-reduced-motion: no-preference) {
  .lh-pin { --lh-pin: 95svh; position: relative; height: calc(100svh + var(--lh-pin) + var(--lh-hold)); }
  /* The hero stays pinned for --lh-hold more, while the Experience chapter (which overlaps this tail) rises over its last frame. lh.js reads the hold from this marker. */
  :root { --lh-hold: 195svh; }
  .lh-pin::after { content: ""; position: absolute; left: 0; bottom: 0; width: 1px; height: var(--lh-hold); pointer-events: none; }
  .lh-pin .lh-hero { --lh-grade: contrast(1.05) saturate(1.08) brightness(1.04); position: sticky; top: 0; height: 100svh; min-height: 0; }
  :root:not(.lh-off) .lh-hero .hero-image { transform: none; filter: var(--lh-grade); }
  .lh-connect { display: block; }
  :root.lh-off .lh-pin { height: auto; }
  :root.lh-off .lh-pin .lh-hero { position: relative; height: auto; min-height: max(46rem, 96svh); }
  :root.lh-off .lh-stage, :root.lh-off .lh-connect { display: none; }
}
@media (prefers-reduced-motion: no-preference) and (max-width: 45rem) { .lh-pin { --lh-pin: 85svh; } :root { --lh-hold: 180svh; } }

/* Lighter grade: legibility comes from a local scrim and text shadow, not global darkness. Only while the sequence is active. */
@media (prefers-reduced-motion: no-preference) {
  :root:not(.lh-off) .lh-hero .hero-media::before {
    background:
      linear-gradient(180deg, transparent 0%, transparent 76%, #07070b66 90%, var(--ink-950) 100%),
      linear-gradient(90deg, #0404098f 0%, #04040955 30%, #04040912 58%, transparent 78%),
      linear-gradient(180deg, #04040938 0%, transparent 22%);
  }
  :root:not(.lh-off) .lh-hero .hero-media::after { opacity: 0.22; }
  
  :root:not(.lh-off) .lh-hero .scene-inner::before {                         /* local scrim behind the type only */
    content: ""; position: absolute; left: -14vw; bottom: -14vh; width: 78vw; height: 66vh; z-index: -1; pointer-events: none;
    background: radial-gradient(ellipse 62% 58% at 26% 76%, #040409b8 0%, #04040978 42%, transparent 74%);
  }
  :root:not(.lh-off) .lh-hero .hero h1, :root:not(.lh-off) .lh-hero .hero-answer, :root:not(.lh-off) .lh-hero .hero-positioning, .lh-connect { text-shadow: 0 2px 26px #040409d9, 0 0 3px #04040999; }
}
/* Scroll-linked dissolve: the photo sinks into the page colour as the hero leaves into Experience (opacity only). */
.lh-hero::after { content: ""; position: absolute; inset: 0; z-index: -2; pointer-events: none; opacity: 0; background: linear-gradient(180deg, transparent 0%, #07070ba6 38%, var(--ink-950) 82%); }

/* Header: the same floating pill, transparent. A faint veil keeps the nav readable once content passes under it. */
:root .site-header::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: calc(var(--header-height) + 5.5rem); z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, #040409b0 0%, #04040970 40%, #04040928 72%, transparent 100%);
  opacity: 0.6; transition: opacity 500ms var(--ease-standard);
}
:root .site-header.is-scrolled::before { opacity: 1; }
:root .site-header .header-shell, :root .site-header.is-scrolled .header-shell, :root .site-header:focus-within .header-shell {
  background: transparent; border-color: transparent; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
}
:root .nav-open .header-shell { background: transparent; border-color: transparent; box-shadow: none; }
:root .header-shell::before { display: none; }
:root .brand, :root .primary-nav a, :root .menu-toggle { text-shadow: 0 1px 14px #040409d9, 0 0 2px #04040980; }
:root .primary-nav a { color: #f1ecf4; }
:root .nav-open .primary-nav a { text-shadow: none; }
:root .scroll-progress { position: fixed; inset: 0 0 auto 0; bottom: auto; height: 2px; background: none; }

.lh-connect {
  position: absolute; left: 0; bottom: 0.1em; margin: 0; max-width: 11ch; pointer-events: none;
  font-family: var(--font-display, inherit); font-weight: 350; letter-spacing: -0.055em; line-height: 0.98;
  font-size: clamp(3.2rem, 7.4vw, 7.2rem); color: #fbf8fd;
}
@media (max-width: 45rem) { .lh-connect { font-size: clamp(3rem, 14vw, 4.6rem); bottom: 0.2em; } }
:root .lh-connect .tv-w { display: inline-block; --w: clamp(0, calc((var(--m2-h, 0) * (var(--n, 1) + 2) - var(--i, 0)) / 2), 1);
  opacity: calc(var(--w) * (1 - var(--m2-x, 0))); translate: 0 calc((1 - var(--w)) * 0.6em - var(--m2-x, 0) * 0.35em); }
:root .lh-connect .tv-w:last-child { background: var(--gradient-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Type stays at full strength while it travels, then clears quickly: no long half-transparent phase over the photograph. */
@media (prefers-reduced-motion: no-preference) {
  :root:not(.lh-off) .lh-hero .hero-content { opacity: calc(1 - (var(--lh-a, 0) - 0.55) * 2.2); }
  :root:not(.lh-off) .lh-hero .hero h1 span:nth-child(1) { translate: 0 calc(var(--lh-a, 0) * -10vh); opacity: calc(1 - (var(--lh-a, 0) - 0.4) * 2.4); }
  :root:not(.lh-off) .lh-hero .hero h1 span:nth-child(2) { translate: 0 calc(var(--lh-a, 0) * -6vh); opacity: calc(1 - (var(--lh-a, 0) - 0.5) * 2.4); }
  :root:not(.lh-off) .lh-hero .hero-answer { translate: 0 calc(var(--lh-a, 0) * -3vh); }
  :root:not(.lh-off) .lh-hero .scroll-cue { opacity: calc(1 - var(--lh-a, 0) * 4); }
  :root:not(.lh-off) .lh-hero .hero-network { opacity: calc(0.42 - var(--lh-a, 0) * 0.25 + var(--lh-b, 0) * 0.15); }
  :root:not(.lh-off) .lh-hero::after { opacity: var(--lh-h, 0); }
}
