/* ============================================
   Main CSS - Global Styles and Layout
   ============================================ */

/* CSS Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Color Palette - Minimalist Black & White with Dark Blue */
    --primary: #000000;
    --primary-dark: #000000;
    --accent: #152c6b; /* Darker blue for better contrast on white */
    --accent-bright: #1e3a8a;
    --accent-alt: #152c6b;
    --background: #ffffff;
    --background-alt: #fafafa;
    --surface: #ffffff;
    --surface-alt: #f5f5f5;
    --badge-bg: rgba(255, 255, 255, 0.95);
    --text: #000000;
    --text-light: #666666;
    --success: #000000;
    --border: #e5e5e5;
    --border-light: #f0f0f0;
    color-scheme: light;
    
    /* Typography */
    --font-heading: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'IBM Plex Mono', 'JetBrains Mono', 'Courier New', monospace;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 4rem;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    
    /* Shadows - Minimal */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.1);
}

:root[data-theme="dark"] {
    --primary: #f5f5f5;
    --primary-dark: #d9dbe2;
    --accent: #7aa2ff;
    --accent-bright: #8cb4ff;
    --accent-alt: #6f96ff;
    --background: #0b0d12;
    --background-alt: #11141d;
    --surface: #0f1117;
    --surface-alt: #151a24;
    --badge-bg: rgba(15, 18, 26, 0.9);
    --text: #f4f6fb;
    --text-light: #b8c0cc;
    --success: #a7f3d0;
    --border: #2a3240;
    --border-light: #1f2633;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 6px 14px rgba(0, 0, 0, 0.4);
    color-scheme: dark;
}

:root[data-theme="light"] {
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]):not([data-theme="dark"]) {
        --primary: #f5f5f5;
        --primary-dark: #d9dbe2;
        --accent: #7aa2ff;
        --accent-bright: #8cb4ff;
        --accent-alt: #6f96ff;
        --background: #0b0d12;
        --background-alt: #11141d;
        --surface: #0f1117;
        --surface-alt: #151a24;
        --badge-bg: rgba(15, 18, 26, 0.9);
        --text: #f4f6fb;
        --text-light: #b8c0cc;
        --success: #a7f3d0;
        --border: #2a3240;
        --border-light: #1f2633;
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
        --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.35);
        --shadow-lg: 0 6px 14px rgba(0, 0, 0, 0.4);
        color-scheme: dark;
    }
}

html {
    scroll-behavior: smooth;
    background-color: var(--background);
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--background);
}

/* Load reveal for page content (JS adds .reveal-ready and .is-revealed) */
html.reveal-ready header.site-header,
html.reveal-ready main > *,
html.reveal-ready footer.site-footer {
    opacity: 1;
    transform: translateY(8px);
}

html.reveal-ready body.is-revealed header.site-header,
html.reveal-ready body.is-revealed main > *,
html.reveal-ready body.is-revealed footer.site-footer {
    animation: reveal-rise 0.9s ease forwards;
    animation-delay: var(--reveal-delay, 0s);
    will-change: transform, opacity;
}

html.reveal-ready body[data-load-reveal]::before {
    content: '';
    position: fixed;
    inset: 0;
    background: var(--background);
    opacity: 1;
    animation: reveal-overlay 0.9s ease forwards;
    z-index: 2000;
    pointer-events: none;
}

@keyframes reveal-overlay {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes reveal-rise {
    from {
        opacity: 0.7;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    html.reveal-ready header.site-header,
    html.reveal-ready main > *,
    html.reveal-ready footer.site-footer {
        opacity: 1;
        transform: none;
    }

    html.reveal-ready body.is-revealed header.site-header,
    html.reveal-ready body.is-revealed main > *,
    html.reveal-ready body.is-revealed footer.site-footer {
        animation: none;
    }

    html.reveal-ready body[data-load-reveal]::before {
        animation: none;
        opacity: 0;
    }
}

/* Typography Scale (1.25 modular scale) */
h1 {
    font-size: 2.441rem; /* ~39px */
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
    transition: font-size 0.3s ease, line-height 0.3s ease;
}

h2 {
    font-size: 1.953rem; /* ~31px */
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: var(--spacing-md);
    transition: font-size 0.3s ease, line-height 0.3s ease;
}

h3 {
    font-size: 1.563rem; /* ~25px */
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: var(--spacing-sm);
    transition: font-size 0.3s ease, line-height 0.3s ease;
}

h4 {
    font-size: 1.25rem; /* ~20px */
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: var(--spacing-sm);
    transition: font-size 0.3s ease, line-height 0.3s ease;
}

p {
    margin-bottom: var(--spacing-sm);
    transition: font-size 0.3s ease, line-height 0.3s ease;
}

a {
    color: var(--text);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

a:hover {
    opacity: 0.7;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Layout Utilities */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.section {
    padding: var(--spacing-xl) 0;
}

.section-alt {
    background-color: var(--background-alt);
    padding: var(--spacing-xl) 0;
    position: relative;
}

/* Skip Link for Accessibility */
.skip-link {
    position: absolute;
    top: 0;
    left: 0;
    background: var(--primary);
    color: var(--background);
    padding: 8px;
    text-decoration: none;
    z-index: 100;
    transform: translateY(-200%);
}

.skip-link:focus {
    transform: translateY(0);
}

/* Base responsive adjustments - more specific overrides in responsive.css */
