/* DAWcord design tokens.
   The mode (dark / light) switches with `data-mode`; the DAW accent with `data-accent`.
   Everything else in the stylesheets reads these variables and nothing else. */

:root {
  color-scheme: dark;

  /* Type: a 1.25 scale, three weights. */
  --font-body: "IBM Plex Sans", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --font-brand: "Poppins", var(--font-body);
  --font-mono: "Cascadia Mono", "Consolas", ui-monospace, monospace;

  --text-caption: 12px; /* LED captions, timestamps, field hints */
  --text-body: 15px; /* interface text */
  --text-lead: 19px; /* section titles, KPI values */
  --text-title: 24px; /* page title */
  --text-display: 30px; /* project name, session timer */

  --leading-tight: 1.2;
  --leading-body: 1.5;
  --track-caps: 0.08em;
  --track-ui: 0.01em;
  --track-display: -0.02em;

  --weight-read: 400;
  --weight-ui: 500;
  --weight-strong: 600;

  /* Space: a 4 px base. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-pill: 999px;

  /* Motion: 80 ms press, 150 ms state, 220 ms entering. */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --dur-press: 80ms;
  --dur-state: 150ms;
  --dur-enter: 220ms;

  /* Layout */
  --sidebar-width: 216px;
  --titlebar-height: 40px;
  --preview-width: 336px;
}

/* ---- Surfaces and text ------------------------------------------------------------------ */

:root,
:root[data-mode="dark"] {
  --bg-0: #15191e; /* window background */
  --bg-1: #1c2128; /* sidebar, caption strips, wells */
  --bg-2: #242a32; /* panels */
  --bg-3: #2f3741; /* controls at rest */
  --bg-4: #3a444f; /* controls on hover */
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --fg-1: #eef1f4;
  --fg-2: #b3bcc6;
  --fg-3: #93a0ad;
  --live: #5bd671;
  --live-text: #74e187;
  --idle: #56a8f5;
  --idle-text: #78baf7;
  --warn: #f4bc41;
  --danger: #ff6b5e;
  --danger-text: #ff8579;
  --off: #77828f;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.38);
  --inset-top: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  --inset-well: inset 0 1px 3px rgba(0, 0, 0, 0.45);
}

:root[data-mode="light"] {
  color-scheme: light;
  --bg-0: #e7eaee;
  --bg-1: #f0f2f5;
  --bg-2: #fbfbfc;
  --bg-3: #e0e4e9;
  --bg-4: #d1d8df;
  --line: rgba(18, 24, 31, 0.1);
  --line-strong: rgba(18, 24, 31, 0.18);
  --fg-1: #151a20;
  --fg-2: #424d58;
  --fg-3: #5a6672;
  --live: #178a43;
  --live-text: #13703a;
  --idle: #1f6fbf;
  --idle-text: #1a5c9d;
  --warn: #7c5500;
  --danger: #c2362a;
  --danger-text: #ab2c22;
  --off: #626c76;
  --shadow: 0 10px 28px rgba(20, 26, 33, 0.14);
  --inset-top: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  --inset-well: inset 0 1px 3px rgba(20, 26, 33, 0.16);
}

/* OLED: the window and the sidebar are pure black; panels lift off it just enough to read. */
:root[data-mode="oled"] {
  color-scheme: dark;
  --bg-0: #000000; /* window background */
  --bg-1: #000000; /* sidebar, caption strips */
  --bg-2: #0a0b0d; /* panels */
  --bg-3: #15171b; /* controls at rest */
  --bg-4: #202329; /* controls on hover */
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.13);
  --fg-1: #eef1f4;
  --fg-2: #b3bcc6;
  --fg-3: #8f9cab;
  --live: #5bd671;
  --live-text: #74e187;
  --idle: #56a8f5;
  --idle-text: #78baf7;
  --warn: #f4bc41;
  --danger: #ff6b5e;
  --danger-text: #ff8579;
  --off: #6b7683;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.8);
  --inset-top: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --inset-well: inset 0 1px 3px rgba(0, 0, 0, 0.7);
}

/* ---- Accents: one per DAW, the brand one when no DAW runs --------------------------------- */
/* `--accent` fills controls; `--accent-text` is the same hue tuned to 4.5:1 as text. */

:root,
:root[data-accent="dawcord"] {
  --accent: #8834f5;
  --accent-text: #bb90ff;
  --accent-2: #a1affd;
  --on-accent: #ffffff;
}
:root[data-accent="fl_studio"] {
  --accent: #ff7e1b;
  --accent-text: #ff9a4d;
  --accent-2: #bdc7db;
  --on-accent: #1b1105;
}
:root[data-accent="ableton"] {
  --accent: #f4bc41;
  --accent-text: #f6c65a;
  --accent-2: #6deafc;
  --on-accent: #1f1804;
}
:root[data-accent="pro_tools"] {
  --accent: #578aae;
  --accent-text: #7fb0d0;
  --accent-2: #fe7e7d;
  --on-accent: #0c1620;
}

:root[data-mode="light"][data-accent="dawcord"] {
  --accent-text: #6b21d4;
  --accent-2: #7c8cf0;
}
:root[data-mode="light"][data-accent="fl_studio"] {
  --accent-text: #9a4905;
  --accent-2: #6c7892;
}
:root[data-mode="light"][data-accent="ableton"] {
  --accent-text: #7a5600;
  --accent-2: #0a8f9e;
}
:root[data-mode="light"][data-accent="pro_tools"] {
  --accent-text: #2c6386;
  --accent-2: #b23a39;
}

/* Each DAW tints the surfaces slightly, so a theme change is felt, not just seen. */
:root {
  --app: var(--bg-0);
  --surface: color-mix(in oklab, var(--bg-2) 94%, var(--accent) 6%);
  --well: color-mix(in oklab, var(--bg-1) 93%, var(--accent) 7%);
  --accent-wash: color-mix(in oklab, var(--accent) 18%, transparent);
  --knob-cap: radial-gradient(circle at 35% 30%, var(--bg-4), var(--bg-2) 70%);
}

/* ---- Discord's own palette, so the preview matches the real card in both modes ----------- */

:root,
:root[data-mode="dark"] {
  --dc-popout: #2b2d31;
  --dc-card: #111214;
  --dc-text: #dbdee1;
  --dc-muted: #949ba4;
  --dc-line: rgba(255, 255, 255, 0.08);
  --dc-button: #4e5058;
  --dc-button-text: #ffffff;
  --dc-playing: #dbdee1;
}
:root[data-mode="light"] {
  --dc-popout: #f2f3f5;
  --dc-card: #ffffff;
  --dc-text: #4e5058;
  --dc-muted: #6d6f78;
  --dc-line: rgba(0, 0, 0, 0.1);
  --dc-button: #4e5058;
  --dc-button-text: #ffffff;
  --dc-playing: #4e5058;
}
