:root {
    /* Semantic colors — dark mode (default) */
    --gold: #C5A44E;
    --gold-light: #D4B96A;
    --gold-dark: #A68B3E;
    --charcoal: #1A1A1A;
    --dark: #0D0D0D;
    --cream: #F5F0E8;
    --cream-dark: #E8E0D0;
    --ruby: #9B1B30;
    --sapphire: #1B3A9B;
    --emerald: #1B6B3A;
    --amethyst: #6B1B8A;

    /* Theme-aware tokens */
    --bg-primary: #0D0D0D;
    --bg-secondary: #1A1A1A;
    --bg-card: rgba(30, 28, 24, 0.85);
    --bg-header: rgba(13, 13, 13, 0.97);
    --text-primary: #F5F0E8;
    --text-secondary: rgba(245, 240, 232, 0.55);
    --text-muted: rgba(245, 240, 232, 0.4);
    --border-subtle: rgba(197, 164, 78, 0.15);
    --border-medium: rgba(197, 164, 78, 0.2);
    --border-strong: rgba(197, 164, 78, 0.3);
    --img-bg: rgba(245, 240, 232, 0.03);
    --shadow-card: rgba(0, 0, 0, 0.4);
    --overlay-bg: rgba(0, 0, 0, 0.7);
    --map-invert: invert(1) hue-rotate(180deg) brightness(0.8) contrast(1.2);

    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', -apple-system, sans-serif;

    /* Spacing scale */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Type scale */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 2rem;

    /* Container widths */
    --container-sm: 540px;
    --container-md: 720px;
    --container-lg: 960px;
    --container-xl: 1140px;

    /* Touch target minimum */
    --tap-min: 44px;

    /* Content width */
    --content-max: 1200px;
}

/* ═══════════════════════════════════════
   LIGHT MODE
   ═══════════════════════════════════════ */
[data-theme="light"] {
    --gold: #8B6914;
    --gold-light: #A67C1A;
    --gold-dark: #6B5210;
    --charcoal: #F0EDE6;
    --dark: #FAFAF7;
    --cream: #1A1A1A;
    --cream-dark: #333333;

    --bg-primary: #FAFAF7;
    --bg-secondary: #F0EDE6;
    --bg-card: rgba(255, 255, 255, 0.95);
    --bg-header: rgba(250, 250, 247, 0.97);
    --text-primary: #1A1A1A;
    --text-secondary: rgba(26, 26, 26, 0.6);
    --text-muted: rgba(26, 26, 26, 0.4);
    --border-subtle: rgba(139, 105, 20, 0.12);
    --border-medium: rgba(139, 105, 20, 0.2);
    --border-strong: rgba(139, 105, 20, 0.3);
    --img-bg: #FFFFFF;
    --shadow-card: rgba(0, 0, 0, 0.08);
    --overlay-bg: rgba(0, 0, 0, 0.4);
    --map-invert: none;
}

[data-theme="light"] .logo {
    background: linear-gradient(135deg, #8B6914, #A67C1A, #8B6914);
    -webkit-background-clip: text;
    background-clip: text;
}

[data-theme="light"] .cathedral-fallback {
    background: linear-gradient(180deg, #FAFAF7, #F0EDE6, #FAFAF7);
}

[data-theme="light"] #three-canvas {
    display: none;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    transition: background 0.3s, color 0.3s;
}

h1, h2, h3, h4 { font-family: var(--font-display); }

a {
    color: var(--gold);
    text-decoration: none;
    transition: color 0.2s;
}
a:hover { color: var(--gold-light); }

#three-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

#app {
    position: relative;
    z-index: 1;
}

@media (min-width: 1024px) {
    html { font-size: 24.5px; }  /* ~175% of 14px base — optimized for 2K monitors */
}
