@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ==========================================
   GLOBAL DESIGN SYSTEM VARIABLES
   ========================================== */
:root {
    /* Colors */
    --bg-base: #030303;           /* Pitch Black */
    --bg-surface: #0f0f11;        /* Dark Charcoal */
    --bg-panel: #1a1a1d;          /* Lighter Charcoal */
    --bg-input: #0a0a0c;          /* Deep Input Field */
    
    /* Branding */
    --brand-primary: #e60000;     /* Aggressive Racing Red */
    --brand-hover: #ff1a1a;       /* Bright Red Hover */
    --brand-glow: rgba(230, 0, 0, 0.4);
    
    /* Typography */
    --text-pure: #ffffff;
    --text-muted: #9ca3af;
    --text-dark: #111827;
    
    /* Borders & Glassmorphism */
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(230, 0, 0, 0.5);
    
    /* Layout */
    --header-height: 80px;
}

/* ==========================================
   RESET & BASE
   ========================================== */
* {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    text-decoration: none;
}

html, body {
    width: 100%;
    min-height: 100vh;
    background-color: var(--bg-base);
    color: var(--text-pure);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    display: flex;
    flex-direction: column;
}

/* Custom Racing Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
    background: var(--brand-primary);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--brand-hover);
}

/* ==========================================
   GLOBAL TYPOGRAPHY & UTILITIES
   ========================================== */
.text-gradient {
    background: linear-gradient(135deg, #ffffff 0%, #888 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.glass-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

@media (max-width: 768px) {
    .container { padding: 0 20px; }
}

/* ==========================================
   3D SCROLL REVEAL ENGINE
   ========================================== */
.reveal-3d {
    opacity: 0;
    transform: translateY(60px) rotateX(-10deg) scale(0.95);
    transition: opacity 1s cubic-bezier(0.2, 0.8, 0.2, 1), 
                transform 1s cubic-bezier(0.2, 0.8, 0.2, 1);
    transform-style: preserve-3d;
    will-change: transform, opacity;
}
.reveal-3d.in-view {
    opacity: 1;
    transform: translateY(0) rotateX(0deg) scale(1);
}
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }

/* ==========================================
   PORTAL PRELOADER
   ========================================== */
#portal-preloader {
    position: fixed;
    inset: 0;
    background: var(--bg-base);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#portal-preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.preloader-spinner {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--border-glass);
    border-top-color: var(--brand-primary);
    animation: spin 1s linear infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.preloader-logo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.preloader-text {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--brand-primary);
    animation: pulse 2s infinite;
}

@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }