/* =============================================================================
 * vault/tokens.css: the PackOS design-system tokens for the ABM Vault shell.
 *
 * PROVENANCE. PackOS Design System, claude.ai artifact 8bNMPXeYArarSM4UFTnWm2,
 * version 1793080229-0e50, tokens.json v3. That system ships no tokens.css; the
 * blocks below are tokens.json compiled the way its repo/build-tokens.mjs does
 * (copied from ~/abm-vault-ds-ref/tokens.compiled.css on 2026-10-26), then:
 *   1. the measured WCAG overrides the Vault carries (dieline-studio vault-ui.css,
 *      origin/next-release 23205835d), listed below;
 *   2. a type scale (--fs-*) read from tokens.json's type groups, which
 *      build-tokens.mjs does not emit, so vault/components.css never writes px;
 *   3. three colours bundle.css wrote as literals, given names here;
 *   4. --line and --line-strong moved off :root (styles.css owns --line there);
 *   5. bridge aliases from ABM's own variables, under body.vui only.
 *
 * NO VISUAL CHANGE ON ITS OWN. Every name on :root below is new to ABM (checked
 * against public/ and src/ on 27ae8566). Every rule that re-points an existing
 * ABM name sits under body.vui, which no page carries yet. This is the only
 * stylesheet in public/vault/ allowed hex literals (test/design-drift.test.mjs).
 *
 * MEASURED OVERRIDES (WCAG 2.2; carried from vault-ui.css, which measured them):
 *   alias            system value   measured            here       measured
 *   --text-muted     #6c7079        4.43 on sunken      #5b6474    5.33 sunken / 5.72 paper
 *   --text-danger    #d94f33        3.93 on paper       coral-700  5.72 paper / 5.33 sunken
 *   --border-strong  #d2ccbc        1.54 on paper       ink @ 50%  3.36 paper / 3.45 card
 * and one measured for this port (test/vault-ui-browser.test.mjs found it), as
 * .pk-badge-pending text over --status-pending-subtle composited on each surface:
 *   --status-pending #96690f        4.30 on paper       #85600d    5.05 paper / 5.17 card / 4.75 sunken
 * --status-positive (#03a396, 3.01) is for fills and dots, never behind text.
 *
 * TYPE. tokens.json names Inter first; ABM loads no webfonts (CSP style-src
 * 'self'), so the stack falls through to the system face where Inter is absent.
 * ========================================================================== */

:root,[data-theme="paper"]{
  /* ---- brand primitives (the kit, exact) ---------------------------------- */
  --teal-50:#e8faf8;--teal-100:#c6f2ee;--teal-200:#93e7e0;--teal-300:#5cdbd2;--teal-400:#23cfc3;
  --teal-500:#05c6b8;--teal-600:#03a396;--teal-700:#067a6f;--teal-800:#055b53;--teal-900:#043a35;
  --ink-200:#c3c6cb;--ink-300:#9aa0a8;--ink-400:#6c7079;--ink-500:#565b64;
  --ink-600:#3d4149;--ink-700:#2a2d34;--ink-800:#20232a;--ink-900:#16181d;
  --paper-0:#ffffff;--paper-50:#fffdf8;--paper-100:#fbfaf7;--paper-200:#f4f2ec;
  --paper-300:#e9e5db;--paper-400:#e2ddd1;--paper-500:#d2ccbc;
  --coral-100:#fde6e0;--coral-300:#f7a794;--coral-500:#f0684c;--coral-600:#d94f33;--coral-700:#b03c24;
  --yellow-500:#f2c53d;--cyan-500:#00b7e8;--magenta-500:#f0368f;--foil-500:#d9b34a;
  --green-600:#1a8251;--warn-600:#b45309;

  /* ---- semantic surfaces -------------------------------------------------- */
  --surface-page:var(--paper-100);
  --surface-card:var(--paper-50);
  --surface-sunken:var(--paper-200);
  --surface-inset:var(--paper-300);

  /* ---- semantic text (three differ from the system; see the header) -------- */
  --text-body:var(--ink-900);
  --text-muted:#5b6474;
  --text-subtle:var(--ink-300);           /* placeholders and disabled only (2.53:1), never content */
  --text-accent:var(--teal-700);
  --text-danger:var(--coral-700);
  --text-on-accent:var(--ink-900);        /* 8.27:1 on teal-500; never white */
  --text-on-ink:var(--paper-100);
  --text-on-ink-muted:#a7aab2;            /* bundle.css .pk-toast span literal; vault-ui.css name */

  /* ---- semantic lines ----------------------------------------------------- */
  --border-hairline:var(--paper-400);     /* decorative (1.30), on purpose */
  --border-strong:rgba(22,24,29,0.50);    /* the edge of a control: 3:1 under 1.4.11 */
  --border-on-ink:#2f333b;                /* bundle.css .pk-card-ink literal; vault-ui.css name */
  --rule:var(--paper-500);

  /* ---- semantic status ---------------------------------------------------- */
  --status-positive:var(--teal-600);
  --status-positive-subtle:var(--teal-50);
  --status-attention:var(--coral-500);
  --status-attention-subtle:var(--coral-100);
  --status-neutral:var(--ink-400);
  --status-neutral-subtle:var(--paper-200);
  --status-pending:#85600d;               /* measured; the system's #96690f is 4.30 as badge text (header) */
  --status-pending-subtle:rgba(217,179,74,0.13);
  --status-pending-line:rgba(217,179,74,0.55); /* bundle.css .pk-badge-pending border literal */
  --status-agent:var(--teal-700);

  /* ---- focus, scrim, grid ------------------------------------------------- */
  --focus-ring:var(--teal-500);
  --scrim:rgba(22,24,29,0.46);
  --grid-line:rgba(22,24,29,0.055);

  /* ---- space and layout --------------------------------------------------- */
  --space-1:4px;--space-2:8px;--space-3:12px;--space-4:16px;--space-5:20px;--space-6:24px;
  --space-8:32px;--space-10:40px;--space-12:48px;--space-16:64px;--space-24:96px;
  --gutter:44px;--measure:56ch;--layout-max:1160px;--app-sidebar:248px;--app-rail:72px;
  --control-h-s:30px;--control-h-m:38px;--control-h-l:46px;

  /* ---- radius ------------------------------------------------------------- */
  --radius-hair:2px;--radius-xs:3px;--radius-doc:4px;--radius-s:6px;--radius-m:8px;
  --radius-ctl:10px;--radius-card:14px;--radius-lg:18px;--radius-pill:999px;

  /* ---- type: tokens.json type groups (sizes) plus the three bundle.css uses
     that the system does not name (15, 12 and 10px) --------------------------- */
  --fs-hero:60px;--fs-h1:44px;--fs-h2:30px;--fs-title:22px;--fs-lead:19px;--fs-h3:18px;
  --fs-body:16px;--fs-ui-l:15px;--fs-body-s:14px;--fs-caption:13px;--fs-data:13px;
  --fs-meta:12px;--fs-label:11px;--fs-data-s:11px;--fs-micro:10px;--fs-chip:9px;
  --fw-regular:400;--fw-medium:500;--fw-semibold:600;--fw-bold:700;
  --tracking-label:0.16em;--tracking-label-loose:0.28em;
  --font-sans:"Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono:ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  /* ---- elevation ---------------------------------------------------------- */
  --shadow-1:0 1px 2px rgba(22,24,29,0.05);
  --shadow-2:0 2px 6px rgba(22,24,29,0.06), 0 1px 1px rgba(22,24,29,0.04);
  --shadow-3:0 8px 24px rgba(22,24,29,0.08), 0 2px 6px rgba(22,24,29,0.04);
  --shadow-4:0 24px 60px rgba(22,24,29,0.14), 0 6px 16px rgba(22,24,29,0.06);
  --glow-accent:0 0 0 1px #05c6b8, 0 0 24px rgba(5,198,184,0.28);
  --focus-input:0 0 0 3px rgba(5,198,184,0.38);

  /* ---- motion: mechanical and fast, no overshoot --------------------------- */
  --dur-instant:80ms;--dur-fast:140ms;--dur-base:220ms;--dur-slow:380ms;--dur-stage:700ms;
  --ease-standard:cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-out:cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:cubic-bezier(0.5, 0, 0.9, 0.2);
  --press-scale:0.985;

  /* ---- stacking, breakpoints, opacity ------------------------------------- */
  --z-sticky:10;--z-dialog:40;--z-toast:60;
  --bp-xs:400px;--bp-sm:640px;--bp-md:768px;--bp-lg:900px;--bp-xl:1024px;--bp-2xl:1200px;
  --opacity-disabled:0.45;--opacity-on-ink-muted:0.72;--opacity-bar:0.92;--opacity-topbar:0.82;
}

/* The reversed theme. Nothing in ABM sets data-theme="ink" today. */
[data-theme="ink"]{
  --surface-page:var(--ink-900);--surface-card:var(--ink-800);--surface-sunken:#101216;--surface-inset:var(--ink-700);
  --text-body:var(--paper-100);--text-muted:#a7aab2;--text-subtle:#8a8f99;--text-accent:var(--teal-400);--text-danger:var(--coral-300);
  --border-hairline:#2f333b;--border-strong:var(--ink-400);--rule:var(--ink-700);
  --status-positive-subtle:var(--teal-900);--status-attention-subtle:#3c1d15;--status-neutral-subtle:var(--ink-700);
  --status-pending-subtle:rgba(217,179,74,0.18);--grid-line:rgba(255,255,255,0.055);
  color-scheme:dark;
}

@media (prefers-reduced-motion:reduce){
  :root{--dur-instant:0ms;--dur-fast:0ms;--dur-base:0ms;--dur-slow:0ms;--dur-stage:0ms;--press-scale:1}
}

/* =============================================================================
 * OPTED-IN PAGES ONLY (body.vui).
 *
 * --line / --line-strong are the system's names, but public/styles.css already
 * defines --line on :root for the classic workspace, so they live here instead.
 *
 * BRIDGE ALIASES. ABM's stylesheets draw with --pk-* (served as /brand/tokens.css
 * from src/brand/web-brand.mjs), --ui-accent* (ui-tokens.css) and styles.css's
 * short names. On a body.vui page those resolve to the system's tokens, so
 * classic content dropped into the new shell takes its surfaces without a
 * rename sweep: the way dieline-studio vault-ui.css aliases auth.css. Short
 * names derived on :root (--ui-accent-strong, --muted, --ink ...) are restated
 * because a custom property computed on :root does not re-resolve below it.
 * Not aliased, because the system has no matching role: --pk-mark (logo teal),
 * --pk-goodFill (green fill), --pk-fillTint vs --lime stay ABM's own colours.
 * ========================================================================== */
body.vui{
  --line:rgba(22,24,29,0.10);
  --line-strong:rgba(22,24,29,0.18);

  /* ui-tokens.css */
  --ui-accent:var(--text-accent);
  --ui-accent-strong:var(--teal-800);

  /* /brand/tokens.css (--pk-*) */
  --pk-ink:var(--text-body);
  --pk-muted:var(--text-muted);
  --pk-line:var(--border-hairline);
  --pk-line2:var(--rule);
  --pk-bg:var(--surface-page);
  --pk-card:var(--surface-card);
  --pk-card2:var(--surface-sunken);
  --pk-accent:var(--text-accent);
  --pk-fill:var(--teal-500);
  --pk-fillInk:var(--text-on-accent);
  --pk-fillTint10:var(--status-positive-subtle);
  --pk-warnText:var(--status-pending);
  --pk-warnFill:var(--yellow-500);
  --pk-errText:var(--text-danger);
  --pk-errFill:var(--coral-500);
  --pk-good:var(--green-600);
  --pk-sans:var(--font-sans);
  --pk-mono:var(--font-mono);

  /* styles.css short names (derived from --pk-* on :root) */
  --paper:var(--surface-page);
  --white:var(--surface-card);
  --ink:var(--text-body);
  --muted:var(--text-muted);
  --green:var(--text-accent);
  --soft:var(--status-positive-subtle);
  --amber:var(--status-pending);
  --sans:var(--font-sans);
}
[data-theme="ink"] body.vui,body.vui[data-theme="ink"],body.vui [data-theme="ink"]{
  --line:#2f333b;
  --line-strong:var(--ink-600);
}
