/* Design tokens: the single source of every colour, size and spacing. Light and dark themes. */
@font-face {
    font-family: "Atkinson Hyperlegible";
    src: url("../fonts/atkinson-hyperlegible-400.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Atkinson Hyperlegible";
    src: url("../fonts/atkinson-hyperlegible-700.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    color-scheme: light dark;

    /* Brand: deep navy with an electric amber accent */
    --navy-900: #0b1724;
    --navy-800: #13293d;
    --navy-700: #1d3a54;
    --navy-100: #e6edf3;
    --amber-500: #f2a900;
    --amber-400: #ffc233;
    --amber-100: #fff4d6;

    --primary: #1d5c8f;
    --primary-hover: #164a74;
    --on-primary: #ffffff;
    --accent: var(--amber-500);
    --on-accent: #1a1300;

    --bg-body: #f5f3ee;
    --bg-surface: #ffffff;
    --bg-muted: #ece9e1;
    --bg-hover: #e9eef3;
    --bg-nav: var(--navy-800);
    --text-nav: #e8eef4;
    --text-nav-muted: #9fb3c6;

    --text-primary: #17202a;
    --text-secondary: #4a5662;
    --text-muted: #5f6b77;

    --border: #d9d4c8;
    --focus: var(--amber-500);

    --success: #1f7a3d;
    --success-bg: #e8f5ec;
    --error: #b42318;
    --error-bg: #fdecea;
    --warning: #8a5a00;
    --warning-bg: #fff4d6;
    --info: #1d5c8f;
    --info-bg: #e7f0f8;

    --font-body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
    --text-sm: 0.9375rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.375rem;
    --text-2xl: clamp(1.5rem, 1.2rem + 1.4vw, 2rem);
    --leading: 1.5;

    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 2px rgb(16 24 40 / 0.06);
    --shadow-md: 0 4px 12px rgb(16 24 40 / 0.08);

    --touch: 44px;
    --topbar-h: 56px;
    --nav-w: 260px;
    --content-max: 1200px;
    --transition-fast: 0.15s ease;
    --transition: 0.25s ease;
}

@media (prefers-color-scheme: dark) {
    :root {
        --primary: #5aa2dc;
        --primary-hover: #7cb7e6;
        --on-primary: #0b1724;
        --bg-body: #0e1620;
        --bg-surface: #16212d;
        --bg-muted: #1d2a38;
        --bg-hover: #213244;
        --bg-nav: var(--navy-900);
        --text-primary: #e6ecf2;
        --text-secondary: #b6c2ce;
        --text-muted: #9aa8b6;
        --border: #2c3b4b;
        --success: #5cc584;
        --success-bg: #12301f;
        --error: #ff8a80;
        --error-bg: #3a1714;
        --warning: #ffc233;
        --warning-bg: #3a2c08;
        --info: #7cb7e6;
        --info-bg: #13283b;
        --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
        --shadow-md: 0 4px 12px rgb(0 0 0 / 0.4);
    }
}

@media (prefers-reduced-motion: reduce) {
    :root { --transition-fast: 0s; --transition: 0s; }
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
