/* ===== LIGHT THEME ===== */
:root,
[data-theme="light"] {
    --bg: #ffffff;
    --bg-alt: #f5f5f5;
    --bg-card: #ffffff;
    --text: #111111;
    --text-muted: #555555;
    --border: #e2e2e2;
    --green: #1a7a2e;
    --green-light: #74c48c;
    --green-glow: rgba(26, 122, 46, 0.15);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.06);
    --shadow-card-hover: 0 16px 48px rgba(0, 0, 0, 0.10);
    --nav-bg: rgba(255, 255, 255, 0.85);
    --footer-bg: #111111;
    --footer-text: #ffffff;
    --footer-muted: rgba(255, 255, 255, 0.5);
    --toggle-icon: "🌙";
}

/* ===== DARK THEME ===== */
[data-theme="dark"] {
    --bg: #0e0e0e;
    --bg-alt: #161616;
    --bg-card: #1a1a1a;
    --text: #f0f0f0;
    --text-muted: #999999;
    --border: #2a2a2a;
    --green: #5cb870;
    --green-light: #74c48c;
    --green-glow: rgba(92, 184, 112, 0.15);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-card-hover: 0 16px 48px rgba(0, 0, 0, 0.4);
    --nav-bg: rgba(14, 14, 14, 0.9);
    --footer-bg: #0a0a0a;
    --footer-text: #f0f0f0;
    --footer-muted: rgba(255, 255, 255, 0.35);
    --toggle-icon: "☀️";
}

/* ===== RESET ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: auto;
}

/* Only smooth-scroll for anchor clicks, not all scrolling */
@media (prefers-reduced-motion: no-preference) {
    html:focus-within {
        scroll-behavior: smooth;
    }
}

body {
    min-height: 100vh;
    font-family: "Space Grotesk", sans-serif;
    font-weight: 500;
    font-size: 18px;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Theme transition — only triggers on toggle, not scroll */
html[data-theme] body,
html[data-theme] nav,
html[data-theme] .footer-container {
    transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3 {
    font-family: "Space Grotesk", sans-serif;
    font-weight: 700;
    line-height: 1.15;
    color: var(--text);
}

h2 {
    margin-bottom: 5px;
}

h1:focus {
    outline: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ===== SCROLL REVEAL ===== */
.reveal {
    opacity: 0;
    transform: translate3d(0, 24px, 0);
    will-change: opacity, transform;
    transition: opacity 0.5s ease-out,
                transform 0.5s ease-out;
}

.reveal.revealed {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    will-change: auto;
}

.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }

/* ===== PAGE LOADER ===== */
#page-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease;
}

#page-loader.loaded {
    opacity: 0;
    pointer-events: none;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--green);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== FORM VALIDATION ===== */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--green);
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}


