/* ═══════════════════════════════════════════════════════════════
   REALITY FRACTURE — Base Design System
   Reset, Typography, Colors, Tokens, Utilities
   ═══════════════════════════════════════════════════════════════ */

/* ── CSS Custom Properties ─────────────────────────────────── */
:root {
    /* Void palette */
    --void: #000000;
    --abyss: #060612;
    --deep: #0a0a1a;
    --surface: #111128;
    --surface-light: #1a1a3e;

    /* Accent palette */
    --electric-blue: #00d4ff;
    --electric-blue-dim: rgba(0, 212, 255, 0.15);
    --electric-blue-glow: rgba(0, 212, 255, 0.4);
    --neon-violet: #8b5cf6;
    --neon-violet-dim: rgba(139, 92, 246, 0.15);
    --neon-violet-glow: rgba(139, 92, 246, 0.4);
    --spectral-cyan: #06ffd0;
    --spectral-cyan-dim: rgba(6, 255, 208, 0.15);
    --radioactive-lime: #c8ff00;
    --radioactive-lime-dim: rgba(200, 255, 0, 0.15);

    /* Text palette */
    --text-primary: rgba(255, 255, 255, 0.92);
    --text-secondary: rgba(255, 255, 255, 0.55);
    --text-dim: rgba(255, 255, 255, 0.25);
    --text-ghost: rgba(255, 255, 255, 0.08);

    /* Borders */
    --border-ghost: rgba(255, 255, 255, 0.06);
    --border-subtle: rgba(255, 255, 255, 0.1);
    --border-accent: rgba(0, 212, 255, 0.3);

    /* Spacing scale (8px base) */
    --sp-1: 8px;
    --sp-2: 16px;
    --sp-3: 24px;
    --sp-4: 32px;
    --sp-5: 40px;
    --sp-6: 48px;
    --sp-8: 64px;
    --sp-10: 80px;
    --sp-12: 96px;
    --sp-16: 128px;
    --sp-24: 192px;

    /* Typography scale */
    --font-grotesk: 'Space Grotesk', sans-serif;
    --font-serif: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --text-xs: 0.7rem;
    --text-sm: 0.85rem;
    --text-base: 1rem;
    --text-lg: 1.15rem;
    --text-xl: 1.4rem;
    --text-2xl: 1.8rem;
    --text-3xl: 2.4rem;
    --text-4xl: 3.2rem;
    --text-5xl: 4.5rem;
    --text-6xl: 6rem;
    --text-hero: clamp(3.5rem, 10vw, 9rem);

    /* 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.4, 0, 0.2, 1);
    --duration-fast: 200ms;
    --duration-normal: 400ms;
    --duration-slow: 800ms;
    --duration-glacial: 1400ms;

    /* Z-index scale */
    --z-particles: 1;
    --z-content: 10;
    --z-overlay: 20;
    --z-cursor: 9999;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--text-secondary);
    background-color: var(--void);
    overflow-x: hidden;
    cursor: none;
}

a {
    text-decoration: none;
    color: inherit;
    cursor: none;
}

button {
    cursor: none;
}

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

ul, ol {
    list-style: none;
}

/* ── Typography ────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-grotesk);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.05;
    letter-spacing: -0.03em;
}

em {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
}

/* ── Selection ─────────────────────────────────────────────── */
::selection {
    background: var(--electric-blue-dim);
    color: var(--electric-blue);
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--void);
}

::-webkit-scrollbar-thumb {
    background: var(--surface-light);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--electric-blue-dim);
}

/* ── Particle Canvas ───────────────────────────────────────── */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-particles);
    pointer-events: none;
}

/* ── Custom Cursor ─────────────────────────────────────────── */
.cursor-glow {
    position: fixed;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(0, 212, 255, 0.3);
    pointer-events: none;
    z-index: var(--z-cursor);
    transition: transform 0.15s var(--ease-out-expo),
                width 0.3s var(--ease-out-expo),
                height 0.3s var(--ease-out-expo),
                border-color 0.3s ease;
    transform: translate(-50%, -50%);
    mix-blend-mode: screen;
}

.cursor-glow.hovering {
    width: 60px;
    height: 60px;
    border-color: var(--electric-blue);
    background: var(--electric-blue-dim);
}

.cursor-dot {
    position: fixed;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--electric-blue);
    pointer-events: none;
    z-index: var(--z-cursor);
    transform: translate(-50%, -50%);
    box-shadow: 0 0 12px var(--electric-blue-glow);
}

/* ── Button System ─────────────────────────────────────────── */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 40px;
    font-family: var(--font-grotesk);
    font-size: var(--text-sm);
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-primary);
    background: transparent;
    overflow: hidden;
    transition: all var(--duration-normal) var(--ease-out-expo);
}

.btn--primary {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.12), rgba(139, 92, 246, 0.08));
    border: 1px solid var(--border-accent);
}

.btn--primary:hover {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.25), rgba(139, 92, 246, 0.15));
    border-color: var(--electric-blue);
    box-shadow: 0 0 40px rgba(0, 212, 255, 0.2),
                inset 0 0 40px rgba(0, 212, 255, 0.05);
    transform: translateY(-2px);
}

.btn--primary .btn__glow {
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, var(--electric-blue), var(--neon-violet));
    opacity: 0;
    filter: blur(20px);
    transition: opacity var(--duration-normal) ease;
    z-index: -1;
}

.btn--primary:hover .btn__glow {
    opacity: 0.3;
}

.btn--secondary {
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

.btn--secondary:hover {
    border-color: var(--text-dim);
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
    transform: translateY(-2px);
}

.btn--large {
    padding: 20px 56px;
    font-size: var(--text-base);
}

.btn__text {
    position: relative;
    z-index: 2;
}

.btn__border {
    position: absolute;
    inset: 0;
    border: 1px solid transparent;
    transition: border-color var(--duration-normal) ease;
}

/* ── Section Header System ─────────────────────────────────── */
.section-header {
    text-align: center;
    margin-bottom: var(--sp-12);
}

.section-header__label {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 500;
    letter-spacing: 0.3em;
    color: var(--electric-blue);
    text-transform: uppercase;
    margin-bottom: var(--sp-3);
    padding: 6px 16px;
    border: 1px solid var(--electric-blue-dim);
    background: rgba(0, 212, 255, 0.03);
}

.section-header__title {
    font-size: clamp(2.5rem, 5vw, var(--text-5xl));
    margin-bottom: var(--sp-3);
}

.section-header__title em {
    color: var(--electric-blue);
}

.section-header__subtitle {
    font-size: var(--text-lg);
    color: var(--text-dim);
    max-width: 550px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ── Reveal Animations ─────────────────────────────────────── */
.reveal-up {
    opacity: 0;
    transform: translateY(60px);
    transition: opacity var(--duration-glacial) var(--ease-out-expo),
                transform var(--duration-glacial) var(--ease-out-expo);
    transition-delay: var(--delay, 0s);
}

.reveal-up.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-80px);
    transition: opacity var(--duration-glacial) var(--ease-out-expo),
                transform var(--duration-glacial) var(--ease-out-expo);
}

.reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(80px);
    transition: opacity var(--duration-glacial) var(--ease-out-expo),
                transform var(--duration-glacial) var(--ease-out-expo);
}

.reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

/* ── Mobile cursor override ────────────────────────────────── */
@media (pointer: coarse) {
    body, a, button {
        cursor: auto;
    }
    .cursor-glow, .cursor-dot {
        display: none;
    }
}
