/* 01_tokens.css - KP Equipment design tokens. EVERY global design token lives in this one file.
 *
 * Source: KP CIC styles/01_tokens.css (names and values copied, light :root + dark [data-theme="dark"],
 * legacy aliases, paper) and the house-bar tokens from KP CIC styles/08_brand.css, as mapped in
 * docs/research/kpcic-shell-map.md section 2 (slice B26). Nothing else may define a global token.
 *
 * OPEN ITEMS for the design pass (known differences from the register design v3 - NOT resolved here):
 *  1. --warn / --bad: CIC aliases them to --warning (#d97706) / --danger (#dc2626); v3 means
 *     #b45309 / #b91c1c. v3 CSS must map to --warning-fg / --danger-fg / --success-fg (or be
 *     namespaced), never redefine --warn / --bad. Kept here as CIC has them.
 *  2. Theme: CIC never follows the OS and always sets data-theme (adopted here, see 20_theme.js);
 *     v3 follows the OS via prefers-color-scheme. No prefers-color-scheme arm is shipped.
 *  3. Font stack: CIC --font names Inter (never loaded, Segoe UI in practice); v3 says
 *     Calibri / Carlito (Carlito self-hosted in 57). Owner / plan decision owed. CIC stack kept.
 *  4. Breakpoints: CIC 700 / 1080 (Settings 760 / 960 / 1280); v3 640 / 1000 / 1180 with no
 *     `screen` scoping (breaks the A4 print invariant). No breakpoint is defined in this slice.
 *  5. Tokens v3 needs that CIC lacks: --canvas, --surface-3, --line-strong, --accent-ink,
 *     --lock-bg / --lock-ink, --navy-deep, --sat / --sab (v3 dark --canvas #0b1220 vs CIC --bg
 *     #0b1120 - one digit apart, probably a typo on one side). Not added.
 *  6. --kp-size: defined in CIC 08_brand.css on a line B26 did not read; 16px here is CIC's
 *     04_shell.css:394 override value (14px at :403). UNVERIFIED.
 */

:root {
  color-scheme: light;

  --brand: #2563eb;
  --brand-hover: #1d4ed8;
  --brand-soft: #dbeafe;
  --brand-solid: #2563eb;
  --brand-solid-hover: #1d4ed8;
  --on-brand: #ffffff;
  --danger-solid: #dc2626;
  --navy: #1e3a5f;
  --navy-hover: #2b4d78;
  --ink-deep: #0f172a;

  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --ink: #0f172a;
  --ink-soft: #475569;
  --ink-muted: #5a6a80;
  --line: #e2e8f0;
  --line-soft: #f1f5f9;

  --success: #16a34a;
  --success-bg: #dcfce7;
  --success-fg: #15803d;
  --warning: #d97706;
  --warning-bg: #fef3c7;
  --warning-fg: #b45309;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --danger-fg: #b91c1c;
  --info: #0369a1;
  --info-bg: #e0f2fe;
  --violet: #7c3aed;
  --violet-bg: #ede9fe;
  --amber-action: #f59e0b;

  --filled-bg: #f2faf2;
  --filled-line: #b7dcbb;
  --tool-frame: #e2e8f0;

  --r-sm: 6px;
  --r: 10px;
  --r-modal: 8px;
  --r-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(15,23,42,.05);
  --shadow: 0 1px 3px rgba(15,23,42,.08), 0 4px 12px rgba(15,23,42,.05);
  --shadow-lg: 0 12px 32px rgba(15,23,42,.14);
  --scrim: rgba(15,23,42,.45);

  --font: 'Inter','Segoe UI',system-ui,-apple-system,sans-serif;
  --mono: 'Consolas',ui-monospace,monospace;

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

  --dur-fast: 0.12s;
  --dur: 0.18s;
  --dur-slow: 0.25s;
  --ease: cubic-bezier(.4,0,.2,1);
  --ease-out: cubic-bezier(0,0,.2,1);

  --site-orkie: #0e7490;
  --site-balmalcolm: #be185d;

  /* House bar (CIC 08_brand.css:15-32) */
  --kp-bar: var(--navy);
  --kp-bar-ink: #ffffff;
  --kp-bar-ink-2: rgba(255,255,255,.7);
  --kp-bar-line: rgba(255,255,255,.28);
  --kp-bar-tint: rgba(255,255,255,.1);
  --kp-bar-on: #ffffff;
  --kp-bar-ring: #ffffff;
  --kp-bar-shadow: 0 2px 8px rgba(0,0,0,.15);
  --kp-k1: #111111;
  --kp-k2: #4a9d3f; /* large text only */
  --kp-dot-ok: #4ade80;
  --kp-dot-bad: #f87171;
  --kp-avatar: rgba(255,255,255,.16);
  --kp-avatar-ink: #ffffff;
  --kp-avatar-line: rgba(255,255,255,.35);
  --kp-size: 16px; /* UNVERIFIED, open item 6 */
}

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

  --brand: #60a5fa;
  --brand-hover: #93c5fd;
  --brand-soft: rgba(59,130,246,.18);
  --on-brand: #0b1120;
  --navy: #172033;
  --navy-hover: #243047;
  --ink-deep: #f8fafc;

  --bg: #0b1120;
  --surface: #1e293b;
  --surface-alt: #0f172a;
  --ink: #f1f5f9;
  --ink-soft: #cbd5e1;
  --ink-muted: #94a3b8;
  --line: #334155;
  --line-soft: #1e293b;

  --success: #4ade80;
  --success-bg: rgba(34,197,94,.15);
  --success-fg: #4ade80;
  --warning: #fbbf24;
  --warning-bg: rgba(217,119,6,.18);
  --warning-fg: #fbbf24;
  --danger: #f87171;
  --danger-bg: rgba(220,38,38,.18);
  --danger-fg: #f87171;
  --info: #38bdf8;
  --info-bg: rgba(3,105,161,.20);
  --violet: #a78bfa;
  --violet-bg: rgba(124,58,237,.20);

  --filled-bg: #334155;
  --filled-line: #64748b;
  --tool-frame: #cbd5e1;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.40);
  --shadow: 0 1px 3px rgba(0,0,0,.45), 0 4px 12px rgba(0,0,0,.35);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.55);
  --scrim: rgba(0,0,0,.6);

  --site-orkie: #67e8f9;
  --site-balmalcolm: #f9a8d4;

  /* House bar (CIC 08_brand.css:38-41) */
  --kp-bar: var(--surface);
  --kp-bar-ink: var(--ink);
  --kp-bar-ink-2: var(--ink-2);
  --kp-bar-line: var(--line);
  --kp-bar-tint: rgba(255,255,255,.06);
  --kp-bar-on: var(--brand);
  --kp-bar-ring: var(--brand);
  --kp-bar-shadow: inset 0 2px 0 0 var(--brand), inset 0 -1px 0 0 var(--line), 0 2px 8px rgba(0,0,0,.35);
}

/* Legacy aliases, both themes (CIC 01_tokens.css:116-137) */
:root, [data-theme="dark"] {
  --acc: var(--brand);
  --acc-strong: var(--brand-hover);
  --acc-deep: var(--navy);
  --acc-ink: #ffffff;
  --bg-2: var(--surface-alt);
  --panel: var(--surface);
  --panel-2: var(--surface-alt);
  --line-2: var(--line);
  --ink-2: var(--ink-soft);
  --ink-3: var(--ink-muted);
  --ok: var(--success);
  --warn: var(--warning);
  --bad: var(--danger);
  --ff: var(--font);
  --r-s: var(--r-sm);
  --r-m: var(--r);
  --r-l: var(--r);
  --sp: 4px;
  --ring: 0 0 0 2px var(--brand-soft);
  --maxw: 1180px;
}

/* Paper (CIC 01_tokens.css:140) */
:root {
  --paper: #ffffff;
  --paper-ink: #0f172a;
}
