/*
 * themes.css - the colour themes every bench offers in ⚙ Settings (kit/themes.js lists them):
 * listing paper, plain white, sepia, green and amber terminal, high contrast. Each is a set of
 * the custom properties that kit/bench.css and the bench's own styles draw with. Also here: the
 * type (--mono, --sans, --serif, --code-font, --code-size), the menus' panel, the gold of
 * repairs (--kin, --kin-bg), the annotation marks, and the colour
 * schemes of the genealogy figures (data-gpal, chosen in the Genealogy toolbar).
 *
 * Loaded after kit/bench.css and before the bench's css/research.css, which sets the bench's
 * own default colours on :root (the theme shown when none is chosen, with color-scheme) and
 * may change any token of a theme by repeating its selector: Spacewar sets its own accent
 * (--amber, --hl, --noted-bg) in each. The accent here is the template's.
 * Part of bench-kit (github.com/critical-code-studies/bench-kit).
 */

:root {
  --lamp-off: #3a2a1a;
  --lamp-on: #ffcf6e;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --code-size: 13px;
  --code-font: var(--mono);   /* set in ⚙ Settings; applies wherever code is shown */
}

:root[data-theme="paper"] {
  --code-bg: #fbf9f3;   /* the ground of code: listings, diffs */
  --noted-bg: rgba(163, 49, 122, 0.06);
  --bg: #ece7da;
  --bg-2: #e3ddcd;
  --surface: #faf8f2;
  --surface-2: #e8e2d3;
  --line: #c4bba5;
  --line-soft: #d9d2c0;
  --text: #15191c;
  --text-dim: #45505a;
  --text-faint: #6f767d;
  --beam: #0f6f86;
  --amber: #a3317a;
  --green: #1d7a45;
  --red: #b3261e;
  --violet: #6b3fb5;
  --hl: rgba(163, 49, 122, 0.10);
  --sel: rgba(15, 111, 134, 0.12);
  --add-bg: rgba(29, 122, 69, 0.12);
  --del-bg: rgba(179, 38, 30, 0.10);
  --g-retained: #0f6f86;
  --g-moved: #6b3fb5;
  --g-edited: #b36b00;
  --g-rewritten: #c2410c;
  --g-added: #1d7a45;
  --g-removed: #b3261e;
  /* figure ink for exports on white or paper */
  --g-text: #1d2327; --g-muted: #56606a; --g-stroke: #9aa0a6; --g-box: #d4cdbb; --g-heat: #0f6f86; --g-line: #6f767d; --g-cell-dark: #ffffff;
  --bar-1: #6f9fb2; --bar-2: #5f93a8; --bar-fg: #0d1a20; --bar-line: #4d7a8b;
  --pick-bg: rgba(255, 255, 255, 0.55); --pick-fg: #0d1a20; --pick-line: rgba(0, 0, 0, 0.2);
  --plate: #ffffff; --plate-line: #c4bba5; --pick-stroke: #1d2327; --hl-filter: brightness(0.9) saturate(1.3);
  --on-amber: #ffffff; --tape-paper: #ffffff; --tape-hole: #1c2a31;
  color-scheme: light;
}

/* Paper: plain black on white */
:root[data-theme="white"] {
  --code-bg: #f8f9fb;   /* the ground of code: listings, diffs */
  --noted-bg: rgba(156, 47, 117, 0.05);
  --bg: #ffffff; --bg-2: #f3f4f6; --surface: #ffffff; --surface-2: #f1f3f5;
  --line: #cfd4da; --line-soft: #e3e6ea;
  --text: #111418; --text-dim: #4b5563; --text-faint: #6b7280;
  --beam: #0b5cad; --amber: #9c2f75; --green: #11703c; --red: #b3261e; --violet: #5b2ea6;
  --hl: rgba(156, 47, 117, 0.09); --sel: rgba(11, 92, 173, 0.10); --add-bg: rgba(17, 112, 60, 0.10); --del-bg: rgba(179, 38, 30, 0.08);
  --g-retained: #0b5cad; --g-moved: #5b2ea6; --g-edited: #a86400; --g-rewritten: #c2410c; --g-added: #11703c; --g-removed: #b3261e;
  --g-text: #111418; --g-muted: #5b6470; --g-stroke: #9aa0a6; --g-box: #e5e7eb; --g-heat: #0b5cad; --g-line: #6b7280; --g-cell-dark: #ffffff;
  --bar-1: #f3f4f6; --bar-2: #e5e7eb; --bar-fg: #111418; --bar-line: #cfd4da;
  --pick-bg: #ffffff; --pick-fg: #111418; --pick-line: #b8bec6;
  --plate: #ffffff; --plate-line: #cfd4da; --pick-stroke: #111418; --hl-filter: brightness(0.9) saturate(1.3);
  --on-amber: #ffffff; --tape-paper: #ffffff; --tape-hole: #1c2a31;
  color-scheme: light;
}

/* Sepia: brown ink on warm paper, easy on the eyes for long reading */
:root[data-theme="sepia"] {
  --code-bg: #fffefb;   /* the ground of code: listings, diffs */
  --noted-bg: rgba(142, 59, 107, 0.06);
  --bg: #f7f2e8; --bg-2: #efe9dd; --surface: #fffefb; --surface-2: #ede6d8;   /* lighter, less beige (was #f4ecd8); code sits on near-white */
  --line: #ddd3c1; --line-soft: #ece5d8;
  --text: #3b2f22; --text-dim: #6b5a45; --text-faint: #7a684f;
  --beam: #8a4f1c; --amber: #8e3b6b; --green: #56682a; --red: #a1392b; --violet: #7b4a7a;
  --hl: rgba(142, 59, 107, 0.11); --sel: rgba(138, 79, 28, 0.12); --add-bg: rgba(86, 104, 42, 0.13); --del-bg: rgba(161, 57, 43, 0.10);
  --g-retained: #2f6f73; --g-moved: #7b4a7a; --g-edited: #a87414; --g-rewritten: #b5541c; --g-added: #56682a; --g-removed: #a1392b;
  --g-text: #3b2f22; --g-muted: #7a6a55; --g-stroke: #c9bb9f; --g-box: #efe8da; --g-heat: #2f6f73; --g-line: #8c7a62; --g-cell-dark: #ffffff;
  --bar-1: #ece3d1; --bar-2: #e4d9c3; --bar-fg: #3b2f22; --bar-line: #d2c5ab;
  --pick-bg: rgba(255, 250, 238, 0.7); --pick-fg: #3b2f22; --pick-line: rgba(59, 47, 34, 0.25);
  --plate: #ffffff; --plate-line: #ddd3c1; --pick-stroke: #3b2f22; --hl-filter: brightness(0.92) saturate(1.2);
  --on-amber: #fffaf0; --tape-paper: #fffcf4; --tape-hole: #3b2f22;
  color-scheme: light;
}

/* Terminal, green: green phosphor on black */
:root[data-theme="green"] {
  --code-bg: #010602;   /* the ground of code: listings, diffs */
  --noted-bg: rgba(166, 240, 255, 0.07);
  --bg: #020a04; --bg-2: #04110a; --surface: #061a0e; --surface-2: #0a2414;
  --line: #155c2e; --line-soft: #0d3319;
  --text: #8dffa8; --text-dim: #4fcf76; --text-faint: #2f8f4f;
  --beam: #c8ffd6; --amber: #a6f0ff; --green: #5dffa0; --red: #ff6b6b; --violet: #7af0d0;
  --hl: rgba(166, 240, 255, 0.12); --sel: rgba(200, 255, 214, 0.12); --add-bg: rgba(93, 255, 160, 0.12); --del-bg: rgba(255, 107, 107, 0.14);
  --g-retained: #3fd97a; --g-moved: #7af0d0; --g-edited: #e6ff8a; --g-rewritten: #ffc857; --g-added: #c8ffd6; --g-removed: #ff6b6b;
  --g-text: #8dffa8; --g-muted: #3aa35c; --g-stroke: #1f6b37; --g-box: #0a2414; --g-heat: #5dffa0; --g-line: #4fcf76; --g-cell-dark: #010603;
  --bar-1: #0a2414; --bar-2: #0a2414; --bar-fg: #8dffa8; --bar-line: #155c2e;   /* the selection bar's colour (surface-2), set off from the tab row */
  --pick-bg: rgba(0, 0, 0, 0.4); --pick-fg: #8dffa8; --pick-line: #155c2e;
  --plate: #010603; --plate-line: #0d3319; --pick-stroke: #c8ffd6; --hl-filter: brightness(1.5);
  --on-amber: #041004; --tape-paper: #d9e6d2; --tape-hole: #06140a;
  color-scheme: dark;
}

/* Terminal, amber: amber phosphor on black */
:root[data-theme="amber"] {
  --code-bg: #070400;   /* the ground of code: listings, diffs */
  --noted-bg: rgba(255, 159, 198, 0.07);
  --bg: #0c0700; --bg-2: #140c02; --surface: #1a1003; --surface-2: #241706;
  --line: #5a3a10; --line-soft: #33220b;
  --text: #ffb000; --text-dim: #cf8e1c; --text-faint: #8f6216;
  --beam: #ffd27a; --amber: #ff9fc6; --green: #d8c35a; --red: #ff6b4a; --violet: #ff9f6b;
  --hl: rgba(255, 159, 198, 0.14); --sel: rgba(255, 210, 122, 0.12); --add-bg: rgba(216, 195, 90, 0.13); --del-bg: rgba(255, 107, 74, 0.14);
  --g-retained: #ffb000; --g-moved: #ff7a45; --g-edited: #fff0b3; --g-rewritten: #ff5a1f; --g-added: #d8c35a; --g-removed: #ff4040;
  --g-text: #ffb000; --g-muted: #a06e14; --g-stroke: #6b4a12; --g-box: #241706; --g-heat: #ffb000; --g-line: #cf8e1c; --g-cell-dark: #0c0700;
  --bar-1: #241706; --bar-2: #241706; --bar-fg: #ffb000; --bar-line: #5a3a10;   /* surface-2, as the selection bar */
  --pick-bg: rgba(0, 0, 0, 0.4); --pick-fg: #ffb000; --pick-line: #5a3a10;
  --plate: #080500; --plate-line: #33220b; --pick-stroke: #fff0b3; --hl-filter: brightness(1.45);
  --on-amber: #1a1100; --tape-paper: #ecdcc0; --tape-hole: #1a1003;
  color-scheme: dark;
}

/* High contrast: white and bright colours on black */
:root[data-theme="contrast"] {
  --code-bg: #0d0d0d;   /* the ground of code: listings, diffs */
  --noted-bg: rgba(255, 138, 216, 0.10);
  --bg: #000000; --bg-2: #0a0a0a; --surface: #000000; --surface-2: #141414;
  --line: #8a8a8a; --line-soft: #4a4a4a;
  --text: #ffffff; --text-dim: #e6e6e6; --text-faint: #bdbdbd;
  --beam: #00e5ff; --amber: #ff8ad8; --green: #3dff6e; --red: #ff5c5c; --violet: #d6a6ff;
  --hl: rgba(255, 138, 216, 0.20); --sel: rgba(0, 229, 255, 0.18); --add-bg: rgba(61, 255, 110, 0.18); --del-bg: rgba(255, 92, 92, 0.20);
  --g-retained: #00e5ff; --g-moved: #ff3df5; --g-edited: #ffd400; --g-rewritten: #ff8c00; --g-added: #3dff6e; --g-removed: #ff5c5c;
  --g-text: #ffffff; --g-muted: #cfcfcf; --g-stroke: #9a9a9a; --g-box: #1c1c1c; --g-heat: #00e5ff; --g-line: #e6e6e6; --g-cell-dark: #000000;
  --bar-1: #2a2a2a; --bar-2: #222222; --bar-fg: #ffffff; --bar-line: #8a8a8a;   /* lighter than the page and tab row, so the top bar stands apart */
  --pick-bg: #000000; --pick-fg: #ffffff; --pick-line: #ffffff;
  --plate: #000000; --plate-line: #8a8a8a; --pick-stroke: #ffffff; --hl-filter: brightness(1.6);
  --on-amber: #000000; --tape-paper: #ffffff; --tape-hole: #000000;
  color-scheme: dark;
}

/* Colour schemes for the genealogy figures (flow, block map, legends). Chosen in the
   Genealogy toolbar; they apply on screen and in exported figures alike. */
:root[data-gpal="okabe"], :root[data-gpal="okabe"] .legend { --g-retained: #56b4e9; --g-moved: #cc79a7; --g-edited: #e69f00; --g-rewritten: #0072b2; --g-added: #009e73; --g-removed: #d55e00; }
:root[data-gpal="tol"], :root[data-gpal="tol"] .legend { --g-retained: #4477aa; --g-moved: #aa3377; --g-edited: #ccbb44; --g-rewritten: #66ccee; --g-added: #228833; --g-removed: #ee6677; }
:root[data-gpal="muted"], :root[data-gpal="muted"] .legend { --g-retained: #6f93a8; --g-moved: #9483c2; --g-edited: #c9a24d; --g-rewritten: #b9774a; --g-added: #6aa67a; --g-removed: #c46a5f; }
:root[data-gpal="bold"], :root[data-gpal="bold"] .legend { --g-retained: #00e5ff; --g-moved: #ff3df5; --g-edited: #ffe600; --g-rewritten: #ff8c00; --g-added: #00ff85; --g-removed: #ff2d55; }
:root[data-gpal="grey"], :root[data-gpal="grey"] .legend { --g-retained: #8f969c; --g-moved: #c9ced3; --g-edited: #5f666d; --g-rewritten: #aeb4ba; --g-added: #e6e8ea; --g-removed: #3a4046; }
:root[data-gpal="warm"], :root[data-gpal="warm"] .legend { --g-retained: #e0a458; --g-moved: #b56576; --g-edited: #f2d492; --g-rewritten: #e07a3a; --g-added: #88b04b; --g-removed: #d1495b; }

/* Menus: a panel a little lighter than the page, so it reads as lifted above it;
   groups separated by thin dividers, their headings plain and faint. */
:root { --menu-bg: #1c2733; --menu-line: rgba(255, 255, 255, 0.12); }
@supports (background: color-mix(in srgb, red, blue)) { :root { --menu-bg: color-mix(in srgb, var(--surface) 84%, #ffffff 16%); } }
:root[data-theme="paper"], :root[data-theme="white"], :root[data-theme="sepia"] { --menu-bg: #ffffff; --menu-line: rgba(0, 0, 0, 0.12); }
:root[data-theme="paper"] .tab-menu, :root[data-theme="white"] .tab-menu, :root[data-theme="sepia"] .tab-menu,
:root[data-theme="paper"] .toolbar .menu-body, :root[data-theme="white"] .toolbar .menu-body, :root[data-theme="sepia"] .toolbar .menu-body { box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.08); }

/* the code an annotation is attached to: a thin bracket at the right of the word
   column, and a span within the lines dotted underneath; both stronger on hover */
:root { --anno-line: var(--amber); --anno-block: color-mix(in srgb, var(--amber) 60%, var(--red)); }

/* gold, for repairs and ratings */
:root { --kin: #d4af37; --kin-bg: rgba(212, 175, 55, 0.13); }
/* a star given: the gold of the repairs, a little brighter, since a star is a shape and not text */
:root { --star: #e9c547; }
:root[data-theme="paper"], :root[data-theme="white"], :root[data-theme="sepia"] { --kin: #9a7400; --kin-bg: rgba(170, 128, 0, 0.12); }
:root[data-theme="paper"], :root[data-theme="white"], :root[data-theme="sepia"] { --star: #c29a12; }
