/* Themes: every colour the player uses, as tokens, per theme. player.css uses only these.
   A walkthrough picks a theme (start_walkthrough `theme`, front matter `theme:`), a viewer may
   override it (?theme=, or the menu), and a project may override single tokens with
   showntell.theme.json. Contrast is checked by tests/test_themes.py. */

:root, [data-theme="dark"] {
  color-scheme: dark;
  --scheme: dark;
  --bg: #0a0c10;
  --stage: #11151c;
  --panel: #181d26;
  --panel-2: #212835;
  --panel-deep: #0d1015;
  --panel-glass: rgba(20, 24, 32, 0.94);
  --line: #2a3240;
  --fg: #ebeef3;
  --muted: #98a2b3;
  --caption: #c9d1dc;
  --caption-now: #ffffff;
  --accent: #ffc857;
  --on-accent: #1a1406;
  --accent-soft: rgba(255, 200, 87, 0.2);
  --accent-faint: rgba(255, 200, 87, 0.09);
  --accent-glow: rgba(255, 200, 87, 0.38);
  --node: #1b2330;
  --node-line: #6fb6ff;
  --note: #2b2a1f;
  --danger: #f87171;
  --add: rgba(46, 160, 67, 0.18);
  --add-strong: rgba(63, 185, 80, 0.5);
  --add-fg: #3fb950;
  --del: rgba(248, 81, 73, 0.15);
  --del-strong: rgba(248, 81, 73, 0.5);
  --del-fg: #f85149;
  --code-bg: #0c1016;
  --code-head: #0f141b;
  --code-fg: #c9d1d9;
  --ln: #5d6878;
  --scrim: rgba(7, 9, 12, 0.62);
  --scrim-light: rgba(7, 9, 12, 0.35);
  --shadow: rgba(0, 0, 0, 0.5);
  --edge: rgba(255, 255, 255, 0.04);
  --glow-1: rgba(111, 182, 255, 0.10);
  --glow-2: rgba(244, 114, 182, 0.07);
  --hl-keyword: #ff7b72;
  --hl-title: #d2a8ff;
  --hl-attr: #79c0ff;
  --hl-string: #a5d6ff;
  --hl-built-in: #ffa657;
  --hl-comment: #8b949e;
  --hl-name: #7ee787;
  --hl-section: #6fb6ff;
  --hl-bullet: #f2cc60;
  --c1: #ffc857;
  --c2: #6fb6ff;
  --c3: #4ade80;
  --c4: #f472b6;
  --c5: #a78bfa;
  --c6: #ff8a65;
  --grid: rgba(152, 162, 179, 0.07);
}

[data-theme="light"] {
  color-scheme: light;
  --scheme: light;
  --bg: #e9edf2;
  --stage: #ffffff;
  --panel: #f3f5f8;
  --panel-2: #e4e9ef;
  --panel-deep: #f7f8fa;
  --panel-glass: rgba(255, 255, 255, 0.95);
  --line: #d0d7de;
  --fg: #1f2328;
  --muted: #59636e;
  --caption: #31373e;
  --caption-now: #000000;
  --accent: #9a5b00;
  --on-accent: #ffffff;
  --accent-soft: rgba(212, 140, 20, 0.22);
  --accent-faint: rgba(212, 140, 20, 0.1);
  --accent-glow: rgba(212, 140, 20, 0.3);
  --node: #f1f5fb;
  --node-line: #0969da;
  --note: #fff8c5;
  --danger: #cf222e;
  --add: rgba(46, 160, 67, 0.15);
  --add-strong: rgba(46, 160, 67, 0.35);
  --add-fg: #1a7f37;
  --del: rgba(207, 34, 46, 0.1);
  --del-strong: rgba(207, 34, 46, 0.3);
  --del-fg: #cf222e;
  --code-bg: #f6f8fa;
  --code-head: #eef1f4;
  --code-fg: #1f2328;
  --ln: #747e88;
  --scrim: rgba(240, 243, 247, 0.7);
  --scrim-light: rgba(240, 243, 247, 0.35);
  --shadow: rgba(31, 35, 40, 0.15);
  --edge: rgba(31, 35, 40, 0.08);
  --glow-1: rgba(9, 105, 218, 0.06);
  --glow-2: rgba(191, 57, 137, 0.05);
  --hl-keyword: #cf222e;
  --hl-title: #8250df;
  --hl-attr: #0550ae;
  --hl-string: #0a3069;
  --hl-built-in: #953800;
  --hl-comment: #636c76;
  --hl-name: #116329;
  --hl-section: #0550ae;
  --hl-bullet: #953800;
  --c1: #b45309;
  --c2: #0969da;
  --c3: #1a7f37;
  --c4: #bf3989;
  --c5: #8250df;
  --c6: #0e7490;
  --grid: rgba(31, 35, 40, 0.06);
}

[data-theme="paper"] {
  color-scheme: light;
  --scheme: light;
  --bg: #e8e1d4;
  --stage: #fbf7ef;
  --panel: #f3ede1;
  --panel-2: #e9e1d2;
  --panel-deep: #f6f1e7;
  --panel-glass: rgba(251, 247, 239, 0.95);
  --line: #d6cbb7;
  --fg: #2a241e;
  --muted: #645a4e;
  --caption: #3a332b;
  --caption-now: #000000;
  --accent: #a3410f;
  --on-accent: #ffffff;
  --accent-soft: rgba(196, 90, 30, 0.2);
  --accent-faint: rgba(196, 90, 30, 0.09);
  --accent-glow: rgba(196, 90, 30, 0.28);
  --node: #f4ecdd;
  --node-line: #2f5f8a;
  --note: #f6e7b6;
  --danger: #b42318;
  --add: rgba(60, 130, 60, 0.15);
  --add-strong: rgba(60, 130, 60, 0.35);
  --add-fg: #2f6b2f;
  --del: rgba(180, 35, 24, 0.1);
  --del-strong: rgba(180, 35, 24, 0.3);
  --del-fg: #b42318;
  --code-bg: #f4eee2;
  --code-head: #ede5d6;
  --code-fg: #2a241e;
  --ln: #8f8473;
  --scrim: rgba(244, 238, 226, 0.7);
  --scrim-light: rgba(244, 238, 226, 0.35);
  --shadow: rgba(60, 45, 25, 0.16);
  --edge: rgba(60, 45, 25, 0.08);
  --glow-1: rgba(47, 95, 138, 0.06);
  --glow-2: rgba(196, 90, 30, 0.06);
  --hl-keyword: #a3261b;
  --hl-title: #6a3d9a;
  --hl-attr: #2f5f8a;
  --hl-string: #3d5a1e;
  --hl-built-in: #8a4b00;
  --hl-comment: #6b6152;
  --hl-name: #2f6b2f;
  --hl-section: #2f5f8a;
  --hl-bullet: #8a4b00;
  --c1: #a3410f;
  --c2: #2f5f8a;
  --c3: #3d6b2f;
  --c4: #9b2c5f;
  --c5: #6a3d9a;
  --c6: #0f6b6b;
  --grid: rgba(60, 45, 25, 0.07);
}

[data-theme="contrast"] {
  color-scheme: dark;
  --scheme: dark;
  --bg: #000000;
  --stage: #000000;
  --panel: #111111;
  --panel-2: #1c1c1c;
  --panel-deep: #050505;
  --panel-glass: rgba(10, 10, 10, 0.97);
  --line: #5a5a5a;
  --fg: #ffffff;
  --muted: #d0d0d0;
  --caption: #ffffff;
  --caption-now: #000000;
  --accent: #ffd60a;
  --on-accent: #000000;
  --accent-soft: #ffd60a;
  --accent-faint: rgba(255, 214, 10, 0.16);
  --accent-glow: rgba(255, 214, 10, 0.5);
  --node: #0d0d0d;
  --node-line: #7cc4ff;
  --note: #2a2600;
  --danger: #ff8080;
  --add: rgba(80, 220, 100, 0.22);
  --add-strong: rgba(80, 220, 100, 0.6);
  --add-fg: #6ef08a;
  --del: rgba(255, 110, 100, 0.2);
  --del-strong: rgba(255, 110, 100, 0.6);
  --del-fg: #ff8a80;
  --code-bg: #000000;
  --code-head: #0d0d0d;
  --code-fg: #ffffff;
  --ln: #a0a0a0;
  --scrim: rgba(0, 0, 0, 0.75);
  --scrim-light: rgba(0, 0, 0, 0.45);
  --shadow: rgba(0, 0, 0, 0.6);
  --edge: rgba(255, 255, 255, 0.35);
  --glow-1: transparent;
  --glow-2: transparent;
  --hl-keyword: #ff9e94;
  --hl-title: #e2c2ff;
  --hl-attr: #9fd3ff;
  --hl-string: #c4e5ff;
  --hl-built-in: #ffc285;
  --hl-comment: #bdbdbd;
  --hl-name: #9ff0a8;
  --hl-section: #9fd3ff;
  --hl-bullet: #ffe066;
  --c1: #ffd60a;
  --c2: #7cc4ff;
  --c3: #6ef08a;
  --c4: #ff8ad8;
  --c5: #c4a7ff;
  --c6: #5ff0f0;
  --grid: transparent;
}

[data-theme="night"] {
  color-scheme: dark;
  --scheme: dark;
  --bg: #0b0a18;
  --stage: #13112a;
  --panel: #1c1938;
  --panel-2: #262247;
  --panel-deep: #0e0c20;
  --panel-glass: rgba(22, 19, 44, 0.94);
  --line: #332e5c;
  --fg: #eeecfb;
  --muted: #a7a2cc;
  --caption: #d4d0ee;
  --caption-now: #ffffff;
  --accent: #ff7ab6;
  --on-accent: #22061a;
  --accent-soft: rgba(255, 122, 182, 0.2);
  --accent-faint: rgba(255, 122, 182, 0.09);
  --accent-glow: rgba(255, 122, 182, 0.4);
  --node: #1f1b3d;
  --node-line: #7dd3fc;
  --note: #2e1f38;
  --danger: #fb7185;
  --add: rgba(46, 160, 67, 0.18);
  --add-strong: rgba(63, 185, 80, 0.5);
  --add-fg: #3fb950;
  --del: rgba(248, 81, 73, 0.15);
  --del-strong: rgba(248, 81, 73, 0.5);
  --del-fg: #f85149;
  --code-bg: #0d0b1f;
  --code-head: #110f26;
  --code-fg: #d6d3f0;
  --ln: #6f6a98;
  --scrim: rgba(6, 5, 14, 0.62);
  --scrim-light: rgba(6, 5, 14, 0.35);
  --shadow: rgba(0, 0, 0, 0.5);
  --edge: rgba(255, 255, 255, 0.05);
  --glow-1: rgba(125, 211, 252, 0.10);
  --glow-2: rgba(255, 122, 182, 0.10);
  --hl-keyword: #ff8fc4;
  --hl-title: #c4b5fd;
  --hl-attr: #7dd3fc;
  --hl-string: #a5f3fc;
  --hl-built-in: #fdba74;
  --hl-comment: #9b96c2;
  --hl-name: #86efac;
  --hl-section: #7dd3fc;
  --hl-bullet: #fde68a;
  --c1: #ff7ab6;
  --c2: #7dd3fc;
  --c3: #86efac;
  --c4: #fbbf24;
  --c5: #c4b5fd;
  --c6: #fb923c;
  --grid: rgba(167, 162, 204, 0.08);
}

[data-theme="ocean"] {
  color-scheme: dark;
  --scheme: dark;
  --bg: #061317;
  --stage: #0a1c22;
  --panel: #10272f;
  --panel-2: #17333d;
  --panel-deep: #07161b;
  --panel-glass: rgba(12, 32, 38, 0.94);
  --line: #21434e;
  --fg: #e8f4f4;
  --muted: #94b4b8;
  --caption: #c8dfe0;
  --caption-now: #ffffff;
  --accent: #ff8a5c;
  --on-accent: #2a0e03;
  --accent-soft: rgba(255, 138, 92, 0.2);
  --accent-faint: rgba(255, 138, 92, 0.09);
  --accent-glow: rgba(255, 138, 92, 0.38);
  --node: #0f2a33;
  --node-line: #5eead4;
  --note: #2c2219;
  --danger: #f87171;
  --add: rgba(46, 160, 67, 0.18);
  --add-strong: rgba(63, 185, 80, 0.5);
  --add-fg: #3fb950;
  --del: rgba(248, 81, 73, 0.15);
  --del-strong: rgba(248, 81, 73, 0.5);
  --del-fg: #f85149;
  --code-bg: #071519;
  --code-head: #0a1b20;
  --code-fg: #cfe3e4;
  --ln: #5f838a;
  --scrim: rgba(3, 10, 12, 0.62);
  --scrim-light: rgba(3, 10, 12, 0.35);
  --shadow: rgba(0, 0, 0, 0.5);
  --edge: rgba(255, 255, 255, 0.04);
  --glow-1: rgba(94, 234, 212, 0.10);
  --glow-2: rgba(255, 138, 92, 0.07);
  --hl-keyword: #ff9b7a;
  --hl-title: #c4b5fd;
  --hl-attr: #67e8f9;
  --hl-string: #a7f3d0;
  --hl-built-in: #fdba74;
  --hl-comment: #8aa6aa;
  --hl-name: #86efac;
  --hl-section: #5eead4;
  --hl-bullet: #fde047;
  --c1: #ff8a5c;
  --c2: #5eead4;
  --c3: #facc15;
  --c4: #60a5fa;
  --c5: #f472b6;
  --c6: #a3e635;
  --grid: rgba(148, 180, 184, 0.08);
}

[data-theme="studio"] {
  color-scheme: light;
  --scheme: light;
  --bg: #e8e6f0;
  --stage: #fbfaff;
  --panel: #f2f0fa;
  --panel-2: #e6e2f4;
  --panel-deep: #f7f6fc;
  --panel-glass: rgba(251, 250, 255, 0.95);
  --line: #d4cfe6;
  --fg: #1c1830;
  --muted: #5b5575;
  --caption: #2f2a46;
  --caption-now: #000000;
  --accent: #6d28d9;
  --on-accent: #ffffff;
  --accent-soft: rgba(109, 40, 217, 0.18);
  --accent-faint: rgba(109, 40, 217, 0.08);
  --accent-glow: rgba(109, 40, 217, 0.28);
  --node: #f3f0fc;
  --node-line: #db2777;
  --note: #fdf2f8;
  --danger: #cf222e;
  --add: rgba(46, 160, 67, 0.15);
  --add-strong: rgba(46, 160, 67, 0.35);
  --add-fg: #1a7f37;
  --del: rgba(207, 34, 46, 0.1);
  --del-strong: rgba(207, 34, 46, 0.3);
  --del-fg: #cf222e;
  --code-bg: #f6f4fc;
  --code-head: #eeebf8;
  --code-fg: #1c1830;
  --ln: #77718f;
  --scrim: rgba(240, 238, 248, 0.7);
  --scrim-light: rgba(240, 238, 248, 0.35);
  --shadow: rgba(28, 24, 48, 0.15);
  --edge: rgba(28, 24, 48, 0.08);
  --glow-1: rgba(109, 40, 217, 0.07);
  --glow-2: rgba(219, 39, 119, 0.06);
  --hl-keyword: #a21caf;
  --hl-title: #6d28d9;
  --hl-attr: #1d4ed8;
  --hl-string: #0f5132;
  --hl-built-in: #9a3412;
  --hl-comment: #68627e;
  --hl-name: #be185d;
  --hl-section: #1d4ed8;
  --hl-bullet: #9a3412;
  --c1: #6d28d9;
  --c2: #db2777;
  --c3: #0d9488;
  --c4: #ea580c;
  --c5: #2563eb;
  --c6: #65a30d;
  --grid: rgba(28, 24, 48, 0.06);
}

/* Syntax colours from the tokens (highlight.js class names). */
.hljs { color: var(--code-fg); background: var(--code-bg); }
.hljs-doctag, .hljs-keyword, .hljs-meta .hljs-keyword, .hljs-template-tag, .hljs-template-variable, .hljs-type, .hljs-variable.language_ { color: var(--hl-keyword); }
.hljs-title, .hljs-title.class_, .hljs-title.class_.inherited__, .hljs-title.function_ { color: var(--hl-title); }
.hljs-attr, .hljs-attribute, .hljs-literal, .hljs-meta, .hljs-number, .hljs-operator, .hljs-selector-attr, .hljs-selector-class, .hljs-selector-id, .hljs-variable { color: var(--hl-attr); }
.hljs-meta .hljs-string, .hljs-regexp, .hljs-string { color: var(--hl-string); }
.hljs-built_in, .hljs-symbol { color: var(--hl-built-in); }
.hljs-code, .hljs-comment, .hljs-formula { color: var(--hl-comment); }
.hljs-name, .hljs-quote, .hljs-selector-pseudo, .hljs-selector-tag { color: var(--hl-name); }
.hljs-subst, .hljs-emphasis, .hljs-strong { color: var(--code-fg); }
.hljs-section { color: var(--hl-section); font-weight: 700; }
.hljs-bullet { color: var(--hl-bullet); }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 700; }
.hljs-addition { color: var(--add-fg); background-color: var(--add); }
.hljs-deletion { color: var(--del-fg); background-color: var(--del); }
