/* Theme tokens shared by any page that loads theme.js. Only custom
   properties live here, so a page's own sheet decides layout. theme.js sets
   data-theme on <html> before first paint; the blue block also matches a bare
   :root, so the page still has a palette if the script fails. The CSP allows
   'self' fonts only, so the stacks use Inter / JetBrains Mono when installed
   and fall back to system fonts. */

:root {
  --r: 12px;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* Dark blue, the default. Green here only means ok. */
:root, :root[data-theme="blue"] {
  color-scheme: dark;
  --bg: #05070f; --bg-2: #080c18; --panel: #0c1222; --inset: #060912;
  --fg: #cfd8ea; --fg-strong: #f4f7ff; --dim: #8592ad;
  --line: rgba(120, 160, 255, 0.12); --line-strong: rgba(120, 160, 255, 0.26);
  --accent: #5b8cff; --accent-2: #a8c8ff; --link: #5b8cff;
  --ok: #34d399; --info: #a8c8ff; --warn: #ffb547; --red: #ff5c72;
  --grad: linear-gradient(100deg, #5b8cff, #a8c8ff);
  --accent-soft: rgba(91, 140, 255, 0.08); --accent-edge: rgba(91, 140, 255, 0.26);
  --accent-faint: rgba(91, 140, 255, 0.05);
  --accent-2-soft: rgba(168, 200, 255, 0.1); --accent-2-edge: rgba(168, 200, 255, 0.3);
  --glow-1: rgba(0, 82, 255, 0.16); --glow-2: rgba(91, 140, 255, 0.07);
  --nav-bg: rgba(5, 7, 15, 0.8); --code-bg: rgba(120, 160, 255, 0.07);
  --track: rgba(120, 160, 255, 0.08);
  --btn-fg: #ffffff; --btn-bg: linear-gradient(100deg, #0052ff, #1f63ff);
  --btn-shadow: 0 8px 30px -10px rgba(0, 82, 255, 0.65); --ghost-bg: transparent;
  --cw-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  --hero-shadow: 0 40px 100px -30px rgba(0, 82, 255, 0.35), 0 30px 80px -30px #000;
  --cw-dot: #1c2540; --cw-resp: rgba(12, 18, 34, 0.5);
  --c-k: #c792ff; --c-s: #b4d0ff; --c-p: #6b98ff; --c-n: #ffb547; --c-c: #6a7898;
  --shadow: none; --card-end: var(--bg-2); --install-bg: var(--bg-2);
  --dot-ok-glow: 0 0 8px #34d399;
}

/* Warm amber. Orange means caution, yellow moderate. */
:root[data-theme="amber"] {
  color-scheme: dark;
  --bg: #15130f; --bg-2: #1a1712; --panel: #201c17; --inset: #110f0c;
  --fg: #d9d1c3; --fg-strong: #faf5ec; --dim: #a0968a;
  --line: rgba(255, 210, 140, 0.1); --line-strong: rgba(255, 210, 140, 0.22);
  --accent: #f2b544; --accent-2: #dd9f75; --link: #f2b544;
  --ok: #5fd08a; --info: #e6d06a; --warn: #ff8640; --red: #ff5c63;
  --grad: linear-gradient(100deg, #ffd27a, #f2b544 55%, #dd9f75);
  --accent-soft: rgba(242, 181, 68, 0.08); --accent-edge: rgba(242, 181, 68, 0.26);
  --accent-faint: rgba(242, 181, 68, 0.05);
  --accent-2-soft: rgba(221, 159, 117, 0.1); --accent-2-edge: rgba(221, 159, 117, 0.3);
  --glow-1: rgba(242, 181, 68, 0.09); --glow-2: rgba(221, 159, 117, 0.06);
  --nav-bg: rgba(21, 19, 15, 0.82); --code-bg: rgba(255, 210, 140, 0.07);
  --track: rgba(255, 210, 140, 0.08);
  --btn-fg: #1a1206; --btn-bg: linear-gradient(100deg, #ffd27a, #f2b544 55%, #dd9f75);
  --btn-shadow: 0 8px 30px -10px rgba(242, 181, 68, 0.6); --ghost-bg: transparent;
  --cw-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  --hero-shadow: 0 40px 100px -30px rgba(242, 181, 68, 0.16), 0 30px 80px -30px #000;
  --cw-dot: #3a332a; --cw-resp: rgba(32, 28, 23, 0.5);
  --c-k: #ec8b7f; --c-s: #d8cf9c; --c-p: #f2b544; --c-n: #b9cc8c; --c-c: #978c7c;
  --shadow: none; --card-end: var(--bg-2); --install-bg: var(--bg-2);
  --dot-ok-glow: 0 0 8px #5fd08a;
}

/* Clean light: white panels, dark code windows (scoped below). */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f8f7; --bg-2: #f1f4f3; --panel: #ffffff; --inset: #f4f7f6;
  --fg: #2a3834; --fg-strong: #0c1613; --dim: #56665f;
  --line: rgba(16, 40, 34, 0.09); --line-strong: rgba(16, 40, 34, 0.16);
  --accent: #047857; --accent-2: #1d4ed8; --link: #1d4ed8;
  --ok: #047857; --info: #1d4ed8; --warn: #b45309; --red: #c8102e;
  --grad: linear-gradient(100deg, #047857, #0e6e8c);
  --accent-soft: rgba(4, 120, 87, 0.07); --accent-edge: rgba(4, 120, 87, 0.22);
  --accent-faint: rgba(4, 120, 87, 0.05);
  --accent-2-soft: rgba(29, 78, 216, 0.06); --accent-2-edge: rgba(29, 78, 216, 0.22);
  --glow-1: rgba(29, 78, 216, 0.05); --glow-2: rgba(4, 120, 87, 0.05);
  --nav-bg: rgba(247, 248, 247, 0.85); --code-bg: rgba(4, 120, 87, 0.06);
  --track: rgba(16, 40, 34, 0.08);
  --btn-fg: #ffffff; --btn-bg: linear-gradient(100deg, #047857, #0e6e8c);
  --btn-shadow: 0 6px 18px -8px rgba(4, 120, 87, 0.5); --ghost-bg: #ffffff;
  --cw-shadow: 0 24px 60px -28px rgba(16, 24, 40, 0.45), 0 0 0 1px rgba(16, 24, 40, 0.08);
  --hero-shadow: 0 40px 90px -36px rgba(29, 78, 216, 0.35), 0 24px 60px -28px rgba(16, 24, 40, 0.5), 0 0 0 1px rgba(16, 24, 40, 0.08);
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 4px 14px -6px rgba(16, 24, 40, 0.08);
  --card-end: #fbfcfc; --install-bg: #ffffff;
  --dot-ok-glow: 0 0 0 3px rgba(4, 120, 87, 0.15);
}
/* A dark island on the light page: code windows re-declare the dark tokens. */
:root[data-theme="light"] .code-window {
  --inset: #0d1416; --panel: #151e21; --fg: #c9d9d4; --fg-strong: #f3fbf8; --dim: #8fa49d;
  --line: rgba(255, 255, 255, 0.07); --line-strong: rgba(255, 255, 255, 0.1);
  --accent: #34d399; --accent-soft: rgba(52, 211, 153, 0.1); --accent-edge: rgba(52, 211, 153, 0.3);
  --ok: #34d399; --red: #ff6b80; --code-bg: rgba(52, 211, 153, 0.07);
  --cw-dot: #2b3a3f; --cw-resp: rgba(21, 30, 33, 0.5);
  --c-k: #ff79d9; --c-s: #a8e6cf; --c-p: #6b98ff; --c-n: #ffb547; --c-c: #7a918b;
}
