/* Design tokens. * * Three themes, selected by `data-theme` on : light, dark, blue. * Components never write a colour literal -- they reference a token, so a * fourth theme is a block in this file and nothing else. * * Contrast: every text/background pair below meets WCAG AA (>= 4.5:1 for body * text, >= 3:1 for large text and UI borders). `npm run check:contrast` * asserts it -- run it after touching any colour here, because this is * exactly the kind of thing that regresses silently. */ :root { /* --- shape and space (theme-independent) --- */ --radius-sm: 4px; --radius: 8px; --radius-lg: 14px; --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px; --space-7: 48px; --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; --font-mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, "Liberation Mono", monospace; --text-xs: 0.75rem; --text-sm: 0.875rem; --text-base: 1rem; --text-lg: 1.125rem; --text-xl: 1.5rem; --text-2xl: 2rem; --transition: 120ms ease; --header-height: 56px; } /* --- light ---------------------------------------------------------- */ :root, [data-theme="light"] { color-scheme: light; --bg: #f6f8fb; --surface: #ffffff; --surface-raised: #ffffff; --surface-sunken: #eef2f7; /* --border is decorative (dividers, card edges) and is exempt from the contrast rule. --border-strong bounds interactive controls -- inputs, focus rings -- so WCAG 1.4.11 wants 3:1 against the surface behind it. */ --border: #dde3ec; --border-strong: #848f9e; --text: #14202e; --text-muted: #56677d; --text-inverse: #ffffff; --accent: #1257c4; --accent-hover: #0e46a0; --accent-subtle: #e4edfb; --success: #17724a; --warning: #8a5a00; --danger: #b3242c; --shadow: 0 1px 2px rgb(16 24 40 / 6%), 0 4px 12px rgb(16 24 40 / 8%); --overlay: rgb(16 24 40 / 40%); } /* --- dark (neutral) ------------------------------------------------- */ [data-theme="dark"] { color-scheme: dark; --bg: #121417; --surface: #191c21; --surface-raised: #21252b; --surface-sunken: #0d0f12; --border: #2e343c; --border-strong: #656d7a; --text: #e8eaed; --text-muted: #a3adba; --text-inverse: #10141a; --accent: #6ba1ff; --accent-hover: #8bb6ff; --accent-subtle: #1b2534; --success: #3dd68c; --warning: #f0b429; --danger: #ff6b71; --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 8px 24px rgb(0 0 0 / 40%); --overlay: rgb(0 0 0 / 60%); } /* --- blue (dark navy) ----------------------------------------------- */ [data-theme="blue"] { color-scheme: dark; --bg: #0b1220; --surface: #111c2e; --surface-raised: #17253b; --surface-sunken: #070d17; --border: #22344f; --border-strong: #5a7196; --text: #e6edf7; --text-muted: #9fb3ce; --text-inverse: #0b1220; --accent: #4c8dff; --accent-hover: #6ba1ff; --accent-subtle: #152740; --success: #3dd68c; --warning: #f0b429; --danger: #f2545b; --shadow: 0 1px 2px rgb(0 0 0 / 45%), 0 8px 28px rgb(3 8 18 / 55%); --overlay: rgb(4 9 18 / 65%); }