/* Design tokens — the single source of truth for the cassette/VHS-core look.
   Three presets are three tape stocks (PLAN.md 2.3). The accent picker recolours the
   marker pen and nothing else.

   FONTS: a Windows-native stack rather than vendored webfonts. This is a Windows-only
   NSIS bundle; `Ink Free` and `Bahnschrift` ship with Windows 10/11, and a handwriting
   face is exactly what a hand-labelled tape wants. Zero bytes, zero licence risk, and
   nothing to fetch at first paint — which the offline requirement cares about. The
   `RC *` families lead each stack so vendored faces can be dropped in later without
   touching a rule. */

:root {
  --font-marker: "RC Marker", "Ink Free", "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive;
  --font-label: "RC Label", "Bahnschrift", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --font-osd: "RC OSD", "Cascadia Mono", Consolas, "Courier New", ui-monospace, monospace;

  --step--2: 0.6875rem;
  --step--1: 0.75rem;
  --step-0: 0.875rem;
  --step-1: 1.0625rem;
  --step-2: 1.375rem;
  --step-3: 1.875rem;
  --step-4: 2.75rem;
  --step-5: 3.75rem;

  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;

  --r-sm: 3px;
  --r-md: 6px;
  --r-lg: 10px;

  --t-key: 90ms;
  --t-fade: 600ms;
  --t-band: 240ms;

  /* ── case rarity ─────────────────────────────────────────────────────────
     Deliberately outside the tape-stock themes and deliberately close to the colours
     everybody already knows from a weapon case, because the whole point of a rarity
     ladder is that it is legible at a glance and across products. A theme that recoloured
     these would be a theme that broke the one thing the ladder is for.

     They are pulled a few points off full saturation so a wall of them still sits inside
     this app's palette rather than glowing out of it. */
  --rr-industrial: #7f9bb5;
  --rr-milspec: #5a76e8;
  --rr-restricted: #8b52e0;
  --rr-classified: #c743cf;
  --rr-covert: #e14b4b;
  --rr-gold: #f0b429;

  --bezel-h: 44px;
  /* Letterbox bar height. Anything a picker puts near the top or bottom of its stage
     has to clear this, or the bars land on it when they slide in. See cinema.js. */
  --cine-bar: clamp(16px, 5.5vh, 40px);
}

/* ── oxide — the default tape stock: warm, brown, domestic ──────────────── */
[data-theme="oxide"] {
  --room: #0b0806;
  --shell: #241a10;
  --shell-hi: #3a2a1a;
  --shell-lo: #100b06;
  --well: #14100b;
  --well-line: #2b2016;

  --label: #e8dcc0;
  --label-edge: #cdbe9c;
  --ink: #3a2a1c;
  --ink-soft: #6f5a41;

  --osd: #e4d9bd;
  --osd-dim: #94866a;

  --accent: #c8642a;
  --accent-lit: #f08a45;
  --accent-ink: #1c0d04;

  --good: #7d9a58;
  --warn: #c98a34;
  --bad: #b4553f;

  --scan-op: 0.3;
  --grain-op: 0.06;
  --bloom-op: 0.12;
  --fringe-r: rgba(255, 60, 90, 0.3);
  --fringe-c: rgba(60, 220, 255, 0.26);

  /* brass, for a warm domestic deck */
  --coin-hi: #f7e4b4;
  --coin-mid: #c2a066;
  --coin-lo: #7c6134;
  --coin-ink: #2a1c0a;
}

/* ── chrome — cool metal, the hi-fi deck ────────────────────────────────── */
[data-theme="chrome"] {
  --room: #070a0c;
  --shell: #171e23;
  --shell-hi: #2a353d;
  --shell-lo: #0a0e11;
  --well: #0e1418;
  --well-line: #1e282f;

  --label: #c9d1d6;
  --label-edge: #a5b0b7;
  --ink: #1b2429;
  --ink-soft: #4d5a63;

  --osd: #d6e3ea;
  --osd-dim: #76858f;

  --accent: #3fd0d9;
  --accent-lit: #7ceef5;
  --accent-ink: #04191b;

  --good: #4fbf8b;
  --warn: #d69a3c;
  --bad: #e0685c;

  --scan-op: 0.38;
  --grain-op: 0.05;
  --bloom-op: 0.2;
  --fringe-r: rgba(255, 40, 80, 0.34);
  --fringe-c: rgba(80, 240, 255, 0.34);

  /* steel, to match the hi-fi deck */
  --coin-hi: #f2f7fa;
  --coin-mid: #aebac4;
  --coin-lo: #5c6a75;
  --coin-ink: #101820;
}

/* ── nightshift — near-black, heavy bloom, 3am ──────────────────────────── */
[data-theme="nightshift"] {
  --room: #040302;
  --shell: #0d0a07;
  --shell-hi: #191310;
  --shell-lo: #000000;
  --well: #080605;
  --well-line: #1a1410;

  --label: #d8c9a8;
  --label-edge: #ab9c7e;
  --ink: #241a10;
  --ink-soft: #5d4b35;

  --osd: #f0c98d;
  --osd-dim: #86693f;

  --accent: #e8873f;
  --accent-lit: #ffb571;
  --accent-ink: #1a0e04;

  --good: #8aa35c;
  --warn: #d08b3a;
  --bad: #c9603f;

  --scan-op: 0.48;
  --grain-op: 0.08;
  --bloom-op: 0.2;
  --fringe-r: rgba(255, 70, 40, 0.4);
  --fringe-c: rgba(70, 200, 255, 0.3);

  /* old bronze, tarnished — it is three in the morning */
  --coin-hi: #edcd96;
  --coin-mid: #b28a51;
  --coin-lo: #674a25;
  --coin-ink: #1c1105;
}

/* An accent chosen in Settings overrides the preset's, and only the pen. */
[data-accent] {
  --accent: var(--accent-override, var(--accent));
}

/* The OS preference and the in-app toggle must never disagree; both resolve to the
   same `data-motion="off"` state, applied by vhs.js. */
@media (prefers-reduced-motion: reduce) {
  :root {
    --t-fade: 1ms;
    --t-band: 1ms;
  }
}
