/**
 * Kaffa design tokens.
 *
 * Paper and espresso dual themes for a specialty coffee roastery look:
 * warm cream surfaces, hairline borders, square cards, pill buttons,
 * serif display type over a grotesque body with mono accents.
 *
 * Static per-preset values keyed on [data-ec-preset][data-color-scheme];
 * dynamic values (accent triplet, container width, grid density, font
 * pairing and radius overrides) are injected inline at runtime by the
 * framework's TokenCompiler and win the cascade by order.
 *
 * Presets share the paper/espresso surfaces and differ only in accent:
 * Copper (default), Olive, Oxblood. The dark blocks for the default are
 * keyed on :root[data-color-scheme] so an unset preset slug still gets a
 * correct dark scheme; the named presets override after by source order.
 */

:root {
    /* Defaults: Copper on paper. */
    --ec-bg: #f4eee1;
    --ec-surface: #faf6ec;
    --ec-surface-2: #ede5d2;
    --ec-fg: #241c12;
    --ec-fg-2: #6d5f4b;
    --ec-border: #ddd2bc;
    --ec-accent: #a85b28;
    --ec-accent-fg: #faf6ec;
    --ec-accent-soft: rgba(168, 91, 40, 0.12);

    /* Kaffa extras consumed only by template CSS */
    --ec-border-2: #c9bb9f;
    --ec-fg-3: #998a72;
    --ec-font-mono: 'Space Mono', ui-monospace, 'Cascadia Mono', monospace;

    --ec-radius: 0px;
    --ec-btn-radius: 999px;
    --ec-img-radius: 0px;
    --ec-shadow: 0 1px 2px rgba(60, 42, 20, 0.06), 0 6px 24px rgba(60, 42, 20, 0.07);

    --ec-font-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    --ec-font-body: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --ec-disp-weight: 500;
    --ec-disp-style: normal;
    --ec-disp-tracking: -0.01em;
    --ec-disp-transform: none;

    --ec-cw: 1280px;
    --ec-gut: 1.5rem;
    --ec-sect-y: 4rem;
    --ec-grid: 3;
    --ec-grid-gap: 1.125rem;

    --ec-dur-1: 150ms;
    --ec-dur-2: 250ms;
    --ec-dur-3: 400ms;
    --ec-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Espresso: the default dark scheme, whatever the preset slug says */
:root[data-color-scheme="dark"] {
    --ec-bg: #161109;
    --ec-surface: #221b12;
    --ec-surface-2: #1d1710;
    --ec-fg: #f0e7d4;
    --ec-fg-2: #b3a386;
    --ec-border: #382e1f;
    --ec-accent: #d99052;
    --ec-accent-fg: #1d130a;
    --ec-accent-soft: rgba(217, 144, 82, 0.14);

    --ec-border-2: #4d4029;
    --ec-fg-3: #7d6f57;

    --ec-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 28px rgba(0, 0, 0, 0.35);
}

/* Olive: herbal, green-forward accent on the same paper */
[data-ec-preset="olive"] {
    --ec-accent: #5c6b3c;
    --ec-accent-fg: #f4f0e4;
    --ec-accent-soft: rgba(92, 107, 60, 0.12);
}

[data-ec-preset="olive"][data-color-scheme="dark"] {
    --ec-accent: #a9bb72;
    --ec-accent-fg: #171a0c;
    --ec-accent-soft: rgba(169, 187, 114, 0.14);
}

/* Oxblood: deep red accent on the same paper */
[data-ec-preset="oxblood"] {
    --ec-accent: #7a2e2e;
    --ec-accent-fg: #f6ede4;
    --ec-accent-soft: rgba(122, 46, 46, 0.12);
}

[data-ec-preset="oxblood"][data-color-scheme="dark"] {
    --ec-accent: #cf7a6d;
    --ec-accent-fg: #1d0f0c;
    --ec-accent-soft: rgba(207, 122, 109, 0.14);
}

/* Motion is opt-out at the token layer */
@media (prefers-reduced-motion: reduce) {
    :root {
        --ec-dur-1: 0ms;
        --ec-dur-2: 0ms;
        --ec-dur-3: 0ms;
    }
}
