:root {
  --bg: #06070b;
  --ink: #f2efe9;
  --muted: #a9a59c;
  --amber: #ff8a3c;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --gutter: clamp(20px, 4.5vw, 72px);
  --display: 'Syne', system-ui, sans-serif;
  --mono: 'Martian Mono', ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 500 1.0625rem/1.5 var(--display);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, p, dl, dd { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 4px; }

#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.vignette { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(120% 90% at 50% 45%, transparent 45%, rgba(3, 3, 6, .78)); }
.flash { position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 6; }

/* Viewfinder */
.hud { position: fixed; inset: clamp(14px, 2.2vw, 30px); z-index: 4; pointer-events: none; transition: opacity .4s ease; }
.hud__c { position: absolute; width: 26px; height: 26px; border: 0 solid rgba(242, 239, 233, .55); }
.hud__c--tl { left: 0; top: 0; border-width: 1.5px 0 0 1.5px; }
.hud__c--tr { right: 0; top: 0; border-width: 1.5px 1.5px 0 0; }
.hud__c--bl { left: 0; bottom: 0; border-width: 0 0 1.5px 1.5px; }
.hud__c--br { right: 0; bottom: 0; border-width: 0 1.5px 1.5px 0; }
.hud__read {
  position: absolute;
  left: 50%;
  bottom: 10px;
  translate: -50% 0;
  display: flex;
  gap: clamp(14px, 3vw, 40px);
  font: 400 .75rem/1 var(--mono);
  color: rgba(242, 239, 233, .8);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
#rAperture { color: var(--amber); min-width: 4.2em; }
body.is-end .hud { opacity: 0; }

/* Nav */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 8;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: max(clamp(26px, 3.6vw, 52px), env(safe-area-inset-top)) clamp(32px, 5vw, 84px) 0;
  font-size: .9375rem;
}
.nav__brand { font-weight: 700; text-decoration: none; letter-spacing: -0.01em; }
.nav__tag { margin-left: .5em; padding: .2em .6em; border: 1px solid rgba(242, 239, 233, .4); border-radius: 99px; font: 400 .6875rem/1.4 var(--mono); vertical-align: middle; }
.nav__links { display: none; gap: clamp(16px, 2.2vw, 34px); }
.nav__links a { text-decoration: none; color: rgba(242, 239, 233, .75); transition: color .2s ease; }
@media (hover: hover) and (pointer: fine) { .nav__links a:hover { color: var(--amber); } }
@media (min-width: 860px) { .nav__links { display: flex; } }

/* Scroll track and pinned copy */
main { position: relative; z-index: 5; }
.track { position: relative; height: 700svh; }
.mark { position: absolute; top: calc(var(--i) * 100svh); }
.stage { position: sticky; top: 0; height: 100svh; overflow: hidden; pointer-events: none; }
.panel {
  position: absolute;
  left: var(--gutter);
  bottom: clamp(64px, 13svh, 130px);
  width: min(100% - var(--gutter) * 2, 27rem);
  opacity: 0;
  will-change: opacity, transform;
  text-shadow: 0 1px 24px rgba(0, 0, 0, .8);
}
.panel--right { left: auto; right: var(--gutter); }
.panel--wide { width: min(100% - var(--gutter) * 2, 34rem); }
h1 { font-weight: 800; font-size: clamp(2.75rem, 6.6vw, 6.5rem); line-height: .86; letter-spacing: -0.045em; }
.panel h2 { font-weight: 700; font-size: clamp(1.9rem, 3.6vw, 3.25rem); line-height: 1; letter-spacing: -0.035em; text-wrap: balance; }
.panel p { margin-top: 1em; max-width: 36ch; color: rgba(242, 239, 233, .86); }
.panel--hero { width: auto; }
.panel--hero h1 { animation: rise 1.1s var(--ease-out) .2s both; }
.panel--hero p { max-width: 30ch; animation: rise 1.1s var(--ease-out) .35s both; }

/* Closing section sits over the canvas */
.end { position: relative; background: var(--bg); padding: clamp(80px, 12vw, 160px) var(--gutter) 28px; }
.end h2 { font-weight: 800; font-size: clamp(2.2rem, 5vw, 4.5rem); line-height: .95; letter-spacing: -0.04em; }
.specs { margin-top: clamp(32px, 5vw, 60px); display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); column-gap: clamp(24px, 4vw, 64px); }
.specs div { padding: 1.2em 0; border-top: 1px solid rgba(242, 239, 233, .2); }
.specs dt { font: 400 .75rem/1.4 var(--mono); color: var(--muted); }
.specs dd { margin-top: .4em; font-size: 1.25rem; line-height: 1.25; letter-spacing: -0.01em; }
.end__note { margin-top: 2em; max-width: 60ch; font-size: .875rem; color: var(--muted); }
.btn { display: inline-block; margin-top: 2em; padding: .9em 1.5em; border-radius: 99px; background: var(--ink); color: var(--bg); font-weight: 700; font-size: .9375rem; text-decoration: none; transition: transform .14s var(--ease-out); }
.btn:active { transform: scale(.97); }
.footer { margin-top: clamp(64px, 9vw, 120px); padding-top: 22px; border-top: 1px solid rgba(242, 239, 233, .14); font-size: .8125rem; color: var(--muted); }
.footer a { color: var(--ink); text-decoration: none; transition: color .2s ease; }
.footer a:hover, .footer a:focus-visible { color: var(--amber); }
.bar { display: inline-block; width: 1px; height: .9em; margin: 0 .7em; background: currentColor; opacity: .5; vertical-align: -1px; }
.nogl { position: fixed; left: var(--gutter); right: var(--gutter); top: 40%; z-index: 3; max-width: 44ch; font-size: .9375rem; color: var(--muted); }

@media (max-width: 599px) {
  .panel, .panel--right { left: var(--gutter); right: var(--gutter); width: auto; bottom: 72px; }
  .hud__read { gap: 12px; font-size: .625rem; }
  #rAperture { min-width: 3.6em; }
  .bar { display: none; }
  .footer a { display: block; margin-top: .3em; }
}

@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .panel--hero h1, .panel--hero p { animation: none; }
}
