/* ────────────────────────────────────────────────────────────────────
   Aaron Lemke · Field Report · inferno theme · single seamless scroll
   Tokens lifted from /resume.html so the resume + site share one DNA.
   ──────────────────────────────────────────────────────────────────── */

:root {
  /* inferno palette (matplotlib inferno stops) */
  --i0:  #000004;
  --i1:  #1B0C42;
  --i2:  #420A68;
  --i3:  #6A176E;
  --i4:  #932667;
  --i5:  #BB3754;
  --i6:  #DD513A;
  --i7:  #F37819;
  --i8:  #FCA50A;
  --i9:  #F6D746;
  --i10: #FCFFA4;

  /* surface tokens */
  --paper: #07020E;
  --paper-deep: #04010A;
  --ink:   #FBE9C5;
  --ink-soft: #E5D0A6;
  --dim:   #B49B7E;
  --rule:  rgba(252, 165, 10, 0.22);
  --rule-strong: rgba(252, 165, 10, 0.42);
  --glow:  rgba(243, 120, 25, 0.55);
  --glow-soft: rgba(243, 120, 25, 0.18);

  /* type scales */
  --t-display: clamp(4rem, 16vw, 18rem);
  --t-h1: clamp(2rem, 5vw, 4rem);
  --t-h2: clamp(2.4rem, 5vw, 4.5rem);
  --t-lede: clamp(1rem, 1.4vw, 1.35rem);
  --t-body: clamp(0.95rem, 1vw, 1.05rem);
  --t-kicker: 0.72rem;
  --t-mono-sm: 0.72rem;

  --gap-xl: clamp(4rem, 9vw, 11rem);
  --gap-l: clamp(2rem, 4vw, 4rem);
  --gap-m: clamp(1rem, 2vw, 1.75rem);
  --gap-s: 0.5rem;

  --radius: 4px;
  --radius-lg: 8px;

  --hud-h: 44px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ── reset ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--paper); color: var(--ink); }

html {
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.55;
  text-size-adjust: 100%;
  /* deck snap is implemented in JS (controllable speed); native CSS snap
     would steal wheel events and snap at a fixed fast duration. */
  scroll-behavior: auto;
}

body {
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "ss02", "cv11";
  background:
    radial-gradient(ellipse 90% 60% at 100% 0%, rgba(243, 120, 25, 0.12), transparent 60%),
    radial-gradient(ellipse 70% 90% at 0% 100%, rgba(66, 10, 104, 0.45), transparent 65%),
    linear-gradient(180deg, var(--paper) 0%, #0a0410 50%, #100621 100%);
}

a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 1px dashed var(--i8); outline-offset: 4px; }

img, svg, video, iframe { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: transparent; border: 0; cursor: pointer; }

/* ── atmosphere layers ─────────────────────────────────────────────── */
#ember-field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.85;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image:
    repeating-conic-gradient(from 0deg at 50% 50%, transparent 0deg 0.4deg, rgba(255,255,255,0.04) 0.4deg 0.8deg);
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 100% 80% at 50% 50%, transparent 50%, rgba(0,0,0,0.55) 100%);
}

main { position: relative; z-index: 3; }

/* ── HUD ───────────────────────────────────────────────────────────── */
.hud {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--hud-h);
  z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 2rem);
  padding: 0 clamp(1rem, 3vw, 2rem);
  font-family: 'Geist Mono', ui-monospace, Menlo, monospace;
  font-size: var(--t-mono-sm);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  background: rgba(7, 2, 14, 0.72);
  border-bottom: 1px solid var(--rule);
}

.hud-name {
  font-family: 'Fraunces', serif;
  font-variation-settings: "opsz" 144, "wght" 600, "SOFT" 30, "WONK" 1;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--ink);
}

.hud-left, .hud-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  white-space: nowrap;
}

.hud-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--i8);
  box-shadow: 0 0 10px var(--glow);
  animation: pulse 2.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.18); }
}

.hud-label { color: var(--dim); }
.hud-sep { color: var(--i7); opacity: 0.55; }
.hud-clock {
  color: var(--i9);
  font-variant-numeric: tabular-nums;
  min-width: 10ch;
  text-align: right;
}

.hud-nav {
  display: flex;
  gap: clamp(0.5rem, 1.2vw, 1.2rem);
  overflow-x: auto;
  scrollbar-width: none;
  justify-content: flex-end;
}
.hud-nav::-webkit-scrollbar { display: none; }

.hud-nav a {
  color: var(--dim);
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  transition: color 200ms var(--ease), border-color 200ms var(--ease), background 200ms var(--ease);
  white-space: nowrap;
}
.hud-nav a:hover {
  color: var(--i9);
  border-color: var(--rule);
  background: rgba(243, 120, 25, 0.04);
}
.hud-nav a.is-active {
  color: var(--paper-deep);
  background: var(--i8);
  border-color: var(--i8);
}

@media (max-width: 720px) {
  .hud-nav { display: none; }
}

/* ── HERO ──────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100dvh;
  padding: calc(var(--hud-h) + var(--gap-l)) clamp(1rem, 5vw, 4rem) var(--gap-l);
  display: grid;
  align-content: center;
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap-m);
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.hero-meta { grid-column: 1 / -1; }

.kicker {
  font-family: 'Geist Mono', ui-monospace, Menlo, monospace;
  font-size: var(--t-kicker);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--i8);
  display: inline-block;
}
.kicker--accent { color: var(--i9); }

.hero-mark {
  position: absolute;
  top: -2vw;
  right: -3vw;
  width: clamp(140px, 26vw, 360px);
  pointer-events: none;
  z-index: 0;
  filter: drop-shadow(0 0 40px rgba(252, 165, 10, 0.35));
  animation: lantern-breathe 9s ease-in-out infinite;
}

.lantern { width: 100%; height: auto; display: block; }

@keyframes lantern-breathe {
  0%, 100% { transform: rotate(-1deg) scale(1.0); filter: drop-shadow(0 0 30px rgba(252, 165, 10, 0.35)); }
  50% { transform: rotate(1deg) scale(1.04); filter: drop-shadow(0 0 60px rgba(252, 165, 10, 0.55)); }
}

@media (max-width: 720px) {
  .hero-mark {
    position: relative;
    inset: auto;
    width: 50vw;
    margin: 0 auto var(--gap-s);
  }
}

.wordmark {
  position: relative;
  z-index: 2;
  font-family: 'Fraunces', 'Times New Roman', serif;
  font-variation-settings: "opsz" 144, "wght" 700, "SOFT" 30, "WONK" 1;
  font-size: var(--t-display);
  line-height: 0.84;
  letter-spacing: -0.04em;
  margin-top: clamp(1rem, 4vw, 2.5rem);
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(105deg,
      var(--i10) 0%,
      var(--i9) 18%,
      var(--i8) 36%,
      var(--i7) 56%,
      var(--i5) 80%,
      var(--i3) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 60px rgba(252, 165, 10, 0.18);
}

.word { display: block; }
.word--first {
  font-variation-settings: "opsz" 144, "wght" 600, "SOFT" 80, "WONK" 1;
  font-style: italic;
}
.word--last {
  font-variation-settings: "opsz" 144, "wght" 800, "SOFT" 0, "WONK" 0;
}
.wordmark-dot {
  color: var(--i6);
  -webkit-text-fill-color: var(--i6);
  font-style: normal;
}

.tagline {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: clamp(0.78rem, 1vw, 0.95rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--i9);
  margin-top: var(--gap-m);
  max-width: 60ch;
}

.lede {
  font-family: 'Fraunces', serif;
  font-variation-settings: "opsz" 18, "wght" 400, "SOFT" 100, "WONK" 0;
  font-size: clamp(1.15rem, 1.8vw, 1.65rem);
  line-height: 1.4;
  color: var(--ink);
  margin-top: var(--gap-s);
  max-width: 48ch;
  font-style: italic;
}
.lede-prefix {
  font-family: 'Geist Mono', monospace;
  font-style: normal;
  color: var(--i8);
  opacity: 0.6;
}
[data-typewriter] {
  border-right: 0.06em solid var(--i8);
  animation: caret 1s steps(1) infinite;
  white-space: pre-wrap;
}
@keyframes caret {
  50% { border-right-color: transparent; }
}
[data-typewriter].is-done {
  border-right-color: transparent;
  animation: none;
}

/* CTAs */
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: var(--gap-m);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.1rem;
  font-family: 'Geist Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(7, 2, 14, 0.4);
  transition: transform 200ms var(--ease), background 200ms var(--ease), border-color 200ms var(--ease), color 200ms var(--ease);
}
.btn:hover { transform: translateY(-1px); border-color: var(--i7); background: rgba(243, 120, 25, 0.08); }
.btn--primary {
  background: linear-gradient(135deg, var(--i7), var(--i8));
  border-color: var(--i8);
  color: var(--paper-deep);
  box-shadow: 0 8px 30px -8px rgba(243, 120, 25, 0.6);
}
.btn--primary:hover { background: linear-gradient(135deg, var(--i8), var(--i9)); color: var(--paper-deep); }
.btn--ghost {
  background: transparent;
  color: var(--ink-soft);
}

/* hero stats rail */
.hero-rail {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--gap-m);
  margin-top: var(--gap-l);
  padding: var(--gap-m) 0;
  border-top: 1px solid var(--rule);
}
.hero-rail li {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.rail-num {
  font-family: 'Fraunces', serif;
  font-variation-settings: "opsz" 60, "wght" 600, "SOFT" 20, "WONK" 0;
  font-size: clamp(1.5rem, 2.4vw, 2.4rem);
  color: var(--i9);
  letter-spacing: -0.02em;
  line-height: 1;
}
.rail-lbl {
  font-family: 'Geist Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}

.hero-edge {
  position: absolute;
  bottom: clamp(1rem, 3vw, 2rem);
  right: clamp(1rem, 3vw, 2rem);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'Geist Mono', monospace;
  font-size: var(--t-kicker);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--i7);
  opacity: 0.7;
}
.edge-tick {
  display: inline-block;
  transform: rotate(90deg);
  animation: edge-bounce 2s ease-in-out infinite;
}
@keyframes edge-bounce {
  0%, 100% { transform: rotate(90deg) translateX(0); }
  50% { transform: rotate(90deg) translateX(4px); }
}

/* ── BAY (project section) ─────────────────────────────────────────── */
.bay {
  position: relative;
  min-height: 100dvh;
  padding: calc(var(--hud-h) + clamp(0.75rem, 1.6vw, 1.4rem)) clamp(1rem, 5vw, 4rem) clamp(0.75rem, 2vw, 1.5rem);
  display: flex;
  flex-direction: column;
  gap: clamp(0.6rem, 1.4vw, 1.1rem);
  scroll-snap-align: start;
  scroll-snap-stop: always;
  /* dormant state default; BayScheduler toggles is-active/is-warming/is-cooling */
  contain: paint;
}

/* text-only bays (catalog) lay out their own grid below the head */
.bay--text { gap: clamp(1rem, 2vw, 1.75rem); }

/* paint-saving for bays far off-screen — placeholder height matches the
   bay's actual deck height so snap targets don't drift before mounting */
.bay:not(.is-active):not(.is-warming):not(.is-cooling) {
  content-visibility: auto;
  contain-intrinsic-size: auto 100dvh;
}

/* compact header band: num | (kicker, title, lede) | tags */
.bay-head {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "num spine tags";
  column-gap: clamp(0.9rem, 2vw, 1.75rem);
  row-gap: 0.4rem;
  align-items: center;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  text-align: left;
}

.bay-num {
  grid-area: num;
  align-self: center;
  font-family: 'Geist Mono', monospace;
  font-size: clamp(1.1rem, 1.7vw, 1.7rem);
  font-weight: 300;
  color: var(--i8);
  line-height: 1;
  letter-spacing: 0.18em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 20px var(--glow-soft);
  position: relative;
  padding-right: clamp(0.4rem, 1vw, 0.9rem);
}
.bay-num::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 1.6em;
  background: linear-gradient(180deg, transparent, var(--i7), transparent);
  opacity: 0.7;
}

.bay-spine {
  grid-area: spine;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: flex-start;
  min-width: 0;
}

.bay-spine .kicker {
  text-align: left;
  font-size: clamp(0.6rem, 0.7vw, 0.72rem);
}

.bay-title {
  font-family: 'Fraunces', serif;
  font-variation-settings: "opsz" 144, "wght" 700, "SOFT" 30, "WONK" 1;
  font-size: clamp(1.6rem, 3.2vw, 2.8rem);
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--ink);
  background: linear-gradient(95deg, var(--ink) 0%, var(--i9) 70%, var(--i7) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.bay-lede {
  font-family: 'Fraunces', serif;
  font-variation-settings: "opsz" 22, "wght" 400, "SOFT" 100, "WONK" 0;
  font-size: clamp(0.85rem, 1.05vw, 1.05rem);
  line-height: 1.4;
  color: var(--ink-soft);
  font-style: italic;
  max-width: 70ch;
}

.bay-tags {
  grid-area: tags;
  align-self: center;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem;
  max-width: 32ch;
}
.bay-tags li {
  font-family: 'Geist Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--i9);
  padding: 0.22rem 0.6rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(243, 120, 25, 0.1), rgba(187, 55, 84, 0.06));
  white-space: nowrap;
}

/* on narrower viewports stack head into a vertical compact column */
@media (max-width: 900px) {
  .bay-head {
    grid-template-columns: 1fr;
    grid-template-areas:
      "num"
      "spine"
      "tags";
    align-items: start;
  }
  .bay-num { align-self: start; padding-right: 0; padding-bottom: 0.3rem; }
  .bay-num::after {
    right: auto; left: 0; top: auto; bottom: 0;
    width: 1.6em; height: 1px;
    background: linear-gradient(90deg, var(--i7), transparent);
    transform: none;
  }
  .bay-tags { justify-content: flex-start; max-width: none; }
}

/* ── STAGE (the iframe / video / image holder) ─────────────────────── */
.stage {
  position: relative;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  transition: filter 380ms var(--ease), opacity 380ms var(--ease), transform 380ms var(--ease);
}

/* default: stages inside a deck bay flex-fill the remaining viewport */
.bay > .stage {
  flex: 1 1 auto;
  min-height: 0;
  aspect-ratio: auto;
}

/* aspect-ratio variants only kick in when the stage is NOT inside a deck bay */
:not(.bay) > .stage--16x9 { aspect-ratio: 16 / 9; }
:not(.bay) > .stage--cinema { aspect-ratio: 21 / 9; }
:not(.bay) > .stage--bleed { aspect-ratio: 16 / 9; max-width: none; margin-inline: clamp(-4rem, -5vw, -1rem); }
:not(.bay) > .stage--4x3 { aspect-ratio: 4 / 3; max-width: 900px; }

/* on very short screens, fall back to aspect-ratio so headers + stage both fit */
@media (max-height: 560px) {
  .bay > .stage { flex: 0 0 auto; aspect-ratio: 16 / 9; }
}

.stage-frame {
  position: absolute;
  inset: 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background:
    repeating-linear-gradient(45deg,
      transparent 0,
      transparent 24px,
      rgba(243, 120, 25, 0.025) 24px,
      rgba(243, 120, 25, 0.025) 25px),
    radial-gradient(ellipse at 50% 50%, rgba(27, 12, 66, 0.25), rgba(7, 2, 14, 0.6));
  overflow: hidden;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.6),
    0 30px 80px -30px rgba(0, 0, 0, 0.7);
  transition: box-shadow 380ms var(--ease), border-color 380ms var(--ease);
}

/* corner brackets — cinema framing marks */
.stage-corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--i8);
  opacity: 0.85;
  pointer-events: none;
}
.stage-corner--tl { top: 10px; left: 10px; border-right: 0; border-bottom: 0; }
.stage-corner--tr { top: 10px; right: 10px; border-left: 0; border-bottom: 0; }
.stage-corner--bl { bottom: 10px; left: 10px; border-right: 0; border-top: 0; }
.stage-corner--br { bottom: 10px; right: 10px; border-left: 0; border-top: 0; }

.stage-meta {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-family: 'Geist Mono', monospace;
  font-size: var(--t-mono-sm);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
  pointer-events: none;
  z-index: 2;
  text-align: center;
}
.stage-id { color: var(--i9); }
.stage-dim { color: var(--dim); font-size: 0.65rem; }

.stage-mount {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 1;
}
.stage-mount iframe,
.stage-mount video,
.stage-mount img {
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--paper-deep);
}

/* placeholder text inside an unmounted stage */
.stage-msg {
  font-family: 'Geist Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
  text-align: center;
  line-height: 1.6;
}
.stage-msg code {
  color: var(--i8);
  background: rgba(243, 120, 25, 0.08);
  padding: 1px 6px;
  border-radius: 4px;
}

/* Scroll catcher: absorbs wheel events so they bubble to the page instead
   of being captured by the iframe. Click to engage interaction. */
.stage-catcher {
  position: absolute;
  inset: 0;
  z-index: 5;
  cursor: pointer;
  background: transparent;
  display: grid;
  place-items: end center;
  padding-bottom: 1.2rem;
  transition: opacity 200ms var(--ease);
}
.stage-catcher__hint {
  font-family: 'Geist Mono', ui-monospace, monospace;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.7rem;
  padding: 0.55rem 1rem;
  border: 1px solid var(--i7);
  background: rgba(7, 2, 14, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 999px;
  color: var(--i9);
  opacity: 0;
  transition: opacity 220ms var(--ease), transform 220ms var(--ease);
  transform: translateY(4px);
  pointer-events: none;
  box-shadow: 0 8px 30px -10px rgba(243, 120, 25, 0.5);
}
.bay.is-active .stage-catcher:hover .stage-catcher__hint {
  opacity: 1;
  transform: translateY(0);
}
/* When user clicks in: catcher hides, iframe gets events */
.bay.is-engaged .stage-catcher { opacity: 0; pointer-events: none; }
.bay.is-engaged .stage-eject {
  opacity: 0.6;
  pointer-events: auto;
}
/* Eject pill — visible only when engaged, lets you release back to scroll. */
.stage-eject {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 6;
  font-family: 'Geist Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.65rem;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--rule);
  background: rgba(7, 2, 14, 0.75);
  backdrop-filter: blur(6px);
  border-radius: 999px;
  color: var(--ink-soft);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms var(--ease);
}
.stage-eject:hover { opacity: 1 !important; color: var(--i9); border-color: var(--i7); }

/* loading overlay shown while iframe warms */
.stage-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(7, 2, 14, 0.75);
  z-index: 3;
  pointer-events: none;
  font-family: 'Geist Mono', monospace;
  font-size: var(--t-mono-sm);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--i9);
  opacity: 0;
  transition: opacity 200ms var(--ease);
}
.stage-loading.is-visible { opacity: 1; }
.stage-loading::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent, rgba(252, 165, 10, 0.08), transparent);
  background-size: 200% 100%;
  animation: scan 1.6s linear infinite;
}
@keyframes scan {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── BAY LIFECYCLE STATES ──────────────────────────────────────────── */

/* default (dormant) — neutral framing, no glow */
.bay .stage { filter: none; opacity: 1; }

/* warming — mounted, paused, slightly dim */
.bay.is-warming .stage {
  filter: blur(2px) saturate(0.85);
  opacity: 0.7;
}

/* active — full clarity, ember edge glow */
.bay.is-active .stage-frame {
  border-color: var(--i7);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.6),
    0 0 0 1px var(--i7),
    0 0 60px -10px var(--glow),
    0 30px 80px -30px rgba(0, 0, 0, 0.8);
}
.bay.is-active .bay-num { color: var(--i9); text-shadow: 0 0 30px var(--glow); }

/* cooling — paused, dimmed for cinematic focus pull */
.bay.is-cooling .stage {
  filter: blur(6px) saturate(0.5);
  opacity: 0.35;
  transform: scale(0.985);
}

@media (prefers-reduced-motion: reduce) {
  .bay .stage { transition: none; }
  .stage-loading::before { animation: none; }
  .hud-dot, .hero-mark, .edge-tick { animation: none; }
  [data-typewriter] { animation: none; border-right-color: transparent; }
}

/* ── WebGPU not supported card ─────────────────────────────────────── */
.stage-unsupported {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 2rem;
  z-index: 4;
  background: rgba(7, 2, 14, 0.85);
}
.stage-unsupported__inner {
  text-align: center;
  max-width: 38ch;
  display: grid;
  gap: 0.6rem;
}
.stage-unsupported__title {
  font-family: 'Fraunces', serif;
  font-variation-settings: "opsz" 60, "wght" 600, "SOFT" 30;
  font-size: 1.4rem;
  color: var(--i9);
  font-style: italic;
}
.stage-unsupported__msg {
  font-family: 'Geist Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
  line-height: 1.7;
}

/* ── CATALOG (text-only bay) ───────────────────────────────────────── */
.catalog {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gap-m);
  max-width: 1400px;
  margin: 0 auto;
}
.cat-card {
  padding: var(--gap-m);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(27, 12, 66, 0.35), rgba(7, 2, 14, 0.55));
  transition: border-color 240ms var(--ease), transform 240ms var(--ease);
}
.cat-card:hover { border-color: var(--i7); transform: translateY(-2px); }
.cat-tag {
  font-family: 'Geist Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--i8);
  margin-bottom: 0.6rem;
}
.cat-title {
  font-family: 'Fraunces', serif;
  font-variation-settings: "opsz" 60, "wght" 600, "SOFT" 30;
  font-size: 1.3rem;
  line-height: 1.15;
  margin-bottom: 0.4rem;
  color: var(--ink);
}
.cat-desc {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

/* ── FOOTER ────────────────────────────────────────────────────────── */
.foot {
  min-height: 100dvh;
  padding: calc(var(--hud-h) + var(--gap-l)) clamp(1rem, 5vw, 4rem) var(--gap-l);
  border-top: 1px solid var(--rule);
  background: linear-gradient(180deg, transparent, rgba(7, 2, 14, 0.65));
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
}
.foot-grid {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: var(--gap-l);
  align-items: start;
}
@media (max-width: 720px) {
  .foot-grid { grid-template-columns: 1fr; }
}
.foot-mark { display: grid; gap: 0.4rem; }
.foot-lede {
  font-family: 'Fraunces', serif;
  font-variation-settings: "opsz" 22, "wght" 400, "SOFT" 100;
  font-style: italic;
  font-size: 1.1rem;
  color: var(--ink-soft);
}

.foot-links {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  font-family: 'Geist Mono', monospace;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
}
.foot-links a {
  display: inline-block;
  padding: 4px 0;
  color: var(--ink-soft);
  border-bottom: 1px solid transparent;
  transition: color 180ms var(--ease), border-color 180ms var(--ease);
}
.foot-links a:hover { color: var(--i9); border-color: var(--i7); }

.foot-fine {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  padding-top: var(--gap-m);
  border-top: 1px solid var(--rule);
  color: var(--dim);
}

/* ── responsive tweaks ─────────────────────────────────────────────── */
@media (max-width: 720px) {
  .bay { padding-block: var(--gap-l); padding-inline: 1rem; }
  .stage--bleed { margin-inline: 0; }
  .stage--cinema { aspect-ratio: 4 / 3; }
  .hero { padding-inline: 1rem; padding-top: calc(var(--hud-h) + 1rem); }
  .hero-mark {
    position: relative;
    inset: auto;
    width: 60vw;
    margin: 0 auto;
  }
  .hud { padding-inline: 1rem; }
  .hud-clock { min-width: 8ch; font-size: 0.65rem; }
}

@media (max-width: 480px) {
  .bay-num { font-size: 1.2rem; }
  .bay-tags li { font-size: 0.62rem; padding: 0.25rem 0.55rem; }
  .hud-left .hud-label:not(:first-child),
  .hud-left .hud-sep { display: none; }
}
