/* ============================================================
   HOTSTREAK — playable pitch
   Palette pulled from the flame logo: near-black, ember orange,
   flame yellow, one cool accent per subsystem.
   ============================================================ */

:root {
  --bg: #050407;
  --bg2: #0b0a10;
  --panel: #100e16;
  --line: #1e1b26;
  --ink: #f5efe6;
  --muted: #9a948a;
  --dim: #5a5548;
  --fire: #ff6a00;
  --flame: #ffb347;
  --gold: #ffd24a;
  --red: #e6323c;
  --font-px: "Press Start 2P", monospace;
  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
  scroll-padding-top: 60px; /* clears the fixed nav (~50px tall) */
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  overflow-x: hidden;
}

::selection { background: var(--fire); color: #0a0508; }

body::before { /* film grain */
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 4;
  opacity: 0.05;
  background-image: repeating-conic-gradient(#fff 0% 0.0001%, transparent 0.0002% 0.0004%);
  background-size: 157px 143px;
  mix-blend-mode: overlay;
}

/* ---------------- nav ---------------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  background: linear-gradient(to bottom, rgba(5,4,7,0.92), rgba(5,4,7,0.72));
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav-logo {
  font-family: var(--font-px);
  font-size: 11px;
  color: var(--gold);
  text-decoration: none;
  letter-spacing: 2px;
  text-shadow: 0 0 12px rgba(255,106,0,0.6);
}
.nav-logo-mark { color: var(--fire); margin-left: 6px; }

.nav-stages { display: flex; gap: 6px; }
.nav-stages a {
  font-family: var(--font-px);
  font-size: 9px;
  color: var(--dim);
  text-decoration: none;
  padding: 7px 9px;
  border: 1px solid transparent;
  transition: color .2s, border-color .2s;
}
.nav-stages a:hover { color: var(--flame); }
.nav-stages a.active { color: var(--fire); border-color: var(--fire); }

.nav-sound {
  font-family: var(--font-px);
  font-size: 8px;
  color: var(--flame);
  background: none;
  border: 1px solid var(--line);
  padding: 8px 10px;
  cursor: pointer;
  transition: all .2s;
}
.nav-sound:hover { border-color: var(--fire); }
.nav-sound.muted { color: var(--dim); }

/* ---------------- hero ---------------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  overflow: hidden;
  background: radial-gradient(ellipse 80% 60% at 50% 100%, #170a12 0%, var(--bg) 65%);
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.hero-embers, .finale-embers {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  image-rendering: pixelated;
  pointer-events: none;
}

/* no z-index here — a stacking context would stop the logo's
   mix-blend-mode from seeing the hero gradient behind it */
.hero-inner { position: relative; padding: 90px 24px 40px; }

.hero-eyebrow {
  font-family: var(--font-px);
  font-size: clamp(8px, 1.3vw, 11px);
  color: var(--fire);
  letter-spacing: 4px;
  margin-bottom: 8px;
  text-shadow: 0 0 16px rgba(255,106,0,0.5);
}

.hero-logo {
  width: min(420px, 78vw);
  /* the jpg has no alpha — screen blend melts its black bg into the page;
     no drop-shadow, or the glow outlines the rectangle */
  mix-blend-mode: screen;
}

.hero-sub {
  color: var(--muted);
  font-size: clamp(14px, 1.6vw, 17px);
  line-height: 1.7;
  margin: 10px auto 34px;
  max-width: 560px;
}

.coin-btn {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--font-px);
  font-size: 12px;
  color: #0a0508;
  background: linear-gradient(180deg, var(--gold), var(--fire));
  text-decoration: none;
  padding: 16px 28px;
  border: 1px solid var(--flame);
  box-shadow: 0 0 30px rgba(255,106,0,0.35), inset 0 1px 0 rgba(255,255,255,0.4);
  transition: transform .15s, box-shadow .15s;
}
.coin-btn:hover { transform: translateY(-2px); box-shadow: 0 0 44px rgba(255,106,0,0.55), inset 0 1px 0 rgba(255,255,255,0.4); }
.coin-btn .coin { animation: coinblink 1.2s steps(2) infinite; }
@keyframes coinblink { 50% { opacity: 0.25; } }

.hero-scroll {
  position: absolute; bottom: 26px; left: 50%;
  transform: translateX(-50%);
  color: var(--fire);
  font-size: 14px;
  animation: bob 1.6s ease-in-out infinite;
  z-index: 2;
}
@keyframes bob { 50% { transform: translate(-50%, 8px); } }

/* ---------------- stages ---------------- */
.stage {
  display: grid;
  grid-template-columns: minmax(320px, 460px) minmax(400px, 640px);
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 110px clamp(20px, 5vw, 72px) 70px;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
.stage:nth-child(even) { grid-template-columns: minmax(400px, 640px) minmax(320px, 460px); }
.stage:nth-child(even) .stage-copy { order: 2; }
.stage:nth-child(even) .crt-rig { order: 1; }

.stage:nth-of-type(odd) { background: var(--bg); }
.stage:nth-of-type(even) { background: linear-gradient(180deg, var(--bg) 0%, var(--bg2) 50%, var(--bg) 100%); }

.kicker {
  font-family: var(--font-px);
  font-size: 10px;
  color: var(--fire);
  letter-spacing: 3px;
  margin-bottom: 18px;
  text-shadow: 0 0 14px rgba(255,106,0,0.45);
}

.stage-copy h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.4vw, 44px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.5px;
  margin-bottom: 20px;
}

.stage-copy .body {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
  margin-bottom: 22px;
  max-width: 52ch;
}
.stage-copy .body b { color: var(--ink); font-weight: 600; }

.takeaway {
  font-family: var(--font-px);
  font-size: 9px;
  line-height: 1.9;
  color: var(--flame);
  border-left: 3px solid var(--fire);
  padding: 10px 0 10px 16px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.stat-chips { display: flex; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 12px 16px;
  display: flex; flex-direction: column; gap: 4px;
}
.chip b {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--gold);
}
.chip span {
  font-family: var(--font-px);
  font-size: 7px;
  color: var(--dim);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ---------------- the CRT ---------------- */
.crt-rig { display: flex; flex-direction: column; gap: 14px; }

.crt {
  background: linear-gradient(165deg, #1b1a21 0%, #121118 55%, #0c0b11 100%);
  border: 1px solid #26242e;
  border-radius: 18px;
  padding: 22px 22px 12px;
  box-shadow:
    0 30px 80px rgba(0,0,0,0.75),
    0 4px 18px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.06),
    inset 0 -6px 16px rgba(0,0,0,0.5);
}

.screen {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #000;
  border-radius: 14px / 12px;
  overflow: hidden;
  box-shadow:
    inset 0 0 0 2px #000,
    inset 0 0 34px rgba(0,0,0,0.95),
    0 0 0 3px #060509,
    0 0 24px rgba(255,106,0,0.06);
  cursor: crosshair;
}

.screen canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.fx { position: absolute; inset: 0; pointer-events: none; }

.scanlines {
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0px, rgba(0,0,0,0) 2px,
    rgba(0,0,0,0.22) 3px
  );
  animation: flicker 0.12s steps(2) infinite;
}
@keyframes flicker { 50% { opacity: 0.92; } }

.aperture { /* faint RGB stripe mask */
  background: repeating-linear-gradient(
    to right,
    rgba(255,0,0,0.035) 0px, rgba(0,255,0,0.03) 1px, rgba(0,0,255,0.035) 2px, rgba(0,0,0,0) 3px
  );
}

.glare {
  background:
    radial-gradient(ellipse 120% 90% at 50% 45%, rgba(0,0,0,0) 62%, rgba(0,0,0,0.42) 100%),
    linear-gradient(115deg, rgba(255,255,255,0.075) 0%, rgba(255,255,255,0.02) 22%, rgba(255,255,255,0) 40%);
  border-radius: 14px / 12px;
}

.crt-controls {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 6px 6px;
}

.crt-brand {
  font-family: var(--font-px);
  font-size: 7px;
  color: #4a4652;
  letter-spacing: 1px;
}

.crt-vents {
  flex: 1;
  height: 8px;
  background: repeating-linear-gradient(to right, #0c0b11 0 3px, transparent 3px 7px);
  border-radius: 2px;
  opacity: 0.9;
}

.knob {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #34313e, #17161c);
  border: 1px solid #26242e;
}

.led {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #3a2020;
  transition: all .25s;
}
.led.on {
  background: var(--fire);
  box-shadow: 0 0 10px var(--fire), 0 0 20px rgba(255,106,0,0.5);
}

.crt-caption {
  font-family: var(--font-px);
  font-size: 8px;
  line-height: 1.9;
  color: var(--dim);
  letter-spacing: 1px;
  text-align: center;
}

/* ---------------- finale ---------------- */
.finale {
  position: relative;
  padding: 140px clamp(20px, 5vw, 72px) 40px;
  background:
    radial-gradient(ellipse 70% 40% at 50% 0%, #1c0b12 0%, transparent 60%),
    var(--bg);
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.finale-embers { height: 100%; }

.finale-banner {
  position: relative; /* no z-index: keeps logo blend mode working */
  text-align: center;
  margin-bottom: 120px;
}

.finale-title {
  font-family: var(--font-px);
  font-size: clamp(26px, 5.5vw, 64px);
  line-height: 1.35;
  background: linear-gradient(180deg, #fff6d8 0%, var(--gold) 35%, var(--fire) 75%, var(--red) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 28px rgba(255,106,0,0.4));
  margin: 26px 0 34px;
}
.finale-title .cursor {
  animation: coinblink 1s steps(2) infinite;
  -webkit-text-fill-color: var(--fire);
}

.finale-logo {
  width: min(300px, 60vw);
  mix-blend-mode: screen;
}

/* ---------------- ecosystem ---------------- */
.eco { position: relative; z-index: 2; max-width: 1500px; margin: 0 auto; }

.eco-head { max-width: 720px; margin-bottom: 36px; }
.eco-head h3 {
  font-family: var(--font-display);
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 700;
  margin-bottom: 14px;
}
.eco-head .body { color: var(--muted); font-size: 16px; line-height: 1.7; }
.eco-head .body b { color: var(--flame); }

.eco-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 20px; }
.eco-legend-item {
  font-family: var(--font-px);
  font-size: 7px;
  color: var(--muted);
  letter-spacing: 1px;
  display: inline-flex; align-items: center; gap: 7px;
}
.eco-legend-item i { width: 9px; height: 9px; display: inline-block; }

.eco-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
}

.eco-map {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
}

.eco-svg { width: 100%; height: auto; display: block; }

.eco-edge line {
  stroke: #3a3644;
  stroke-width: 1.6;
  transition: stroke .2s;
}
.eco-edge.hot line { stroke: var(--fire); stroke-width: 2.4; }
.eco-edge-label {
  font-family: var(--font-px);
  font-size: 9px;
  fill: #57515f;
  text-anchor: middle;
}
.eco-edge.hot .eco-edge-label { fill: var(--flame); }

.eco-node { cursor: pointer; }
.eco-node rect {
  fill: #14111c;
  stroke: var(--node-col);
  stroke-width: 1.6;
  transition: fill .2s, filter .2s, opacity .2s;
}
.eco-node:hover rect { fill: #1c1826; }
.eco-node.sel rect {
  fill: #221828;
  filter: drop-shadow(0 0 10px var(--node-col));
  stroke-width: 2.5;
}
.eco-node.dim { opacity: 0.34; }
.eco-node-core rect { stroke-width: 3; }

.eco-node text { pointer-events: none; }
.eco-node-label {
  font-family: var(--font-px);
  font-size: 11px;
  fill: var(--ink);
  text-anchor: middle;
}
.eco-node.sel .eco-node-label { fill: #fff6d8; }
.eco-node-core .eco-node-label { fill: var(--gold); }

.eco-stat-key { font-family: var(--font-px); font-size: 10px; fill: var(--muted); }
.eco-stat-val { font-family: var(--font-px); font-size: 13px; fill: var(--gold); text-anchor: end; }

.eco-panel {
  position: sticky; top: 90px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px;
  min-height: 320px;
}

.eco-panel-group {
  font-family: var(--font-px);
  font-size: 8px;
  letter-spacing: 2px;
  margin-bottom: 12px;
}
.eco-panel h4 {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.2;
}
.eco-panel-blurb {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 18px;
}
.eco-panel-links-title {
  font-family: var(--font-px);
  font-size: 7px;
  color: var(--dim);
  letter-spacing: 2px;
  margin-bottom: 10px;
}
.eco-panel-links { display: flex; flex-wrap: wrap; gap: 6px; }
.eco-panel-links button {
  font-family: var(--font-px);
  font-size: 7px;
  color: var(--node-col);
  background: none;
  border: 1px solid var(--node-col);
  padding: 6px 8px;
  cursor: pointer;
  letter-spacing: 1px;
  transition: all .15s;
}
.eco-panel-links button:hover { background: var(--node-col); color: #0a0508; }

/* ---------------- footer ---------------- */
.footer {
  position: relative; z-index: 2;
  text-align: center;
  margin-top: 130px;
  padding: 50px 20px 40px;
  border-top: 1px solid var(--line);
}
.footer-cheers {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 14px;
}
.footer-contact {
  font-family: var(--font-px);
  font-size: 10px;
  display: flex; justify-content: center; gap: 16px;
  margin-bottom: 26px;
}
.footer-contact a { color: var(--flame); text-decoration: none; }
.footer-contact a:hover { color: var(--gold); text-shadow: 0 0 12px rgba(255,106,0,0.6); }
.footer-contact span { color: var(--dim); }
.footer-fine {
  font-family: var(--font-px);
  font-size: 7px;
  color: var(--dim);
  letter-spacing: 2px;
}

/* ---------------- reveal animation ---------------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .8s cubic-bezier(.2,.6,.2,1), transform .8s cubic-bezier(.2,.6,.2,1);
}
.reveal.in { opacity: 1; transform: none; }

/* ---------------- responsive ---------------- */
@media (max-width: 1100px) {
  .eco-wrap { grid-template-columns: 1fr; }
  .eco-panel { position: static; min-height: 0; }
}

@media (max-width: 900px) {
  /* stacked layout can run taller than one viewport — mandatory snap would trap scrolling mid-stage */
  html { scroll-snap-type: y proximity; }
  .stage, .stage:nth-child(even) { grid-template-columns: 1fr; min-height: 0; padding-top: 90px; }
  .stage:nth-child(even) .stage-copy { order: 1; }
  .stage:nth-child(even) .crt-rig { order: 2; }
  .crt-rig { max-width: 620px; margin: 0 auto; width: 100%; }
  .nav { padding: 12px 14px; }
  .nav-stages a { padding: 6px 5px; }
  .finale-banner { margin-bottom: 70px; }
}
