/* ═══════════════════════════════════════════════════════════════
   theme.css — hue-based design tokens + light/dark mode
   ═══════════════════════════════════════════════════════════════ */

:root {
  --hue: 210;

  /* Accent palette (hue-driven) */
  --accent:        hsl(var(--hue), 80%, 58%);
  --accent-dim:    hsl(var(--hue), 70%, 48%);
  --accent-bright: hsl(var(--hue), 90%, 70%);
  --accent-glow:   hsl(var(--hue), 80%, 58%, 0.18);
  --accent-faint:  hsl(var(--hue), 60%, 58%, 0.08);
  --accent-text:   hsl(var(--hue), 90%, 80%);

  /* Typography */
  --font-ui:   'Syne', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Sizing */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  18px;

  /* Transitions */
  --t-fast: 120ms ease;
  --t-med:  220ms ease;
}

/* ── DARK THEME (default) ────────────────────────────────────── */
[data-theme="dark"] {
  --bg-base:      #0d0e10;
  --bg-surface:   #141517;
  --bg-raised:    #1c1d20;
  --bg-hover:     #24252a;
  --bg-active:    #2c2d33;

  --border:       rgba(255,255,255,0.07);
  --border-mid:   rgba(255,255,255,0.12);
  --border-hi:    rgba(255,255,255,0.22);

  --text-primary:   #e8e9ec;
  --text-secondary: #9a9ba6;
  --text-muted:     #5a5b66;
  --text-accent:    var(--accent-text);

  --wave-fill:     hsl(var(--hue), 70%, 52%);
  --wave-stroke:   hsl(var(--hue), 80%, 68%);
  --sel-fill:      hsl(var(--hue), 70%, 50%, 0.22);
  --sel-border:    hsl(var(--hue), 80%, 65%, 0.7);
  --playhead:      hsl(45, 95%, 62%);
  --grid-line:     rgba(255,255,255,0.04);
  --grid-text:     #404150;

  --scrollbar-track: #1a1b1f;
  --scrollbar-thumb: #35363d;

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.5);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.6);
  --shadow-lg:  0 8px 40px rgba(0,0,0,0.7);
}

/* ── LIGHT THEME ─────────────────────────────────────────────── */
[data-theme="light"] {
  --bg-base:      #f0f1f5;
  --bg-surface:   #f8f9fc;
  --bg-raised:    #ffffff;
  --bg-hover:     #ecedf2;
  --bg-active:    #e2e3ea;

  --border:       rgba(0,0,0,0.07);
  --border-mid:   rgba(0,0,0,0.13);
  --border-hi:    rgba(0,0,0,0.22);

  --text-primary:   #1a1b22;
  --text-secondary: #5c5d6e;
  --text-muted:     #9a9baa;
  --text-accent:    hsl(var(--hue), 65%, 38%);

  --wave-fill:     hsl(var(--hue), 65%, 48%);
  --wave-stroke:   hsl(var(--hue), 70%, 40%);
  --sel-fill:      hsl(var(--hue), 65%, 50%, 0.15);
  --sel-border:    hsl(var(--hue), 70%, 42%, 0.6);
  --playhead:      hsl(32, 95%, 45%);
  --grid-line:     rgba(0,0,0,0.05);
  --grid-text:     #bbbcc8;

  --scrollbar-track: #e4e5ec;
  --scrollbar-thumb: #c0c1cc;

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.12);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.14);
  --shadow-lg:  0 8px 40px rgba(0,0,0,0.18);
}

/* ── BASE RESET ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font-ui);
  font-size: 13px;
  background: var(--bg-base);
  color: var(--text-primary);
  transition: background var(--t-med), color var(--t-med);
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }

input[type="range"] {
  -webkit-appearance: none;
  height: 3px;
  background: var(--bg-active);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  flex: 1;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  cursor: pointer;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}
input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 0 5px var(--accent-glow);
}

button { cursor: pointer; font-family: var(--font-ui); }

kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--bg-active);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  padding: 2px 5px;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}
