/* themes.css - the single source of truth for themes.
 *
 * HOW TO ADD A THEME
 *   1. Copy an existing block below and change the selector to your new name.
 *   2. Set --theme-label (button tooltip) and --theme-swatch (button colour).
 *   3. Set the --color-* variables.
 *
 * That is all. theme.js reads this file at runtime and builds the switcher
 * buttons from whatever [data-theme] blocks it finds, so the buttons, the
 * allowlist and the styles cannot drift apart. There is no second list to
 * update and no HTML to edit.
 *
 * The first theme after :root is the default. Keep `green` first.
 *
 * NOTE: public/offline.html inlines a copy of this file, because it has to
 * work when the server is down and cannot fetch it. After editing this file
 * run  python3 tools/sync-offline-themes.py  to regenerate that copy.
 */

/* ===== SWITCHER BUTTONS ===== */
/* These are deliberately left at the browser's default button shape: the
   original markup was a row of plain <button> elements and that is what
   people are used to. Do NOT set width/height/padding/border-width here --
   any of them changes the size. Spacing comes from the natural inline flow
   (the whitespace between the buttons), which is what produced the original
   gaps. Only colour and cursor are themed. */
.theme-btn {
    cursor: pointer;
    vertical-align: middle;
}

.theme-btn.active {
    box-shadow: 0 0 8px var(--color-accent);
}

/* Themes that want a ring instead of a flat fill (e.g. asphalt: black tile
   with yellow outline). --theme-swatch-outline is optional. */
.theme-btn[data-outline] {
    outline: 2px solid var(--theme-swatch-outline);
    outline-offset: -2px;
}

/* The footer sits directly under the last post. It has no styling of its own
   by design (it never had any), but it needs breathing room above it or the
   buttons crowd the last card. */
.site-footer {
    margin-top: 20px;
    padding-bottom: 20px;
}

/* ===== DEFAULT (no data-theme set, or an unknown name) ===== */
:root {
    --color-bg: rgb(15, 15, 0);
    --color-text-primary: rgb(0, 220, 0);
    --color-text-secondary: rgb(70, 100, 70);
    --color-accent: rgb(0, 200, 0);
    --color-accent-bright: rgb(0, 240, 0);
    --color-error: rgb(210, 0, 0);
    --color-border: rgb(0, 200, 0);
    --color-secondary-border: rgb(0, 150, 100);
    --color-signature: rgb(150, 0, 100);
    --color-bg-subtle-glow: rgb(0, 25, 10);
    /* Base styles (font, spacing, etc.) */
    --font-family: 'OCR-A', 'Courier New', monospace;
    --font-size-base: 16px;
    --font-size-sm: 14px;
    --spacing-unit: 10px;
    --border-radius: 0px;
    --border-width: 1px;
    --padding: 10px;
    --font-size-lg: 16px;
}

[data-theme="green"] {
    /* --- switcher metadata (read by theme.js) --- */
    --theme-label: "Matrix Hacker Green - Classic SSH Club";
    --theme-swatch: #00cc00;
    --color-bg: rgb(15, 15, 0);
    --color-text-primary: rgb(0, 220, 0);
    --color-text-secondary: rgb(70, 100, 70);
    --color-accent: rgb(0, 200, 0);
    --color-accent-bright: rgb(0, 240, 0);
    --color-error: rgb(210, 0, 0);
    --color-border: rgb(0, 200, 0);
    --color-secondary-border: rgb(0, 150, 100);
    --color-signature: rgb(150, 0, 100);
    --color-bg-subtle-glow: rgb(0, 25, 10);
}

[data-theme="red"] {
    /* --- switcher metadata (read by theme.js) --- */
    --theme-label: "Critical Error Red - Cyber criminal Edition";
    --theme-swatch: #ff3232;
    --color-bg: rgb(20, 0, 0); /* Darker, true red tint instead of purple */
    --color-text-primary: rgb(255, 50, 50); /* Brightened for readability */
    --color-text-secondary: rgb(150, 60, 60);
    --color-accent: rgb(200, 0, 0);
    --color-accent-bright: rgb(255, 80, 80);
    --color-error: rgb(255, 100, 0); /* Orange error for red theme visibility */
    --color-border: rgb(200, 0, 0);
    --color-secondary-border: rgb(255, 100, 0); /* Amber accents */
    --color-signature: rgb(0, 200, 200); /* Cyan signature for contrast */
    --color-bg-subtle-glow: rgb(40, 0, 0);
}

[data-theme="blue"] {
    /* --- switcher metadata (read by theme.js) --- */
    --theme-label: "Sleep destroying blue light - Color of wine in ancient Greece";
    --theme-swatch: #0088ff;
    --color-bg: rgb(0, 10, 25); /* Deep ocean blue */
    --color-text-primary: rgb(100, 200, 255); /* CRT Cyan-Blue, much easier to read */
    --color-text-secondary: rgb(60, 90, 120);
    --color-accent: rgb(0, 130, 200);
    --color-accent-bright: rgb(150, 220, 255);
    --color-error: rgb(255, 50, 50);
    --color-border: rgb(0, 130, 200);
    --color-secondary-border: rgb(0, 200, 180); /* Teal accents */
    --color-signature: rgb(255, 200, 0); /* Gold/yellow signature for contrast */
    --color-bg-subtle-glow: rgb(0, 20, 40);
}

[data-theme="asphalt"] {
    /* --- switcher metadata (read by theme.js) --- */
    --theme-label: "Asphalt - The city shows you where to go";
    --theme-swatch: #0d0e10;
    --theme-swatch-outline: #ffc400;

    /* Wet asphalt after rain: near-black with a cold blue sheen, not a flat
       grey. Slightly lifted so text has something to sit on. */
    --color-bg: rgb(18, 20, 23);

    /* Sodium-vapour road paint. The one colour the city gives you, and it
       only ever tells you where to go. */
    --color-text-primary: rgb(255, 196, 0);

    /* Weathered concrete -- present but receding. */
    --color-text-secondary: rgb(122, 126, 130);

    /* Painted lane markings, worn at the edges. */
    --color-accent: rgb(214, 164, 0);
    --color-accent-bright: rgb(255, 214, 51);

    /* Brake lights in the rain. */
    --color-error: rgb(240, 82, 66);

    /* Kerb lines and hazard paint. */
    --color-border: rgb(92, 88, 60);
    --color-secondary-border: rgb(58, 62, 66);

    /* Rust bleeding through the concrete. */
    --color-signature: rgb(176, 88, 36);

    /* Standing water under a streetlight. */
    --color-bg-subtle-glow: rgb(28, 30, 32);
}

[data-theme="miku"] {
    /* --- switcher metadata (read by theme.js) --- */
    --theme-label: "Miku - SEKAAAAAAIII DEEEE";
    --theme-swatch: #39c5bb;
    --color-bg: rgb(10, 20, 25); /* Dark blueish-black */
    --color-text-primary: rgb(150, 240, 240); /* Light cyan for readability */
    --color-text-secondary: rgb(80, 120, 130);
    --color-accent: rgb(57, 197, 187); /* Classic Miku Teal #39C5BB */
    --color-accent-bright: rgb(120, 255, 240); /* Bright glowing cyan */
    --color-error: rgb(255, 50, 50);
    --color-border: rgb(57, 197, 187);
    --color-secondary-border: rgb(255, 100, 180); /* Hot pink accents (ties/headset) */
    --color-signature: rgb(255, 0, 150); /* Magenta signature */
    --color-bg-subtle-glow: rgb(0, 40, 50);
}

[data-theme="dark-academia"] {
    /* --- switcher metadata (read by theme.js) --- */
    --theme-label: "Dark Academia - Ivy League at Midnight";
    --theme-swatch: #5c4a3d;
    --color-bg: #1a1612;
    --color-text-primary: #d4c5a9;
    --color-text-secondary: #7a6f5f;
    --color-accent: #e8a84c;
    --color-accent-bright: #c9a85c;
    --color-error: #8b4513;
    --color-border: #5c4a3d;
    --color-secondary-border: #a65d4a;
    --color-signature: #7a8b6a;
    --color-bg-subtle-glow: #2a2420;
}

[data-theme="cherryblossom"] {
    /* --- switcher metadata (read by theme.js) --- */
    --theme-label: "Cherry Blossom - かわいい~~~";
    --theme-swatch: linear-gradient(45deg, #ffccd5, #d84a75);

    /* Night in Tokyo, not daylight. Deep plum-black with a warm magenta cast
       so the pink reads as neon rather than as pastel paper. */
    --color-bg: #1a0e14;

    /* Blossom lit from below -- pale pink, not white, so it stays in key. */
    --color-text-primary: #ffd9e2;

    /* Distant petals in shadow. */
    --color-text-secondary: #b07f8e;

    /* Vibrant cherry pink, kept saturated against the dark. */
    --color-accent: #ff5c8a;
    --color-accent-bright: #ff8fb0;

    /* Crisp crimson, lifted so it reads on plum-black. */
    --color-error: #ff4d5e;

    /* Branch bark catching the streetlight. */
    --color-border: #7d3f56;
    --color-secondary-border: #4d2233;

    /* Fresh matcha leaf green for contrast -- the one cool note. */
    --color-signature: #7fbf6a;

    /* Warm neon spill on wet pavement. */
    --color-bg-subtle-glow: #2a1520;
}

[data-theme="cyberdeck"] {
    /* --- switcher metadata (read by theme.js) --- */
    --theme-label: "Cyberdeck OS - 90s Retro Workstation";
    --theme-swatch: #00e5ff;
    --color-bg: #151d21;
    --color-text-primary: #ff9d3b;
    --color-text-secondary: #00e5ff;
    --color-accent: #00e5ff;
    --color-accent-bright: #00ff66;
    --color-error: #ff3232;
    --color-border: #00e5ff;
    --color-secondary-border: #ff7700;
    --color-signature: #ff9d3b;
    --color-bg-subtle-glow: #0e1619;
    --font-family: 'VT323', 'Courier New', monospace;

    /* Cyberdeck-only effect tokens (used by the index page overrides). */
    --cd-crt: #00ff2b;                 /* ASCII banner phosphor green */
    --cd-crt-shadow: #005511;          /* banner hard shadow */
    --cd-crt-glow: rgba(0, 255, 43, 0.4);
    --cd-card: #121c21;                /* card bg, a touch darker than --color-bg */
    --cd-shadow-mid: #00a8bd;          /* halftone-offset shadow, near */
    --cd-shadow-deep: #007788;         /* halftone-offset shadow, far */
    --cd-motd: #ff8800;                /* MOTD pill */
    --cd-motd-glow: rgba(255, 136, 0, 0.4);
}


/* ===== BRUTALIST ===== */
/* Brutalist is the one theme that is not just a set of variables. Exposing the
   browser's own rendering cannot be done by overriding the site's CSS (styled
   scrollbars cannot be un-styled, appearance and border rules win on
   specificity, and the global reset cannot be undone from here), so when this
   theme is active theme.js DISABLES the normal stylesheets and loads
   css/brutalist-*.css in their place. See theme.js setStylesheets().
 *
 * Only the switcher metadata lives here, because theme.js reads the theme
 * list out of this file. The colours below are unused while the theme is
 * active; they exist so the block is a valid, complete theme definition. */
[data-theme="brutalist"] {
    --theme-label: "Brutalist - The browser, unadorned";
    --theme-swatch: #ffffff;
    --theme-swatch-outline: #000000;

    --color-bg: #ffffff;
    --color-text-primary: #000000;
    --color-text-secondary: #000000;
    --color-accent: #000000;
    --color-accent-bright: #000000;
    --color-error: #cc0000;
    --color-border: #000000;
    --color-secondary-border: #808080;
    --color-signature: #000000;
    --color-bg-subtle-glow: #f0f0f0;
    --font-family: serif;
}
