/*
 * CricketHype design tokens (Runbook 29; docs/DESIGN.md). From the owner's design canvas (Oct 2026). Plain CSS custom
 * properties: light on :root, dark under [data-theme="dark"] (on any element: a page or one block). Loaded ONLY by the pages
 * built on the kit (with ch-ui.css); site.css is legacy and unchanged. Every text/background pair the kit uses is checked
 * for WCAG AA in tests/Feature/DesignTokensContrastTest.php (4.5:1 body text, 3:1 large text): add a pair there with a new use.
 * Fonts are self-hosted (public/fonts, OFL licences in public/fonts/LICENSES); never overwrite a font file, new bytes need a
 * new file name (nginx serves fonts with "expires max").
 */
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/barlow-v13-400-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/barlow-v13-500-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/barlow-v13-600-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/barlow-v13-700-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/barlow-condensed-v13-600-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/barlow-condensed-v13-700-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 800; font-display: swap; src: url("../fonts/barlow-condensed-v13-800-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root, [data-theme="light"] {
    color-scheme: light;

    /* Brand (fixed in both themes) */
    --ch-orange: #F26B1D;          /* on dark only (fills, links, accents) */
    --ch-orange-ink: #C2410C;      /* on light: text, links, the primary button */
    --ch-gold: #FFC928;            /* on navy/dark only; text on gold is navy */
    --ch-navy: #0A1636;

    /* Theme roles (light) */
    --ch-accent: var(--ch-orange-ink);
    --ch-accent-hover: #9A3412;
    --ch-on-accent: #FFFFFF;
    --ch-text: #0E1525;
    --ch-text-2: #3D475C;
    --ch-muted: #5A6478;
    --ch-bg: #F4F6FA;
    --ch-surface: #FFFFFF;
    --ch-surface-2: #EEF1F6;       /* table heads, quiet fills (between bg and border-1) */
    --ch-border: #E2E6EE;
    --ch-border-2: #D5DBE6;
    --ch-border-3: #C9D0DC;        /* the strongest decorative line */
    --ch-control-edge: #7B8599;    /* an input's edge: 3:1 on the surface and the page (WCAG 1.4.11; the canvas's #C9D0DC is 1.55:1) */
    --ch-focus: #C2410C;
    --ch-danger-text: #DC2626;     /* an error line on the surface */

    /* Status (badges and alerts carry their own background: the same in both themes) */
    --ch-success: #16A34A;
    --ch-success-bg: #DCFCE7;
    --ch-success-ink: #166534;
    --ch-warning: #D97706;
    --ch-warning-bg: #FEF3C7;
    --ch-warning-ink: #92400E;
    --ch-danger: #DC2626;
    --ch-danger-2: #E11D48;
    --ch-danger-bg: #FFE4E6;
    --ch-danger-ink: #9F1239;
    --ch-info: #1E3A8A;
    --ch-info-bg: #DBEAFE;
    --ch-neutral-bg: #E2E6EE;
    --ch-neutral-ink: #3D475C;

    /* Type */
    --ch-font-body: "Barlow", "Segoe UI", system-ui, sans-serif;
    --ch-font-display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
    --ch-fs-12: .75rem;
    --ch-fs-13: .8125rem;
    --ch-fs-14: .875rem;
    --ch-fs-15: .9375rem;
    --ch-fs-16: 1rem;
    --ch-fs-20: 1.25rem;
    --ch-fs-22: 1.375rem;
    --ch-fs-26: 1.625rem;
    --ch-fs-34: 2.125rem;
    --ch-fs-48: 3rem;

    /* Radius */
    --ch-r-4: 4px;
    --ch-r-6: 6px;
    --ch-r-10: 10px;
    --ch-r-12: 12px;
    --ch-r-14: 14px;
    --ch-r-20: 20px;
    --ch-r-card: var(--ch-r-12);
    --ch-r-control: var(--ch-r-10);

    /* Space (4 px scale) */
    --ch-s-1: 4px;
    --ch-s-2: 8px;
    --ch-s-3: 12px;
    --ch-s-4: 16px;
    --ch-s-5: 20px;
    --ch-s-6: 24px;
    --ch-s-8: 32px;
    --ch-s-10: 40px;

    --ch-tap: 44px;                /* the smallest tap target */
    --ch-shadow: 0 1px 2px rgba(14, 21, 37, .06), 0 2px 8px rgba(14, 21, 37, .06);
}

[data-theme="dark"] {
    color-scheme: dark;
    --ch-accent: var(--ch-orange);
    --ch-accent-hover: #FF8A3D;
    --ch-on-accent: #0B1426;
    --ch-text: #FFFFFF;
    --ch-text-2: #C2CADB;
    --ch-muted: #AEB8CC;
    --ch-bg: #0B1426;
    --ch-surface: #131F38;
    --ch-surface-2: #1A2742;
    --ch-border: #24314D;
    --ch-border-2: #2E3C5C;
    --ch-border-3: #3A4A6E;
    --ch-control-edge: #64749A;    /* 3:1 on the dark surface (WCAG 1.4.11) */
    --ch-focus: #FFC928;
    --ch-danger-text: #FDA4AF;     /* #DC2626 is 3.6:1 on the dark surface: a lighter red for an error line (contrast test) */
    --ch-shadow: none;
}
