/*  VOLURR — institutional design tokens  ·  tokens.css
    PURELY ADDITIVE foundation layer. Loaded right after base.css.
    Adds the scales DESIGN.md prescribes but base.css never tokenized (spacing, radius rungs,
    elevation, z-index, motion) + semantic colour ALIASES that resolve to existing values.
    ⚠ Does NOT redefine any existing token (--bg/--card/--gold/--up/--r/--r2/--shadow … stay authoritative
      in base.css; .cmx + chart-card local tokens stay untouched) → cannot change current rendering. */
:root{
  /* ── spacing scale (DESIGN.md §5: 4·6·8·10·12·14·16·18, + two larger group gaps) ── */
  --sp-1:4px; --sp-2:6px; --sp-3:8px; --sp-4:10px; --sp-5:12px;
  --sp-6:14px; --sp-7:16px; --sp-8:18px; --sp-9:24px; --sp-10:32px;

  /* ── radius scale (fills the rungs between the existing --r2:10 / --r:14) ── */
  --rad-xs:6px; --rad-sm:9px; --rad-md:var(--r2,10px); --rad-lg:var(--r,14px); --rad-xl:18px; --rad-pill:999px;

  /* ── elevation (DESIGN.md §6 shadow tokens; --shadow stays the legacy card token) ── */
  --el-1:0 4px 12px rgba(0,0,0,.32);
  --el-2:0 8px 22px rgba(0,0,0,.40);
  --el-3:0 16px 44px rgba(0,0,0,.45);
  --el-4:0 24px 70px rgba(0,0,0,.62);

  /* ── motion ── */
  --dur-1:.12s; --dur-2:.18s; --dur-3:.3s; --ease:cubic-bezier(.2,.9,.3,1);

  /* ── z-index scale (matches base.css: ticker 60 · side 50 · topbar 40) ── */
  --z-base:1; --z-nav:40; --z-side:50; --z-ticker:60; --z-popover:120; --z-modal:300; --z-overlay:1000;

  /* ── semantic colour aliases — resolve to EXISTING values, no visual change ──
       (fix the "--gold is actually red" naming confusion without flipping anything) */
  --brand:var(--gold); --brand-2:var(--gold2); --brand-glow:var(--glow);

  /* accents that components currently hardcode as raw hex — now tokenised & global.
     ⚠ usage: on SOLID FILLS pair --amber/--warn/--info with DARK text (#14161c) — white text fails AA on them
        (reserve white-on-fill for --brand). As TEXT, use them only on dark surfaces / at large+bold sizes. */
  --amber:#e8a33d; --amber-bg:rgba(232,163,61,.15);   /* chart-UI active accent / borders (was local --pcac) — UI & borders, not <14px body text */
  --warn:#f59e0b;                                      /* medium-impact / stale-feed */
  --info:#3aa0ff;                                      /* informational / KPI blue */
  --ai:#b06bff;                                        /* AI / analyst accent */

  /* ════════════════════════════════════════════════════════════════════════════
     BR-AGI-001 · OFFICIAL VOLURR AGI BRAND-BOOK TOKENS  (internal standard · v1.0 · 2026)
     The single source of truth for the brand vocabulary, derived from the Claude Design
     Brand Book (see app/BRAND.md). Names are the brand-book's canonical names; values
     ALIAS the app's authoritative tokens (base.css) so the project is standardised
     WITHOUT changing the shipped look — and auto-flip in light theme via --gold/--txt.
     COLOR LAW: crimson is the brand; --up green / --down red are RESERVED for price
     direction only (never chrome). Honesty + analysis-only are brand principles, not just legal.
     ──────────────────────────────────────────────────────────────────────────── */
  --crimson:var(--gold); --crimson-light:var(--gold); --crimson-deep:#b81e26;   /* brand crimson (real --gold, theme-aware) + gradient deep-end */
  --shield-1:#ff9a9a; --shield-2:#e23b3b; --shield-3:#7e1414; --shield-depth:#560d0d; --shield-gloss-1:#ff6262; --shield-gloss-2:#9c1c1c;   /* 3D shield-mark gradient stops (centralised from the landing LP_SHIELD) */
  --crimson-grad:linear-gradient(135deg,var(--crimson),var(--crimson-deep));     /* canonical brand fill */
  --t-primary:var(--txt); --t-secondary:var(--txt2); --t-muted:var(--muted); --t-faint:var(--muted);   /* text tiers → real values */
  --surface-base:var(--bg); --surface-panel:var(--card); --surface-deepest:var(--bg2); --line-3:var(--line);   /* surfaces + raised hairline */
  --font-latin:'Inter',system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;     /* Latin display + UI */
  --font-ar:'Cairo','Noto Kufi Arabic',sans-serif;                               /* Arabic (RTL, primary) */
  --font-ku:'Vazirmatn','Cairo',sans-serif;                                      /* Kurdish / Persian */
  --font-mono:ui-monospace,'SF Mono','JetBrains Mono',Menlo,Monaco,Consolas,monospace;   /* data labels / codes (tabular-nums elsewhere) */
}

/* light theme: soften elevation to match base.css's light --shadow (cool, low-alpha) */
html[data-theme="light"]{
  --el-1:0 4px 12px rgba(40,55,90,.10);
  --el-2:0 8px 22px rgba(40,55,90,.14);
  --el-3:0 16px 40px rgba(40,55,90,.16);
  --el-4:0 24px 60px rgba(40,55,90,.20);
  --amber:#c9831f; --warn:#b45309; --info:#1f72e0; --ai:#8a3ff0;   /* deepen accents for AA on white (--warn/--info/--ai pass AA text; --amber is UI/border tier ~3:1) */
}
