/* theme.css: every charlieco.co color, defined once (2026-11-20).

   Dark is the site's look and the default. Light turns on by itself when
   the visitor's device is set to light mode (prefers-color-scheme); there
   is no toggle. A page can opt out and stay dark with
   <html data-theme="dark">.

   Rules for page stylesheets:
   - Link this first: <link rel="stylesheet" href="/theme.css"> (relative
     path on subpages), before common.css and the page's own CSS.
   - Use these names. A page may add its own names that point at these
     (--bg-primary: var(--bg)), but never re-define one of these with a
     different value, or light mode can't flip it.
   - No raw hex colors for backgrounds, text, or borders. If a new color is
     needed, add it here, in both blocks.

   Not on this theme, on purpose: the OIF photo viewers (gallery, Fifteen
   Months, timeline, video; their own dark sand palette), the SCEA (a
   letter on paper), and site-print.html (print). */

:root {
    color-scheme: dark;

    --bg: #0d1209;
    --bg-elevated: rgba(13, 18, 9, 0.92);
    --surface: #131a0e;
    --surface-2: #18210f;
    --border: #1e2a18;

    --text: #e4e8dc;
    --text-dim: #7d8f73;
    --dim: var(--text-dim);
    --label: #6a9850;        /* small green labels and eyebrows: readable dim green */

    --accent: #7aaa60;
    --accent-dim: #4a7030;
    --green: #7aaa60;
    --green-dim: #4a7030;
    --green-dk: #4a7030;

    --highlight: #c5a84e;
    --amber: #c89040;
    --amber-dk: #8a6020;

    --red: #e35d5d;
    --red-dim: #7a1a1a;
    --crisis: #c62828;

    /* text on a filled button or badge */
    --on-highlight: #161204;
    --on-accent: #0d1209;

    /* translucent fills and lines over the page */
    --tint-highlight: rgba(197, 168, 78, 0.08);
    --tint-accent: rgba(122, 170, 96, 0.08);
    --tint-red: rgba(227, 93, 93, 0.08);
    --shadow: rgba(0, 0, 0, 0.45);
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
        color-scheme: light;

        --bg: #f5f3ea;
        --bg-elevated: rgba(245, 243, 234, 0.94);
        --surface: #fdfcf7;
        --surface-2: #ece8da;
        --border: #d6d0bd;

        --text: #1c2214;
        --text-dim: #56604c;
        --label: #4d6a38;

        --accent: #3d6b28;
        --accent-dim: #4d6a38;
        --green: #3d6b28;
        --green-dim: #4d6a38;
        --green-dk: #4d6a38;

        --highlight: #7a590c;
        --amber: #8a5410;
        --amber-dk: #8d5f1c;

        --red: #b3322f;
        --red-dim: #e8b4b2;
        --crisis: #c62828;

        --on-highlight: #ffffff;
        --on-accent: #ffffff;

        --tint-highlight: rgba(122, 89, 12, 0.07);
        --tint-accent: rgba(61, 107, 40, 0.07);
        --tint-red: rgba(179, 50, 47, 0.07);
        --shadow: rgba(40, 36, 20, 0.18);
    }
}

/* Paper is always light: print uses the light set, even from a dark-mode device. */
@media print {
    :root {
        color-scheme: light;

        --bg: #f5f3ea;
        --bg-elevated: rgba(245, 243, 234, 0.94);
        --surface: #fdfcf7;
        --surface-2: #ece8da;
        --border: #d6d0bd;

        --text: #1c2214;
        --text-dim: #56604c;
        --label: #4d6a38;

        --accent: #3d6b28;
        --accent-dim: #4d6a38;
        --green: #3d6b28;
        --green-dim: #4d6a38;
        --green-dk: #4d6a38;

        --highlight: #7a590c;
        --amber: #8a5410;
        --amber-dk: #8d5f1c;

        --red: #b3322f;
        --red-dim: #e8b4b2;
        --crisis: #c62828;

        --on-highlight: #ffffff;
        --on-accent: #ffffff;

        --tint-highlight: rgba(122, 89, 12, 0.07);
        --tint-accent: rgba(61, 107, 40, 0.07);
        --tint-red: rgba(179, 50, 47, 0.07);
        --shadow: rgba(40, 36, 20, 0.18);
    }
}
