/*
 * Design tokens — the single place to change the look of the site.
 * Palette: "Classic" — .NET violet accent, cyan highlight; deep indigo surfaces in dark mode.
 * Seasonal palettes (spring, summer, autumn, winter) live in palettes.css.
 * Light is the default; the dark theme is applied via [data-theme="dark"] on <html>
 * (set by js/theme.js from the visitor's saved choice).
 */
:root {
    color-scheme: light;

    /* Palette */
    --color-bg: #f7f7fb;
    --color-surface: #ffffff;
    --color-surface-2: #f0effa;
    --color-border: #e1e0ef;
    --color-text: #14162b;
    --color-text-muted: #575d7a;
    --color-accent: #512bd4;
    --color-accent-strong: #3f1fb0;
    --color-highlight: #0891b2;
    --color-link-hover: var(--color-accent-strong);   /* the cyan highlight is below 4.5:1 on light backgrounds */
    --color-warning-bg: #fff3c4;
    --color-success: #16a34a;   /* status dot, always next to words */
    --gradient-hero: linear-gradient(135deg, #512bd4 0%, #0891b2 100%);
    --color-accent-contrast: #ffffff;

    /* Typography */
    /* System fonts only (no font files are served): each device uses its own UI font,
       Segoe UI on Windows, San Francisco on Apple, Roboto on Android. */
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.375rem;
    --text-2xl: 1.875rem;
    --text-3xl: clamp(2rem, 1.5vw + 1.5rem, 2.75rem);   /* page titles */
    --text-hero: clamp(2.25rem, 5vw + 1rem, 4rem);

    /* Spacing & shape: a 4/8 px grid */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-24: 6rem;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 999px;
    --container: 72rem;
    --shadow-card: 0 1px 2px rgba(20, 22, 43, 0.04), 0 8px 24px rgba(20, 22, 43, 0.05);
    --shadow-card-hover: 0 2px 4px rgba(20, 22, 43, 0.05), 0 16px 40px rgba(20, 22, 43, 0.10);
    --tap-target: 2.75rem;   /* 44px minimum touch target */

    /* Image viewer (js/lightbox.js): always dark, whatever the theme or palette. */
    --color-overlay: rgba(8, 9, 18, 0.92);
    --color-overlay-text: #ffffff;
    --color-overlay-control: rgba(255, 255, 255, 0.12);
    --color-overlay-control-hover: rgba(255, 255, 255, 0.24);
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --color-bg: #0b0d17;
    --color-surface: #131629;
    --color-surface-2: #1b1f38;
    --color-border: #262b4a;
    --color-text: #e6e8f2;
    --color-text-muted: #9aa0bf;
    --color-accent: #8b6cff;        /* readable on dark, derived from .NET purple */
    --color-accent-strong: #512bd4; /* official .NET brand purple */
    --color-accent-contrast: #ffffff;
    --color-highlight: #22d3ee;     /* cyan, used sparingly */
    --color-link-hover: var(--color-highlight);
    --color-warning-bg: #5c4a12;
    --color-success: #22c55e;
    --gradient-hero: linear-gradient(135deg, #8b6cff 0%, #22d3ee 100%);
    --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 8px 24px rgba(0, 0, 0, 0.25);
    --shadow-card-hover: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 16px 40px rgba(0, 0, 0, 0.4);
}
