/*
 * Semantic theme tokens (PRD §145). Every surface/text/border/accent in the
 * app must consume one of these custom properties -- never a hardcoded
 * color. This file defines the built-in "Light" theme as :root defaults;
 * the full 38-palette Ellipsus theme system (Phase 7) adds
 * `[data-theme="..."]` blocks that override this same token set, plus a
 * companion Dark default below for the Light/Dark/System appearance mode.
 */

:root {
    --color-background: #faf9f7;
    --color-surface: #ffffff;
    --color-surface-elevated: #ffffff;
    --color-surface-muted: #f1efec;

    --color-text: #1c1a17;
    --color-text-secondary: #4b4740;
    --color-text-muted: #857f74;
    --color-text-inverse: #ffffff;

    --color-border: #e4e0d9;
    --color-border-subtle: #ecebe6;

    --color-accent: #b5502f;
    --color-accent-hover: #9c4327;
    --color-accent-foreground: #ffffff;

    --color-link: #8a4a2c;
    --color-link-hover: #6c3a22;

    --color-input-background: #ffffff;
    --color-input-border: #d9d4cb;
    --color-input-text: #1c1a17;

    --color-selection-background: #f0d9c9;
    --color-selection-text: #1c1a17;

    --color-code-background: #f1efec;
    --color-code-text: #4b3a2a;

    --color-quote-border: #b5502f;
    --color-quote-background: #f6f1ea;

    --color-calendar-background: #ffffff;
    --color-calendar-hover: #f1efec;
    --color-calendar-active: #b5502f;

    --color-danger: #b3261e;
    --color-success: #2e7d4f;
    --color-warning: #a7690a;

    --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-serif: Georgia, "Times New Roman", serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
}

/* Dark appearance default (used when Appearance = Dark, or System + OS dark,
   and no Ellipsus theme is selected). */
[data-appearance="dark"] {
    --color-background: #17140f;
    --color-surface: #1f1b15;
    --color-surface-elevated: #241f18;
    --color-surface-muted: #292319;

    --color-text: #f2ede4;
    --color-text-secondary: #cabfaf;
    --color-text-muted: #93887a;
    --color-text-inverse: #17140f;

    --color-border: #362f24;
    --color-border-subtle: #2b261d;

    --color-accent: #e08a5c;
    --color-accent-hover: #eb9c72;
    --color-accent-foreground: #17140f;

    --color-link: #e0a980;
    --color-link-hover: #edbd99;

    --color-input-background: #241f18;
    --color-input-border: #3a3226;
    --color-input-text: #f2ede4;

    --color-selection-background: #4a3120;
    --color-selection-text: #f2ede4;

    --color-code-background: #241f18;
    --color-code-text: #e8c8a8;

    --color-quote-border: #e08a5c;
    --color-quote-background: #241f18;

    --color-calendar-background: #1f1b15;
    --color-calendar-hover: #292319;
    --color-calendar-active: #e08a5c;

    --color-danger: #ef6a61;
    --color-success: #6bc492;
    --color-warning: #e0a94b;
}

@media (prefers-color-scheme: dark) {
    [data-appearance="system"] {
        --color-background: #17140f;
        --color-surface: #1f1b15;
        --color-surface-elevated: #241f18;
        --color-surface-muted: #292319;
        --color-text: #f2ede4;
        --color-text-secondary: #cabfaf;
        --color-text-muted: #93887a;
        --color-text-inverse: #17140f;
        --color-border: #362f24;
        --color-border-subtle: #2b261d;
        --color-accent: #e08a5c;
        --color-accent-hover: #eb9c72;
        --color-accent-foreground: #17140f;
        --color-link: #e0a980;
        --color-link-hover: #edbd99;
        --color-input-background: #241f18;
        --color-input-border: #3a3226;
        --color-input-text: #f2ede4;
        --color-selection-background: #4a3120;
        --color-selection-text: #f2ede4;
        --color-code-background: #241f18;
        --color-code-text: #e8c8a8;
        --color-quote-border: #e08a5c;
        --color-quote-background: #241f18;
        --color-calendar-background: #1f1b15;
        --color-calendar-hover: #292319;
        --color-calendar-active: #e08a5c;
        --color-danger: #ef6a61;
        --color-success: #6bc492;
        --color-warning: #e0a94b;
    }
}
