/* paper-ledger - uiforagents identity tokens for the etelej.com lab-sites.
   Scoped to [data-theme="paper-ledger"] (set on <html> by BaseLayout) so
   identities coexist side by side, mirroring espresso-panel-theme.css.
   Values are the paper-ledger identity spec (uiforagents identities/
   paper-ledger/foundation.css): cool paper, near-black ink, one deep
   ink-blue accent, hairline rules, sans statement text with mono
   tabular figures, 4px radii.

   Dual theme rides the identity's light-dark() pairs verbatim: the file
   pins color-scheme: dark so the shared [data-scheme] hook works in both
   directions, and the [data-scheme="light"] hook - the masthead scheme
   toggle - flips it to light. The identity's canonical scheme is light
   (slot 1 values); dark is the derived alternative, re-gated for
   contrast. Fonts: the identity ships system sans + system mono, so the
   stacks are declared here and nothing preloads. */

[data-theme="paper-ledger"] {
  color-scheme: dark;

  /* paper-ledger native vocabulary (light-dark: slot 1 light, slot 2 dark) */
  --bg:          light-dark(oklch(0.977 0.003 250), oklch(0.205 0.010 260));
  --surface:     light-dark(oklch(1 0 0),           oklch(0.245 0.011 260));
  --ink:         light-dark(oklch(0.250 0.012 260), oklch(0.930 0.008 260));
  --muted:       light-dark(oklch(0.500 0.012 260), oklch(0.720 0.012 260));
  --faint:       light-dark(oklch(0.620 0.010 250), oklch(0.545 0.012 260));
  --line:        light-dark(oklch(0.905 0.006 250), oklch(0.335 0.012 260));
  --line-strong: light-dark(oklch(0.760 0.010 250), oklch(0.460 0.014 260));
  --accent:      light-dark(oklch(0.420 0.130 262), oklch(0.720 0.115 262));
  --accent-ink:  light-dark(oklch(0.985 0.002 250), oklch(0.180 0.020 262));
  --accent-soft: light-dark(oklch(0.420 0.130 262 / 0.07), oklch(0.720 0.115 262 / 0.14));
  --ok:     light-dark(oklch(0.520 0.110 155), oklch(0.760 0.120 155));
  --warn:   light-dark(oklch(0.550 0.120 75),  oklch(0.800 0.120 75));
  --danger: light-dark(oklch(0.520 0.170 27),  oklch(0.720 0.150 27));
  --radius: 4px;
  --r-sm: 2px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;

  /* Ledger extras (verbatim; the rule hierarchy is arithmetic notation:
     hairlines separate rows, strong rules bound blocks, the single rule
     under a subtotal means the figures above sum to the figure below,
     the double rule means proved final). */
  --rule-sub: light-dark(oklch(0.380 0.014 260), oklch(0.820 0.010 260));

  /* Derived chrome tones (color-mixed from the palette, never new colors) */
  --surface-2: color-mix(in oklab, var(--surface) 94%, var(--ink));
  --sunken: color-mix(in oklab, var(--bg) 93%, var(--ink));
  --line-soft: color-mix(in oklab, var(--line) 55%, var(--surface));

  /* Instrument extras (verbatim; derive from the palette, never new colors) */
  --chart-grid: var(--line);
  --chart-axis: var(--line-strong);
  --chart-label: var(--faint);
  --chart-value: var(--muted);
  --chart-series: var(--accent);
  --chart-series-dim: var(--faint);

  /* Lab-site shared component vocabulary (the same names graphite-theme.css
     defines) mapped onto the identity tokens, so identity-agnostic
     components keep their three-level fallbacks working under this
     identity. Statement text is the sans; every numeral, table head, and
     label voice is the mono; severity is the identity's state trio. */
  --background: var(--bg);
  --foreground: var(--ink);
  --card: var(--surface);
  --card-foreground: var(--ink);
  --popover: var(--surface);
  --popover-foreground: var(--ink);
  --primary: var(--accent);
  --primary-foreground: var(--accent-ink);
  --secondary: var(--accent-soft);
  --secondary-foreground: var(--ink);
  --muted-foreground: var(--muted);
  --accent-foreground: var(--accent);
  --destructive: var(--danger);
  --destructive-foreground: var(--accent-ink);
  --ok-soft: color-mix(in oklab, var(--ok) 12%, transparent);
  --ok-foreground: var(--ok);
  --warn-soft: color-mix(in oklab, var(--warn) 12%, transparent);
  --warn-foreground: var(--warn);
  --danger-soft: color-mix(in oklab, var(--danger) 13%, transparent);
  --danger-soft-foreground: var(--danger);
  --border: var(--line);
  --input: var(--line);
  --ring: var(--accent);
  --font-display: var(--sans);
  --font-sans: var(--sans);
  --font-mono: var(--mono);
  --shadow-identity: none;
}

/* The masthead scheme toggle flips data-scheme; light-dark() follows. */
[data-theme="paper-ledger"][data-scheme="light"] {
  color-scheme: light;
}
