/* ============================================================================
 * BigBreakingWire Prime — Central Design Tokens (Part 2 foundation)
 * ----------------------------------------------------------------------------
 * Single source of truth for the Prime visual language. Part 1 audit found
 * three parallel token systems with the same hex values under different names
 * (style.css --accent-blue #2563eb vs dashboard --blue #1e56e0 vs per-page
 * --abw-* / --mf-* / --pc-* renames with drift). This file defines the canonical
 * set; every value below matches the agreed Part 1 specification (§E).
 *
 * SCOPE CONTRACT (do not widen without a visual diff on all 17 shell pages):
 * - This file declares :root CUSTOM PROPERTIES ONLY (plus color-scheme).
 *   Custom properties change nothing by themselves, so loading this sheet on
 *   a page that never references --bbw-* is a guaranteed visual no-op.
 * - It deliberately does NOT redefine legacy names (--bg, --surface, --blue,
 *   --abw-*, --mf-*, --pc-*). Page stylesheets keep owning those; the legacy
 *   -> canonical mapping is documented in the comment table at the bottom so
 *   Part 3 can migrate page by page. Redefining them here would silently win
 *   the cascade (foundation links resolve after page CSS on sidebar pages).
 * - No element selectors, no resets, no framework. Safe for wp-admin-adjacent
 *   contexts: unknown variables are inert.
 *
 * Load order: tokens -> bbw-shell.css -> bbw-components.css -> page CSS.
 * Cache busting is automatic (bbw_prime_asset_url appends filemtime).
 * ========================================================================== */

:root {
    color-scheme: light;

    /* ---- Surfaces: neutral analytical canvas, white working surface ------- */
    --bbw-bg-canvas: #eef1f5;
    --bbw-surface: #ffffff;
    --bbw-surface-2: #f7f9fb;
    --bbw-surface-3: #f0f3f7;

    /* ---- Borders ---------------------------------------------------------- */
    --bbw-border: #e2e7ee;
    --bbw-border-strong: #cfd8e3;

    /* ---- Accent: restrained institutional blue ---------------------------- */
    --bbw-blue: #1e56e0;
    --bbw-blue-strong: #1745b5;
    --bbw-blue-soft: #eef3ff;

    /* ---- Semantic market colors (never repurposed for chrome) -------------
     * Part 5 contrast audit: --bbw-up darkened #0e9f6e -> #0c7f5c so up-text
     * meets WCAG AA on white (4.99) and on --bbw-up-soft (4.55). Page
     * stylesheets own their separate --green tokens and are unaffected. */
    --bbw-up: #0c7f5c;
    --bbw-up-soft: #e8f8f1;
    --bbw-down: #d90429;
    --bbw-down-soft: #fdeef1;
    --bbw-amber: #b45309;
    --bbw-amber-soft: #fdf3e3;

    /* ---- Ink ---------------------------------------------------------------
     * --bbw-ink-3 is decorative/border-adjacent only: #8a97ab on white is
     * ~3.4:1 and FAILS WCAG AA for text. Body/metadata text MUST use
     * --bbw-ink / --bbw-ink-2 / --bbw-ink-3-text instead. */
    --bbw-ink: #0b1526;
    --bbw-ink-2: #46556c;
    --bbw-ink-3: #8a97ab;
    --bbw-ink-3-text: #5c6b80;

    /* ---- Typography -------------------------------------------------------- */
    --bbw-font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --bbw-mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;

    /* Type scale (desktop; shell compresses display sizes under 700px) */
    --bbw-text-display: 24px;
    --bbw-text-h2: 18px;
    --bbw-text-h3: 15px;
    --bbw-text-body: 14px;
    --bbw-text-label: 13px;
    --bbw-text-meta: 12px;
    --bbw-text-micro: 10.5px;

    /* ---- Spacing ------------------------------------------------------------ */
    --bbw-space-1: 4px;
    --bbw-space-2: 8px;
    --bbw-space-3: 12px;
    --bbw-space-4: 16px;
    --bbw-space-5: 20px;
    --bbw-space-6: 24px;
    --bbw-space-8: 32px;

    /* ---- Radii / elevation --------------------------------------------------- */
    --bbw-radius: 12px;
    --bbw-radius-sm: 8px;
    --bbw-radius-pill: 999px;
    --bbw-shadow-sm: 0 1px 2px rgba(11, 21, 38, .05);
    --bbw-shadow: 0 1px 3px rgba(11, 21, 38, .08), 0 5px 16px rgba(11, 21, 38, .07);
    --bbw-shadow-lg: 0 12px 40px rgba(11, 21, 38, .18);

    /* ---- Shell geometry ------------------------------------------------------- */
    --bbw-sidebar: 222px;
    --bbw-sidebar-rail: 64px;
    --bbw-topbar: 58px;
    --bbw-content-max: 1640px;
    --bbw-content-pad: 26px;

    /* ---- Interaction states ---------------------------------------------------- */
    --bbw-focus-ring: 0 0 0 3px rgba(30, 86, 224, .18);
    --bbw-transition-fast: .12s ease;
    --bbw-transition-med: .18s ease;

    /* ---- Z-index scale (single ladder; nothing above the ask FAB) -------------
     * Order matters: the drawer MUST sit above the overlay (the overlay dims
     * the page; the drawer stays interactive above it), and both stay below
     * modals. Regression fix: overlay-above-drawer buried the mobile menu
     * under a dull, click-eating layer. */
    --bbw-z-sticky: 60;
    --bbw-z-overlay: 96;
    --bbw-z-drawer: 120;
    --bbw-z-dropdown: 100;
    --bbw-z-modal: 200;
    --bbw-z-toast: 300;

    /* ---- Breakpoints (documented; plain CSS has no custom media) ---------------
     * --bbw-bp-*: 1160px content-narrow | 900px drawer/table-stack |
     *             700px compact | 600px pager-stack | 480px tiles.
     * The ONLY responsive rule the foundation owns is the 900px shell drawer;
     * everything else stays with page stylesheets until Part 3. */
}

/* ============================================================================
 * LEGACY -> CANONICAL MAPPING (documentation only, not code)
 * style.css:        --bg-canvas(#f4f6f8*) --card-bg --card-border --accent-blue
 *                   #2563eb* --accent-red --accent-green #10b981* --text-main
 *                   --text-muted   (* diverge from canonical; pages do not use
 *                   style.css tokens, so no migration needed there)
 * dashboard.css:    --bg --surface --surface-2 --surface-3 --border
 *                   --border-strong --blue --blue-strong --blue-soft --red
 *                   --red-soft --green --green-soft --amber --amber-soft --ink
 *                   --ink-2 --ink-3 --radius --radius-sm --shadow-sm --shadow
 *                   --font --sbw  ===  canonical values, renamed --bbw-*
 * technical-patterns.css + chart.php inline :root: same values as dashboard.
 * chart.css .pc-app:--pc-bg --pc-surface(2/3) --pc-border(2) --pc-text --pc-muted
 *                   --pc-dim --pc-accent(--hover/--soft) --pc-up(--soft)
 *                   --pc-down(--soft) --pc-radius  ===  canonical aliases.
 * facts --mf-* / ask --abw-*: same hues except surface-2 #f7f9fc (vs #f7f9fb),
 *                   up #12805c (vs #0e9f6e), down #c0392b (vs #d90429), radius
 *                   14/16px (vs 12px) — migrate explicitly in Part 3, do NOT
 *                   alias silently here.
 * ========================================================================== */
