/* ========== RESET ========== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html {
    scroll-behavior: auto;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    width: 100%;
    scroll-padding-top: calc(var(--nav-total-h) + 16px);
    overflow-x: hidden;
    overflow-x: clip;
}
body {
    width: 100%;
    overflow-x: hidden;
    overflow-x: clip;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    background-image:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(var(--accent-rgb),0.03) 0%, transparent 55%),
        radial-gradient(ellipse 60% 50% at 80% 50%, rgba(var(--violet-rgb),0.02) 0%, transparent 55%),
        radial-gradient(ellipse 70% 40% at 10% 100%, rgba(var(--blue-rgb),0.02) 0%, transparent 55%);
    color: var(--text);
    line-height: 1.6;
    position: relative;
    isolation: isolate;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 { font-family: 'Space Grotesk', sans-serif; line-height: 1.15; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { display: block; max-width: 100%; }
ul { list-style: none; }
input { font-family: inherit; }
:focus-visible { outline: 2px solid rgba(var(--accent-rgb),0.55); outline-offset: 3px; }
:where(section[id]) { scroll-margin-top: calc(var(--nav-total-h) + 16px); }

/* ========== AURORA BACKDROP (GPU-friendly transforms only) ========== */
body::before {
    content: '';
    position: fixed;
    inset: -30%;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(40% 50% at 15% 20%, rgba(var(--accent-rgb),0.14) 0%, transparent 60%),
        radial-gradient(45% 55% at 85% 25%, rgba(var(--violet-rgb),0.12) 0%, transparent 62%),
        radial-gradient(40% 50% at 55% 85%, rgba(var(--blue-rgb),0.10) 0%, transparent 60%);
    filter: blur(70px) saturate(1.15);
    opacity: 0.75;
    transform: translate3d(0,0,0);
    animation: aurora-drift 14s ease-in-out infinite alternate;
    will-change: transform;
}

/* ========== FILM GRAIN OVERLAY ========== */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 9000;
    pointer-events: none;
    opacity: 0.02;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-size: 128px 128px;
}

/* ========== UTILITY CLASSES ========== */
.container {
    width: min(100%, var(--layout-max-w));
    margin: 0 auto;
    padding-left: max(clamp(16px, 3.5vw, 40px), env(safe-area-inset-left, 0px));
    padding-right: max(clamp(16px, 3.5vw, 40px), env(safe-area-inset-right, 0px));
}
.sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
}
.section-label {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; font-weight: 500;
    letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent);
    margin-bottom: 20px;
}
.section-label::before {
    content: ''; width: 8px; height: 8px; border-radius: 50%;
    background: var(--accent); display: inline-block;
}
.section-title {
    font-size: clamp(2rem, 4.5vw, 3.2rem); font-weight: 700; color: var(--text);
    margin-bottom: 16px; letter-spacing: -0.02em;
}
.section-desc {
    font-size: clamp(0.95rem, 1.8vw, 1.1rem); color: var(--text-dim);
    max-width: 600px; line-height: 1.7;
}
.gradient-text {
    background: linear-gradient(135deg, var(--accent), var(--violet));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.mono { font-family: 'JetBrains Mono', monospace; }

/* ========== SECTION DIVIDERS ========== */
.divider {
    height: 1px; max-width: var(--layout-max-w); margin: 0 auto;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
}

/* ========== REVEAL HELPERS ========== */
.reveal { will-change: transform, opacity; }
