/* Design tokens: the Figma "Semantic" collection, modes amber-light and amber-dark.
   Names are the Figma names with "/" turned into "-" (bg/card -> --bg-card).
   The page follows prefers-color-scheme; <html data-theme="light|dark"> overrides it.
   The dark block is written twice (system preference, explicit choice) because CSS
   cannot share one declaration list between a media query and an attribute selector:
   change a dark value in both places. */

:root {
    color-scheme: light;
    --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

    /* Figma "Primitives": space, radius, type size */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;
    --space-8: 64px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 10px;
    --radius-xl: 16px;
    --radius-full: 999px;
    --text-xs: 0.75rem;
    --text-sm: 0.8125rem;
    --text-base: 0.9375rem;
    --text-lg: 1.0625rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.75rem;
    --text-3xl: 2.5rem;

    --bg-page: #eeeeea;
    --bg-canvas: #f7f7f4;
    --bg-card: #ffffff;
    --bg-raised: #f1f1ed;
    --border-subtle: #e3e3de;
    --border-strong: #c9c9c3;
    --text-primary: #16171a;
    --text-secondary: #464951;
    --text-tertiary: #767a84;
    --text-disabled: #acafb6;
    --text-link: #8a510a;
    --accent-default: #a5620e;
    --accent-hover: #8a510a;
    --accent-muted: #e6c38a;
    --accent-soft: #fbefd8;
    --accent-on-accent: #131519;
    --accent-on-light: #b87516;
    --focus-ring: #e8a33d;
    --btn-primary-bg: #e8a33d;
    --btn-primary-text: #131519;
    --btn-primary-border: #e8a33d;
    --prio-1: #e8a33d;
    --prio-2: #c98a2e;
    --prio-3: #e6c38a;
    --prio-4: #f0ddb8;
    --mark-lit: #e8a33d;
    --mark-unlit: #e3e3de;
    --status-error: #c23a35;
    --status-error-soft: #fce9e7;
    --status-success: #1f8a58;
    --status-success-soft: #e3f5ec;
    --status-info: #2f6fd6;
    --status-info-soft: #e6effd;
    --type-bug: #c2336a;
    --type-bug-soft: #fce7ef;
    --type-feature: #2f6fd6;
    --type-feature-soft: #e6effd;
    --type-idea: #464951;
    --type-idea-soft: #f1f1ed;
    --type-praise: #1f8a58;
    --type-praise-soft: #e3f5ec;
    --type-question: #6d4fd8;
    --type-question-soft: #eee9fd;
    --type-other: #464951;
    --type-other-soft: #f1f1ed;
    --bg-scrim: rgba(20, 18, 13, 0.38);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --bg-page: #0a0b0d;
        --bg-canvas: #131519;
        --bg-card: #1b1e22;
        --bg-raised: #24262b;
        --border-subtle: #3a3c42;
        --border-strong: #52555e;
        --text-primary: #f5f6fa;
        --text-secondary: #b2b6c3;
        --text-tertiary: #7a7f8c;
        --text-disabled: #52555e;
        --text-link: #e8a33d;
        --accent-default: #e8a33d;
        --accent-hover: #f5b94e;
        --accent-muted: #9a6a25;
        --accent-soft: #3d2c14;
        --accent-on-accent: #131519;
        --accent-on-light: #b87516;
        --focus-ring: #e8a33d;
        --btn-primary-bg: #e8a33d;
        --btn-primary-text: #131519;
        --btn-primary-border: #e8a33d;
        --prio-1: #e8a33d;
        --prio-2: #c98a2e;
        --prio-3: #9a6a25;
        --prio-4: #6b4a1c;
        --mark-lit: #e8a33d;
        --mark-unlit: #3a3c42;
        --status-error: #f0645f;
        --status-error-soft: #3a1f1f;
        --status-success: #3fbf87;
        --status-success-soft: #16301f;
        --status-info: #5b9bf8;
        --status-info-soft: #16233a;
        --type-bug: #e8558a;
        --type-bug-soft: #3a1b2a;
        --type-feature: #5b9bf8;
        --type-feature-soft: #16233a;
        --type-idea: #b2b6c3;
        --type-idea-soft: #24262b;
        --type-praise: #3fbf87;
        --type-praise-soft: #16301f;
        --type-question: #a78bfa;
        --type-question-soft: #272040;
        --type-other: #b2b6c3;
        --type-other-soft: #24262b;
        --bg-scrim: rgba(0, 0, 0, 0.62);
    }
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg-page: #0a0b0d;
    --bg-canvas: #131519;
    --bg-card: #1b1e22;
    --bg-raised: #24262b;
    --border-subtle: #3a3c42;
    --border-strong: #52555e;
    --text-primary: #f5f6fa;
    --text-secondary: #b2b6c3;
    --text-tertiary: #7a7f8c;
    --text-disabled: #52555e;
    --text-link: #e8a33d;
    --accent-default: #e8a33d;
    --accent-hover: #f5b94e;
    --accent-muted: #9a6a25;
    --accent-soft: #3d2c14;
    --accent-on-accent: #131519;
    --accent-on-light: #b87516;
    --focus-ring: #e8a33d;
    --btn-primary-bg: #e8a33d;
    --btn-primary-text: #131519;
    --btn-primary-border: #e8a33d;
    --prio-1: #e8a33d;
    --prio-2: #c98a2e;
    --prio-3: #9a6a25;
    --prio-4: #6b4a1c;
    --mark-lit: #e8a33d;
    --mark-unlit: #3a3c42;
    --status-error: #f0645f;
    --status-error-soft: #3a1f1f;
    --status-success: #3fbf87;
    --status-success-soft: #16301f;
    --status-info: #5b9bf8;
    --status-info-soft: #16233a;
    --type-bug: #e8558a;
    --type-bug-soft: #3a1b2a;
    --type-feature: #5b9bf8;
    --type-feature-soft: #16233a;
    --type-idea: #b2b6c3;
    --type-idea-soft: #24262b;
    --type-praise: #3fbf87;
    --type-praise-soft: #16301f;
    --type-question: #a78bfa;
    --type-question-soft: #272040;
    --type-other: #b2b6c3;
    --type-other-soft: #24262b;
    --bg-scrim: rgba(0, 0, 0, 0.62);
}
