/* ==========================================================================
   ELMAALLEMSPACE - SPATIAL DESIGN SYSTEM & CORE TOKENS
   El Maallem Salah Eddine — Software Engineer
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
    /* Base Environment - Deep Graphite Palette */
    --space-bg: #07090e;
    --space-bg-secondary: #0c0f18;
    --space-surface: rgba(18, 24, 38, 0.65);
    --space-surface-hover: rgba(26, 35, 56, 0.8);

    /* Spatial Glass Tokens - Optimized for 60/120fps GPU compositing */
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-highlight: rgba(255, 255, 255, 0.25);
    --glass-glow: rgba(0, 122, 255, 0.2);
    --glass-blur: blur(12px);

    /* System Accents - Restrained Light Spectrum */
    --accent-blue: #007aff;
    --accent-cyan: #00d2ff;
    --accent-violet: #8b5cf6;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;

    /* Typography */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.72);
    --text-muted: rgba(255, 255, 255, 0.4);
    --text-dim: rgba(255, 255, 255, 0.2);

    --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Physics & Transition Curves */
    --spring-smooth: cubic-bezier(0.16, 1, 0.3, 1);
    --spring-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Reset & Global Canvas */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    scroll-behavior: smooth;
    background-color: var(--space-bg);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
}

body {
    background-color: var(--space-bg);
    min-height: 100vh;
    position: relative;
    cursor: default;
}

/* Custom Cursor - Hardware Accelerated */
@media (hover: hover) and (pointer: fine) {
    body {
        cursor: none;
    }

    a,
    button,
    [role="button"],
    input,
    textarea,
    .interactive {
        cursor: none;
    }
}

#custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 10px rgba(0, 122, 255, 0.8);
    pointer-events: none;
    z-index: 9999;
    will-change: transform;
    transform: translate3d(-50%, -50%, 0);
    transition: width 0.2s ease, height 0.2s ease, background 0.2s ease;
}

#custom-cursor-follower {
    position: fixed;
    top: 0;
    left: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.02);
    pointer-events: none;
    z-index: 9998;
    will-change: transform;
    transform: translate3d(-50%, -50%, 0);
    transition: width 0.2s ease, height 0.2s ease, border-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#cursor-label {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: #ffffff;
    opacity: 0;
    transition: opacity 0.15s ease;
    text-transform: uppercase;
}

#custom-cursor.hovering {
    width: 6px;
    height: 6px;
    background: var(--accent-cyan);
}

#custom-cursor-follower.hovering {
    width: 54px;
    height: 54px;
    border-color: rgba(0, 210, 255, 0.6);
    background: rgba(0, 122, 255, 0.08);
}

#custom-cursor-follower.hovering #cursor-label {
    opacity: 1;
}

/* Background Ambient Lighting & Architectural Grid - Zero Cost Pure Gradients */
.spatial-ambient-canvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    transform: translateZ(0);
}

#particle-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.architectural-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 80px 80px;
    mask-image: radial-gradient(circle at 50% 50%, black 40%, transparent 80%);
    -webkit-mask-image: radial-gradient(circle at 50% 50%, black 40%, transparent 80%);
}

.ambient-light-orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.35;
    transform: translateZ(0);
}

.orb-primary {
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(0, 122, 255, 0.25) 0%, transparent 70%);
    top: -200px;
    left: 20%;
}

.orb-secondary {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.2) 0%, transparent 70%);
    top: 40%;
    right: -100px;
}

.orb-tertiary {
    width: 650px;
    height: 650px;
    background: radial-gradient(circle, rgba(0, 210, 255, 0.2) 0%, transparent 70%);
    bottom: -150px;
    left: -100px;
}

/* Glass Components - Hardware Accelerated */
.spatial-glass {
    background: var(--space-surface);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    position: relative;
    border-radius: 28px;
    overflow: hidden;
    transform: translateZ(0);
}

.spatial-glass::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--glass-border-highlight) 50%, transparent 100%);
    pointer-events: none;
}