/* ── Theme families ───────────────────────────────────────────────────────
   The Paper / Contrast token overrides, in their own file so that EVERY
   page can carry them -- including the templates that still declare their
   own local copy of the design tokens.

   Why this is not in editorial.css
   --------------------------------
   Most of the token-forking templates (settings, subscription, past_courses,
   canvas_settings, school_admin, and every legal page) do not link
   editorial.css at all -- they are self-contained, with their own :root
   block. When Contrast became the default on 2026-08-25 those pages simply
   ignored it: /academics/ and /calendar/ rendered true white while
   /settings/ and /legal/privacy/ stayed cream, because the family rules were
   not present on them. One small file every page can link fixes that without
   pulling editorial.css's component rules (.c-btn and friends) onto pages
   that were never styled against them.

   Why the selectors are :root-qualified
   -------------------------------------
   A bare [data-theme-family="contrast"] is specificity (0,1,0) -- exactly the
   same as the :root block those templates declare inline. Equal specificity
   means source order decides, and a template's inline <style> always comes
   after its <link>s, so the local tokens would win and nothing would change.
   :root[data-theme-family="contrast"] is (0,2,0) and beats a local :root
   (0,1,0) regardless of order. The dark rule is (0,3,0), which likewise beats
   the [data-theme="dark"] (0,1,0) block those templates use.

   Paper needs no rules at all: it IS each page's own base token set, which is
   why it stays the safe fallback if this file ever fails to load.

   Foreground values were measured against the surface they sit on.

   Dark-mode body text WAS dialled back to #d9d9d9 (14.88:1) on the reasoning
   that pure white on pure black reads as harsh -- the halation argument. That
   was overruled by the founder on 2026-08-27: on a true-black ground the
   softened grey read as washed out rather than gentle. Body text is now pure
   #ffffff (21:1). The SECONDARY tier is deliberately left at #b0b0b0 (9.68:1)
   -- lifting that to white too would flatten the type hierarchy, which is the
   thing the soft tier exists to carry.

   The two families are exact MIRRORS as of 2026-08-27, which is the property to
   preserve when touching either: primary is 21:1 in both, secondary is 10.4:1
   in both, and the gap between the tiers is 2.03:1 in both. Dark's secondary
   was #b0b0b0 (9.68:1), close enough to look deliberate and not be one. If you
   change one side, recompute the other rather than eyeballing a hex. */

:root[data-theme-family="contrast"] {
  --surface:      #ffffff;
  --card-surface: #ffffff;
  --text:         #000000;
  --text-soft:    #404040;   /* 10.37:1 on #fff -- mirrors #b6b6b6 on #000 */
  --line:         rgba(0, 0, 0, 0.14);
  --line-strong:  #5c5c5c;   /* 6.69:1 on #fff -- clears the 3:1 UI-border floor */
  --c-silver:     #ffffff;   /* see the dark block -- same reason, inverted */
}

:root[data-theme-family="contrast"][data-theme="dark"] {
  --surface:      #000000;
  --card-surface: #000000;   /* OLED-black everywhere; cards separate via border, not fill */
  --text:         #ffffff;   /* 21:1 on #000 -- pure white (founder, 2026-08-27) */
  --text-soft:    #b6b6b6;   /* 10.36:1 on #000 -- exact mirror of #404040 on #fff */
  --line:         rgba(255, 255, 255, 0.14);
  --line-strong:  #787878;   /* 4.76:1 on #000 -- clears the 3:1 UI-border floor */
  --c-silver:     #ffffff;   /* pages that fork their own tokens alias primary
                                text to --c-silver and read it DIRECTLY in ~11
                                places, bypassing --text. Without this line those
                                stayed #eef1f6 while everything else went white. */
}

/* ── One soft-text class ──────────────────────────────────────────────────
   Templates previously reached for `text-base-content/60`, `/70` and `/80` --
   three different alpha values doing one job, which rendered as three
   different greys and read as inconsistent rather than hierarchical.

   Hand-written rather than an @utility in input.css on purpose: tailwind.css
   is not reliably rebuilt in this repo (see the status-badge note), so a
   build-dependent class would silently not exist. This file is linked by every
   page and needs no build step, which is the same reason the family tokens
   live here. */
.text-soft { color: var(--text-soft); }
