/* tokens.css - the one place the palette is defined.
 *
 * The mocha ground with its ember spot, and the light-mode counterpart. Every
 * page links this, and nothing else declares a colour token.
 *
 * It exists because the article pages had grown a palette of their own -
 * indigo #6366f1 on #030303 against the site's mocha #C08457 on #0D0A08 - so
 * a link, a button or an audit chip meant one colour on a briefing and another
 * everywhere else. Two products' worth of accent on one site.
 *
 * Anything clickable takes its colour from here, so consistency is structural
 * rather than something to remember.
 */
:root {
    /* Mocha ground with an ember spot. The base is warm-neutral rather than the
       blue-black it replaced, so the accent can be warm without fighting it.
       Mocha carries the everyday surface (links, CTAs, borders); ember is the
       hint, reserved for state that means something - live, active, urgent. */
    --bg-primary: #0D0A08;
    --bg-secondary: #14100C;
    --bg-card: rgba(255, 246, 238, 0.038);
    --bg-card-hover: rgba(255, 246, 238, 0.075);
    --text-primary: #F3EBE2;
    --text-secondary: #A99584;
    --text-tertiary: #6B5D51;
    --accent: #C08457;
    --accent-secondary: #E0521F;
    --accent-tertiary: #D9A441;
    --accent-glow: rgba(224, 82, 31, 0.38);
    --border: rgba(255, 240, 228, 0.09);
    /* Ink for anything filled with the accent gradient. White was used on most of
       these controls and near-black on one, and the measurements settle it rather
       than taste: against the gold end of the gradient, #D9A441, white contrasts
       at 2.25, under the 3.0 floor for large UI text. This ink measures 8.32
       there, 5.96 on mocha and 4.81 on ember, so it clears AA on every stop. */
    --on-accent: #1a1008;
    --border-hover: rgba(224, 82, 31, 0.34);
    --gradient: linear-gradient(120deg, #D9A441 0%, #C08457 46%, #E0521F 100%);
    --gradient-subtle: linear-gradient(135deg, rgba(217, 164, 65, 0.09) 0%, rgba(192, 132, 87, 0.09) 55%, rgba(224, 82, 31, 0.10) 100%);
    /* Kept for the handful of places that call it directly. */
    --accent-warm: #E0521F;
    --gradient-warm: linear-gradient(120deg, #D9A441 0%, #E0521F 100%);
    --glass: rgba(255, 255, 255, 0.025);
    --glass-border: rgba(255, 255, 255, 0.06);
    /* motion + depth tokens for silky interactions */
    --ease-silk: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --dur-fast: 0.22s;
    --dur: 0.4s;
    --dur-slow: 0.7s;
    --shadow-card: 0 10px 40px -12px rgba(0, 0, 0, 0.55);
    --shadow-glow: 0 0 48px -10px var(--accent-glow);
    --radius: 18px;

    /* Three roles instead of one. Inter set every word on the site, which is
       why the palette change alone did not change its character. The display
       face is a system serif, so it costs no request and cannot silently fall
       back to something unintended. */
    --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;

    /* One scale, used everywhere, instead of per-component values. */
    --t-xs: 0.72rem;
    --t-sm: 0.84rem;
    --t-base: 1rem;
    --t-lg: 1.15rem;
    --t-xl: clamp(1.5rem, 2.4vw, 1.9rem);
    --t-2xl: clamp(2rem, 4.2vw, 2.9rem);
    --t-3xl: clamp(2.4rem, 6vw, 4rem);
}

[data-theme="light"] {
    /* Warm paper rather than pure white, so the mocha accent sits on a ground of
       the same temperature. Both accents darken here to hold contrast on light. */
    --bg-primary: #FBF7F2;
    --bg-secondary: #F3ECE3;
    --bg-card: rgba(61, 40, 26, 0.028);
    --bg-card-hover: rgba(61, 40, 26, 0.06);
    --text-primary: #1B1410;
    --text-secondary: #6A5849;
    --text-tertiary: #9A8878;
    --accent: #8A5230;
    --accent-secondary: #B23A15;
    --accent-tertiary: #9A6B15;
    --accent-glow: rgba(178, 58, 21, 0.28);
    --border: rgba(61, 40, 26, 0.12);
    --border-hover: rgba(178, 58, 21, 0.32);
    --glass: rgba(61, 40, 26, 0.02);
    --glass-border: rgba(61, 40, 26, 0.06);
    --gradient: linear-gradient(120deg, #9A6B15 0%, #8A5230 46%, #B23A15 100%);
    --accent-warm: #B23A15;
    /* The light-mode gradient is darker, so the ink flips. Measured against its
       three stops, paper reads 4.39 / 5.91 / 5.61 and the dark ink 4.00 / 2.97 /
       3.13 - so near-black actually fails the 3.0 floor on the mocha stop here,
       which is a stronger reason to flip than the one first written down. */
    --on-accent: #FBF7F2;
}
