/* ═══════════════════════════════════════════════════════════════
   ANTIGRAVITY PORTFOLIO — Design System & Base Styles
   ═══════════════════════════════════════════════════════════════ */

/* ── Custom Properties ──────────────────────────────────────── */
:root {
    /* Deep Space Background */
    --bg-void: #030308;
    --bg-deep: #050510;
    --bg-space: #0a0a1a;
    --bg-nebula: #0d0d24;

    /* Neon Accent Colors */
    --neon-cyan: #00f0ff;
    --neon-magenta: #ff00aa;
    --neon-blue: #4d7cff;
    --neon-purple: #a855f7;
    --neon-pink: #f472b6;

    /* Neon with alpha */
    --neon-cyan-20: rgba(0, 240, 255, 0.2);
    --neon-cyan-10: rgba(0, 240, 255, 0.1);
    --neon-cyan-05: rgba(0, 240, 255, 0.05);
    --neon-magenta-20: rgba(255, 0, 170, 0.2);
    --neon-magenta-10: rgba(255, 0, 170, 0.1);
    --neon-blue-20: rgba(77, 124, 255, 0.2);

    /* Surface Colors (Glass) */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-bg-hover: rgba(255, 255, 255, 0.06);
    --glass-bg-active: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-border-hover: rgba(255, 255, 255, 0.12);
    --glass-blur: 20px;
    --glass-blur-heavy: 40px;

    /* Text Colors */
    --text-primary: rgba(255, 255, 255, 0.95);
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-tertiary: rgba(255, 255, 255, 0.35);
    --text-ghost: rgba(255, 255, 255, 0.15);

    /* Neon Glow Shadows */
    --glow-cyan: 0 0 20px rgba(0, 240, 255, 0.3), 0 0 60px rgba(0, 240, 255, 0.1);
    --glow-cyan-intense: 0 0 30px rgba(0, 240, 255, 0.5), 0 0 80px rgba(0, 240, 255, 0.2), 0 0 120px rgba(0, 240, 255, 0.1);
    --glow-magenta: 0 0 20px rgba(255, 0, 170, 0.3), 0 0 60px rgba(255, 0, 170, 0.1);
    --glow-magenta-intense: 0 0 30px rgba(255, 0, 170, 0.5), 0 0 80px rgba(255, 0, 170, 0.2);
    --glow-blue: 0 0 20px rgba(77, 124, 255, 0.3), 0 0 60px rgba(77, 124, 255, 0.1);
    --glow-mixed: 0 0 30px rgba(0, 240, 255, 0.2), 0 0 60px rgba(255, 0, 170, 0.1);

    /* Spacing Scale */
    --space-2xs: 4px;
    --space-xs: 8px;
    --space-sm: 12px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
    --space-4xl: 96px;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Z-Index Layers */
    --z-canvas: 0;
    --z-content: 10;
    --z-nav: 100;
    --z-detail: 500;
    --z-cursor: 600;
    --z-overlay: 1000;

    /* Transition Defaults */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);

    /* Card dimensions */
    --card-width: 380px;
    --card-height: 440px;
    --card-gap: 40px;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: auto; /* We handle scroll manually */
    overflow: hidden;
}

body {
    font-family: var(--font-sans);
    font-variation-settings: 'wght' 400, 'opsz' 20;
    background: var(--bg-void);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
    cursor: auto;
    position: relative;
}

/* Selection styling */
::selection {
    background: var(--neon-cyan-20);
    color: var(--neon-cyan);
}

/* ── Custom Scrollbar ───────────────────────────────────────── */
::-webkit-scrollbar {
    width: 3px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--neon-cyan-20);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--neon-cyan);
}

/* ── Links ──────────────────────────────────────────────────── */
a {
    color: var(--neon-cyan);
    text-decoration: none;
    transition: color 0.3s var(--ease-smooth);
}

a:hover {
    color: var(--neon-magenta);
}

/* ── Utility Classes ────────────────────────────────────────── */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── Loading Screen ─────────────────────────────────────────── */
#loading-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-void);
    transition: opacity 0.8s var(--ease-out-expo), visibility 0.8s;
}

#loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-logo {
    font-size: 2rem;
    font-variation-settings: 'wght' 200;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--text-primary);
    margin-bottom: var(--space-xl);
    animation: loading-breathe 2s ease-in-out infinite;
}

.loading-logo span {
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-magenta));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-variation-settings: 'wght' 700;
}

.loading-bar-track {
    width: 200px;
    height: 2px;
    background: var(--glass-border);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.loading-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-magenta));
    border-radius: var(--radius-full);
    transition: width 0.3s var(--ease-smooth);
    box-shadow: var(--glow-cyan);
}

@keyframes loading-breathe {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* ── Canvas Background ──────────────────────────────────────── */
#nebula-canvas {
    position: fixed;
    inset: 0;
    z-index: var(--z-canvas);
    pointer-events: none;
    width: 100%;
    height: 100%;
}



/* ── Main Layout ────────────────────────────────────────────── */
#portfolio-feed {
    position: relative;
    z-index: var(--z-content);
    width: 100%;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding-top: 100px;
    padding-bottom: 200px;
    scroll-behavior: auto;
}

/* Scroll container for the floating cards */
#cards-container {
    position: relative;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    min-height: 200vh;
    padding: 0 var(--space-2xl);
}

/* ── Responsive Breakpoints ─────────────────────────────────── */
@media (max-width: 1200px) {
    :root {
        --card-width: 340px;
        --card-height: 400px;
        --card-gap: 30px;
    }
}

@media (max-width: 900px) {
    :root {
        --card-width: 300px;
        --card-height: 360px;
        --card-gap: 24px;
    }

    #cards-container {
        padding: 0 var(--space-lg);
    }
}

@media (max-width: 640px) {
    :root {
        --card-width: 100%;
        --card-height: 380px;
        --card-gap: 20px;
    }



    #cards-container {
        padding: 0 var(--space-md);
    }
}

/* ── Reduced Motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
