/* ═══════════ TO THE MOON — Apollo 11 ═══════════ */
:root {
  --black: #060709;
  --space: #0a0c10;
  --grey: #b8bcc2;
  --offwhite: #e9e7e1;
  --green: #46e08c;
  --green-dim: #2c9e63;
  --amber: #ffb347;
  --hud-border: rgba(184, 188, 194, 0.28);
  --font-hud: 'IBM Plex Mono', ui-monospace, monospace;
  --font-body: 'Barlow', 'Helvetica Neue', sans-serif;
  --font-cond: 'Barlow Condensed', 'Barlow', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { background: var(--black); color: var(--offwhite); }
body {
  font-family: var(--font-body);
  font-weight: 300;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
.mono { font-family: var(--font-hud); }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

/* ═══════════ PRELOADER ═══════════ */
#loader {
  position: fixed; inset: 0; z-index: 100;
  background: var(--black);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.9s ease, visibility 0.9s;
}
#loader.done { opacity: 0; visibility: hidden; }
.loader-inner { text-align: center; max-width: 320px; padding: 0 24px; }
.loader-patch { margin-bottom: 28px; animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: .85; } 50% { opacity: .45; } }
.loader-title {
  font-family: var(--font-cond); font-weight: 200; font-size: 34px;
  letter-spacing: 0.55em; margin-left: 0.55em; color: var(--offwhite);
}
.loader-sub {
  font-family: var(--font-hud); font-size: 10px; letter-spacing: 0.32em;
  color: var(--grey); opacity: .6; margin: 10px 0 34px;
}
.loader-bar {
  height: 1px; background: rgba(184,188,194,.2);
  position: relative; overflow: hidden;
}
.loader-bar-fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0%;
  background: var(--green); transition: width .3s ease;
}
.loader-status {
  margin-top: 14px; font-size: 10px; letter-spacing: .2em;
  color: var(--green); opacity: .85;
}

/* ═══════════ FILM LAYERS ═══════════ */
#film {
  position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh;
  z-index: 1; display: block; background: var(--black);
}
#grade {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  background: transparent;
  mix-blend-mode: multiply;
}
#horizonMask {
  position: fixed; inset: 0; z-index: 2; pointer-events: none; opacity: 0;
  will-change: opacity;
  background: linear-gradient(to top,
    rgba(4,5,7,1) 0%, rgba(4,5,7,1) 12%, rgba(4,5,7,.9) 22%,
    rgba(4,5,7,.6) 32%, rgba(4,5,7,.25) 42%, transparent 52%);
}
#scanlines {
  position: fixed; inset: 0; z-index: 3; pointer-events: none; opacity: .30;
  background: repeating-linear-gradient(
    to bottom, transparent 0 3px, rgba(0,0,0,.14) 3px 4px);
}
#vignette {
  position: fixed; inset: 0; z-index: 3; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(4,5,7,.55) 100%);
}
/* dark scrim the footer rises through -- opacity driven by scroll progress through
   the footer-reveal zone (see js/main.js), NOT by body.post-film. #film is
   deliberately left OUT of the post-film fade below: the last frame stays visible
   the whole time, darkening only via this scrim as the footer panel rises over it */
#endFade {
  position: fixed; inset: 0; z-index: 4; pointer-events: none;
  will-change: opacity;
  background: linear-gradient(to top, rgba(4,5,7,.94) 0%, rgba(4,5,7,.6) 45%, transparent 100%);
  opacity: 0;
}
/* #introFade - INERT since 2026-08-27. This was a flat black scrim over the
   opening frames, opacity driven by frame index in js/main.js (0.45 at frame
   0, out by frame 40) so the hero title read against the bright launch-pad
   sky. The driver has been removed; opacity:0 below means the element now
   paints nothing. Kept, with its markup, so the effect can be restored by
   putting that one line back in main.js - re-add will-change:opacity here if
   so, it was dropped because a static full-screen layer should not hold a
   compositor layer open for nothing. */
#introFade {
  position: fixed; inset: 0; z-index: 4; pointer-events: none;
  background: #000; opacity: 0;
}
body.post-film #grade,
body.post-film #scanlines, body.post-film #vignette { opacity: 0; transition: opacity .5s; }
#grade { transition: opacity .5s; }

/* ═══════════ HUD ═══════════ */
#hud { position: fixed; inset: 0; z-index: 10; pointer-events: none;
  opacity: 0; transition: opacity 1s ease .2s; }
body.ready #hud { opacity: 1; }
body.post-film #hud { opacity: 0; transition: opacity .4s; }
.hud-top, .hud-bottom {
  position: absolute; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 28px;
}
.hud-top { top: 0; }
.hud-bottom { bottom: 0; justify-content: flex-end; }
#hudKeyCell {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  font-size: 19px; padding: 12px 24px; letter-spacing: .18em; opacity: 1;
}
.hud-cell {
  font-size: 12.5px; letter-spacing: .18em; color: var(--green);
  text-shadow: 0 0 8px rgba(70,224,140,.35);
  background: rgba(6,7,9,.35); padding: 6px 10px;
  border: 1px solid rgba(70,224,140,.16);
  backdrop-filter: blur(2px);
}
.hud-phase { color: var(--offwhite); border-color: var(--hud-border); }
.hud-label { color: var(--grey); opacity: .8; margin-right: 8px; }
#hudKeyValue { color: var(--amber); text-shadow: 0 0 8px rgba(255,179,71,.3); }
.hud-corner { position: absolute; width: 26px; height: 26px; opacity: .5; }
.hud-corner.tl { top: 64px; left: 24px; border-top: 1px solid var(--grey); border-left: 1px solid var(--grey); }
.hud-corner.tr { top: 64px; right: 24px; border-top: 1px solid var(--grey); border-right: 1px solid var(--grey); }
.hud-corner.bl { bottom: 64px; left: 24px; border-bottom: 1px solid var(--grey); border-left: 1px solid var(--grey); }
.hud-corner.br { bottom: 64px; right: 24px; border-bottom: 1px solid var(--grey); border-right: 1px solid var(--grey); }
.hud-crosshair { position: absolute; top: 50%; left: 50%; opacity: .3; }
.ch-v { position: absolute; left: 0; top: -9px; width: 1px; height: 18px; background: var(--grey); display: block; }
.ch-h { position: absolute; top: 0; left: -9px; height: 1px; width: 18px; background: var(--grey); display: block; }

/* ═══════════ PHASE RAIL ═══════════ */
#rail {
  position: fixed; right: 26px; top: 50%; transform: translateY(-50%);
  z-index: 11; display: flex; flex-direction: column; gap: 22px;
  opacity: 0; transition: opacity 1s ease .4s;
}
body.ready #rail { opacity: 1; }
body.post-film #rail { opacity: 0; transition: opacity .4s; }
.rail-dot { position: relative; width: 12px; height: 12px; pointer-events: auto; }
.rail-dot i {
  display: block; width: 8px; height: 8px; border-radius: 50%;
  border: 1px solid var(--grey); opacity: .5; transition: all .3s;
}
.rail-dot.active i { background: var(--green); border-color: var(--green); opacity: 1;
  box-shadow: 0 0 10px rgba(70,224,140,.6); }
.rail-dot span {
  position: absolute; right: 22px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-hud); font-size: 9px; letter-spacing: .22em;
  color: var(--grey); opacity: 0; transition: opacity .3s; white-space: nowrap;
}
.rail-dot:hover span, .rail-dot.active span { opacity: .85; }

/* ═══════════ SCROLL EXPERIENCE / OVERLAYS ═══════════ */
#experience { position: relative; z-index: 5; }
.overlay {
  position: fixed; inset: 0; z-index: 6;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; padding: 0 24px;
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(24px);
  transition: opacity .45s ease, transform .45s ease, visibility .45s;
}
.overlay.on { opacity: 1; visibility: visible; transform: translateY(0); }
.overlay.on .cta, .overlay.on a { pointer-events: auto; }
#replayBtn { pointer-events: auto; }

.kicker {
  font-size: 12.5px; letter-spacing: .4em; color: var(--green);
  margin-bottom: 22px; text-shadow: 0 0 10px rgba(70,224,140,.4);
}
.hero-title {
  font-family: var(--font-cond); font-weight: 100; line-height: .95;
  font-size: clamp(64px, 14vw, 168px); letter-spacing: .18em; margin-left: .18em;
  color: var(--offwhite); text-shadow: 0 2px 40px rgba(0,0,0,.8);
}
.hero-sub {
  margin-top: 26px; font-size: clamp(17px, 2.2vw, 22px); font-weight: 300;
  letter-spacing: .04em; color: var(--grey); max-width: 480px;
  text-shadow: 0 1px 12px rgba(0,0,0,.9);
}
.scroll-cue {
  position: absolute; bottom: 90px; display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.scroll-cue .mono { font-size: 10.5px; letter-spacing: .34em; color: var(--grey); opacity: .75; }
.cue-line { width: 1px; height: 42px; background: linear-gradient(var(--grey), transparent);
  animation: cue 2s ease-in-out infinite; }
@keyframes cue { 0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  100% { transform: scaleY(1) translateY(20px); opacity: 0; } }

.card { align-items: flex-start; text-align: left; max-width: none; }
.card::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(100deg, rgba(4,5,7,.54) 0%, rgba(4,5,7,.31) 38%, transparent 68%);
}
.card-box {
  position: relative; max-width: 780px;
  padding: clamp(30px, 4.6vw, 54px) clamp(30px, 4.6vw, 58px);
  background: rgba(6,7,9,.46);
  border: 1px solid var(--hud-border);
  border-left: 2px solid var(--green);
  backdrop-filter: blur(4px);
  box-shadow: 0 8px 60px rgba(0,0,0,.45), 0 0 32px rgba(70,224,140,.06) inset;
}
.card-box::before, .card-box::after {
  content: ''; position: absolute; width: 18px; height: 18px; opacity: .8;
}
.card-box::before { top: -1px; right: -1px; border-top: 1px solid var(--green); border-right: 1px solid var(--green); }
.card-box::after { bottom: -1px; right: -1px; border-bottom: 1px solid var(--green); border-right: 1px solid var(--green); }
#overlayHero::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(ellipse at center, rgba(4,5,7,.55) 0%, rgba(4,5,7,.28) 52%, rgba(4,5,7,.05) 78%);
}
#overlayEnd::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: rgba(4,5,7,.34);
}
.card > * { max-width: 780px; }
.card { padding-left: clamp(28px, 9vw, 140px); }
.card-index {
  font-size: 14px; letter-spacing: .34em; color: var(--green);
  margin-bottom: 18px; text-shadow: 0 0 10px rgba(70,224,140,.4);
}
.card h2 {
  font-family: var(--font-cond); font-weight: 200;
  font-size: clamp(48px, 7.2vw, 84px); line-height: 1.02; letter-spacing: .02em;
  color: var(--offwhite); text-shadow: 0 2px 30px rgba(0,0,0,.85);
  margin-bottom: 20px;
}
.card-fact { color: var(--offwhite);
  font-size: clamp(20px, 2.7vw, 27px); font-weight: 300; line-height: 1.55;
  color: var(--grey); text-shadow: 0 1px 12px rgba(0,0,0,.9);
}
.card-fact em { color: var(--offwhite); font-style: italic; }
.card-hudnote {
  margin-top: 26px; font-size: 13px; letter-spacing: .22em;
  color: var(--amber); opacity: .9; text-shadow: 0 0 8px rgba(255,179,71,.3);
  border-left: 2px solid var(--amber); padding-left: 12px;
}

.end-line {
  font-family: var(--font-cond); font-weight: 200;
  font-size: clamp(34px, 5vw, 60px); line-height: 1.15; letter-spacing: .03em;
  max-width: 720px; color: var(--offwhite); text-shadow: 0 2px 30px rgba(0,0,0,.9);
}
.end-ctas { margin-top: 48px; display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.cta {
  display: inline-block; font-family: var(--font-hud); font-size: 12.5px;
  letter-spacing: .22em; color: var(--offwhite); text-decoration: none;
  padding: 14px 26px; border: 1px solid var(--hud-border);
  background: rgba(6,7,9,.5); backdrop-filter: blur(3px);
  transition: all .3s;
}
.cta:hover { border-color: var(--green); color: var(--green);
  box-shadow: 0 0 20px rgba(70,224,140,.2); }

/* ═══════════ POST-FILM SECTIONS ═══════════ */
#after { position: relative; z-index: 20; background: var(--black); }
#after section { max-width: 980px; margin: 0 auto; padding: 120px 28px; }
.sec-head { margin-bottom: 64px; }
.sec-head .kicker { margin-bottom: 14px; }
.sec-head h2 {
  font-family: var(--font-cond); font-weight: 200;
  font-size: clamp(40px, 6vw, 64px); letter-spacing: .04em;
}

.tl { list-style: none; border-left: 1px solid rgba(184,188,194,.2); }
.tl li { display: flex; gap: 28px; padding: 26px 0 26px 28px; position: relative; }
.tl li::before {
  content: ''; position: absolute; left: -4px; top: 36px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--black); border: 1px solid var(--green);
}
.tl-met { flex: 0 0 110px; font-size: 13.5px; color: var(--green); letter-spacing: .08em; padding-top: 3px; }
.tl h3 { font-weight: 400; font-size: 21px; letter-spacing: .02em; margin-bottom: 6px; }
.tl p { font-size: 16.5px; line-height: 1.6; color: var(--grey); }

.facts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1px;
  background: rgba(184,188,194,.14); border: 1px solid rgba(184,188,194,.14); }
.fact { background: var(--space); padding: 30px 24px; }
.fact-num { display: block; font-size: 30px; color: var(--offwhite); letter-spacing: .04em; margin-bottom: 12px; }
.fact p { font-size: 15px; line-height: 1.6; color: var(--grey); }

/* #foot is a fixed panel that rises over the last frame as a scroll-scrubbed
   reveal (translateY driven directly by scroll position in js/main.js) rather
   than being scrolled DOWN into via normal document flow -- #endFade (above)
   is the dark scrim that fades in over the still-visible frame as it rises */
#foot {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21;
  height: 100vh; height: 100dvh;
  transform: translateY(100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 70px 28px;
  /* translucent, not solid -- the last frame stays dimly visible through the
     panel rather than being fully hidden behind it */
  background: rgba(6,7,9,.7);
  border-top: 1px solid rgba(184,188,194,.12);
}
#foot::before {
  content: ''; position: absolute; left: 0; right: 0; top: -90px; height: 90px;
  background: linear-gradient(to bottom, transparent, rgba(6,7,9,.7));
  pointer-events: none;
}
#foot .mono { font-size: 15px; letter-spacing: .22em; color: var(--grey); opacity: .7; margin-bottom: 30px; }
#foot .cta { font-size: 10.5px; padding: 10px 20px; letter-spacing: .18em; }
.foot-brands { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 34px; margin-top: 40px; }
.foot-brand { display: inline-flex; flex-direction: column; align-items: center; gap: 10px; opacity: .9; transition: opacity .3s; text-decoration: none; }
.foot-brand:hover { opacity: 1; }
.foot-brand-label {
  font-family: var(--font-hud); font-size: 10px; letter-spacing: .32em;
  color: var(--grey); opacity: .65;
}
.foot-brand-img { height: 38px; width: auto; display: block; filter: brightness(0) invert(1); }
.foot-brand .logo-type { display: grid; gap: 4px; text-align: center; -webkit-font-smoothing: antialiased; }
.foot-brand .logo-type strong {
  letter-spacing: -.035em; align-items: flex-start; justify-content: center; font-size: 36px;
  font-weight: 400; display: flex; color: #fff;
}
.foot-brand .logo-type strong b { font-weight: 950; }
.foot-brand .logo-type strong span { font-weight: 400; }
.foot-brand .logo-type small {
  letter-spacing: .34em; font-size: 10.5px;
  font-weight: 850; color: #fff; opacity: .75;
}

/* ═══════════ RESPONSIVE ═══════════ */
@media (max-width: 720px) {
  .hud-top, .hud-bottom { padding: 12px 14px; }
  .hud-cell { font-size: 9px; padding: 4px 6px; letter-spacing: .12em; }
  .hud-top > .hud-cell:first-child { display: none; } /* "APOLLO 11 · AS-506" -- removed so the phase-name box (e.g. "LOOKING BACK") takes its place at top-left */
  #hudKeyCell {
    font-size: 14px; padding: 10px 18px; letter-spacing: .06em;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    max-width: 96vw; text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
  }
  #hudKeyCell .hud-label { margin-right: 0; white-space: nowrap; }
  #hudKeyCell #hudKeyValue { white-space: nowrap; }
  .hud-corner { display: none; }
  #rail { right: 12px; gap: 16px; }
  .rail-dot span { display: none; }
  .card { padding-left: 24px; padding-right: 24px; }
  .card-box { padding: 20px 22px; }
  .card-index { font-size: 11px; margin-bottom: 10px; }
  .card h2 { font-size: clamp(28px, 9vw, 42px); margin-bottom: 12px; }
  .card-fact { font-size: 15px; line-height: 1.42; }
  .card-hudnote { display: none; }
  .tl li { flex-direction: column; gap: 8px; }
  .end-ctas { flex-direction: column; align-items: center; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cue-line, .loader-patch { animation: none; }
}

/* ═══════════ HIDDEN FOR NOW ═══════════ */
/* Timeline/Facts sections and their nav links, off for now -- content and markup
   left untouched in index.html, remove this block to bring them back */
#timeline, #facts,
.end-ctas a[href="#timeline"], .end-ctas a[href="#facts"] { display: none; }
