/* ===========================================================
   NYC // THE CITY BETWEEN — v3 cinematic stylesheet
   Color language: deep night base + per-chapter accent drives
   CSS variables are mutated at runtime by JS (--chapter-progress,
   --scroll-velocity, --grade-warm, --grade-cool, --grade-lift).
   =========================================================== */

/* Godly gothic hero face — blackletter for the intro "SPARK M!NDS" title.
   Grenze Gotisch (bold, holds the gold gradient) + UnifrakturMaguntia (ornate
   medieval alt, ready to swap). CSP allows fonts.googleapis.com / gstatic.com. */
@import url('https://fonts.googleapis.com/css2?family=Grenze+Gotisch:wght@700;900&family=UnifrakturMaguntia&display=swap');

:root {
  color-scheme: dark;
  --bg: #05070a;
  --bg-deep: #02030640;
  --ink: #f4f1e8;
  --ink-soft: #c4c8d0;
  --muted: #9aa0aa;
  /* v5: SPARK M!NDS brand gold palette (matches sparkminds.xyz) */
  --gold: #f5c542;
  --gold-bright: #ffd700;
  --gold-warm: #ffe066;
  --gold-deep: #e8a800;
  --gold-dim: rgba(255, 215, 0, 0.12);
  --gold-glow: rgba(245, 197, 66, 0.32);
  --gold-text: rgba(245, 197, 66, 0.95);
  --yellow: #f5c542;   /* alias for legacy refs */
  --yellow-warm: #ffb648;
  --cyan: #76d9ff;
  --cyan-cool: #4cb4ff;
  --red: #ff4e45;
  --magenta: #ff5db1;
  --green: #36ff78;
  --line: rgba(255,255,255,.16);
  --line-soft: rgba(255,255,255,.08);
  --pad: clamp(24px, 5vw, 84px);

  /* Per-chapter color grade — JS mutates these */
  --grade-warm: 0.0;
  --grade-cool: 0.0;
  --grade-lift: 0.0;
  --grade-tint: #000000;
  --grade-tint-a: 0.0;
  --chapter-accent: var(--gold);

  /* v5: Brand typography — Orbitron for marks, Cormorant for display, Space Grotesk for body */
  --font-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-mark: 'Orbitron', 'Inter', sans-serif;
  --font-body: 'Space Grotesk', 'Inter', ui-sans-serif, -apple-system, BlinkMacSystemFont, sans-serif;

  font-family: var(--font-body);
  font-feature-settings: "ss01", "cv11", "tnum";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  overflow-x: clip;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: none; }

#world { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; }
#app { position: relative; min-height: 100%; isolation: isolate; }
main { position: relative; z-index: 3; }

/* ===========================================================
   FILM GRADE OVERLAY
   Layered: grain + vignette + scanlines + letterbox bars + flash
   These compound on top of the WebGL render to drive the cinematic look.
   =========================================================== */

.film {
  position: fixed; inset: 0; pointer-events: none; z-index: 4;
  mix-blend-mode: normal;
}
.film-vignette {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 50% 45%, transparent 38%, rgba(0,0,0,.18) 70%, rgba(0,0,0,.55) 110%),
    linear-gradient(180deg, rgba(2,4,8,.05), rgba(2,4,8,.28));
  transition: background .8s ease;
}
.film-grain {
  position: absolute; inset: 0;
  opacity: .09;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  animation: grain .18s steps(2) infinite;
}
@keyframes grain {
  0% { transform: translate(0); }
  25% { transform: translate(-1.5%, 1%); }
  50% { transform: translate(1%, -1%); }
  75% { transform: translate(.5%, 1.5%); }
}
.film-scanlines {
  position: absolute; inset: 0;
  opacity: .035;
  background-image: repeating-linear-gradient(0deg, rgba(255,255,255,.6) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}
.film-letterbox {
  position: absolute; left: 0; right: 0; height: 0;
  background: #000;
  transition: height .8s cubic-bezier(.2,.7,.2,1);
  pointer-events: none;
}
.film-letterbox--top { top: 0; }
.film-letterbox--bottom { bottom: 0; }
body.theatre .film-letterbox { height: 7vh; }
.film-flash {
  position: absolute; inset: 0;
  background: var(--chapter-accent);
  opacity: 0;
  mix-blend-mode: screen;
  transition: opacity .3s ease;
}
.film-flash.fire { animation: flashFire .8s ease-out; }
@keyframes flashFire {
  0% { opacity: .35; }
  100% { opacity: 0; }
}

/* Per-chapter film grade */
body[data-chapter="0"] .film-vignette {
  background:
    radial-gradient(circle at 60% 38%, transparent 48%, rgba(8,16,28,.25) 75%, rgba(0,0,0,.55) 115%),
    linear-gradient(180deg, rgba(10,20,32,.18), rgba(2,4,8,.32));
}
body[data-chapter="1"] .film-vignette {
  background:
    radial-gradient(circle at 50% 50%, transparent 38%, rgba(8,5,2,.20) 72%, rgba(0,0,0,.55) 110%),
    linear-gradient(180deg, rgba(10,8,4,.10), rgba(2,4,8,.30));
}
body[data-chapter="2"] .film-vignette {
  background:
    radial-gradient(circle at 50% 46%, transparent 28%, rgba(0,0,0,.35) 72%, rgba(0,0,0,.68) 110%),
    linear-gradient(180deg, rgba(13,20,16,.18), rgba(0,0,0,.38));
}
body[data-chapter="3"] .film-vignette {
  background:
    radial-gradient(circle at 50% 48%, transparent 32%, rgba(8,4,16,.30) 72%, rgba(0,0,0,.62) 110%),
    linear-gradient(180deg, rgba(20,10,30,.10), rgba(2,4,8,.30));
}
body[data-chapter="4"] .film-vignette {
  background:
    radial-gradient(circle at 52% 40%, transparent 45%, rgba(0,0,0,.22) 78%),
    linear-gradient(180deg, rgba(5,10,16,.04), rgba(2,4,8,.32));
}
body[data-chapter="5"] .film-vignette {
  background:
    radial-gradient(circle at 50% 55%, transparent 50%, rgba(8,16,28,.20) 80%, rgba(0,0,0,.50) 115%),
    linear-gradient(180deg, rgba(12,22,36,.06), rgba(2,4,8,.30));
}

/* CURSOR HALO + RING */
.cursor-glow {
  position: fixed; z-index: 2; width: 520px; height: 520px; border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(118,217,255,.10), rgba(244,196,48,.025) 35%, transparent 65%);
  transform: translate(-50%,-50%);
  opacity: 0;
  transition: opacity .3s ease, background .8s ease;
  mix-blend-mode: screen;
}
@media (pointer: fine) { .cursor-glow { opacity: 1; } }
.cursor-ring {
  position: fixed; z-index: 5; width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.35);
  pointer-events: none;
  transform: translate(-50%,-50%);
  opacity: 0;
  transition: opacity .25s ease, width .25s ease, height .25s ease, border-color .25s ease;
  mix-blend-mode: difference;
}
@media (pointer: fine) { .cursor-ring { opacity: 1; } }
.cursor-ring.active { width: 56px; height: 56px; border-color: var(--chapter-accent); }

/* CHAPTER TRANSITION PULSE (cinematic flash overlay) */
.pulse {
  position: fixed; inset: 0; z-index: 40; pointer-events: none;
  background: var(--chapter-accent);
  opacity: 0;
  mix-blend-mode: overlay;
}
.pulse.fire { animation: pulseFire .9s ease-out; }
@keyframes pulseFire {
  0% { opacity: 0; }
  15% { opacity: .22; }
  100% { opacity: 0; }
}

/* ===========================================================
   TOPBAR
   =========================================================== */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px var(--pad);
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(3,5,8,.78), rgba(3,5,8,.1) 80%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}
.brand {
  text-decoration: none;
  font-size: 11px; font-weight: 800; letter-spacing: .18em;
  display: flex; align-items: center; gap: 9px;
  color: var(--ink);
}
.brand-mark {
  font-family: var(--font-mark);
  font-size: 14px; font-weight: 900; letter-spacing: .04em;
  color: var(--gold-bright);
  text-shadow: 0 0 12px var(--gold-glow);
}
.brand-slash { color: var(--gold); font-weight: 800; margin: 0 -2px; }
.brand-name { color: var(--ink-soft); font-family: var(--font-mark); font-weight: 500; letter-spacing: .14em; font-size: 10px; }
.topbar-actions { display: flex; gap: 8px; }
.quiet-button {
  position: relative;
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid rgba(255,255,255,.16);
  color: #d9dce2; background: rgba(5,7,10,.4);
  padding: 8px 12px; border-radius: 999px;
  font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  cursor: pointer;
  transition: border-color .25s ease, color .25s ease, background .25s ease, transform .25s ease;
}
.quiet-button .icon { width: 14px; height: 14px; opacity: .85; }
.quiet-button .lbl { line-height: 1; }
.quiet-button:hover { border-color: rgba(255,255,255,.42); color: white; background: rgba(255,255,255,.04); transform: translateY(-1px); }
.quiet-button[aria-pressed="true"] {
  border-color: var(--chapter-accent);
  color: var(--chapter-accent);
  box-shadow: 0 0 0 1px rgba(255,255,255,.06), 0 0 18px -2px var(--chapter-accent);
}
.quiet-button::after {
  content: attr(data-tooltip);
  position: absolute; top: calc(100% + 8px); right: 0;
  padding: 5px 8px; border-radius: 4px;
  background: rgba(5,7,10,.95); border: 1px solid var(--line-soft);
  color: var(--ink-soft); font-size: 9px; letter-spacing: .1em;
  white-space: nowrap;
  opacity: 0; transform: translateY(-4px); transition: opacity .2s, transform .2s;
  pointer-events: none;
}
.quiet-button:hover::after { opacity: 1; transform: none; }

/* ===========================================================
   CHAPTER RAIL (right side, vertical, animated)
   =========================================================== */
.chapter-rail {
  position: fixed; right: 22px; top: 50%; transform: translateY(-50%); z-index: 10;
  display: grid; gap: 12px;
}
.chapter-rail a {
  display: grid; grid-template-columns: 1fr auto;
  align-items: center; gap: 0 10px;
  color: #8d939d; text-decoration: none;
  font-size: 9px; letter-spacing: .13em; text-transform: uppercase;
  position: relative;
}
.chapter-rail b {
  width: 0; overflow: hidden; opacity: 0; font-weight: 600;
  transition: width .35s ease, opacity .35s ease;
  text-align: right; white-space: nowrap;
}
.chapter-rail span {
  width: 28px; height: 28px; border: 1px solid rgba(255,255,255,.14);
  border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-mark); font-size: 10px; font-weight: 700;
  transition: border-color .35s ease, box-shadow .35s ease, background .35s ease, color .35s ease;
  background: rgba(5,7,10,.32);
  position: relative;
}
.chapter-rail .rail-meter {
  display: block; width: 28px; height: 2px; background: rgba(255,255,255,.06);
  position: absolute; left: 0; right: 0; bottom: -6px; margin: auto;
  overflow: hidden; border-radius: 2px;
}
.chapter-rail .rail-meter > i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--chapter-accent), rgba(255,255,255,.6));
  transition: width .3s ease;
}
.chapter-rail a.active { color: white; }
.chapter-rail a.active b, .chapter-rail a:hover b { width: 90px; opacity: 1; }
.chapter-rail a.active span {
  border-color: var(--chapter-accent);
  color: var(--chapter-accent);
  box-shadow: 0 0 0 4px rgba(245,197,66,.10), 0 0 14px -2px var(--chapter-accent);
}
.chapter-rail a.active span::before {
  content: ""; position: absolute; inset: -6px;
  border: 1px solid var(--chapter-accent); border-radius: 50%;
  opacity: .35; animation: railPulse 1.8s ease-in-out infinite;
}
@keyframes railPulse {
  0%, 100% { transform: scale(1); opacity: .35; }
  50% { transform: scale(1.18); opacity: 0; }
}
.rail-progress {
  position: absolute; left: -16px; top: 0; bottom: 0; width: 1px;
  background: rgba(255,255,255,.06);
}
.rail-progress > i {
  display: block; width: 100%; height: 0;
  background: linear-gradient(180deg, var(--yellow), var(--cyan));
  transition: height .15s linear;
}

/* ===========================================================
   RUNTIME HUD (bottom-left)
   =========================================================== */
.runtime-hud {
  position: fixed; z-index: 10; left: var(--pad); bottom: 22px;
  display: flex; align-items: center; gap: 10px;
  color: #858d98; font-size: 8px; letter-spacing: .14em;
  text-transform: uppercase; pointer-events: none;
  font-feature-settings: "tnum";
}
.runtime-hud .hud-sep { color: rgba(255,255,255,.2); }
.pulse-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cyan-cool);
  box-shadow: 0 0 14px rgba(76,180,255,.9);
  animation: pulseDot 1.8s ease-in-out infinite;
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .35; transform: scale(.72); }
}

/* SCROLL VELOCITY METER */
.velocity-meter {
  position: fixed; z-index: 10; left: var(--pad); bottom: 58px;
  display: flex; align-items: center; gap: 10px;
  color: #858d98; font-size: 8px; letter-spacing: .14em; text-transform: uppercase;
  pointer-events: none;
}
.vm-track {
  width: 120px; height: 2px; background: rgba(255,255,255,.08);
  overflow: hidden; border-radius: 1px;
}
.vm-track > i {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--cyan-cool), var(--yellow), var(--red));
  transition: width .12s ease;
}
.vm-value { font-feature-settings: "tnum"; min-width: 32px; color: var(--ink-soft); }

/* v4: RAIN INTENSITY METER */
.rain-meter {
  position: fixed; z-index: 10; left: var(--pad); bottom: 78px;
  display: flex; align-items: center; gap: 10px;
  color: #858d98; font-size: 8px; letter-spacing: .14em; text-transform: uppercase;
  pointer-events: none;
}
.rm-track {
  width: 120px; height: 2px; background: rgba(255,255,255,.08);
  overflow: hidden; border-radius: 1px;
}
.rm-track > i {
  display: block; height: 100%; width: 50%;
  background: linear-gradient(90deg, rgba(118,217,255,.4), var(--cyan-cool));
  transition: width .15s ease;
}
.rm-value { font-feature-settings: "tnum"; min-width: 32px; color: var(--ink-soft); }

/* v4: GOD MODE DEBUG PANEL */
.god-panel {
  position: fixed; z-index: 60; right: 22px; bottom: 60px;
  width: 280px; padding: 18px 20px 16px;
  background: rgba(5,7,10,.92);
  border: 1px solid var(--line-soft);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 10px; letter-spacing: .06em;
  color: var(--ink-soft);
  opacity: 0; transform: translateY(10px); pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.god-panel.open {
  opacity: 1; transform: none; pointer-events: auto;
}
.god-panel .gp-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 14px;
  padding-bottom: 10px; border-bottom: 1px solid var(--line-soft);
}
.god-panel .gp-title {
  font-size: 11px; letter-spacing: .2em; color: var(--chapter-accent);
  font-weight: 700; text-transform: uppercase;
}
.god-panel .gp-sub {
  font-size: 8px; color: #6c727c; letter-spacing: .14em;
}
.god-panel .gp-row {
  display: grid; grid-template-columns: 70px 1fr 40px;
  align-items: center; gap: 8px;
  margin-bottom: 10px;
}
.god-panel .gp-row label {
  font-size: 9px; letter-spacing: .14em; color: #a8aeb6; text-transform: uppercase;
}
.god-panel .gp-row input[type="range"] {
  -webkit-appearance: none; appearance: none;
  height: 2px; background: rgba(255,255,255,.16);
  border-radius: 1px; outline: none;
}
.god-panel .gp-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--chapter-accent); cursor: pointer;
  box-shadow: 0 0 8px var(--chapter-accent);
}
.god-panel .gp-row input[type="range"]::-moz-range-thumb {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--chapter-accent); cursor: pointer; border: none;
}
.god-panel .gp-val {
  font-feature-settings: "tnum"; text-align: right; color: var(--ink);
}
.god-panel .gp-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-soft);
}
.god-panel .gp-stats > div { display: flex; flex-direction: column; gap: 2px; }
.god-panel .gp-stats span {
  font-size: 8px; letter-spacing: .14em; color: #6c727c; text-transform: uppercase;
}
.god-panel .gp-stats b {
  font-size: 11px; color: var(--ink); font-weight: 400; font-feature-settings: "tnum";
}
.god-panel .gp-restart {
  margin-top: 14px; padding: 8px 0; width: 100%;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line-soft);
  color: var(--ink-soft);
  font: inherit; font-size: 9px; letter-spacing: .2em; text-transform: uppercase;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.god-panel .gp-restart:hover {
  background: var(--chapter-accent); color: #05070a; border-color: var(--chapter-accent);
}

/* PROGRESS METER (top-right above rail) */
.progress-meter {
  position: fixed; z-index: 10; right: 22px; top: 88px;
  display: flex; align-items: center; gap: 10px;
  color: #858d98; font-size: 8px; letter-spacing: .14em; text-transform: uppercase;
  pointer-events: none;
}
.pm-label { color: var(--ink-soft); }
.pm-track {
  display: block; width: 60px; height: 2px;
  background: rgba(255,255,255,.08); overflow: hidden; position: relative;
}
.pm-track > i {
  position: absolute; left: 0; top: 0; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--yellow), var(--cyan));
  transition: width .15s ease;
}
.pm-value { font-feature-settings: "tnum"; color: var(--ink); min-width: 32px; }

/* ===========================================================
   CHAPTERS — TYPOGRAPHY + LAYOUT
   =========================================================== */
.chapter { min-height: 145vh; position: relative; padding: 20vh var(--pad) 16vh; display: flex; align-items: center; }
.hero { min-height: 170vh; align-items: flex-start; padding-top: 19vh; }
.hero::before, .chapter::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: -1;
  background: linear-gradient(90deg, rgba(3,5,8,.62) 0%, rgba(3,5,8,.16) 45%, transparent 70%);
}
.hero-copy { width: min(900px, 86vw); position: relative; }
.eyebrow, .kicker, .hero-meta, .footer {
  font-size: 10px; letter-spacing: .22em; text-transform: uppercase;
  color: #c1c6ce;
}
.eyebrow {
  position: absolute; top: 120px; right: var(--pad);
  writing-mode: vertical-rl; transform: rotate(180deg);
  font-feature-settings: "tnum";
}
.kicker { color: var(--chapter-accent); margin: 0 0 18px; }
.display {
  font-family: var(--font-display);
  font-size: clamp(64px, 10.4vw, 178px); font-weight: 300;
  line-height: .82; letter-spacing: -.04em;
  margin: 0; text-wrap: balance;
  text-shadow: 0 8px 50px rgba(0,0,0,.55), 0 0 30px rgba(0,0,0,.4);
}
.display em {
  font-weight: 400; color: transparent;
  -webkit-text-stroke: 1px rgba(244,241,232,.74);
  font-style: italic;
}
/* v5: SPARK M!NDS brand display variant — Orbitron + gold gradient */
.spark-display {
  font-family: var(--font-mark);
  font-weight: 900;
  letter-spacing: .02em;
  background: linear-gradient(180deg, #ffffff 0%, #f5c542 50%, #e8a800 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 30px rgba(245,197,66,.4));
}
.spark-display em {
  background: linear-gradient(135deg, #ffd700 0%, #f5c542 30%, #ffe066 60%, #e8a800 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 0;
  font-style: normal;
  font-weight: 900;
}
/* Gothic "godly" treatment for the intro hero title only (#above), keeping the
   gold gradient from .spark-display above. Swap 'Grenze Gotisch' →
   'UnifrakturMaguntia' for the more ornate medieval look. Blackletter needs
   more line-height (tall ascenders/descenders) than the geometric default. */
#above .spark-display {
  font-family: 'Grenze Gotisch', 'UnifrakturMaguntia', Georgia, serif;
  font-weight: 900;
  letter-spacing: .012em;
  line-height: 1.0;
  font-size: clamp(58px, 9.2vw, 158px);
  position: relative;
  /* Living hero: base gold + a moving white sheen, both clipped to the text.
     Sheen parked off-screen until the hero is active (chapter 00) for perf. */
  background-image:
    linear-gradient(105deg, transparent 42%, rgba(255,255,255,.9) 50%, transparent 58%),
    linear-gradient(180deg, #fff 0%, #f5c542 50%, #e8a800 100%);
  background-size: 230% 100%, 100% 100%;
  background-position: 185% 0, 0 0;
  background-repeat: no-repeat;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 24px rgba(245,197,66,.34));
  will-change: transform, background-position, filter;
}
#above .spark-display em {
  font-weight: 900;
  background-image:
    linear-gradient(105deg, transparent 42%, rgba(255,255,255,.9) 50%, transparent 58%),
    linear-gradient(135deg, #ffd700 0%, #f5c542 30%, #ffe066 60%, #e8a800 100%);
  background-size: 230% 100%, 100% 100%;
  background-position: 185% 0, 0 0;
  background-repeat: no-repeat;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
/* animate only while the hero (chapter 00) is on screen */
body[data-chapter="0"] #above .spark-display { animation: heroSheen 6.5s ease-in-out infinite, heroGlow 4.6s ease-in-out infinite; }
body[data-chapter="0"] #above .spark-display em { animation: heroSheen 6.5s ease-in-out infinite; }
@keyframes heroSheen {
  0%   { background-position: -85% 0, 0 0; }
  15%  { background-position: 185% 0, 0 0; }
  100% { background-position: 185% 0, 0 0; }
}
@keyframes heroGlow {
  0%,100% { filter: drop-shadow(0 4px 24px rgba(245,197,66,.32)); }
  50%     { filter: drop-shadow(0 6px 46px rgba(245,197,66,.6)); }
}
/* Click / tap to SPARK — a gold flare blooms behind the title */
#above .spark-display::before {
  content: ''; position: absolute; left: 50%; top: 52%;
  width: 122%; height: 155%; transform: translate(-50%, -50%) scale(.55);
  background: radial-gradient(ellipse at center, rgba(255,224,140,.6) 0%, rgba(245,197,66,.22) 35%, transparent 66%);
  z-index: -1; pointer-events: none; opacity: 0; filter: blur(4px);
}
#above .spark-display.spark-flare::before { animation: heroFlare .7s ease-out; }
@keyframes heroFlare {
  0%   { opacity: .9; transform: translate(-50%, -50%) scale(.55); }
  100% { opacity: 0;  transform: translate(-50%, -50%) scale(1.5); }
}
@media (prefers-reduced-motion: reduce) {
  body[data-chapter="0"] #above .spark-display,
  body[data-chapter="0"] #above .spark-display em { animation: none; }
  #above .spark-display.spark-flare::before { animation: none; }
}
.lede, .body {
  font-size: clamp(16px, 1.5vw, 22px); line-height: 1.6;
  color: var(--ink-soft); max-width: 620px; margin: 34px 0 0;
}
.enter {
  display: inline-flex; gap: 28px; align-items: center;
  margin-top: 34px; padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,.35);
  text-decoration: none; font-size: 10px; letter-spacing: .2em; font-weight: 800;
  color: var(--ink);
  transition: border-color .3s ease, color .3s ease;
}
.enter:hover { border-color: var(--chapter-accent); color: var(--chapter-accent); }
.enter:hover .enter-arrow { transform: translateY(3px); }
.enter-arrow {
  color: var(--chapter-accent); font-size: 22px; line-height: 1;
  transition: transform .3s ease;
}
.hero-meta {
  position: absolute; bottom: 12vh; left: var(--pad); right: var(--pad);
  display: flex; justify-content: space-between; gap: 16px;
  border-top: 1px solid var(--line); padding-top: 15px;
}
.hero-meta .meta-dot {
  display: inline-block; width: 5px; height: 5px; border-radius: 50%;
  background: var(--cyan-cool); margin-right: 8px; vertical-align: middle;
  box-shadow: 0 0 8px var(--cyan-cool);
  animation: pulseDot 2s ease-in-out infinite;
}
.hero-stripe {
  position: absolute; left: var(--pad); right: var(--pad); bottom: 8vh;
  width: calc(100% - var(--pad) * 2); height: 12px;
  opacity: .35;
}

/* SPLIT CHAPTER (Canyons) */
.split { justify-content: space-between; gap: 8vw; }
.chapter-copy { width: min(820px, 72vw); position: relative; }
.chapter-copy .display { font-size: clamp(62px, 8.4vw, 136px); }
.number {
  display: block; color: #fff;
  font-family: Georgia, serif; font-size: 18px;
  margin-bottom: 28px; opacity: .85;
}
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.tag {
  font-size: 8px; letter-spacing: .18em; text-transform: uppercase;
  padding: 6px 10px; border: 1px solid var(--line-soft);
  color: var(--ink-soft); background: rgba(5,7,10,.4);
  border-radius: 2px;
  transition: border-color .25s ease, color .25s ease;
}
.tag:hover { border-color: var(--chapter-accent); color: var(--chapter-accent); }
.data-card {
  width: min(310px, 28vw); align-self: flex-end; margin-bottom: 15vh;
  border: 1px solid var(--line); background: rgba(5,7,10,.45);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  padding: 22px; position: relative;
}
.data-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--chapter-accent), transparent);
  opacity: .6;
}
.data-card > p { font-size: 9px; letter-spacing: .18em; color: #a2a7b0; margin: 0 0 24px; }
.data-card div { border-top: 1px solid rgba(255,255,255,.1); padding: 15px 0; }
.data-card strong {
  display: block; font-family: Georgia, serif;
  font-size: 36px; font-weight: 400; font-feature-settings: "tnum";
  color: var(--ink);
}
.data-card span { font-size: 8px; letter-spacing: .16em; color: #9ba1ab; }

/* UNDERGROUND */
.underground {
  justify-content: center; text-align: center;
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,.1) 20%, rgba(0,0,0,.45) 75%, transparent 100%);
}
.center-copy { display: flex; flex-direction: column; align-items: center; }
.center-copy .body { text-align: center; }
.platform-strip {
  position: absolute; bottom: 14vh; left: var(--pad); right: var(--pad);
  display: flex; align-items: center; gap: 18px;
  font-size: 9px; letter-spacing: .2em; color: #c9cbd0;
}
.platform-strip i { height: 1px; flex: 1; background: rgba(255,255,255,.25); }
.platform-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 12px var(--green);
  animation: pulseDot 2.4s ease-in-out infinite;
}
.platform-dot.alt { background: var(--yellow); box-shadow: 0 0 12px var(--yellow); animation-delay: .8s; }
.train-wipe-meter {
  position: absolute; left: 50%; bottom: 8vh;
  width: min(520px, 70vw); transform: translateX(-50%);
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px;
  font-size: 8px; letter-spacing: .18em; color: #8e969f;
}
.train-wipe-meter > i {
  display: block; height: 1px; background: rgba(255,255,255,.14);
  overflow: hidden; position: relative;
}
.train-wipe-meter > i > i {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--yellow), var(--cyan));
  transform-origin: left center;
  transform: scaleX(clamp(0, calc((var(--chapter-progress, 0) - .20) / .58), 1));
}
.twm-pct { font-feature-settings: "tnum"; min-width: 36px; text-align: right; color: var(--ink-soft); }

/* SIGNALS */
.signals { display: block; padding-top: 23vh; min-height: 235vh; } /* taller = slower cinematic glide past the cover-art billboards */
.wide-copy { width: min(1100px, 90vw); }
.signal-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin-top: 12vh; margin-left: auto; width: min(900px, 78vw);
}
.signal-grid article {
  min-height: 180px; border: 1px solid rgba(255,255,255,.18);
  padding: 20px; background: rgba(3,5,8,.4);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
  transition: border-color .3s ease, transform .3s ease;
}
.signal-grid article:hover {
  border-color: var(--chapter-accent);
  transform: translateY(-3px);
}
.signal-grid article::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--chapter-accent) 0%, transparent 60%);
  opacity: 0; transition: opacity .3s ease;
  pointer-events: none; mix-blend-mode: overlay;
}
.signal-grid article:hover::before { opacity: .08; }
.signal-grid article:nth-child(1) span { color: var(--cyan); }
.signal-grid article:nth-child(2) span { color: var(--yellow); }
.signal-grid article:nth-child(3) span { color: var(--red); }
.signal-grid span { font-family: Georgia, serif; font-size: 54px; }
.signal-grid p { font-size: 9px; letter-spacing: .14em; color: #b2b6be; }

/* PORTAL GRID */
.portal-grid {
  width: min(1240px, 92vw); margin: 10vh 0 0 auto;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 12px;
}
.portal-grid > .portal-card { flex: 1 1 210px; min-width: 200px; max-width: 300px; }
.portal-card {
  position: relative; min-height: 320px; overflow: hidden;
  border: 1px solid rgba(255,255,255,.18);
  background: transparent; isolation: isolate;
  transition: transform .5s cubic-bezier(.2,.75,.2,1), border-color .5s ease;
}
.portal-card::before {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(180deg, transparent 20%, rgba(3,5,8,.18) 56%, rgba(3,5,8,.95) 100%);
}
.portal-card::after {
  content: "LIVE CAMERA · REC";
  position: absolute; z-index: 4; top: 12px; right: 12px;
  padding: 5px 7px; border: 1px solid rgba(255,255,255,.18);
  color: #c7cbd1; background: rgba(3,5,8,.55);
  font-size: 7px; letter-spacing: .16em;
  display: flex; align-items: center; gap: 6px;
}
.portal-card::after { content: "● LIVE CAMERA · REC"; color: var(--red); }
.portal-view { position: absolute; inset: 0; z-index: 1; background: transparent; }
.portal-scan {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(180deg, transparent 49%, rgba(118,217,255,.18) 50%, transparent 51%);
  background-size: 100% 8px;
  animation: portalScan 4s linear infinite;
  opacity: .25; mix-blend-mode: screen;
}
@keyframes portalScan {
  from { background-position: 0 0; }
  to { background-position: 0 100%; }
}
.portal-copy { position: absolute; z-index: 3; left: 18px; right: 18px; bottom: 16px; }
.portal-copy span {
  display: block; color: var(--yellow); font-size: 8px; letter-spacing: .16em; margin-bottom: 7px;
}
.portal-card:nth-child(1) .portal-copy span { color: var(--cyan); }
.portal-card:nth-child(3) .portal-copy span { color: #ff706b; }
.portal-copy strong {
  display: block; font-family: Georgia, serif;
  font-size: clamp(26px, 3vw, 42px); font-weight: 400; letter-spacing: -.04em;
}
.portal-copy p { margin: 6px 0 0; color: #a7adb5; font-size: 9px; letter-spacing: .06em; }
.portal-corner {
  position: absolute; width: 14px; height: 14px;
  border: 1px solid var(--chapter-accent); z-index: 4;
}
.portal-corner--tl { top: 8px; left: 8px; border-right: none; border-bottom: none; }
.portal-corner--tr { top: 8px; right: 8px; border-left: none; border-bottom: none; }
.portal-corner--bl { bottom: 8px; left: 8px; border-right: none; border-top: none; }
.portal-corner--br { bottom: 8px; right: 8px; border-left: none; border-top: none; }
.portal-card:hover { transform: translateY(-5px); border-color: rgba(255,255,255,.42); }

/* ROOFTOPS */
.rooftops { align-items: flex-start; padding-top: 24vh; }
.quote {
  position: absolute; right: var(--pad); bottom: 14vh;
  width: min(480px, 38vw);
  font-family: Georgia, serif; font-size: clamp(22px, 3vw, 44px);
  font-style: italic; line-height: 1.15; margin: 0; color: #d8d7d1;
  position: absolute;
}
.quote-mark {
  width: 28px; height: 28px; color: var(--chapter-accent);
  display: block; margin-bottom: 8px; opacity: .8;
}
.wind-svg {
  position: absolute; left: var(--pad); bottom: 6vh;
  width: min(440px, 50vw); height: 80px; opacity: .6;
  pointer-events: none;
}

/* FINALE */
.finale { min-height: 160vh; justify-content: center; text-align: center; }
.final-copy { width: min(1200px, 92vw); display: flex; flex-direction: column; align-items: center; }
.final-copy .body { text-align: center; }
.final-copy .display { font-size: clamp(62px, 9vw, 150px); }
.footer {
  position: absolute; bottom: 32px; left: var(--pad); right: var(--pad);
  display: flex; justify-content: space-between;
  border-top: 1px solid var(--line); padding-top: 14px;
}
.finale-ripple {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 200px; height: 200px; border-radius: 50%;
  border: 1px solid var(--chapter-accent);
  opacity: 0; pointer-events: none;
}
.finale-ripple.fire { animation: finaleRipple 1.6s ease-out; }
@keyframes finaleRipple {
  0% { transform: translate(-50%,-50%) scale(.3); opacity: .8; }
  100% { transform: translate(-50%,-50%) scale(8); opacity: 0; }
}

/* ===========================================================
   REVEAL ANIMATION
   =========================================================== */
.reveal {
  opacity: 0; transform: translateY(28px); filter: blur(5px);
  transition: opacity .9s cubic-bezier(.2,.75,.2,1), transform 1s cubic-bezier(.2,.75,.2,1), filter .9s ease;
}
.reveal.visible { opacity: 1; transform: none; filter: none; }

/* ===========================================================
   BOOT SEQUENCE
   =========================================================== */
.boot {
  position: fixed; inset: 0; z-index: 50;
  background: #05070a;
  display: grid; place-items: center; align-content: center; gap: 22px;
  transition: opacity .8s ease, visibility .8s;
}
.boot.done { opacity: 0; visibility: hidden; }
.boot-grid {
  position: absolute; inset: 0;
  display: grid; grid-template-columns: repeat(10, 1fr); grid-template-rows: repeat(10, 1fr);
  opacity: .12;
  pointer-events: none;
}
.boot-grid span {
  border: 1px solid rgba(255,255,255,.08);
}
.boot-mark {
  font-family: var(--font-mark);
  font-size: 46px; font-weight: 900; letter-spacing: .04em;
  color: #fff;
  text-shadow: 0 0 30px rgba(245,197,66,.4);
}
.boot-mark span { color: var(--gold); margin-left: 4px; }
.boot-mark .boot-mind {
  background: linear-gradient(135deg, #ffd700 0%, #f5c542 30%, #ffe066 60%, #e8a800 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 900;
  margin-left: 2px;
}
/* Tie the loading-screen brand to the gothic hero for one cohesive entrance */
.spark-boot-mark { font-family: 'Grenze Gotisch', 'UnifrakturMaguntia', var(--font-mark); letter-spacing: .02em; }
.boot-line {
  width: 180px; height: 1px; background: #22262d; overflow: hidden;
}
.boot-line i {
  display: block; width: 100%; height: 100%;
  background: var(--yellow);
  transform: translateX(-100%);
  animation: load 1.4s cubic-bezier(.2,.8,.2,1) forwards;
}
.boot p {
  font-size: 8px; letter-spacing: .24em; color: #777f8b;
  text-transform: uppercase;
}
.boot-log {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 9px; color: #5b6371; letter-spacing: .08em;
  min-height: 60px; min-width: 280px; max-width: 360px;
  text-align: center; line-height: 1.7;
  opacity: .7;
}
@keyframes load { to { transform: none; } }

/* ===========================================================
   CHAPTER TRANSITION CARD
   =========================================================== */
/* Slim, futuristic chapter banner — pinned near the bottom so it names the
   section without blocking the center visuals. Slides up + fades, holds, then
   fades away on each chapter change. */
.chapter-card {
  position: fixed; z-index: 35; left: 50%; bottom: max(84px, 8.5vh); top: auto;
  transform: translateX(-50%);
  pointer-events: none;
  opacity: 0;
  max-width: 92vw;
  transition: opacity .5s ease;
}
.chapter-card.show {
  animation: ccIn 3s cubic-bezier(.2,.75,.2,1) forwards;
}
@keyframes ccIn {
  0%   { opacity: 0; transform: translateX(-50%) translateY(16px); }
  14%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  82%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}
.cc-inner {
  display: flex; flex-direction: row; align-items: center; gap: 14px;
  max-width: 100%;
  padding: 9px 20px 9px 17px;
  background: rgba(5,7,10,.52);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  box-shadow: 0 12px 40px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.03);
  position: relative;
  white-space: nowrap;
  overflow: hidden;
}
.cc-num {
  font-family: Georgia, serif; font-size: 12px; color: var(--chapter-accent);
  letter-spacing: .2em; flex: 0 0 auto;
}
.cc-line {
  display: block; width: 1px; height: 20px; flex: 0 0 auto;
  background: linear-gradient(180deg, transparent, var(--chapter-accent), transparent);
}
.cc-name {
  font-family: Georgia, serif; font-size: clamp(17px, 2vw, 27px);
  letter-spacing: -.02em; color: var(--ink);
  text-shadow: 0 2px 18px rgba(0,0,0,.6);
  flex: 0 0 auto;
}
.cc-sub {
  font-size: 8px; letter-spacing: .26em; text-transform: uppercase;
  color: var(--ink-soft); flex: 0 0 auto;
}
.cc-lyric {
  font-family: 'Cormorant Garamond', serif;
  font-size: 13px; font-style: italic;
  color: var(--gold-bright);
  letter-spacing: .02em;
  text-shadow: 0 0 12px var(--gold-glow);
  opacity: .85;
  flex: 0 1 auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis;
}

/* WEBGL STATUS (fallback) */
.webgl-status {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 30;
  padding: 10px 14px; border: 1px solid rgba(255,255,255,.16); border-radius: 999px;
  background: rgba(5,7,10,.86); color: #d9dce2;
  font-size: 10px; letter-spacing: .08em;
}
.skip-link {
  position: fixed; left: 16px; top: -60px; z-index: 100;
  background: #fff; color: #05070a;
  padding: 10px 14px; border-radius: 6px;
  font-size: 12px; font-weight: 800; text-decoration: none;
  transition: top .2s ease;
}
.skip-link:focus { top: 16px; }

/* NOWEBGL FALLBACK */
.no-webgl #world, .no-webgl .runtime-hud, .no-webgl .velocity-meter, .no-webgl .progress-meter { display: none; }
.no-webgl body { background: radial-gradient(circle at 70% 12%, #17222c 0, #070a0e 28%, #05070a 68%); }
.no-webgl .chapter::after {
  content: ""; position: absolute; inset: 10% 5%;
  border: 1px solid rgba(255,255,255,.05); pointer-events: none;
}

/* ===========================================================
   RESPONSIVE
   =========================================================== */
@media (max-width: 900px) {
  .chapter-rail { display: none; }
  .brand-name { display: none; }
  .quiet-button:nth-child(2) .lbl, .quiet-button:nth-child(3) .lbl { display: none; }
  .quiet-button:nth-child(4) .lbl { display: none; }
  .quiet-button { padding: 8px 9px; }
  .chapter { min-height: 135vh; padding: 18vh 24px 14vh; }
  .hero { min-height: 155vh; padding-top: 20vh; }
  .hero::before, .chapter::before {
    background: linear-gradient(180deg, rgba(3,5,8,.24), rgba(3,5,8,.08) 45%, rgba(3,5,8,.5));
  }
  .display { font-size: clamp(58px, 19vw, 108px); }
  .chapter-copy .display, .final-copy .display { font-size: clamp(54px, 16vw, 94px); }
  .lede, .body { font-size: 16px; width: min(92%, 520px); }
  .split { display: block; padding-top: 24vh; }
  .chapter-copy { width: 100%; }
  .data-card { width: 100%; max-width: 340px; margin: 12vh 0 0 auto; }
  .signal-grid { grid-template-columns: 1fr; width: 84%; margin-top: 8vh; }
  .signal-grid article { min-height: 110px; }
  .quote { width: 76%; right: 24px; bottom: 12vh; }
  .hero-meta { left: 24px; right: 24px; gap: 12px; flex-wrap: wrap; }
  .eyebrow { display: none; }
  .footer { left: 24px; right: 24px; gap: 10px; flex-direction: column; align-items: center; }
  .platform-strip { left: 24px; right: 24px; }
  .topbar { padding: 14px 18px; }
  .runtime-hud { left: 18px; bottom: 12px; max-width: 72vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .velocity-meter { left: 18px; bottom: 44px; }
  .velocity-meter .vm-track { width: 80px; }
  .progress-meter { right: 18px; top: 70px; }
  .progress-meter .pm-track { width: 40px; }
  .portal-grid { grid-template-columns: 1fr; width: 86%; margin-top: 8vh; }
  .portal-card { min-height: 180px; background: rgba(3,5,8,.58); }
  .portal-card::after { content: "PERSPECTIVE"; }
  .train-wipe-meter { width: calc(100% - 48px); }
  .chapter-card { bottom: max(72px, 7vh); max-width: 94vw; }
  .cc-inner { padding: 7px 14px; gap: 10px; }
  .cc-name { font-size: clamp(15px, 4.4vw, 21px); }
  .cc-sub { display: none; }
  .cc-lyric { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .film-grain { animation: none; }
  .reveal { transition: none; opacity: 1; transform: none; filter: none; }
  .pulse-dot, .platform-dot { animation: none; }
  .portal-card { transition: none; }
  .chapter-card.show { animation: none; opacity: 0; }
}

/* QUALITY-LOW REDUCTIONS */
body[data-quality="low"] .film-grain,
body[data-quality="low"] .cursor-glow,
body[data-quality="low"] .cursor-ring,
body[data-quality="low"] .film-scanlines { display: none; }
body[data-quality="low"] .portal-scan { display: none; }

/* ===========================================================
   v5: SPARK M!NDS PRODUCTIONS brand additions
   Streaming links rail (top, always visible) + finale CTA grid
   =========================================================== */

/* STREAMING LINKS RAIL — sits below topbar on the right */
.spark-links {
  position: fixed; top: 64px; right: var(--pad); z-index: 9;
  display: flex; gap: 6px; align-items: center;
  padding: 6px 8px;
  background: rgba(5,7,10,.5);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
}
.spark-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--ink-soft);
  text-decoration: none;
  font-family: var(--font-mark);
  font-size: 9px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  transition: color .25s ease, background .25s ease, box-shadow .25s ease;
  position: relative;
}
.spark-link svg {
  width: 14px; height: 14px;
  opacity: .85;
  transition: opacity .25s ease, transform .25s ease;
}
.spark-link .sl-label { line-height: 1; }
.spark-link:hover { color: #fff; background: rgba(255,255,255,.06); }
.spark-link:hover svg { opacity: 1; transform: scale(1.1); }
.spark-link::after {
  content: attr(data-tooltip);
  position: absolute; top: calc(100% + 8px); right: 0;
  padding: 5px 8px; border-radius: 4px;
  background: rgba(5,7,10,.95); border: 1px solid var(--line-soft);
  color: var(--ink-soft); font-size: 9px; letter-spacing: .1em;
  white-space: nowrap;
  opacity: 0; transform: translateY(-4px); transition: opacity .2s, transform .2s;
  pointer-events: none;
}
.spark-link:hover::after { opacity: 1; transform: none; }

/* Platform-specific accent colors on hover */
.spark-link.spark-spotify:hover { color: #1DB954; box-shadow: 0 0 16px -2px rgba(29,185,84,.4); }
.spark-link.spark-spotify:hover svg { color: #1DB954; }
.spark-link.spark-apple:hover { color: #fc3c44; box-shadow: 0 0 16px -2px rgba(252,60,68,.4); }
.spark-link.spark-apple:hover svg { color: #fc3c44; }
.spark-link.spark-soundcloud:hover { color: #ff5500; box-shadow: 0 0 16px -2px rgba(255,85,0,.4); }
.spark-link.spark-soundcloud:hover svg { color: #ff5500; }
.spark-link.spark-youtube:hover { color: #ff0000; box-shadow: 0 0 16px -2px rgba(255,0,0,.4); }
.spark-link.spark-youtube:hover svg { color: #ff0000; }
.spark-link.spark-sparkminds:hover { color: var(--gold-bright); box-shadow: 0 0 16px -2px var(--gold-glow); }
.spark-link.spark-sparkminds:hover svg { color: var(--gold-bright); }

/* SPARK CTA GRID — finale streaming buttons */
.spark-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 10px;
  margin: 40px auto 30px;
  max-width: 1060px;
  width: 100%;
}
.spark-cta .cta-btn { flex: 0 1 auto; min-width: 190px; }
.cta-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 18px;
  border: 1px solid var(--line-soft);
  background: rgba(5,7,10,.55);
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-mark);
  font-size: 11px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  transition: transform .25s ease, border-color .25s ease, color .25s ease, background .25s ease, box-shadow .25s ease;
  position: relative;
  overflow: hidden;
}
.cta-btn svg { width: 18px; height: 18px; opacity: .9; transition: opacity .25s ease, transform .25s ease; }
.cta-btn::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,.04) 50%, transparent 100%);
  opacity: 0; transition: opacity .3s ease;
  pointer-events: none;
}
.cta-btn:hover {
  transform: translateY(-2px);
  border-color: currentColor;
}
.cta-btn:hover::before { opacity: 1; }
.cta-btn:hover svg { opacity: 1; transform: scale(1.08); }
.cta-btn:active { transform: translateY(0); }

.cta-spotify { color: #1DB954; }
.cta-spotify:hover { background: rgba(29,185,84,.08); box-shadow: 0 8px 30px -10px rgba(29,185,84,.6); }
.cta-apple { color: #fc3c44; }
.cta-apple:hover { background: rgba(252,60,68,.08); box-shadow: 0 8px 30px -10px rgba(252,60,68,.6); }
.cta-youtube { color: #ff0000; }
.cta-youtube:hover { background: rgba(255,0,0,.08); box-shadow: 0 8px 30px -10px rgba(255,0,0,.6); }
.cta-soundcloud { color: #ff5500; }
.cta-soundcloud:hover { background: rgba(255,85,0,.08); box-shadow: 0 8px 30px -10px rgba(255,85,0,.6); }
.cta-sparkminds {
  color: var(--gold-bright);
  border-color: var(--gold-glow);
}
.cta-sparkminds:hover {
  background: rgba(245,197,66,.08);
  box-shadow: 0 8px 30px -10px var(--gold-glow);
}

/* SPARK boot mark — extra flourish */
.spark-boot-mark {
  display: flex; align-items: baseline; gap: 2px;
}
.spark-boot-mark .boot-mind { font-size: 38px; }

/* Responsive — hide streaming rail labels on small screens */
@media (max-width: 900px) {
  .spark-links { top: 56px; right: 12px; padding: 4px 6px; gap: 2px; }
  .spark-link { padding: 6px 8px; }
  .spark-link .sl-label { display: none; }
  .spark-link svg { width: 16px; height: 16px; }
  .spark-cta { grid-template-columns: 1fr 1fr; gap: 8px; }
  .cta-btn { padding: 12px 12px; font-size: 10px; }
  .cta-btn span { font-size: 9px; }
}
@media (max-width: 480px) {
  .spark-cta { grid-template-columns: 1fr; }
}

/* ===========================================================
   v6: SPARK M!NDS god-tier additions
   Music video grid + embedded Spotify player + VIP card + now playing feed
   =========================================================== */

/* MUSIC VIDEO GRID — Signals chapter */
.video-grid {
  width: min(1100px, 88vw);
  margin: 8vh auto 0;
  padding: 24px;
  border: 1px solid var(--line-soft);
  background: rgba(5,7,10,.5);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
}
.vg-title {
  font-family: var(--font-mark);
  font-size: 11px; font-weight: 700;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--gold-bright);
  margin: 0 0 18px;
  text-shadow: 0 0 12px var(--gold-glow);
}
.vg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.video-card {
  cursor: pointer;
  transition: transform .3s ease, border-color .3s ease;
  border: 1px solid var(--line-soft);
  overflow: hidden;
  background: rgba(0,0,0,.4);
}
.video-card:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
}
.vc-thumb {
  position: relative;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #0a0e14 0%, #14181e 50%, #0a0e14 100%);
  display: grid; place-items: center;
  overflow: hidden;
}
.vc-thumb::before {
  content: attr(data-yt-thumb);
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: var(--font-mark);
  font-size: 9px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: rgba(245,197,66,.5);
  padding: 12px;
  text-align: center;
}
.vc-thumb::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at center, transparent 30%, rgba(0,0,0,.6) 100%);
  pointer-events: none;
}
.vc-play {
  width: 48px; height: 48px;
  color: #fff;
  background: rgba(255,0,0,.85);
  border-radius: 50%;
  padding: 12px;
  z-index: 2;
  transition: transform .3s ease, background .3s ease;
  filter: drop-shadow(0 4px 12px rgba(255,0,0,.5));
}
.video-card:hover .vc-play {
  transform: scale(1.15);
  background: #ff0000;
}
.vc-duration {
  position: absolute; bottom: 8px; right: 8px;
  padding: 2px 6px;
  background: rgba(0,0,0,.85);
  color: #fff;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 10px;
  z-index: 2;
}
.vc-meta {
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.vc-meta strong {
  font-family: var(--font-mark);
  font-size: 13px; font-weight: 700;
  letter-spacing: .04em;
  color: var(--ink);
}
.vc-meta span {
  font-size: 9px; letter-spacing: .12em;
  color: var(--muted);
  text-transform: uppercase;
}
.vg-channel {
  display: inline-block;
  margin-top: 18px;
  font-family: var(--font-mark);
  font-size: 10px; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold-bright);
  text-decoration: none;
  transition: color .25s ease, transform .25s ease;
}
.vg-channel:hover { color: #fff; transform: translateX(4px); }

/* EMBEDDED SPOTIFY PLAYER — Finale */
.spark-player {
  margin: 30px auto;
  max-width: 720px;
  width: 100%;
  border: 1px solid var(--gold-glow);
  background: rgba(5,7,10,.7);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  overflow: hidden;
  position: relative;
}
.spark-player::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-bright), transparent);
  opacity: .7;
}
.sp-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.sp-label {
  font-family: var(--font-mark);
  font-size: 10px; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase;
  color: #1DB954;
  animation: pulseDot 2s ease-in-out infinite;
}
.sp-station {
  font-family: var(--font-mark);
  font-size: 9px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
}
.spark-player iframe {
  display: block;
  width: 100%;
  height: 380px;
  border: 0;
  background: #000;
}

/* VIP MEMBERSHIP CARD — Finale */
.vip-card {
  display: block;
  margin: 24px auto 30px;
  max-width: 720px;
  width: 100%;
  position: relative;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--gold-glow);
  background:
    radial-gradient(circle at top right, rgba(245,197,66,.08) 0%, transparent 50%),
    linear-gradient(135deg, rgba(20,15,5,.95) 0%, rgba(5,7,10,.95) 100%);
  overflow: hidden;
  transition: transform .35s ease, border-color .35s ease, box-shadow .35s ease;
}
.vip-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold-bright);
  box-shadow: 0 16px 50px -10px rgba(245,197,66,.4), 0 0 0 1px var(--gold-glow);
}
.vc-glow {
  position: absolute; top: -40%; right: -10%;
  width: 60%; height: 200%;
  background: radial-gradient(circle, var(--gold-glow) 0%, transparent 60%);
  opacity: .5;
  pointer-events: none;
  animation: vipGlowPulse 3s ease-in-out infinite;
}
@keyframes vipGlowPulse {
  0%, 100% { opacity: .3; transform: scale(1); }
  50% { opacity: .65; transform: scale(1.1); }
}
.vc-content {
  position: relative;
  display: flex; justify-content: space-between; align-items: center;
  padding: 24px 28px;
  gap: 24px;
}
.vc-left { flex: 1; min-width: 0; }
.vc-eyebrow {
  display: block;
  font-family: var(--font-mark);
  font-size: 9px; font-weight: 700;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--gold-bright);
  margin-bottom: 8px;
}
.vc-title {
  font-family: var(--font-mark);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 900; letter-spacing: .02em;
  margin: 0 0 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f5c542 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.vc-desc {
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin: 0;
}
.vc-right {
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
  flex-shrink: 0;
}
.vc-price {
  font-family: var(--font-mark);
  font-size: 32px; font-weight: 900;
  color: var(--gold-bright);
  letter-spacing: -.02em;
  text-shadow: 0 0 14px var(--gold-glow);
}
.vc-per {
  font-size: 14px; font-weight: 500;
  color: var(--muted);
  margin-left: 2px;
}
.vc-cta {
  display: inline-block;
  padding: 8px 16px;
  background: var(--gold-bright);
  color: #05070a;
  font-family: var(--font-mark);
  font-size: 10px; font-weight: 800;
  letter-spacing: .18em; text-transform: uppercase;
  transition: transform .25s ease, background .25s ease;
}
.vip-card:hover .vc-cta {
  transform: scale(1.05);
  background: #fff;
}

/* NOW PLAYING LIVE FEED — Finale */
.now-playing {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; flex-wrap: wrap;
  margin: 16px auto 30px;
  padding: 10px 18px;
  max-width: 720px;
  border: 1px solid var(--line-soft);
  background: rgba(5,7,10,.6);
  font-family: var(--font-mark);
  font-size: 10px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-soft);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.np-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #1DB954;
  box-shadow: 0 0 12px #1DB954;
  animation: pulseDot 1.6s ease-in-out infinite;
}
.np-label { color: #1DB954; font-weight: 700; }
.np-track {
  color: var(--gold-bright);
  font-weight: 700;
  letter-spacing: .18em;
}
.np-sep { color: rgba(255,255,255,.2); }
.np-listeners { color: var(--ink); font-feature-settings: "tnum"; }
.np-source { color: var(--muted); font-size: 9px; }

/* Responsive */
@media (max-width: 900px) {
  .video-grid { padding: 18px 14px; }
  .vg-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .vc-meta { padding: 10px 12px; }
  .vc-meta strong { font-size: 12px; }
  .spark-player iframe { height: 352px; }  /* >= Spotify's full-card threshold so the embed fills (no white gap on mobile) */
  .vc-content { flex-direction: column; align-items: flex-start; padding: 18px 20px; }
  .vc-right { flex-direction: row; align-items: center; width: 100%; justify-content: space-between; }
  .vc-price { font-size: 24px; }
  .now-playing { font-size: 9px; padding: 8px 12px; }
}
@media (max-width: 480px) {
  .vg-grid { grid-template-columns: 1fr; }
}

/* ===========================================================
   v7: SPARK M!NDS god-tier additions
   Tour dates scroller + merch grid + share buttons + FFT visualizer + custom spark cursor
   =========================================================== */

/* TOUR DATES SCROLLER — Canyons chapter */
.tour-dates {
  position: absolute;
  bottom: 12vh; left: var(--pad); right: var(--pad);
  max-width: 720px;
  width: auto;
}
.td-title {
  font-family: var(--font-mark);
  font-size: 11px; font-weight: 700;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--gold-bright);
  margin: 0 0 12px;
  text-shadow: 0 0 12px var(--gold-glow);
}
.td-scroller {
  display: flex; gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-dim) transparent;
}
.td-scroller::-webkit-scrollbar { height: 4px; }
.td-scroller::-webkit-scrollbar-track { background: transparent; }
.td-scroller::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 2px; }
.td-card {
  flex: 0 0 200px;
  padding: 14px 16px;
  background: rgba(5,7,10,.6);
  border: 1px solid var(--line-soft);
  display: flex; flex-direction: column; gap: 6px;
  transition: border-color .25s ease, transform .25s ease;
}
.td-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}
.td-date {
  font-family: var(--font-mark);
  font-size: 13px; font-weight: 700;
  letter-spacing: .14em;
  color: var(--gold-bright);
}
.td-venue {
  font-family: var(--font-mark);
  font-size: 12px; font-weight: 700;
  letter-spacing: .04em;
  color: var(--ink);
  line-height: 1.3;
}
.td-city {
  font-size: 9px; letter-spacing: .14em;
  color: var(--muted); text-transform: uppercase;
}
.td-tix {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 10px;
  background: var(--gold-bright);
  color: #05070a;
  font-family: var(--font-mark);
  font-size: 9px; font-weight: 800;
  letter-spacing: .14em;
  text-decoration: none;
  text-align: center;
  transition: transform .2s ease;
}
.td-tix:hover { transform: scale(1.05); }
.td-all {
  display: inline-block;
  margin-top: 12px;
  font-family: var(--font-mark);
  font-size: 10px; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold-bright);
  text-decoration: none;
  transition: transform .25s ease, color .25s ease;
}
.td-all:hover { color: #fff; transform: translateX(4px); }

/* MERCH GRID — Finale */
.merch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  max-width: 720px;
  margin: 24px auto;
}
.merch-card {
  display: flex; flex-direction: column;
  text-decoration: none;
  color: var(--ink);
  background: rgba(5,7,10,.5);
  border: 1px solid var(--line-soft);
  padding: 12px;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
  position: relative;
}
.merch-card:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
  box-shadow: 0 12px 30px -10px var(--gold-glow);
}
.mc-thumb {
  aspect-ratio: 1;
  background: linear-gradient(135deg, #0a0e14 0%, #1a1410 50%, #0a0e14 100%);
  position: relative;
  display: grid; place-items: center;
  margin-bottom: 10px;
  overflow: hidden;
}
.mc-thumb::before {
  content: attr(data-merch);
  font-family: var(--font-mark);
  font-size: 11px; font-weight: 700;
  letter-spacing: .18em;
  color: rgba(245,197,66,.4);
  text-align: center;
  padding: 12px;
}
.mc-thumb.alt {
  background: linear-gradient(135deg, #1a0e14 0%, #2a1410 50%, #0a0e14 100%);
}
.mc-tag {
  position: absolute; top: 8px; left: 8px;
  padding: 2px 6px;
  background: var(--gold-bright);
  color: #05070a;
  font-family: var(--font-mark);
  font-size: 8px; font-weight: 800;
  letter-spacing: .14em;
}
.mc-name {
  font-family: var(--font-mark);
  font-size: 12px; font-weight: 700;
  letter-spacing: .04em;
  color: var(--ink);
}
.mc-price {
  font-family: var(--font-mark);
  font-size: 14px; font-weight: 700;
  color: var(--gold-bright);
  margin-top: 2px;
}

/* SHARE ROW — Finale */
.share-row {
  display: flex; align-items: center; justify-content: center;
  gap: 14px;
  margin: 22px auto 16px;
  flex-wrap: wrap;
}
.sr-label {
  font-family: var(--font-mark);
  font-size: 10px; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted);
}
.sr-buttons { display: flex; gap: 8px; }
.share-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 1px solid var(--line-soft);
  background: rgba(5,7,10,.5);
  color: var(--ink-soft);
  text-decoration: none;
  transition: transform .2s ease, border-color .2s ease, color .2s ease, background .2s ease;
  position: relative;
}
.share-btn svg { width: 16px; height: 16px; }
.share-btn:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  color: var(--gold-bright);
}
.share-btn.copied {
  background: var(--gold-bright);
  color: #05070a;
  border-color: var(--gold-bright);
}
.share-btn.copied::after {
  content: "✓ COPIED";
  position: absolute; top: calc(100% + 6px); left: 50%;
  transform: translateX(-50%);
  padding: 3px 8px;
  background: var(--gold-bright);
  color: #05070a;
  font-family: var(--font-mark);
  font-size: 8px; font-weight: 800;
  letter-spacing: .14em;
  white-space: nowrap;
}
.share-twitter:hover { color: #fff; border-color: #fff; }
.share-facebook:hover { color: #1877f2; border-color: #1877f2; }

/* FFT VISUALIZER — bottom-right HUD when audio-reactive is on */
.fft-viz {
  position: fixed; z-index: 20;
  bottom: 22px; right: 80px;
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  background: rgba(5,7,10,.86);
  border: 1px solid var(--line-soft);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  font-family: var(--font-mark);
  pointer-events: none;
  min-width: 220px;
}
.fft-viz.visible { display: flex; }
.fft-label {
  font-size: 8px; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase;
  color: #1DB954;
}
.fft-canvas {
  display: block;
  width: 220px;
  height: 56px;
  background: rgba(0,0,0,.4);
}
.fft-stats {
  display: flex; align-items: center; gap: 6px;
  font-size: 8px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted);
}
.fft-stats span { color: var(--muted); }
.fft-stats b {
  color: var(--gold-bright);
  font-weight: 700;
  font-feature-settings: "tnum";
  min-width: 22px;
  text-align: right;
}

/* Custom SPARK M!ND cursor — gold spark that ignites on click */
.spark-cursor {
  position: fixed; z-index: 100;
  width: 14px; height: 14px;
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 100;
  mix-blend-mode: screen;
  transition: opacity .3s ease, transform .15s ease;
  opacity: 0;
}
@media (pointer: fine) {
  .spark-cursor { opacity: 1; }
  body, a, button { cursor: none; }
}
.spark-cursor::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle, var(--gold-bright) 0%, var(--gold) 30%, transparent 70%);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--gold-glow), 0 0 24px var(--gold-dim);
  animation: sparkPulse 2s ease-in-out infinite;
}
.spark-cursor::after {
  content: "";
  position: absolute; inset: -4px;
  background: radial-gradient(circle, transparent 30%, rgba(245,197,66,.2) 60%, transparent 80%);
  border-radius: 50%;
  animation: sparkPulse 2s ease-in-out infinite reverse;
}
@keyframes sparkPulse {
  0%, 100% { transform: scale(1); opacity: .9; }
  50% { transform: scale(1.3); opacity: .6; }
}
.spark-cursor.click {
  transform: translate(-50%, -50%) scale(2.2);
  filter: brightness(2);
}

/* Responsive */
@media (max-width: 900px) {
  .tour-dates { left: 24px; right: 24px; bottom: 8vh; max-width: 86vw; }
  .td-card { flex: 0 0 170px; padding: 10px 12px; }
  .merch-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .mc-thumb { aspect-ratio: 1; }
  .mc-name { font-size: 11px; }
  .fft-viz { right: 24px; bottom: 12px; min-width: 180px; }
  .fft-canvas { width: 180px; height: 44px; }
}
@media (max-width: 480px) {
  .merch-grid { grid-template-columns: 1fr; }
  .share-row { gap: 10px; }
  .share-btn { width: 32px; height: 32px; }
}

/* ===========================================================
   v8: SPARK M!NDS god-tier additions
   YouTube modal + Album modal + BTS overlay + Oscilloscope + lyric captions
   =========================================================== */

/* YOUTUBE EMBED MODAL */
.yt-modal, .album-modal {
  position: fixed; inset: 0; z-index: 80;
  display: none;
  align-items: center; justify-content: center;
  padding: 5vh 5vw;
}
.yt-modal.open, .album-modal.open { display: flex; }
.yt-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.yt-content, .album-content {
  position: relative;
  z-index: 2;
  width: min(960px, 100%);
  max-height: 90vh;
  background: rgba(5,7,10,.95);
  border: 1px solid var(--gold-glow);
  box-shadow: 0 30px 80px -10px rgba(0,0,0,.8), 0 0 30px var(--gold-glow);
  padding: 16px 18px 18px;
  overflow-y: auto;
}
.yt-close {
  position: absolute; top: 10px; right: 12px;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: rgba(0,0,0,.5);
  border: 1px solid var(--line-soft);
  color: var(--ink);
  font-size: 20px;
  cursor: pointer;
  z-index: 5;
  transition: background .2s, color .2s;
}
.yt-close:hover { background: var(--gold-bright); color: #05070a; }
.yt-title {
  font-family: var(--font-mark);
  font-size: 11px; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold-bright);
  margin: 0 0 12px;
  padding: 0 40px 0 0;
}
.yt-frame-wrap {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
}
.yt-frame-wrap iframe, .album-content iframe {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  border: 0;
}
.album-content iframe {
  position: relative;
  height: 380px;
  margin-top: 18px;
}
.yt-actions {
  display: flex; gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.yt-action {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--line-soft);
  background: rgba(255,255,255,.04);
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-mark);
  font-size: 9px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  transition: border-color .2s, color .2s, background .2s;
}
.yt-action:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
  background: rgba(245,197,66,.06);
}

/* ALBUM MODAL — header with cover art + stream buttons */
.album-header {
  display: flex; gap: 18px;
  padding: 4px 0 14px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 4px;
}
.album-cover {
  width: 180px; height: 180px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #0a0e14 0%, #1a1410 100%);
  border: 1px solid var(--line-soft);
  background-size: cover !important;
  background-position: center !important;
}
.album-meta { flex: 1; min-width: 0; }
.album-eyebrow {
  display: block;
  font-family: var(--font-mark);
  font-size: 9px; font-weight: 700;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--gold-bright);
  margin-bottom: 8px;
}
.album-title {
  font-family: var(--font-mark);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 900; letter-spacing: .02em;
  margin: 0 0 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f5c542 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.album-sub {
  font-family: var(--font-mark);
  font-size: 11px; letter-spacing: .14em;
  color: var(--muted);
  margin: 0 0 14px;
  text-transform: uppercase;
}
.album-stream-row {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.album-stream-btn {
  display: inline-block;
  padding: 7px 11px;
  border: 1px solid var(--line-soft);
  background: rgba(0,0,0,.4);
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-mark);
  font-size: 9px; font-weight: 700;
  letter-spacing: .14em;
  transition: border-color .2s, color .2s;
}
.album-stream-btn.spotify:hover { border-color: #1DB954; color: #1DB954; }
.album-stream-btn.apple:hover { border-color: #fc3c44; color: #fc3c44; }
.album-stream-btn.soundcloud:hover { border-color: #ff5500; color: #ff5500; }
.album-stream-btn.youtube:hover { border-color: #ff0000; color: #ff0000; }

/* BEHIND-THE-SCENES OVERLAY */
.bts-overlay {
  position: fixed; z-index: 70;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  display: none;
  pointer-events: auto;
}
.bts-overlay.open { display: block; }
.bts-panel {
  width: 320px;
  background: rgba(5,7,10,.94);
  border: 1px solid var(--gold-glow);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  padding: 18px 20px;
  box-shadow: 0 20px 50px -10px rgba(0,0,0,.7), 0 0 30px var(--gold-glow);
  font-family: var(--font-mark);
}
.bts-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
}
.bts-title {
  font-size: 11px; font-weight: 800;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--gold-bright);
  text-shadow: 0 0 12px var(--gold-glow);
}
.bts-sub {
  font-size: 8px; letter-spacing: .14em;
  color: var(--muted);
  text-transform: uppercase;
}
.bts-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.bts-stats > div {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 10px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--line-soft);
}
.bts-stats span {
  font-size: 7px; letter-spacing: .14em;
  color: var(--muted);
  text-transform: uppercase;
}
.bts-stats b {
  font-size: 13px; font-weight: 400;
  color: var(--ink);
  font-feature-settings: "tnum";
}
.bts-section {
  margin-bottom: 14px;
}
.bts-label {
  display: block;
  font-size: 8px; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.bts-spline {
  background: rgba(0,0,0,.4);
  border: 1px solid var(--line-soft);
  padding: 8px;
  position: relative;
}
.bts-spline canvas {
  display: block;
  width: 100%; height: 80px;
}
.bts-spline-sub {
  display: block;
  margin-top: 4px;
  font-size: 9px;
  color: var(--gold-bright);
  font-feature-settings: "tnum";
  text-align: right;
}
.bts-toggle {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer;
  font-size: 9px; letter-spacing: .12em;
  color: var(--ink-soft);
  text-transform: uppercase;
}
.bts-toggle input {
  accent-color: var(--gold-bright);
}
.bts-grades {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px;
}
.bts-grades > div {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 8px; color: var(--muted);
}
.bts-grades > div > i {
  display: block; width: 100%; height: 14px;
  border: 1px solid var(--line-soft);
}

/* OSCILLOSCOPE — circular waveform visualizer */
.osc-scope {
  position: fixed; z-index: 25;
  bottom: 22px; left: 50%; transform: translateX(-50%);
  display: none;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s ease;
}
.osc-scope.visible {
  display: block;
  opacity: 1;
}
.osc-canvas {
  display: block;
  width: 160px; height: 160px;
  filter: drop-shadow(0 0 20px var(--gold-glow));
}

/* Responsive */
@media (max-width: 900px) {
  .yt-content, .album-content { padding: 12px; max-height: 95vh; }
  .album-header { flex-direction: column; gap: 12px; }
  .album-cover { width: 100%; height: 200px; }
  .bts-panel { width: 280px; padding: 14px; }
  .bts-stats { grid-template-columns: repeat(2, 1fr); }
  .osc-scope { bottom: 100px; }
  .osc-canvas { width: 120px; height: 120px; }
}
@media (max-width: 480px) {
  .album-cover { height: 160px; }
  .bts-panel { width: calc(100vw - 32px); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SPARK M!NDS — App launcher, app hub, feed hand-off  (added for the universe)
═══════════════════════════════════════════════════════════════════════════ */

/* ⊞ APPS button in the topbar — gold, primary */
.apps-button {
  position: relative;
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid rgba(245,197,66,.55);
  color: var(--gold-warm); background: rgba(245,197,66,.08);
  padding: 8px 14px; border-radius: 999px;
  font-family: var(--font-mark);
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0 18px -6px var(--gold-glow);
  transition: border-color .25s, color .25s, background .25s, transform .25s, box-shadow .25s;
}
.apps-button .icon { width: 13px; height: 13px; color: var(--gold); }
.apps-button:hover { border-color: var(--gold); color: #fff; background: rgba(245,197,66,.16);
  transform: translateY(-1px); box-shadow: 0 0 26px -4px var(--gold-glow); }
.apps-button[aria-expanded="true"] { background: rgba(245,197,66,.2); border-color: var(--gold-bright); color:#fff; }
.apps-button::after {
  content: attr(data-tooltip);
  position: absolute; top: calc(100% + 8px); left: 0;
  padding: 5px 8px; border-radius: 4px;
  background: rgba(5,7,10,.95); border: 1px solid var(--line-soft);
  color: var(--ink-soft); font-size: 9px; letter-spacing: .1em; white-space: nowrap;
  opacity: 0; transform: translateY(-4px); transition: opacity .2s, transform .2s; pointer-events: none;
}
.apps-button:hover::after { opacity: 1; transform: none; }

/* Full-screen launcher overlay */
.app-launcher {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(16px, 4vw, 48px);
  background: radial-gradient(1200px 800px at 50% -10%, rgba(245,197,66,.09), transparent 60%), rgba(3,4,7,.82);
  backdrop-filter: blur(18px) saturate(130%); -webkit-backdrop-filter: blur(18px) saturate(130%);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .4s ease, visibility .4s ease;
}
.app-launcher.open { opacity: 1; visibility: visible; pointer-events: auto; }
.al-backdrop { position: absolute; inset: 0; }
body.al-lock { overflow: hidden; }

.al-panel {
  position: relative; z-index: 1;
  width: min(1040px, 100%); max-height: 88vh; overflow: hidden;
  display: flex; flex-direction: column;
  border: 1px solid rgba(245,197,66,.22); border-radius: 20px;
  background: linear-gradient(180deg, rgba(10,12,17,.96), rgba(6,8,12,.98));
  box-shadow: 0 40px 120px -30px rgba(0,0,0,.8), 0 0 0 1px rgba(255,255,255,.03) inset;
  transform: translateY(16px) scale(.985); transition: transform .45s cubic-bezier(.2,.8,.2,1);
}
.app-launcher.open .al-panel { transform: none; }
.al-close {
  position: absolute; top: 14px; right: 16px; z-index: 3;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(5,7,10,.6); color: var(--ink-soft);
  font-size: 22px; line-height: 1; cursor: pointer; transition: .2s;
}
.al-close:hover { border-color: var(--gold); color: #fff; transform: rotate(90deg); }
.al-head { padding: 30px clamp(22px,4vw,40px) 14px; border-bottom: 1px solid var(--line-soft); }
.al-eyebrow { font-family: var(--font-mark); font-size: 10px; letter-spacing: .34em; color: var(--gold); text-transform: uppercase; }
.al-title { font-family: var(--font-mark); font-weight: 900; font-size: clamp(26px, 4.4vw, 40px);
  letter-spacing: .06em; color: var(--ink); margin: 8px 0 4px; text-shadow: 0 0 26px rgba(245,197,66,.22); }
.al-sub { color: var(--muted); font-size: 13px; letter-spacing: .02em; }
.al-scroll { overflow-y: auto; padding: 18px clamp(22px,4vw,40px) 32px; }
.al-group { margin-top: 22px; }
.al-group:first-child { margin-top: 6px; }
.al-gtitle { font-family: var(--font-mark); font-size: 10px; letter-spacing: .28em; color: var(--muted);
  text-transform: uppercase; margin-bottom: 12px; padding-left: 2px; }
.al-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }

/* App tile — shared by launcher + finale hub */
.app-tile {
  --tile: var(--gold);
  position: relative; display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: 14px; text-decoration: none;
  border: 1px solid var(--line); background: rgba(255,255,255,.02);
  transition: border-color .25s, background .25s, transform .25s, box-shadow .25s;
}
.app-tile:hover {
  border-color: color-mix(in srgb, var(--tile) 70%, transparent);
  background: color-mix(in srgb, var(--tile) 9%, rgba(255,255,255,.02));
  transform: translateY(-2px);
  box-shadow: 0 14px 34px -18px var(--tile), 0 0 0 1px color-mix(in srgb, var(--tile) 30%, transparent) inset;
}
.at-badge {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 11px;
  display: grid; place-items: center; font-size: 20px; line-height: 1;
  color: var(--tile);
  background: color-mix(in srgb, var(--tile) 14%, rgba(0,0,0,.3));
  border: 1px solid color-mix(in srgb, var(--tile) 45%, transparent);
  box-shadow: 0 0 18px -6px var(--tile);
}
.at-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.at-name { font-family: var(--font-mark); font-weight: 700; font-size: 13px; letter-spacing: .07em; color: var(--ink); }
.at-desc { font-size: 11.5px; color: var(--muted); letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.at-go { margin-left: auto; color: var(--muted); font-size: 15px; transition: color .25s, transform .25s; }
.app-tile:hover .at-go { color: var(--tile); transform: translate(2px,-2px); }

/* Streaming row in launcher */
.al-stream { display: flex; flex-wrap: wrap; gap: 10px; }
.al-splink {
  font-family: var(--font-mark); font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-soft); text-decoration: none; padding: 9px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255,255,255,.02); transition: .22s;
}
.al-splink:hover { border-color: var(--gold); color: #fff; background: rgba(245,197,66,.08); }

/* Finale app hub (inline, above the feed hand-off) */
.spark-hub { margin: 40px 0 8px; }
.hub-head { text-align: center; margin-bottom: 20px; }
.hub-eyebrow { font-family: var(--font-mark); font-size: 10px; letter-spacing: .34em; color: var(--gold); text-transform: uppercase; }
.hub-title { font-family: var(--font-mark); font-weight: 900; font-size: clamp(22px,4vw,34px); letter-spacing: .06em;
  color: var(--ink); margin: 8px 0 6px; text-shadow: 0 0 26px rgba(245,197,66,.22); }
.hub-sub { color: var(--muted); font-size: 13px; }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; max-width: 940px; margin: 0 auto; }
.hub-all {
  display: block; margin: 22px auto 0; cursor: pointer;
  font-family: var(--font-mark); font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold-warm); background: rgba(245,197,66,.07);
  border: 1px solid rgba(245,197,66,.45); border-radius: 999px; padding: 12px 26px; transition: .25s;
}
.hub-all:hover { border-color: var(--gold); color: #fff; background: rgba(245,197,66,.16); transform: translateY(-1px); }

/* Finale enter buttons (feed hand-off) */
.finale-enters { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; margin-top: 30px; }
.feed-enter .enter-arrow { animation: feedBob 1.8s ease-in-out infinite; }
@keyframes feedBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(4px); } }
.ghost-enter { opacity: .6; }
.ghost-enter:hover { opacity: 1; }

/* Finale app rail — wrap into a centered grid so every card shows (no side-scroll cut-off) */
.spark-hub .presents-grid { display: flex; flex-wrap: wrap; justify-content: center; align-items: stretch;
  overflow: visible; max-width: 1060px; margin: 0 auto; gap: 12px; padding: 4px 0; }
.spark-hub .presents-card { flex: 0 0 auto; width: 168px; height: 116px; }
.spark-hub .presents-grid::after { display: none; }

/* Generic animated scene for apps without a bespoke live scene (studios/shop).
   Driven by --gen accent so each card feels part of the same system. */
.spark-gen-scene{ position:absolute; inset:0; overflow:hidden; display:flex; flex-direction:column;
  align-items:center; justify-content:center; gap:5px;
  background:linear-gradient(160deg,#05060b 0%,#0a0c15 55%,#06070d 100%); }
.spark-gen-scene::before{ content:''; position:absolute; inset:0;
  background:radial-gradient(ellipse 60% 55% at 50% 44%, color-mix(in srgb, var(--gen,#f5c542) 24%, transparent), transparent 66%);
  animation:genGlow 3.6s ease-in-out infinite; }
.spark-gen-scene::after{ content:''; position:absolute; inset:0; pointer-events:none;
  background:repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(255,255,255,.02) 3px, rgba(255,255,255,.02) 4px);
  animation:genScan 9s linear infinite; }
.gen-glyph{ position:relative; z-index:2; font-size:24px; line-height:1; color:var(--gen,#f5c542);
  filter:drop-shadow(0 0 10px var(--gen,#f5c542)); animation:genFloat 4s ease-in-out infinite; }
.gen-title{ position:relative; z-index:2; font-family:var(--font-mark,'Orbitron',sans-serif);
  font-size:12px; font-weight:800; letter-spacing:.12em; color:#fff; text-shadow:0 0 10px rgba(255,255,255,.12); }
.gen-corner{ position:absolute; width:7px; height:7px; border:1px solid color-mix(in srgb, var(--gen,#f5c542) 45%, transparent); z-index:2; }
.gen-corner.tl{ top:4px; left:4px; border-right:none; border-bottom:none; }
.gen-corner.tr{ top:4px; right:4px; border-left:none; border-bottom:none; }
.gen-corner.bl{ bottom:4px; left:4px; border-right:none; border-top:none; }
.gen-corner.br{ bottom:4px; right:4px; border-left:none; border-top:none; }
@keyframes genGlow{ 0%,100%{ opacity:.55; transform:scale(1); } 50%{ opacity:1; transform:scale(1.07); } }
@keyframes genScan{ 0%{ background-position:0 0; } 100%{ background-position:0 120px; } }
@keyframes genFloat{ 0%,100%{ transform:translateY(0); } 50%{ transform:translateY(-3px); } }

/* Restore the native cursor on the full-screen overlays — the custom spark cursor
   renders behind them, so without this the pointer vanishes over the launcher + feed. */
.app-launcher, .app-launcher *, #spark-feed, #spark-feed * { cursor: auto; }
.app-launcher a, .app-launcher button, .app-tile, .apps-button, .account-button,
#spark-feed a, #spark-feed button, #spark-feed [role="button"], #spark-feed .sf-card,
#sfReveal, #sfBar *, #sfRail * { cursor: pointer; }
#spark-feed input, #spark-feed textarea { cursor: text; }

@media (max-width: 560px) {
  .al-grid, .hub-grid { grid-template-columns: 1fr; }
  .at-desc { white-space: normal; }
  .apps-button .lbl { display: inline; }
}

/* ── TEMPORARILY HIDDEN (per request — restore by deleting this block) ──
   Merch cards (NERVES TEE / SPARK HOODIE / M!NDS VINYL) + the finale
   "05 / THE OTHER SIDE" intro kicker and its descriptive paragraph. */
#bridge .merch-grid { display: none !important; }
#bridge .final-copy > .kicker { display: none !important; }
#bridge .final-copy > .display { display: none !important; }
#bridge .final-copy > .body { display: none !important; }
#canyons .data-card { display: none !important; } /* "SIMULATION / STREET GRID" stats panel */

/* Request-a-show subtitle */
.td-sub { color: var(--muted); font-size: 13px; max-width: 560px; margin: 6px 0 14px; letter-spacing: .01em; line-height: 1.5; }
.td-all[data-req] { cursor: pointer; }

/* ═══ MOBILE READY ═══ */
@media (max-width: 720px) {
  /* Top bar: scroll the whole button row horizontally so nothing is cut off */
  .topbar { padding: 10px 12px; gap: 8px; }
  .brand { flex: 0 0 auto; }
  .topbar-actions {
    flex: 1 1 auto; min-width: 0; justify-content: flex-start;
    overflow-x: auto; overflow-y: hidden; flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 10px, #000 calc(100% - 16px), transparent 100%);
            mask-image: linear-gradient(90deg, transparent 0, #000 10px, #000 calc(100% - 16px), transparent 100%);
  }
  .topbar-actions::-webkit-scrollbar { display: none; }
  .topbar-actions > * { flex: 0 0 auto; }
  /* tooltips get clipped inside the scroller — drop them on touch */
  .quiet-button::after, .apps-button::after, .account-button::after, #spkMusicToggle::after { display: none; }
  /* Streaming links are THE POINT — access to the music + the artist. Keep them
     always visible on mobile as a compact, tappable icon row (never hidden). */
  .spark-links {
    display: flex; flex-direction: row; flex-wrap: nowrap; align-items: center;
    top: 52px; right: 10px; left: auto; gap: 5px; padding: 5px 8px;
    background: rgba(5,7,10,.62); border: 1px solid rgba(255,255,255,.1); border-radius: 999px;
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  }
  .spark-links .sl-label { display: none; }
  .spark-link { width: 33px; height: 33px; padding: 0; justify-content: center; }
  .spark-link svg { width: 17px; height: 17px; }
  .progress-meter { display: none; } /* free the top-right so the links sit clean */

  /* MUSIC hub: full-screen with a header that wraps instead of overflowing */
  #smMusicHub { padding: 0; }
  .smh-shell { width: 100%; height: 100dvh; max-height: 100dvh; border-radius: 0; border-left: 0; border-right: 0; }
  .smh-header { flex-wrap: wrap; gap: 8px; padding: 12px 14px; }
  .smh-title { flex: 1 1 100%; }
  .smh-body { padding: 14px; gap: 14px; }
  .smh-disco { grid-template-columns: repeat(2, 1fr); }

  /* App launcher: comfortable single/paired columns */
  .al-panel { max-height: 92vh; }
}
