/* ============================================================
   Termdeck — Themes

   The default palette ("Ink") is the bare :root in colors.css and has no block
   here. Every alternate theme is one :root[data-theme="..."] block that
   re-declares tokens from that file and nothing else.

   Two rules govern this file, and both are load-bearing:

   1. THE OVERRIDE GOES ON :root, NEVER ON A DESCENDANT.
      colors.css documents the trap at --workspace-focus-ring: a custom property
      assembled from var()s computes where it is DECLARED and inherits as a
      finished string, so re-skinning a subtree leaves the ring on the old
      palette (measured once at 1.17:1). Because these blocks target the same
      element that declares it — html — the ring re-resolves against the theme
      for free. That is why --workspace-focus-ring is absent below, and why a
      body class or an app-shell wrapper would not have worked.

   2. A BLOCK THAT SETS ONLY CUSTOM PROPERTIES IS INLINED INTO THE BOOT <style>
      whatever its selector — see declaresOnlyVars() in
      scripts/lib/critical-css.mjs. Keep these blocks var-only and the theme
      paints in the first frame. Add a real declaration and it stops being
      inlined, and the theme arrives a frame late as a flash.

   3. EVERY THEME BLOCK CARRIES A [data-theme-preview] TWIN.
      The picker in Settings → Appearance paints a miniature of the app in each
      theme, and it has to show you Slate while you are standing in Ink. Pairing
      the preview scope onto the real block — rather than giving the preview its
      own copy of the values — is what stops a tile advertising a palette the
      theme no longer has. The default's twin lives on the :root block in
      tokens/colors.css for the same reason. tests/theme-ids.mjs fails the suite
      on a theme that ships without one.

   Tokens deliberately NOT overridden per theme:
     --workspace-border and the scrollbar thumbs are white-alpha, so they hold
     their weight against any dark base. The semantic colours (live, danger,
     tool, cat-*, diff-*, data-*) are meanings rather than decoration and are
     measured to clear AA on every theme's surfaces — tests/contrast-tokens.mjs
     is what keeps that true.
   ============================================================ */

/* --- Slate ---------------------------------------------------
   Ink lifted off near-black onto a cool graphite ladder: the theme for a
   bright room, where a #08090a canvas is a mirror rather than a page.

   THE REASON THE THEME EXISTS CHANGED ON 2026-08-19, and the old sentence
   ("every text tier is measurably more legible here") is not recoverable, so
   it is not repeated. Ink now carries Linear's text ladder, whose secondary
   tier is much brighter than the grey it replaced. A theme sitting on a
   LIGHTER base cannot beat that on ratio without pushing its own text past
   white. What survives is the part that was always the real difference: the
   faint tier, which is where the 4.5:1 floor actually bites.

              Ink                Slate
     text     #f7f8f8 15.98:1    #f7f8f8 12.49:1
     muted    #d0d6e0 11.64:1    #d0d6e0  9.10:1
     faint    #8a8f98  5.23:1    #a4adbb  5.87:1

   (worst ratio across bg / surface / raised. Ink's faint tier clears the AA
   floor by 0.73 while 84 rules set text at 10-11px; Slate's clears it by
   1.37. Ink's own #8a8f98 would land at 4.09:1 on Slate's raised surface,
   which is why the faint tier is the one Slate still overrides.)

   The six surfaces keep Ink's relative steps so every lift, well and
   hover state means the same thing it meant before. -------------- */
:root[data-theme="slate"],
[data-theme-preview="slate"] {
  /* Surfaces, darkest first. The nav well still sits below the canvas. */
  --workspace-nav-bg: #14161b;
  --workspace-nav-hover: #1e222a;
  --workspace-nav-selected: #2a3039;
  --workspace-nav-border: #2f3540;
  --workspace-bg: #181b21;
  --workspace-overlay-bg: #1e222a;
  --workspace-surface: #232830;
  --workspace-surface-raised: #2a3039;
  --workspace-surface-hover: #333a45;
  --workspace-popover-bg: #232830;

  /* Text. Only the faint tier is overridden now: Ink's top two are Linear's
     and already clear AA with room on this lighter base (12.49:1 and 9.10:1),
     so re-declaring them would be two more values to keep in step for no
     measured gain. The faint tier is the one that does not survive the lift,
     at 4.09:1 against a 4.5 floor, so it is the one that moves. */
  --workspace-faint: #a4adbb;

  /* A lighter base needs a stronger hairline to read as a line at all. */
  --workspace-border-strong: #454c58;
  /* WCAG 2.2 SC 1.4.11 wants 3:1 of a control's edge. Ink's #62666d is only
     2.57:1 on this base, so a text field would be a rectangle you had to
     already know was there. #8b94a2 holds 3.74:1 on the worst of the six
     surfaces. */
  --workspace-control-border: #8b94a2;

  /* Accent: the same near-white, pulled a few degrees cool so it belongs to
     this base rather than sitting on top of it. */
  --workspace-accent: #eef1f6;
  --workspace-accent-rgb: 238, 241, 246;
  --workspace-scrollbar-thumb-active: #eef1f6;

  /* Ink on a light or saturated fill. 15.99:1 on the accent, 8.4:1 on the
     primary green, which is unchanged — the app still has one "go" colour. */
  --workspace-primary-fg: #14161b;

  /* Cool at the same weight as Ink's, which is now Linear's overlay-primary. */
  --workspace-scrim: rgba(8, 10, 14, 0.85);

  /* Usage page: the quiet grey accent, and the one well that sinks below the
     canvas instead of lifting off it. Both move with the base or the page
     reads as a black rectangle dropped into a lighter one.
     The -rgb member used to disagree with its own hex here too (174,180,192
     against 200,206,216); fixed in the same pass as Ink's. */
  --workspace-data-accent: #c8ced8;
  --workspace-data-accent-rgb: 200, 206, 216;
  --workspace-data-accent-dim: #5b6472;
  --workspace-well-from: #12141a;
  --workspace-well-to: #0d0f14;
}
