/*
 * BattleKart design tokens: one source of truth for every dashboard surface.
 * Source: BattleKart Graphics Charter (April 2024), see
 * outreach/BATTLEKART_BRAND_SUMMARY.md and PRODUCT.md.
 *
 * Theme: "pit lane at night". Warm brown-black surfaces drawn from the logo
 * outline (#2C0700) and shadow (#421410), with the logo's orange, red and
 * yellow as the only accents. Numbers sit on calm neutrals so they stay the
 * loudest thing on the page.
 */

/* ---------- Brand fonts (self-hosted, charter section "Typography") ---------- */
@font-face { font-family: "Montreal"; src: url("/static/fonts/Montreal-Heavy.ttf") format("truetype"); font-weight: 700 900; font-display: swap; }
@font-face { font-family: "GROBOLD"; src: url("/static/fonts/GROBOLDpr.ttf") format("truetype"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Source Sans Pro"; src: url("/static/fonts/SourceSansPro-Light.ttf") format("truetype"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Source Sans Pro"; src: url("/static/fonts/SourceSansPro-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Source Sans Pro"; src: url("/static/fonts/SourceSansPro-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Source Sans Pro"; src: url("/static/fonts/SourceSansPro-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
    color-scheme: dark;

    /* ---------- Brand primitives (charter values, do not tweak) ---------- */
    --bk-outline: #2C0700;   /* logo line, RAL 8022 */
    --bk-shadow:  #421410;   /* logo shadow, RAL 3007 */
    --bk-red:     #C53421;   /* "KART", RAL 3000 */
    --bk-orange:  #EA591B;   /* "BATTLE", RAL 2003 */
    --bk-yellow:  #FFE00B;   /* background yellow, RAL 1023 */
    --bk-dots:    #FFDA00;   /* brick-dot pattern */
    --bk-impact:  #FFEE00;   /* impact yellow */

    /* ---------- Surfaces (warm neutrals, lightness steps of ~4%) ---------- */
    --surface-0: #120a07;    /* page */
    --surface-1: #1b120e;    /* cards */
    --surface-2: #241913;    /* raised: hover, inputs, table headers */
    --surface-3: #2f221b;    /* pressed, selected rows */
    --surface-sidebar: #160c08;
    --line-strong: #4a382e;
    --line: #35281f;
    --line-subtle: #281d17;

    /* ---------- Text (contrast on --surface-1) ---------- */
    --text-1: #fbf4ec;       /* 17:1  primary, numbers */
    --text-2: #d6c6b8;       /* 11:1  secondary */
    --text-3: #a8968a;       /* 6.4:1 labels, captions (AA) */
    --text-4: #7d6b60;       /* 3.6:1 decorative only, never for content */
    --text-on-accent: #1a0d07;

    /* ---------- Accents ---------- */
    --accent: var(--bk-orange);
    --accent-strong: #ff6a2b;
    --accent-soft: rgba(234, 89, 27, 0.14);
    --accent-ring: rgba(234, 89, 27, 0.45);
    --highlight: var(--bk-yellow);
    --highlight-soft: rgba(255, 224, 11, 0.12);

    /* ---------- Semantic (finance needs a positive colour the charter lacks) ---------- */
    --positive: #46c37b;
    --positive-soft: rgba(70, 195, 123, 0.14);
    --negative: #ff6b55;     /* brand red lifted for text contrast on dark */
    --negative-soft: rgba(197, 52, 33, 0.18);
    --warning: #ffb547;
    --warning-soft: rgba(255, 181, 71, 0.14);
    --info: #8fb8de;
    --info-soft: rgba(143, 184, 222, 0.14);

    /* ---------- Data visualisation (ordered, colour-blind aware) ---------- */
    --chart-1: #ea591b;
    --chart-2: #ffe00b;
    --chart-3: #8fb8de;
    --chart-4: #46c37b;
    --chart-5: #c58bd6;
    --chart-6: #d6c6b8;
    --chart-grid: rgba(251, 244, 236, 0.08);

    /* ---------- Type ---------- */
    --font-display: "Montreal", "Source Sans Pro", system-ui, sans-serif;
    --font-brand: "GROBOLD", "Montreal", system-ui, sans-serif; /* 2-3 word titles only */
    --font-body: "Source Sans Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, monospace;

    --text-xs: 12px;
    --text-sm: 13px;
    --text-base: 15px;
    --text-md: 17px;
    --text-lg: 20px;
    --text-xl: 26px;
    --text-2xl: 34px;
    --leading-tight: 1.15;
    --leading: 1.5;
    --tracking-label: 0.06em;

    /* ---------- Space (4px grid) ---------- */
    --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;

    /* ---------- Shape & depth ---------- */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-pill: 999px;
    --shadow-1: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-2: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 8px 24px rgba(0, 0, 0, 0.45);
    --focus-ring: 0 0 0 2px var(--surface-0), 0 0 0 4px var(--accent-ring);

    /* ---------- Motion ---------- */
    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
    --dur-fast: 120ms;
    --dur: 180ms;
    --dur-slow: 260ms;

    /* ---------- Layout ---------- */
    --sidebar-w: 232px;
    --content-max: 1440px;
}

@media (prefers-reduced-motion: reduce) {
    :root { --dur-fast: 0ms; --dur: 0ms; --dur-slow: 0ms; }
}
