/* Design tokens: colours, typography, spacing, radii and shadows.
   This is the one file sub-project 2B edits to change the palette --
   nothing in core.css, blog.css, journal.css, contact.css or admin.css
   should ever hold a colour literal (see TestCSS_NoColourLiteralOutsideTheTokens). */

:root {
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', 'Monaco', 'Consolas', monospace;
    --font-display: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

    /* Core colors from Anthropic */
    --primary-color: #a95d44; /* Terracotta/rust accent, darkened to 4.58:1 on --background */
    --primary-hover: #99543d;
    --primary-light: rgba(217, 119, 87, 0.1);
    --foreground: #131314; /* Near-black text */
    --background: #faf9f0; /* Cream/off-white */
    --text-muted: #6b6a64; /* Warm gray, 5.13:1 on --background */
    --text-secondary: #4a4945;
    --card-bg: #ffffff;
    --border-color: #e9e8e4;
    --selection-bg: rgba(204, 120, 92, 0.5);
    --success-color: #22c55e;
    --error-color: #ef4444;
    /* Alpha tints of the two above, the same pattern as --primary-light:
       a token rather than a literal, because contact.css and blog.css each
       duplicated one of these by hand (rgba(239, 68, 68, 0.1) and
       rgba(34, 197, 94, 0.1), both already in the tree at the values below)
       in the same rule as the colour they tint. Values unchanged. */
    --error-light: rgba(239, 68, 68, 0.1);
    --success-light: rgba(34, 197, 94, 0.1);

    /* Deliberately one colour in both themes: a code block matches
       Chroma's dark style, and text on a dark hero or tag is white
       whichever theme is active. Tokens, not literals, so 2B's palette can
       reach them. */
    --surface-code: #1e1e1f;
    --on-surface-code: #faf9f0;
    --on-dark: #ffffff;
    /* --footer-bg is NOT one of the above: it differs by design between
       :root (#f5f4eb) and both dark blocks (#1a1a1b) below, same as every
       other theme-sensitive token. It sits here only because it is a
       surface colour, not because it is theme-independent. */
    --footer-bg: #f5f4eb;

    /* Print output already forces a light page regardless of the active
       theme (see the plain `black`/`white` literals in core.css's and
       blog.css's own @media print blocks -- this file has none) -- this is
       the same fixed-regardless-of-theme pattern applied to a muted
       colour, so dark mode can't silently recolour a printed page. */
    --print-muted: #666;

    /* Spacing & sizing */
    --border-radius: 8px;
    --border-radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 2px 8px rgba(0,0,0,0.04);
    --shadow-hover: 0 12px 32px rgba(0,0,0,0.1);
    --shadow-lg: 0 20px 40px rgba(0,0,0,0.15);

    /* Site margins */
    /* off-scale: 5rem sits well above --space-3xl, the largest named step.
       Left as a literal because snapping it would move pixels; 2B retires it. */
    --site-margin: clamp(var(--space-lg), 5vw, 5rem);
    --content-width: 1100px;

    /* Spacing. Eleven steps, every value one already in use — the scale was
       always there, unnamed. Counts are uses at the time of extraction.
       The two `-half` names are deliberately ugly: they say "this sits
       between two steps" rather than pretending to be one, so the redesign
       can see at a glance what a tighter scale would have to absorb. */
    --space-3xs: 0.25rem;        /* 12 */
    --space-3xs-half: 0.375rem;  /*  9 */
    --space-2xs: 0.5rem;         /* 32 */
    --space-xs: 0.75rem;         /* 26 */
    --space-xs-half: 0.875rem;   /*  7 */
    --space-sm: 1rem;            /* 51 */
    --space-md: 1.25rem;         /* 16 */
    --space-lg: 1.5rem;          /* 53 */
    --space-xl: 2rem;            /* 37 */
    --space-2xl: 2.5rem;         /* 13 */
    --space-3xl: 3rem;           /* 10 */
}

/* Dark Mode */
[data-theme="dark"] {
    --primary-color: #e8956f;
    --primary-hover: #f0a883;
    --primary-light: rgba(232, 149, 111, 0.15);
    --foreground: #faf9f0;
    --background: #131314;
    --text-muted: #a09a94;
    --text-secondary: #9a9590;
    --card-bg: #1e1e1f;
    --border-color: #2e2e30;
    --selection-bg: rgba(232, 149, 111, 0.4);
    --footer-bg: #1a1a1b;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --primary-color: #e8956f;
        --primary-hover: #f0a883;
        --primary-light: rgba(232, 149, 111, 0.15);
        --foreground: #faf9f0;
        --background: #131314;
        --text-muted: #a09a94;
        --text-secondary: #9a9590;
        --card-bg: #1e1e1f;
        --border-color: #2e2e30;
        --selection-bg: rgba(232, 149, 111, 0.4);
        --footer-bg: #1a1a1b;
    }
}
