/* ============================================================
   ThePhrequency — Base (tokens, reset, typography)
   Premium broadcast command center: navy/near-black + RED dominant,
   metallic console feeling, inset panels, edge lighting.
   ============================================================ */

:root {
  /* Core background ramp — deep navy to near-black */
  --bg-0: #03040a;
  --bg-1: #060912;
  --bg-2: #0a0f1c;
  --bg-3: #0e1426;
  --bg-elev: #0b1322;

  /* Metallic panel surfaces — layered depth */
  --panel-base:      #0b1220;
  --panel-raised:    #0f1828;
  --panel-inset:     #060a14;
  --panel-edge:      rgba(220, 38, 38, 0.28);
  --panel-edge-hot:  rgba(220, 38, 38, 0.55);
  --panel-edge-dim:  rgba(255, 255, 255, 0.05);
  --panel-edge-mute: rgba(255, 255, 255, 0.08);

  /* Illuminated red system — the dominant interface accent */
  --red-50:  #fff1f1;
  --red-100: #fca5a5;
  --red-200: #f87171;
  --red-300: #f43f5e;
  --red-400: #ef4444;
  --red-500: #dc2626;
  --red-600: #b91c1c;
  --red-700: #7f1d1d;
  --red-800: #5b1414;
  --red-900: #3a0d0d;
  --red-glow:       rgba(239, 68, 68, 0.55);
  --red-glow-soft:  rgba(220, 38, 38, 0.22);
  --red-glow-faint: rgba(220, 38, 38, 0.08);
  --red-glow-ghost: rgba(220, 38, 38, 0.04);

  /* Burgundy / dark-red container fills */
  --burg-1: #1a0606;
  --burg-2: #220808;
  --burg-3: #2c0a0a;

  /* Text */
  --text:       #eef2ff;
  --text-mute:  rgba(238, 242, 255, 0.62);
  --text-dim:   rgba(238, 242, 255, 0.36);
  --text-faint: rgba(238, 242, 255, 0.18);
  --text-red:   var(--red-100);

  /* Status */
  --state-online:  #34d399;
  --state-onair:   #ef4444;
  --state-offline: #6b7280;
  --state-mock:    #f59e0b;

  /* Motion */
  --ease:      cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 0.12s;
  --dur: 0.22s;
  --dur-slow: 0.42s;

  /* Radii */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;

  /* Fonts */
  --font-display: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', Menlo, monospace;
  --font-display-heavy: 'Inter', 'Helvetica Neue', sans-serif;

  /* Shadows — metallic depth */
  --shadow-1: 0 1px 2px rgba(0,0,0,0.5);
  --shadow-2: 0 6px 18px rgba(0,0,0,0.5);
  --shadow-3: 0 18px 44px rgba(0,0,0,0.6);
  --shadow-inset: inset 0 1px 0 rgba(255,255,255,0.04), inset 0 -1px 0 rgba(0,0,0,0.5);
  --shadow-inset-deep: inset 0 2px 4px rgba(0,0,0,0.6), inset 0 -1px 0 rgba(255,255,255,0.03);
  --shadow-red: 0 0 24px var(--red-glow-soft), 0 0 2px var(--red-glow);
  --shadow-red-strong: 0 0 32px var(--red-glow), 0 0 4px var(--red-glow);
  --shadow-panel: 0 10px 30px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.03);

  /* Console grid overlay (subtle) */
  --grid-line: rgba(220, 38, 38, 0.025);

  /* ============================================================
     JUKEBOX EXTENSIONS — share with Dashboard for "same machine" feel
     ============================================================ */

  /* Chassis — darker graphite than Dashboard's --metal-0 */
  --jukebox-chassis: #0a0a0f;
  --jukebox-chassis-raised: #12121a;
  --jukebox-chassis-inset: #080810;
  --jukebox-chassis-edge: rgba(220, 38, 38, 0.35);
  --jukebox-chassis-edge-hot: rgba(220, 38, 38, 0.65);
  --jukebox-chassis-edge-dim: rgba(255, 255, 255, 0.04);

  /* Ivory/cream song strips — THE KEY VISUAL DIFFERENTIATOR */
  --strip-ivory: #fdf6e3;
  --strip-ivory-warm: #faf0d8;
  --strip-ivory-shadow: #e8dbc5;
  --strip-ink: #1a1a1a;
  --strip-ink-muted: #3d3d3d;
  --strip-accent-red: #dc2626;
  --strip-accent-red-soft: rgba(220, 38, 38, 0.15);
  --strip-accent-red-glow: rgba(220, 38, 38, 0.35);

  /* Selector plates (A1-B12) — mechanical red */
  --selector-bg: #0a0a0f;
  --selector-fg: #fdf6e3;
  --selector-accent: #dc2626;
  --selector-glow: rgba(220, 38, 38, 0.4);

  /* Pagination console */
  --console-bg: #08080f;
  --console-raised: #11111a;
  --console-btn: #0f1116;
  --console-btn-hover: #181a1f;
  --console-btn-active: #dc2626;
  --console-display: #0a0a0f;
  --console-display-fg: #fdf6e3;

  /* Physical center hinge */
  --hinge-bg: #06060a;
  --hinge-highlight: rgba(255, 255, 255, 0.06);
  --hinge-shadow: rgba(0, 0, 0, 0.8);
  --hinge-screw: rgba(255, 255, 255, 0.12);

  /* Station indicator lamps */
  --lamp-phreak: #00d4aa;
  --lamp-smokey: #8b5cf6;
  --lamp-crash: #ef4444;
  --lamp-killer: #f97316;
  --lamp-dim: rgba(255, 255, 255, 0.12);
  --lamp-glow: rgba(255, 255, 255, 0.08);

  /* Active track */
  --active-strip-glow: rgba(220, 38, 38, 0.25);
  --active-strip-border: #dc2626;

  /* Red tube lighting — vertical illuminated tubes */
  --tube-red: #dc2626;
  --tube-red-glow: rgba(220, 38, 38, 0.4);
  --tube-red-faint: rgba(220, 38, 38, 0.06);

  /* Typography scales */
  --strip-title-size: 0.82rem;
  --strip-artist-size: 0.68rem;
  --strip-duration-size: 0.62rem;
  --selector-code-size: 0.6rem;
  --selector-label-size: 0.55rem;

  /* Spacing — 1920x1080 optimized */
  --strip-height: 39px;
  --strip-gap: 4px;
  --bank-padding: 12px;
  --hinge-width: 32px;
  --console-height: 110px;
  --page-padding-v: 12px;
  --readout-height: 44px;
  --filter-panel-height: 48px;
  --chassis-gap: 12px;
  --bank-label-height: 36px;

  /* Animation */
  --flip-duration: 0.45s;
  --flip-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --flip-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Mechanical bevel system */
  --bevel-light: rgba(255,255,255,0.06);
  --bevel-light-strong: rgba(255,255,255,0.12);
  --bevel-dark: rgba(0,0,0,0.7);
  --bevel-dark-strong: rgba(0,0,0,0.9);
  --seam-red: rgba(220,38,38,0.25);
  --seam-red-hot: rgba(220,38,38,0.5);
  --cavity-deep: rgba(0,0,0,0.85);

  /* Tube ferrules */
  --tube-width: 10px;
  --tube-ferrule-height: 12px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  min-height: 100%;
  font-family: var(--font-display);
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(220,38,38,0.10), transparent 60%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(127,29,29,0.08), transparent 60%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Subtle broadcast-grid texture behind everything */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 20%, transparent 90%);
}

h1, h2, h3, h4 { font-weight: 700; letter-spacing: -0.015em; line-height: 1.12; }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.65rem; }
h3 { font-size: 1.1rem; }
a { color: inherit; text-decoration: none; }
code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: rgba(220,38,38,0.10);
  color: var(--red-100);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  border: 1px solid var(--red-glow-ghost);
}
p { line-height: 1.5; }

::selection { background: var(--red-glow); color: #fff; }

/* Scrollbars — metallic red */
* { scrollbar-width: thin; scrollbar-color: var(--red-700) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: var(--panel-inset); }
*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--red-600), var(--red-800));
  border-radius: 4px;
  border: 1px solid var(--red-900);
}
*::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, var(--red-500), var(--red-700)); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}