/* ==========================================================================
   STILL HERE — site stylesheet
   Design language: literal bodycam / night-vision footage. High-contrast
   blue monochrome — near-black shadows, bright cool-blue highlights, one
   consistent monospace "camera readout" face for every HUD/title element.
   Amber survives only as the equipment warning-light convention (primary
   CTA, "coming soon" blink, warning notices); red is the REC dot only.
   Mobile-first. All motion is CSS-transform based and fully disabled under
   prefers-reduced-motion (see the block at the very bottom).
   ========================================================================== */

/* Self-hosted variable fonts (no Google CDN — GDPR-safe, faster, offline).
   Inter = body, Teko = display/headings *and* the hero title, JetBrains
   Mono = HUD/labels/small text. */
@font-face {
  font-family: "Inter";
  src: url("/still-here/fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Teko";
  src: url("/still-here/fonts/teko-var.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/still-here/fonts/jetbrains-mono-var.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  --c-bg: #05080c;
  --c-bg-alt: #080d13;
  --c-panel: #0b131b;
  --c-line: #1c2c3a;
  --c-text: #d9ecfb;
  --c-dim: #6c8aa3;
  --c-amber: #c99a4c;
  --c-amber-hi: #dbb06a;
  --c-cold: #3ea0e6;
  --c-cold-hi: #7cc9f2;
  --c-rec: #e0392c;
  --c-cyan: #6fd8f0;

  --font-hud: "JetBrains Mono", "Consolas", "SFMono-Regular", monospace;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Teko", "Segoe UI", sans-serif;
  --font-hero: var(--font-display);

  --hud-h: 30px;
  --nav-h: 58px;
  --sidebar-w: 300px;
  --terminal-bar-h: 76px;
  --space: clamp(1rem, 4vw, 2rem);
}

/* ---- Reset-ish ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
/* overflow-x: hidden here (not just on body) matters: .grain is
   position: fixed with a -100px inset so its noise texture always
   overscans the viewport, and without this the legacy "body overflow
   propagates to the viewport" behavior doesn't reliably clip that
   fixed-position overscan, letting the page scroll sideways a few px. */
html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  /* Reserves the vertical-scrollbar gutter permanently so toggling
     html.nav-open{overflow:hidden} (mobile dropdown open/close) never
     removes/re-adds a classic scrollbar's width — without this, content
     visibly shifts sideways for a frame on any browser with a
     non-overlay scrollbar (most desktop browsers, some Android configs)
     every time the mobile menu opens or closes. */
  scrollbar-gutter: stable;
  /* overflow-x: hidden (above) stops the page from actually scrolling
     sideways, but on real touch devices it does NOT stop the elastic
     rubber-band/bounce gesture at the left/right edges — a horizontal
     swipe still drags the whole fixed header (incl. the mobile MENU
     button) a few px off its locked position before it springs back.
     This is the "horizontal lock" for that: it disables the bounce
     itself rather than just clipping its overflow. */
  overscroll-behavior-x: none;
}
/* Lenis (public/js/lenis.min.js) owns smooth scrolling once JS is running —
   letting native CSS smoothing run too would double up/fight it. When JS
   never loads, or skips Lenis under reduced-motion, this never applies and
   the html { scroll-behavior: smooth } / instant-jump above is what the
   visitor actually gets instead. */
html.js { scroll-behavior: auto; }
body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  padding-top: calc(var(--hud-h) + var(--nav-h));
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overscroll-behavior-x: none;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--c-cold); }
a:hover { color: var(--c-cold-hi); }
::selection { background: var(--c-cold); color: var(--c-bg); }

:focus-visible {
  outline: 2px solid var(--c-cold);
  outline-offset: 3px;
  border-radius: 1px;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}
.skip-link {
  position: fixed; top: -100%; left: 1rem; z-index: 3000;
  background: var(--c-cold); color: var(--c-bg); padding: .5rem 1rem;
  font-family: var(--font-hud); text-decoration: none;
}
.skip-link:focus { top: 0; }

/* ---- Boot sequence overlay (first page load of the session only) -------- */
.boot-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 6000;
  background: var(--c-bg);
  flex-direction: column; align-items: flex-start; justify-content: center;
  padding: 2rem clamp(1.5rem, 8vw, 6rem);
  transition: opacity .4s ease;
}
.boot-pending .boot-overlay { display: flex; }
.boot-overlay.is-done { opacity: 0; pointer-events: none; }
.boot-overlay__log {
  margin: 0; color: var(--c-cold);
  font-family: var(--font-hud);
  font-size: clamp(1rem, 2.6vw, 2.2rem);
  line-height: 1.6;
  white-space: pre-wrap;
}
.boot-overlay__skip {
  margin: 2rem 0 0; color: var(--c-dim);
  font-family: var(--font-hud);
  font-size: .75rem; letter-spacing: .2em; text-transform: uppercase;
  animation: soon-blink 2s steps(2, jump-none) infinite;
}

/* ---- Film grain overlay (whole page, pure CSS) -------------------------- */
.grain {
  position: fixed; inset: -100px; z-index: 2000; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  opacity: .06;
  animation: grain-shift .6s steps(4) infinite;
}
@keyframes grain-shift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-32px, 18px); }
  50% { transform: translate(22px, -26px); }
  75% { transform: translate(-14px, -12px); }
  100% { transform: translate(28px, 24px); }
}

/* ---- Bodycam HUD chrome (persistent) ------------------------------------ */
.hud {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1200;
  height: var(--hud-h);
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 .75rem;
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-line);
  font-family: var(--font-hud);
  font-size: .72rem;
  letter-spacing: .08em;
  color: var(--c-dim);
}
.hud__left, .hud__right { display: flex; gap: 1rem; align-items: center; }
.hud__rec { color: var(--c-rec); font-weight: bold; display: inline-flex; align-items: center; gap: .35rem; }
.hud__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--c-rec);
  box-shadow: 0 0 6px var(--c-rec);
  animation: rec-pulse 1.4s steps(2, jump-none) infinite;
}
@keyframes rec-pulse { 50% { opacity: .15; } }
.hud__timer { color: var(--c-text); }
@media (max-width: 640px) { .hud__cam { display: none; } }

/* ---- Header / nav -------------------------------------------------------- */
.site-header {
  position: fixed; top: var(--hud-h); left: 0; right: 0; z-index: 1100;
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-line);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  min-height: var(--nav-h);
  padding: 0 var(--space);
  max-width: 1200px; margin: 0 auto;
  font-family: var(--font-hud);
}
.nav__brand {
  color: var(--c-text); text-decoration: none;
  font-weight: bold; font-size: 1.05rem; letter-spacing: .3em;
}
/* Same breathing + scan-sweep language as .hero__title-text, just
   toned down (no mouse-tilt, longer/slower cycle, dimmer highlight) —
   this is a persistent, always-onscreen sidebar label rather than a
   one-time hero moment, so it needs to read as "quietly alive" instead
   of demanding attention. Reuses the hero's title-breathe keyframe
   as-is since the math is identical at any duration; only the sweep
   gets its own slower keyframe. */
.js .nav__brand {
  background:
    linear-gradient(100deg, transparent 42%, rgba(255, 255, 255, .55) 50%, transparent 58%) no-repeat,
    linear-gradient(var(--c-text), var(--c-text));
  background-size: 220% 100%, 100% 100%;
  background-position: 220% 0, 0 0;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: title-breathe 7s ease-in-out infinite, brand-scan-sweep 11s ease-in-out infinite;
}
@keyframes brand-scan-sweep {
  0%, 88% { background-position: 220% 0, 0 0; }
  97% { background-position: -60% 0, 0 0; }
  100% { background-position: -60% 0, 0 0; }
}
.nav__path {
  display: none; margin: -.5rem 0 0; font-size: .68rem; letter-spacing: .05em;
  color: var(--c-dim); opacity: .8;
}
.nav__toggle {
  display: none;
  background: none; border: 1px solid var(--c-line); color: var(--c-text);
  font-family: var(--font-hud); font-size: .8rem; letter-spacing: .15em;
  padding: .45rem .8rem; cursor: pointer;
}
.nav__toggle[aria-expanded="true"] { border-color: var(--c-cold); color: var(--c-cold); }
.nav__menu { display: flex; align-items: center; gap: 1.25rem; }
.nav__links {
  display: flex; gap: 1.1rem; list-style: none; margin: 0; padding: 0;
  font-size: .82rem; letter-spacing: .04em;
}
/* HUD targeting brackets: [ LINK ] draws in on hover/focus, and stays
   drawn on the current page — like a camera locking onto a target.
   The brackets anchor to the inner <span>, not the <a>, so they hug the
   word itself even where the link is a full-width tap target (mobile). */
.nav__links a {
  display: flex; align-items: center; min-width: 0;
  color: var(--c-dim); text-decoration: none;
  padding: .3rem 0;
  transition: color .15s ease;
}
.nav__links a:hover { color: var(--c-text); }
.nav__links a span {
  position: relative; min-width: 0; overflow-wrap: break-word;
  display: inline-block;
  padding: 0 .95rem;
}
.nav__links a span::before,
.nav__links a span::after {
  content: ""; position: absolute; top: 50%;
  font-family: var(--font-hud);
  color: var(--c-cold-hi);
  opacity: 0;
  transition: opacity .15s ease, transform .15s ease;
  pointer-events: none;
}
.nav__links a span::before { content: "["; left: 0; transform: translate(6px, -50%); }
.nav__links a span::after { content: "]"; right: 0; transform: translate(-6px, -50%); }
.nav__links a:hover span::before, .nav__links a:focus-visible span::before,
.nav__links a[aria-current="page"] span::before,
.nav__links a:hover span::after, .nav__links a:focus-visible span::after,
.nav__links a[aria-current="page"] span::after {
  opacity: 1; transform: translate(0, -50%);
}
.nav__links a[aria-current="page"] { color: var(--c-cold); }

/* File-tree nav (LazyVim/VS Code style): icon + filename per entry, real
   Unicode tree connectors (├─ / └─ / a vertical guide for nested items)
   like `tree` command output, a collapsible "case_notes/" directory
   nesting individual devlog posts. */
.nav__links a { gap: .5rem; }
.tree-icon { width: 17px; height: 17px; flex-shrink: 0; opacity: .8; color: var(--c-dim); transition: color .15s ease; }
.nav__links a:hover .tree-icon, .nav__links a[aria-current="page"] .tree-icon { color: var(--c-cold); opacity: 1; }

.tree-item > a::before,
.tree-item__row::before,
.tree-children li > a::before {
  content: "├─"; flex-shrink: 0;
  font-family: var(--font-hud); color: var(--c-line);
  transition: color .15s ease;
}
.tree-item:last-child > a::before { content: "└─"; }
.tree-children li:last-child > a::before { content: "└─"; }
.nav__links a:hover::before, .nav__links a[aria-current="page"]::before,
.tree-item__row:hover::before {
  color: var(--c-cold);
}

.tree-item__row { display: flex; align-items: center; gap: .5rem; }
.tree-item__row > a { flex: 1; min-width: 0; display: flex; align-items: center; gap: .5rem; }
.tree-item__row a span { min-width: 0; overflow-wrap: break-word; }
.tree-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 1.4rem; height: 1.4rem; flex-shrink: 0;
  background: none; border: none; color: var(--c-dim); cursor: pointer;
  padding: 0; transition: color .15s ease;
}
.tree-toggle:hover { color: var(--c-cold); }
.tree-chevron { transition: transform .15s ease; }
.tree-toggle[aria-expanded="true"] .tree-chevron { transform: rotate(90deg); }
.tree-children {
  list-style: none; margin: .1rem 0 0 .6rem; padding: 0 0 0 .9rem;
  font-size: .92em;
  border-left: 1px solid var(--c-line);
  transition: border-color .2s ease;
}
.tree-item--dir:hover .tree-children,
.tree-item--dir:has(.tree-toggle[aria-expanded="true"]) .tree-children {
  border-color: var(--c-cold);
}
.tree-children a { padding: .45rem 0; min-width: 0; }
.tree-children a span { min-width: 0; overflow-wrap: break-word; }
/* Expanded by default so no-JS visitors can always reach every post;
   JS only adds the collapse *interaction* once it's confirmed running. */
.js .tree-children { display: none; }
.js .tree-children.is-expanded { display: block; }

/* Tree items settle in one after another on load — like a directory
   listing populating — instead of all appearing at once. */
.js .tree-item {
  opacity: 0; transform: translateX(-6px);
  animation: tree-item-in .35s ease forwards;
}
.tree-item:nth-child(1) { animation-delay: .05s; }
.tree-item:nth-child(2) { animation-delay: .1s; }
.tree-item:nth-child(3) { animation-delay: .15s; }
.tree-item:nth-child(4) { animation-delay: .2s; }
.tree-item:nth-child(5) { animation-delay: .25s; }
.tree-item:nth-child(6) { animation-delay: .3s; }
.tree-item:nth-child(7) { animation-delay: .35s; }
.tree-item:nth-child(8) { animation-delay: .4s; }

/* "../" parent-directory entry — the way back up to the studio site */
.tree-item--up > a { color: var(--c-dim); }
@keyframes tree-item-in {
  from { opacity: 0; transform: translateX(-6px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 860px) {
  /* Set alongside .nav__menu.is-open (see public/js/main.js) — stops the
     page scrolling behind the open full-height mobile dropdown.
     overflow: hidden blocks wheel/programmatic scroll but NOT real touch
     panning on iOS/Android, which could still drag the whole page (and
     the fixed header + MENU button riding along with it) sideways or
     let it rubber-band. touch-action: none is the actual lock for touch
     input, on both axes. */
  html.nav-open { overflow: hidden; touch-action: none; }
  .nav__toggle { display: block; min-height: 44px; min-width: 44px; }
  .nav__menu {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--c-bg);
    /* Opt back into vertical-only touch panning so the dropdown's own
       contents remain scrollable — html.nav-open's touch-action: none
       above would otherwise block touch scrolling inside it too. */
    touch-action: pan-y;
    border-bottom: 1px solid var(--c-line);
    padding: .5rem var(--space) 1.25rem;
    height: calc(100vh - var(--hud-h) - var(--nav-h));
    overflow-y: auto;
  }
  .nav__menu.is-open { display: flex; }
  .nav__links { flex-direction: column; gap: 0; }
  .nav__links a { padding: .8rem 0; border-bottom: 1px solid var(--c-line); }
  .nav__menu .btn { margin-top: 1rem; justify-content: center; }

  /* Targets acquiring one by one, like the camera cycling a list. */
  .js .nav__menu.is-open .nav__links li {
    opacity: 0; transform: translateX(-8px);
    animation: nav-target-in .28s ease forwards;
  }
  .js .nav__menu.is-open .nav__links li:nth-child(1) { animation-delay: .02s; }
  .js .nav__menu.is-open .nav__links li:nth-child(2) { animation-delay: .07s; }
  .js .nav__menu.is-open .nav__links li:nth-child(3) { animation-delay: .12s; }
  .js .nav__menu.is-open .nav__links li:nth-child(4) { animation-delay: .17s; }
  .js .nav__menu.is-open .nav__links li:nth-child(5) { animation-delay: .22s; }
  .js .nav__menu.is-open .nav__links li:nth-child(6) { animation-delay: .27s; }
  .js .nav__menu.is-open .nav__links li:nth-child(7) { animation-delay: .32s; }
  .js .nav__menu.is-open .btn { animation: nav-target-in .28s ease .37s forwards; opacity: 0; }
}
@keyframes nav-target-in {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: none; }
}

/* Anchor targets on the merged scroll page: without this, jumping to
   #demo/#buy/etc. (via nav click or a direct link) lands the section right
   under the fixed HUD/nav bars, hiding its heading behind them. */
main > section[id] { scroll-margin-top: calc(var(--hud-h) + var(--nav-h) + .75rem); }

/* ---- Sidebar nav (desktop): the top HUD strip stays put, but nav moves
   from a horizontal bar into a persistent left sidebar — case-file style,
   reusing the same bracket-targeting links as mobile. ---------------------- */
@media (min-width: 861px) {
  body { padding-top: var(--hud-h); padding-left: var(--sidebar-w); }
  main > section[id] { scroll-margin-top: calc(var(--hud-h) + var(--terminal-bar-h) + .75rem); }
  .hero { min-height: calc(96svh - var(--hud-h)); }
  .lost { min-height: calc(88svh - var(--hud-h)); }
  .site-header {
    top: var(--hud-h); left: 0; right: auto; bottom: 0;
    width: var(--sidebar-w);
    border-bottom: none; border-right: 1px solid var(--c-line);
  }
  .nav {
    flex-direction: column; align-items: stretch; justify-content: flex-start;
    max-width: none; margin: 0; height: 100%;
    padding: 1.75rem 1.25rem; gap: 2rem;
    overflow-y: auto; overflow-x: hidden;
  }
  .nav__brand { font-size: 1.15rem; }
  .nav__path { display: block; }
  .terminal-bar { position: sticky; top: var(--hud-h); z-index: 500; }
  .nav__menu {
    flex: 1; display: flex; flex-direction: column; align-items: stretch; gap: 1.75rem;
  }
  .nav__menu > :last-child { margin-top: auto; }
  .nav__links { flex-direction: column; gap: .2rem; font-size: .92rem; }
  .nav__links a { padding: .7rem 0; }
  .nav__links a span { padding: 0 1.1rem; }
  .nav__menu .btn {
    width: 100%; justify-content: center; text-align: center;
    white-space: normal; line-height: 1.4;
  }
}

/* ---- Terminal window chrome ------------------------------------------------
   The main content pane reads as "recovered case footage viewed through
   evidence software" rather than the bodycam feed directly: a title bar
   (decorative traffic lights + the current section's fake filename) and a
   one-line log that prints as each section scrolls into view. Sticky on
   desktop only (set above, inside the sidebar media query) — on mobile it
   scrolls away normally rather than stacking a third fixed bar on top of
   the HUD strip and the mobile nav bar that are already there. */
.terminal-bar {
  background: var(--c-panel);
  border: 1px solid var(--c-line);
  border-radius: 8px 8px 0 0;
  margin: .8rem .8rem 0;
}
.terminal-bar__title {
  display: flex; align-items: center; gap: .5rem;
  padding: .55rem .9rem;
  font-family: var(--font-hud); font-size: .75rem; letter-spacing: .04em;
  color: var(--c-dim);
  border-bottom: 1px solid var(--c-line);
}
.terminal-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.terminal-dot--r { background: var(--c-rec); }
.terminal-dot--a { background: var(--c-amber); }
.terminal-dot--g { background: var(--c-cold); }
.terminal-bar__file { margin-left: .4rem; }
.terminal-bar__log {
  padding: .4rem .9rem .5rem;
  font-family: var(--font-hud); font-size: .68rem; line-height: 1.5;
  color: var(--c-cold);
  min-height: 1.4em;
}
.terminal-bar__log-line { display: block; opacity: .55; }
.terminal-bar__log-line:last-child { opacity: 1; }

/* Subtle CRT scanlines across the whole viewport — same texture as the
   hero already had, extended site-wide now that the whole page reads as
   footage on a screen. Purely decorative, disabled under reduced-motion
   alongside .grain. */
.crt-overlay {
  position: fixed; inset: 0; z-index: 1900; pointer-events: none;
  background: repeating-linear-gradient(to bottom, transparent 0 3px, rgba(120, 190, 230, .018) 3px 4px);
}

/* ---- Buttons -------------------------------------------------------------- */
.btn {
  position: relative;
  display: inline-flex; align-items: center; flex-wrap: wrap; gap: .35rem .5rem;
  font-family: var(--font-hud);
  font-size: .9rem; letter-spacing: .12em; text-transform: uppercase;
  text-decoration: none;
  padding: .85rem 1.4rem;
  border: 1px solid;
  cursor: pointer;
  transition: transform .12s ease, background-color .12s ease, color .12s ease, box-shadow .12s ease;
}
.btn--large { padding: 1.15rem 1.9rem; font-size: 1.05rem; }
.btn--small { padding: .55rem .9rem; font-size: .78rem; }
.btn__tag { color: inherit; opacity: .65; }
/* Corner targeting brackets: snap in on hover/focus, like a viewfinder
   locking onto the button — same visual language as the sidebar nav's
   [ LINK ] brackets. One pseudo-element, eight background layers (two
   short bars per corner) so all four corners come from a single box. */
.btn::before {
  content: "";
  position: absolute; inset: -7px;
  background:
    linear-gradient(var(--c-cold-hi), var(--c-cold-hi)) top left / 16px 2px no-repeat,
    linear-gradient(var(--c-cold-hi), var(--c-cold-hi)) top left / 2px 16px no-repeat,
    linear-gradient(var(--c-cold-hi), var(--c-cold-hi)) top right / 16px 2px no-repeat,
    linear-gradient(var(--c-cold-hi), var(--c-cold-hi)) top right / 2px 16px no-repeat,
    linear-gradient(var(--c-cold-hi), var(--c-cold-hi)) bottom left / 16px 2px no-repeat,
    linear-gradient(var(--c-cold-hi), var(--c-cold-hi)) bottom left / 2px 16px no-repeat,
    linear-gradient(var(--c-cold-hi), var(--c-cold-hi)) bottom right / 16px 2px no-repeat,
    linear-gradient(var(--c-cold-hi), var(--c-cold-hi)) bottom right / 2px 16px no-repeat;
  opacity: 0;
  transform: scale(1.18);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
}
.btn:hover::before, .btn:focus-visible::before { opacity: 1; transform: scale(1); }
.btn--soon:hover::before, .btn--soon:focus-visible::before { opacity: 0; }
.btn--primary {
  color: var(--c-amber); border-color: var(--c-amber);
  background: rgba(209, 154, 61, .06);
}
.btn--primary:hover, .btn--primary:focus-visible {
  background: var(--c-amber); color: var(--c-bg);
  transform: translateY(-1px);
  box-shadow: -3px 0 0 rgba(255, 43, 166, .55), 3px 0 0 rgba(38, 224, 218, .55);
}
.btn--secondary {
  color: var(--c-text); border-color: var(--c-line);
  background: rgba(255, 255, 255, .02);
}
.btn--secondary:hover, .btn--secondary:focus-visible {
  border-color: var(--c-text);
  transform: translateY(-1px);
}
.btn--soon {
  border-style: dashed; cursor: not-allowed;
  color: var(--c-dim); border-color: var(--c-dim);
  background: none;
}
.btn--soon:hover { transform: none; box-shadow: none; background: none; color: var(--c-dim); }
.btn__soon-label { color: var(--c-cold-hi); animation: soon-blink 2.2s steps(2, jump-none) infinite; }
@keyframes soon-blink { 50% { opacity: .35; } }

/* Chromatic RGB-split on hover for key interactive text */
.js .glitch-hover:hover, .js .glitch-hover:focus-visible {
  text-shadow: -2px 0 rgba(255, 43, 166, .7), 2px 0 rgba(38, 224, 218, .7);
}

/* ---- Hero ------------------------------------------------------------------ */
.hero {
  position: relative;
  min-height: calc(96svh - var(--hud-h) - var(--nav-h));
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center;
  overflow: hidden;
  padding: 4rem var(--space);
  border-bottom: 1px solid var(--c-line);
}
.hero__video {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover;
  filter: saturate(.55) contrast(1.12) brightness(.6);
}
.hero__scanlines {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 2px,
    rgba(0, 0, 0, .22) 2px 4px
  );
}
.hero__vignette {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(4, 5, 4, .9) 100%);
}
.hero__pretitle {
  font-family: var(--font-hud); font-size: .72rem; letter-spacing: .28em;
  color: var(--c-cold); text-transform: uppercase; margin: 0 0 1.2rem;
}
.hero__title {
  font-family: var(--font-hero);
  font-weight: 650;
  font-size: clamp(3.7rem, 12.2vw, 14rem);
  letter-spacing: .02em;
  line-height: .95;
  margin: 0;
  color: #eef8ff;
  text-transform: uppercase;
  perspective: 700px;
}
/* Mouse tilt + scroll depth, driven by --tilt-x/--tilt-y/--scroll-y
   (set in public/js/main.js). Lives on a child span, not .hero__title
   itself, because the entrance keyframes above already own that
   element's `transform` — animating the same property on both would
   fight. Custom properties still inherit down fine either way. */
.hero__title-text {
  display: inline-block;
  transform:
    rotateX(calc(var(--tilt-y, 0) * -3deg))
    rotateY(calc(var(--tilt-x, 0) * 5deg))
    translateY(calc(var(--scroll-y, 0) * 1px));
  transition: transform .2s ease-out;
  will-change: transform;
}
/* Idle "breathing" (filter, so it can't collide with the tilt transform
   above) plus a scanning light sweep across just the letters — two
   background layers via background-clip: text, one solid (the real
   title color) and one the moving highlight — instead of transform, so
   nothing here fights the JS-driven tilt or the parent's entrance
   animation. */
.js .hero__title-text {
  background:
    linear-gradient(100deg, transparent 42%, rgba(255, 255, 255, .8) 50%, transparent 58%) no-repeat,
    linear-gradient(#eef8ff, #eef8ff);
  background-size: 220% 100%, 100% 100%;
  background-position: 220% 0, 0 0;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: title-breathe 5s ease-in-out infinite, title-scan-sweep 6.5s ease-in-out infinite;
}
@keyframes title-breathe {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.09); }
}
@keyframes title-scan-sweep {
  0%, 82% { background-position: 220% 0, 0 0; }
  94% { background-position: -60% 0, 0 0; }
  100% { background-position: -60% 0, 0 0; }
}
.hero__tagline {
  max-width: 34em;
  margin: 1.4rem auto 2rem;
  color: var(--c-dim);
  font-size: clamp(1rem, 2.5vw, 1.15rem);
}
.hero__cta { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }
@media (max-width: 520px) {
  .hero__cta, .footer__buttons { flex-direction: column; align-items: stretch; width: 100%; }
  .hero__cta .btn, .footer__buttons .btn { justify-content: center; }
  .btn--large { padding: .95rem 1rem; font-size: .82rem; }
}
.hero__scroll {
  position: absolute; bottom: 1.2rem; left: 0; right: 0;
  font-family: var(--font-hud); font-size: .7rem; letter-spacing: .3em;
  color: var(--c-dim);
  animation: soon-blink 3s steps(2, jump-none) infinite;
}

/* Glitch title: chromatic ghost copies that flicker occasionally.
   The ghosts live on ::before/::after reading data-text. */
.glitch-title { position: relative; }
.js .glitch-title::before, .js .glitch-title::after {
  content: attr(data-text);
  position: absolute; inset: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}
.js .glitch-title::before {
  color: var(--c-cold);
  animation: glitch-a 4.5s infinite steps(1);
}
.js .glitch-title::after {
  color: var(--c-cyan);
  animation: glitch-b 4.5s infinite steps(1);
}
/* Shorter cycle + wider trigger window + bigger displacement than the
   original — more of a constant unease than a rare flicker. */
@keyframes glitch-a {
  0%, 87%, 97%, 100% { opacity: 0; transform: none; clip-path: none; }
  88% { opacity: .9; transform: translate(-6px, 3px); clip-path: inset(10% 0 55% 0); }
  90% { opacity: .85; transform: translate(5px, -2px); clip-path: inset(60% 0 6% 0); }
  92% { opacity: .7; transform: translate(-4px, 1px); clip-path: inset(28% 0 45% 0); }
  95% { opacity: .5; transform: translate(2px, 0); clip-path: inset(45% 0 20% 0); }
}
@keyframes glitch-b {
  0%, 87%, 97%, 100% { opacity: 0; transform: none; clip-path: none; }
  88% { opacity: .9; transform: translate(6px, -3px); clip-path: inset(50% 0 18% 0); }
  90% { opacity: .85; transform: translate(-5px, 2px); clip-path: inset(4% 0 65% 0); }
  92% { opacity: .7; transform: translate(4px, -1px); clip-path: inset(35% 0 38% 0); }
  95% { opacity: .5; transform: translate(-2px, 0); clip-path: inset(15% 0 50% 0); }
}

/* ---- Sections --------------------------------------------------------------- */
.section {
  padding: clamp(3rem, 8vw, 5.5rem) var(--space);
  max-width: 1150px;
  margin: 0 auto;
}
.section--alt {
  max-width: none;
  background: var(--c-bg-alt);
  border-top: 1px solid var(--c-line);
  border-bottom: 1px solid var(--c-line);
}
.section--alt > * { max-width: 1150px; margin-left: auto; margin-right: auto; }
.section--page { padding-top: clamp(2.5rem, 6vw, 4rem); }
.section--narrow { max-width: 780px; }
.section__head { margin-bottom: 2rem; }
.section__label {
  font-family: var(--font-hud); font-size: .72rem; letter-spacing: .3em;
  color: var(--c-cold); text-transform: uppercase; margin: 0 0 .6rem;
}
.section__title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 5.6vw, 2.9rem);
  line-height: 1.1;
  margin: 0;
  color: #eef8ff;
  font-weight: 650;
  letter-spacing: .015em;
}
.section__title--small { font-size: clamp(1.15rem, 3vw, 1.45rem); margin: 2.2rem 0 1rem; }
.section__lede { color: var(--c-dim); max-width: 55em; font-size: 1.1rem; }
.section__body--split {
  display: grid; gap: 2.5rem;
  align-items: start;
}
@media (min-width: 900px) {
  .section__body--split { grid-template-columns: 3fr 2fr; }
}
.section__signup-inline {
  margin-top: 3rem; padding: 2rem var(--space);
  border: 1px solid var(--c-line);
}

/* Scroll reveal: hidden only when JS is present (no-JS users see everything).
   .is-visible triggers the slide-in plus a two-frame glitch flicker. */
.js .reveal { opacity: 0; transform: translateY(18px); }
.js .reveal.is-visible {
  opacity: 1; transform: none;
  transition: opacity .5s ease, transform .5s ease;
  animation: reveal-flicker .28s steps(3, jump-none) 1;
}
@keyframes reveal-flicker {
  0% { filter: none; }
  34% { filter: brightness(1.6) contrast(1.4); transform: translateX(-2px); }
  67% { filter: brightness(.8) saturate(0); transform: translateX(2px); }
  100% { filter: none; }
}

/* ---- Prose / content blocks --------------------------------------------------- */
/* studio brand banner in the personnel file */
.studio-banner { margin: 0 0 2rem; }
.studio-banner img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--c-line);
}
.prose { max-width: 65ch; }
.prose--small { font-size: .95rem; }
.prose h2 {
  font-size: 1.3rem; color: #eef8ff; margin-top: 2.2rem;
}
.prose img { border: 1px solid var(--c-line); }
.prose code {
  font-family: var(--font-hud); font-size: .88em;
  background: var(--c-panel); border: 1px solid var(--c-line);
  padding: .1em .35em;
}
.prose pre {
  background: var(--c-panel); border: 1px solid var(--c-line);
  padding: 1rem; overflow-x: auto;
}
.prose pre code { border: none; background: none; padding: 0; }
.prose blockquote {
  margin: 1.5rem 0; padding: .2rem 1.2rem;
  border-left: 2px solid var(--c-cold); color: var(--c-dim);
}

.notice {
  border: 1px solid var(--c-line); background: var(--c-panel);
  padding: 1rem 1.2rem; max-width: 65ch;
}
.notice--warn { border-color: var(--c-amber); }

/* ---- Feature cards -------------------------------------------------------------- */
.features { display: grid; gap: 1.2rem; }
@media (min-width: 800px) { .features { grid-template-columns: repeat(3, 1fr); } }
.feature {
  background: var(--c-panel);
  border: 1px solid var(--c-line);
  padding: 1.6rem;
}
.feature h3 { font-family: var(--font-display); margin: .2rem 0 .6rem; color: #eef8ff; font-size: 1.15rem; }
.feature p { margin: 0; color: var(--c-dim); font-size: .95rem; }
.feature__index {
  font-family: var(--font-hud); font-size: .72rem; letter-spacing: .2em;
  color: var(--c-cold); margin: 0;
}
.js .glitch-card { transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.js .glitch-card:hover {
  transform: translateY(-3px);
  border-color: var(--c-cold);
  box-shadow: -2px 0 0 rgba(255, 43, 166, .35), 2px 0 0 rgba(38, 224, 218, .35);
}

/* ---- Gallery / figures ------------------------------------------------------------ */
.gallery { display: grid; gap: 1.2rem; }
@media (min-width: 700px) { .gallery { grid-template-columns: 1fr 1fr; } }
.gallery figure, .polaroid { margin: 0; }
.gallery img, .polaroid img {
  width: 100%; border: 1px solid var(--c-line);
  filter: saturate(.7) contrast(1.05);
}
.gallery figcaption, .polaroid figcaption {
  font-family: var(--font-hud); font-size: .7rem; letter-spacing: .15em;
  color: var(--c-dim); padding-top: .5rem; text-transform: uppercase;
}
.gallery--press { grid-template-columns: 1fr 1fr; gap: .8rem; }

/* ---- Signup form --------------------------------------------------------------------- */
.signup { max-width: 560px; margin-top: 1.5rem; }
.signup__row { display: flex; gap: .6rem; flex-wrap: wrap; }
.signup__input {
  flex: 1 1 220px;
  background: var(--c-bg);
  border: 1px solid var(--c-line);
  color: var(--c-text);
  font-family: var(--font-hud); font-size: .95rem;
  padding: .75rem .9rem;
}
.signup__input:focus-visible { border-color: var(--c-cold); outline-offset: 0; }
.signup__consent {
  display: flex; gap: .6rem; align-items: flex-start;
  margin-top: .9rem; font-size: .85rem; color: var(--c-dim);
}
.signup__consent input { margin-top: .25rem; accent-color: var(--c-cold); }
.signup__status { font-family: var(--font-hud); font-size: .85rem; min-height: 1.2em; margin: .8rem 0 0; }
.signup__status.is-ok { color: var(--c-cold); }
.signup__status.is-error { color: var(--c-rec); }

/* ---- Tables (specs, factsheet) ---------------------------------------------------------- */
.specs {
  width: 100%; max-width: 640px;
  border-collapse: collapse;
  font-size: .92rem;
}
.specs th, .specs td {
  border: 1px solid var(--c-line);
  padding: .55rem .8rem;
  text-align: left; vertical-align: top;
}
.specs thead th, .specs tbody th {
  font-family: var(--font-hud); font-size: .78rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--c-dim); font-weight: normal;
  white-space: nowrap;
}
.specs--facts td a { word-break: break-all; }
@media (max-width: 640px) {
  .specs { display: block; overflow-x: auto; }
}

/* ---- Misc components ------------------------------------------------------------------------ */
.download-box {
  border: 1px solid var(--c-line); background: var(--c-panel);
  padding: 1.6rem; margin: 1.6rem 0;
}
.download-box__meta {
  font-family: var(--font-hud); font-size: .8rem; letter-spacing: .1em;
  color: var(--c-dim); margin: 1rem 0 0;
}
.download-box__meta--dim { opacity: .7; margin-top: .4rem; }

.side-note {
  border: 1px solid var(--c-line); border-left: 3px solid var(--c-cold);
  background: var(--c-panel);
  padding: 1.4rem 1.6rem;
  font-size: .95rem; color: var(--c-dim);
}
.side-note__title {
  font-family: var(--font-hud); font-size: .78rem; letter-spacing: .25em;
  color: var(--c-cold); margin: 0 0 .8rem;
}
.side-note a { color: var(--c-cold); }

.steam-widget { margin: 1.6rem 0; border: 1px solid var(--c-line); }
.steam-widget iframe { display: block; }

.contact-list { list-style: none; padding: 0; display: grid; gap: .6rem; max-width: 480px; }
.contact-list__tag { font-family: var(--font-hud); color: var(--c-cold); margin-right: .4rem; }

.press-downloads { list-style: none; padding: 0; display: grid; gap: 1.2rem; }
.press-downloads__note {
  font-family: var(--font-hud); font-size: .72rem; letter-spacing: .08em;
  color: var(--c-dim); margin: .5rem 0 0;
}

/* ---- Devlog list --------------------------------------------------------------------------------- */
/* Bounded, independently-scrolling preview panel on the merged page —
   keeps the Devlog section a fixed height no matter how many posts pile
   up. Individual posts still open at their own /devlog/:slug URL. */
.devlog-panel {
  max-height: 62vh; overflow-y: auto;
  margin-top: 2rem; padding: 0 1.2rem;
  border: 1px solid var(--c-line);
  background: var(--c-bg-alt);
}
.devlog-panel .postlist { margin: 1.2rem 0; }
.devlog-panel::-webkit-scrollbar { width: 8px; }
.devlog-panel::-webkit-scrollbar-track { background: transparent; }
.devlog-panel::-webkit-scrollbar-thumb { background: var(--c-line); }
.postlist { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 1.2rem; }
.postlist__item {
  background: var(--c-panel); border: 1px solid var(--c-line);
  padding: 1.5rem 1.7rem;
}
.postlist__date {
  font-family: var(--font-hud); font-size: .74rem; letter-spacing: .2em;
  color: var(--c-cold); text-transform: uppercase; margin: 0 0 .4rem;
}
.postlist__title { font-family: var(--font-display); margin: 0 0 .5rem; font-size: 1.3rem; }
.postlist__title a { color: #eef8ff; text-decoration: none; }
.postlist__title a:hover { color: var(--c-cold); }
.postlist__excerpt { color: var(--c-dim); margin: 0 0 .8rem; font-size: .95rem; }
.postlist__more { margin: 0; font-family: var(--font-hud); font-size: .82rem; }
.postnav { margin-top: 3rem; font-family: var(--font-hud); font-size: .85rem; }

/* ---- Footer ------------------------------------------------------------------------------------------ */
.site-footer {
  margin-top: 4rem;
  border-top: 1px solid var(--c-line);
  background: var(--c-bg-alt);
}
.footer__cta {
  text-align: center;
  padding: clamp(3rem, 8vw, 5rem) var(--space) 2.5rem;
}
.footer__pitch {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4.5vw, 2.2rem); color: #eef8ff; margin: 0 0 1.5rem;
}
.footer__buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.footer__grid {
  max-width: 1150px; margin: 0 auto;
  padding: 2.5rem var(--space);
  display: grid; gap: 2rem;
  border-top: 1px solid var(--c-line);
}
@media (min-width: 800px) { .footer__grid { grid-template-columns: 2fr 1fr 1fr; } }
.footer__brand { font-family: var(--font-hud); letter-spacing: .25em; color: var(--c-text); margin: 0 0 .6rem; }
.footer__brand-link { color: inherit; text-decoration: none; }
.footer__brand-link:hover { color: var(--c-cold); }
.footer__note { font-size: .85rem; color: var(--c-dim); margin: 0; }
.footer__links { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; font-size: .9rem; }
.footer__links a { color: var(--c-dim); text-decoration: none; }
.footer__links a:hover { color: var(--c-cold); }
.footer__social { list-style: none; padding: 0; margin: 0; display: flex; gap: 1rem; flex-wrap: wrap; }
.footer__social a {
  font-family: var(--font-hud); color: var(--c-dim); text-decoration: none;
  border: 1px solid var(--c-line); padding: .4rem .6rem; display: inline-block;
}
.footer__social a:hover { color: var(--c-cold); border-color: var(--c-cold); }
.footer__tape {
  text-align: center;
  font-family: var(--font-hud); font-size: .65rem; letter-spacing: .3em;
  color: #4c5347; text-transform: uppercase;
  border-top: 1px solid var(--c-line);
  padding: 1.2rem var(--space); margin: 0;
}

/* ---- 404 "SIGNAL LOST" --------------------------------------------------------------------------------- */
.lost {
  position: relative;
  min-height: calc(88svh - var(--hud-h) - var(--nav-h));
  display: flex; align-items: center; justify-content: center;
  text-align: center; overflow: hidden;
  padding: 3rem var(--space);
}
.lost__static {
  position: absolute; inset: -100px; z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .13;
  animation: grain-shift .35s steps(3) infinite;
}
.lost__content { position: relative; z-index: 1; }
.lost__code {
  font-family: var(--font-hud); font-size: .75rem; letter-spacing: .3em;
  color: var(--c-rec); text-transform: uppercase; margin: 0 0 1rem;
}
.lost__title {
  font-family: var(--font-hud);
  font-size: clamp(2.2rem, 10vw, 5.5rem);
  letter-spacing: .1em; line-height: 1;
  color: #eef8ff; margin: 0; text-transform: uppercase;
}
.lost__sub { color: var(--c-dim); margin: 1.4rem 0 2rem; }
.lost__actions { margin: 0; }

/* ---- Motion polish ------------------------------------------------------------------------------------------- */
/* Staggered hero entrance: pretitle → title → tagline → CTAs slide up in
   sequence on load, with a soft blur-to-sharp settle. */
.js .hero__pretitle, .js .hero__title, .js .hero__tagline, .js .hero__cta {
  animation: hero-in .7s cubic-bezier(.2, .7, .2, 1) both;
}
.js .hero__title { animation-delay: .12s; }
.js .hero__tagline { animation-delay: .28s; }
.js .hero__cta { animation-delay: .44s; }
@keyframes hero-in {
  from { opacity: 0; transform: translateY(22px); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: none; }
}

/* VHS tracking band: a faint bright line sweeps down the hero every ~9s. */
.hero::after {
  content: "";
  position: absolute; left: 0; right: 0; top: -12%;
  height: 60px;
  background: linear-gradient(to bottom, transparent, rgba(230, 233, 226, .045), rgba(38, 224, 218, .05), transparent);
  pointer-events: none;
  animation: tracking-sweep 9s linear infinite;
}
@keyframes tracking-sweep {
  0%, 74% { transform: translateY(-80px); opacity: 0; }
  76% { opacity: 1; }
  99% { transform: translateY(110vh); opacity: 1; }
  100% { transform: translateY(110vh); opacity: 0; }
}


/* Gallery stills: slow push-in + saturation lift, like scrubbing footage. */
.gallery figure { overflow: hidden; }
.js .gallery img { transition: transform 1.2s cubic-bezier(.2, .6, .2, 1), filter .5s ease; }
.js .gallery figure:hover img { transform: scale(1.045); filter: saturate(1) contrast(1.1); }

/* Buttons get a tactile press. */
.btn:active { transform: translateY(1px) scale(.99); }

/* ---- Support / donations --------------------------------------------------------------------------------------- */
.tiers { display: grid; gap: 1rem; margin: 1.8rem 0; max-width: 640px; }
@media (min-width: 640px) { .tiers { grid-template-columns: repeat(3, 1fr); } }
.tier {
  background: var(--c-panel);
  border: 1px solid var(--c-line);
  padding: 1.4rem 1.2rem;
  text-align: center;
  display: flex; flex-direction: column; gap: .6rem; align-items: center;
}
.tier__amount {
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.8rem; color: #eef8ff;
}
.tier__label {
  font-family: var(--font-hud); font-size: .72rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--c-dim);
}
.tier form { margin-top: auto; width: 100%; }
.tier .btn { width: 100%; justify-content: center; }
.custom-amount { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; max-width: 640px; }
.custom-amount input[type="number"] {
  width: 7.5rem;
  background: var(--c-bg); border: 1px solid var(--c-line); color: var(--c-text);
  font-family: var(--font-hud); font-size: 1rem; padding: .7rem .9rem;
}
.custom-amount input[type="number"]:focus-visible { border-color: var(--c-cold); outline-offset: 0; }

/* ---- Reduced motion: kill every animation and glitch effect ------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .grain, .lost__static { animation: none; }
  .hud__dot { animation: none; opacity: 1; }
  .btn__soon-label, .hero__scroll { animation: none; opacity: 1; }
  .js .glitch-title::before, .js .glitch-title::after { display: none; }
  .js .glitch-hover:hover, .js .glitch-hover:focus-visible { text-shadow: none; }
  .js .reveal { opacity: 1; transform: none; }
  .js .reveal.is-visible { animation: none; }
  .js .glitch-card:hover { transform: none; box-shadow: none; }
  .js .hero__pretitle, .js .hero__title, .js .hero__tagline, .js .hero__cta { animation: none; }
  .hero::after { display: none; }
  .js .gallery figure:hover img { transform: none; }
  .hero__title-text { transform: none !important; }
  .js .nav__menu.is-open .nav__links li, .js .nav__menu.is-open .btn { opacity: 1; transform: none; animation: none; }
  .js .tree-item { opacity: 1; transform: none; animation: none; }
  .boot-overlay { display: none !important; }
  .boot-overlay__skip { animation: none; opacity: 1; }
}
