/* ==========================================================
   Design System / Theme
   Dark-first palette with electric blue -> violet accent gradient.
   Toggle via [data-theme="light"] on <html>.
   ========================================================== */

:root {
    --font-heading: 'Space Grotesk', 'Open Sans', sans-serif;
    --font-body: 'Open Sans', sans-serif;
    --font-mono: 'JetBrains Mono', 'Consolas', 'Courier New', monospace;

    --accent-1: #3b82f6;
    --accent-2: #8b5cf6;
    --accent-3: #14b8a6;
    --gradient: linear-gradient(135deg, var(--accent-1) 0%, var(--accent-2) 65%, var(--accent-3) 100%);
    --gradient-flat: linear-gradient(135deg, var(--accent-1) 0%, var(--accent-2) 100%);

    --bg: #0a0e17;
    --bg-elevated: #10151f;
    --bg-card: #131a27;
    --bg-card-hover: #172032;
    --border-color: rgba(255, 255, 255, 0.09);
    --border-color-strong: rgba(255, 255, 255, 0.16);
    --text: #e8ecf4;
    --text-muted: #93a0b6;
    --text-faint: #5c6a82;

    --shadow-glow: 0 0 0 1px rgba(139, 92, 246, 0.15), 0 0 40px rgba(59, 130, 246, 0.18);
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.35);
    --shadow-elevated: 0 20px 60px rgba(0, 0, 0, 0.45);

    --radius: 14px;
    --radius-sm: 8px;
    --transition-fast: 0.2s ease;
    --transition: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

:root[data-theme="light"] {
    --bg: #f4f6fb;
    --bg-elevated: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8f9fe;
    --border-color: rgba(15, 23, 42, 0.09);
    --border-color-strong: rgba(15, 23, 42, 0.18);
    --text: #10182b;
    --text-muted: #4c5875;
    --text-faint: #8994ab;

    --accent-1: #2563eb;
    --accent-2: #7c3aed;
    --accent-3: #0d9488;

    --shadow-glow: 0 0 0 1px rgba(124, 58, 237, 0.12), 0 0 40px rgba(37, 99, 235, 0.12);
    --shadow-card: 0 10px 30px rgba(15, 23, 42, 0.08);
    --shadow-elevated: 0 20px 50px rgba(15, 23, 42, 0.12);
}

/* ==========================================================
   Base
   ========================================================== */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    transition: background-color var(--transition), color var(--transition);
    overflow-x: hidden;
}

body.theme-transition,
body.theme-transition * {
    transition: background-color var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition) !important;
}

h1, h2, h3, h4, h5, h6,
.site-section h2,
.site-section h3 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.01em;
}

a {
    color: var(--accent-1);
}

::selection {
    background: var(--accent-2);
    color: #fff;
}

/* Accessible focus states everywhere */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--accent-3);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Gradient text utility */
.text-gradient {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.img-lines {
    display: none !important;
}

/* Elements rendered only in print (see print.css) */
@media screen {
    .print-only {
        display: none !important;
    }
}

.section-eyebrow {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-3);
    margin-bottom: 6px;
}

/* ==========================================================
   Scroll-reveal animation
   ========================================================== */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s ease;
    will-change: opacity, transform;
}

.reveal.in-view {
    opacity: 1;
    transform: translateY(0);
}

.reveal-stagger > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-stagger.in-view > * {
    opacity: 1;
    transform: translateY(0);
}

.reveal-stagger.in-view > *:nth-child(1) { transition-delay: 0.02s; }
.reveal-stagger.in-view > *:nth-child(2) { transition-delay: 0.08s; }
.reveal-stagger.in-view > *:nth-child(3) { transition-delay: 0.14s; }
.reveal-stagger.in-view > *:nth-child(4) { transition-delay: 0.2s; }
.reveal-stagger.in-view > *:nth-child(5) { transition-delay: 0.26s; }
.reveal-stagger.in-view > *:nth-child(6) { transition-delay: 0.32s; }
.reveal-stagger.in-view > *:nth-child(7) { transition-delay: 0.38s; }
.reveal-stagger.in-view > *:nth-child(8) { transition-delay: 0.44s; }

@media (prefers-reduced-motion: reduce) {
    .reveal,
    .reveal-stagger > * {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    html {
        scroll-behavior: auto;
    }
}

/* ==========================================================
   Theme toggle button
   ========================================================== */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border-color-strong);
    background: var(--bg-card);
    color: var(--text);
    cursor: pointer;
    transition: border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.theme-toggle:hover {
    border-color: var(--accent-2);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.theme-toggle i {
    font-size: 15px;
}

.locale-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 12px;
    border-radius: 20px;
    border: 1px solid var(--border-color-strong);
    background: var(--bg-card);
    color: var(--text);
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.locale-toggle:hover {
    border-color: var(--accent-2);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.locale-toggle img {
    width: 16px;
    height: 16px;
    border-radius: 2px;
    object-fit: cover;
}

:root[data-theme="dark"] .theme-toggle .fa-sun,
:root:not([data-theme="light"]) .theme-toggle .fa-sun {
    display: inline-block;
}
:root[data-theme="dark"] .theme-toggle .fa-moon,
:root:not([data-theme="light"]) .theme-toggle .fa-moon {
    display: none;
}
:root[data-theme="light"] .theme-toggle .fa-sun {
    display: none;
}
:root[data-theme="light"] .theme-toggle .fa-moon {
    display: inline-block;
}
