:root {
    --bg-dark: #fcfcfd;
    --bg-card: rgba(255, 255, 255, 0.7);
    --primary: #2563eb;
    --primary-glow: rgba(37, 99, 235, 0.2);
    --secondary: #0891b2;
    --accent: #e11d48;
    --text-main: #020617;
    --text-muted: #475569;
    --glass-border: rgba(255, 255, 255, 0.5);
    --nav-height: clamp(60px, 8vh, 80px);
    --transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    
    /* Fluid Spacing */
    --space-xs: clamp(0.75rem, 0.7rem + 0.25vw, 1rem);
    --space-s: clamp(1rem, 0.9rem + 0.5vw, 1.5rem);
    --space-m: clamp(1.5rem, 1.3rem + 1vw, 2.5rem);
    --space-l: clamp(2rem, 1.7rem + 1.5vw, 4rem);
    --space-xl: clamp(3rem, 2.5rem + 2.5vw, 6rem);
    --section-spacing: clamp(4rem, 8vw, 8rem);

    /* Fluid Typography */
    --fs-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
    --fs-s: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
    --fs-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
    --fs-m: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
    --fs-l: clamp(1.5rem, 1.3rem + 1vw, 2rem);
    --fs-xl: clamp(2rem, 1.8rem + 2vw, 3.5rem);
    --fs-display: clamp(2.5rem, 2rem + 6vw, 6rem);
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(37, 99, 235, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(37, 99, 235, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -2;
    pointer-events: none;
}

body.loading {
    overflow: hidden;
}

/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.8s ease, visibility 0.8s;
}

.loader-logo {
    height: 80px;
    width: auto;
    margin-bottom: 10px;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.05));
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loader-bar-container {
    width: 200px;
    height: 2px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 2px;
    overflow: hidden;
}

.loader-bar {
    width: 100%;
    height: 100%;
    background: var(--primary);
    transform: translateX(-100%);
    animation: loading-bar 2s ease-in-out infinite;
}

@keyframes loading-bar {
    0% { transform: translateX(-100%); }
    50% { transform: translateX(0); }
    100% { transform: translateX(100%); }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: initial;
}

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

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--primary), var(--secondary));
    border-radius: 10px;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.section-padding {
    padding-block: var(--section-spacing);
}

/* Navigation Helper */
.glass-nav {
    transition: var(--transition);
}

.glass-nav > div {
    transition: var(--transition);
}

.glass-nav.scrolled > div {
    height: 70px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

/* Mobile Nav Enhancements - Premium Glassmorphism */
@media (max-width: 1023px) {
    .nav-links.active {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100vh !important;
        background-color: rgba(255, 255, 255, 0.95) !important; 
        backdrop-filter: blur(15px) saturate(180%);
        -webkit-backdrop-filter: blur(15px) saturate(180%);
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        z-index: 5000 !important;
        transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s !important;
    }

    .nav-links:not(.active) {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
}

.nav-links.active ul {
    display: flex !important;
    flex-direction: column !important;
    gap: 2.5rem !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: translateY(0);
    animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.nav-links.active a {
    font-size: var(--fs-xl) !important;
    color: var(--text-main) !important;
    font-weight: 700 !important;
    letter-spacing: -0.02em;
    transition: var(--transition);
}

.nav-links.active a:hover {
    color: var(--primary) !important;
    transform: scale(1.05);
}

/* Interactive Process Section (CRITICAL) */
.interactive-process {
    padding: var(--section-spacing) 0;
    background: radial-gradient(circle at 100% 0%, rgba(37, 99, 235, 0.05), transparent 50%);
}

.process-visual {
    position: relative;
    height: 300px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    border-radius: 40px;
    border: 1px solid var(--glass-border);
    margin-top: 60px;
    overflow: hidden;
}

.truck-path {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 2px;
    transform: translateY(-50%);
}

.truck-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
    border-radius: 2px;
}

#truck-svg {
    position: absolute;
    top: 50%;
    left: -100px;
    transform: translateY(-50%);
    z-index: 50;
    filter: drop-shadow(0 0 15px rgba(37, 99, 235, 0.3));
}

.process-node {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: white;
    border: 2px solid var(--glass-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: var(--transition);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.process-node.active {
    border-color: var(--primary);
    box-shadow: 0 0 30px var(--primary-glow);
    transform: translate(-50%, -50%) scale(1.1);
}

.node-info {
    position: absolute;
    top: 120%;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    text-align: center;
}

/* Custom Cursor */
#custom-cursor {
    position: fixed;
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
}

#cursor-follower {
    position: fixed;
    width: 35px;
    height: 35px;
    border: 1px solid var(--primary);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transition: width 0.3s, height 0.3s, background 0.3s;
}

@media (pointer: coarse) {
    #custom-cursor, #cursor-follower {
        display: none;
    }
}

#back-to-top:hover i {
    transform: translateY(-4px);
}

/* Professional Responsive Tweaks */
@media (max-width: 768px) {
    .process-visual {
        height: 260px;
        margin-top: 20px;
    }
    
    #truck-svg {
        width: 55px;
        height: 28px;
    }
    
    .process-node {
        width: 50px;
        height: 50px;
        top: 40% !important;
    }

    .truck-path {
        top: 40% !important;
    }

    #truck-svg {
        top: 40% !important;
    }

    #node-2 .node-info, #node-4 .node-info {
        top: 160%;
    }
    
    .node-info h4 {
        font-size: 10px;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .process-visual {
        height: 220px;
        margin-top: 15px;
        border-radius: 20px;
        padding-inline: 10px;
    }
    
    #truck-svg {
        width: 40px;
        height: 20px;
    }
    
    .process-node {
        width: 42px;
        height: 42px;
    }

    .process-node i {
        width: 16px !important;
        height: 16px !important;
    }
    
    .node-info h4 {
        font-size: 8px;
        font-weight: 800;
    }
}

/* Bento Grid Specifics */
@media (min-width: 768px) and (max-width: 1024px) {
    .grid-cols-1.md\:grid-cols-2.lg\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Glass Nav Mobile Fixes */
@media (max-width: 1024px) {
    .glass-nav > div {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}