/* ========== CSS VARIABLES ========== */
:root {
    /* Dark theme (default) */
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-tertiary: #1a1a1a;
    --bg-surface: #141414;
    --bg-surface-hover: #1c1c1c;

    --text-primary: #e8e8e8;
    --text-secondary: #888888;
    --text-tertiary: #555555;
    --text-muted: #333333;

    --accent: #00f0ff;
    --accent-dim: rgba(0, 240, 255, 0.15);
    --accent-glow: rgba(0, 240, 255, 0.08);
    --accent-strong: rgba(0, 240, 255, 0.4);

    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --border-accent: rgba(0, 240, 255, 0.2);

    --smoke-1: rgba(20, 20, 30, 0.4);
    --smoke-2: rgba(10, 10, 20, 0.3);
    --smoke-3: rgba(30, 30, 40, 0.2);

    --particle-color: rgba(255, 255, 255, 0.3);
    --particle-glow: rgba(0, 240, 255, 0.15);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(0, 240, 255, 0.06);

    /* Typography */
    --font-primary: 'Space Grotesk', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --font-body: 'Inter', -apple-system, sans-serif;

    /* Sizing */
    --nav-height: 64px;
    --container-max: 1400px;
    --container-padding: 24px;

    /* Transitions */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

    --transition-fast: 0.15s var(--ease-out-expo);
    --transition-normal: 0.3s var(--ease-out-expo);
    --transition-slow: 0.6s var(--ease-out-expo);
    --transition-theme: 0.8s var(--ease-in-out);
}

/* Light theme */
[data-theme="light"] {
    --bg-primary: #f5f5f0;
    --bg-secondary: #eaeae5;
    --bg-tertiary: #e0e0db;
    --bg-surface: #ffffff;
    --bg-surface-hover: #f0f0eb;

    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --text-muted: #cccccc;

    --accent: #0066ff;
    --accent-dim: rgba(0, 102, 255, 0.1);
    --accent-glow: rgba(0, 102, 255, 0.05);
    --accent-strong: rgba(0, 102, 255, 0.3);

    --border: rgba(0, 0, 0, 0.06);
    --border-hover: rgba(0, 0, 0, 0.12);
    --border-accent: rgba(0, 102, 255, 0.2);

    --smoke-1: rgba(200, 200, 195, 0.3);
    --smoke-2: rgba(220, 220, 215, 0.2);
    --smoke-3: rgba(180, 180, 175, 0.15);

    --particle-color: rgba(0, 0, 0, 0.15);
    --particle-glow: rgba(0, 102, 255, 0.1);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 40px rgba(0, 102, 255, 0.04);
}

/* Void theme */
[data-theme="void"] {
    --bg-primary: #020204;
    --bg-secondary: #080810;
    --bg-tertiary: #0c0c14;
    --bg-surface: #0a0a12;
    --bg-surface-hover: #10101a;

    --text-primary: #c8c8d0;
    --text-secondary: #606070;
    --text-tertiary: #404050;
    --text-muted: #202030;

    --accent: #8b5cf6;
    --accent-dim: rgba(139, 92, 246, 0.12);
    --accent-glow: rgba(139, 92, 246, 0.06);
    --accent-strong: rgba(139, 92, 246, 0.35);

    --border: rgba(255, 255, 255, 0.04);
    --border-hover: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(139, 92, 246, 0.2);

    --smoke-1: rgba(10, 10, 20, 0.5);
    --smoke-2: rgba(5, 5, 15, 0.4);
    --smoke-3: rgba(15, 15, 30, 0.3);

    --particle-color: rgba(200, 200, 220, 0.2);
    --particle-glow: rgba(139, 92, 246, 0.12);

    --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.04);
}

/* ========== RESET ========== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    cursor: none;
    transition: background-color var(--transition-theme), color var(--transition-theme);
    line-height: 1.6;
}

@media (hover: none) and (pointer: coarse) {
    body {
        cursor: auto;
    }
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    background: none;
    border: none;
    color: inherit;
    font: inherit;
    cursor: none;
    outline: none;
}

@media (hover: none) and (pointer: coarse) {
    button { cursor: auto; }
    a { cursor: auto; }
}

img {
    max-width: 100%;
    display: block;
}

ul, ol {
    list-style: none;
}

/* ========== UTILITY ========== */
.section {
    position: relative;
    min-height: 100vh;
    padding: 120px 0;
}

.section__container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.section__header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 80px;
}

.section__number {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent);
    letter-spacing: 0.1em;
}

.section__title {
    font-family: var(--font-primary);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 400;
    letter-spacing: 0.15em;
    color: var(--text-primary);
}

.section__line {
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Scroll progress */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    z-index: 9999;
    background: transparent;
}

.scroll-progress__bar {
    height: 100%;
    width: 0%;
    background: var(--accent);
    transition: width 0.1s linear;
    box-shadow: 0 0 10px var(--accent-strong);
}

/* Selection */
::selection {
    background: var(--accent-dim);
    color: var(--text-primary);
}

/* Smooth theme transition on everything */
.theme-transitioning * {
    transition: background-color var(--transition-theme),
                color var(--transition-theme),
                border-color var(--transition-theme),
                box-shadow var(--transition-theme),
                fill var(--transition-theme),
                stroke var(--transition-theme) !important;
}

/* Canvas layers */
.smoke-canvas,
.particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.smoke-canvas {
    z-index: 0;
    opacity: 0.6;
}

.particle-canvas {
    z-index: 2;
}

/* Main content above canvases */
.main {
    position: relative;
    z-index: 3;
}

/* Body loading state */
body.is-loading {
    overflow: hidden;
}

body.is-loading .main,
body.is-loading .nav,
body.is-loading .footer {
    opacity: 0;
    pointer-events: none;
}