/* Critical CSS for above-the-fold content */
:root {
    --primary: #6B46C1;
    --secondary: #EC4899;
    --background: #0F172A;
    --nav-height: 4rem;
    --nav-height-mobile: 4.5rem;
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

/* Reset and base styles */
html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-height);
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--background);
    color: #fff;
    font-family: system-ui, -apple-system, sans-serif;
}

/* Critical Components */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Glass morphism effects */
.glass-morphism {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Gradient animations */
.animate-gradient {
    background-size: 200% 200%;
    animation: gradient 8s ease infinite;
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Loading states */
.skeleton {
    background: linear-gradient(90deg, #2A2A2A 25%, #3A3A3A 50%, #2A2A2A 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Mobile-specific styles */
@media (max-width: 768px) {
    body {
        padding-bottom: calc(var(--nav-height-mobile) + var(--safe-area-bottom));
    }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Improved touch targets */
    button, 
    a {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Better spacing for mobile */
    .section {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
    
    /* Font size adjustments */
    h1 { font-size: clamp(2rem, 8vw, 3.5rem); }
    h2 { font-size: clamp(1.5rem, 6vw, 2.5rem); }
    h3 { font-size: clamp(1.2rem, 4vw, 1.8rem); }
    
    /* Prevent horizontal scroll */
    .overflow-x-auto {
        -webkit-overflow-scrolling: touch;
    }
}

/* iOS Safe Area Support */
@supports(padding: max(0px)) {
    body {
        padding-bottom: max(var(--nav-height-mobile), env(safe-area-inset-bottom));
    }
}