/* SEO Performance Optimizations */

/* Critical CSS - Above the fold styles */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-content {
    z-index: 2;
    position: relative;
}

/* Font optimization */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('https://fonts.gstatic.com/s/inter/v12/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hiA.woff2') format('woff2');
}

/* Image optimization */
img {
    max-width: 100%;
    height: auto;
    loading: lazy;
}

/* Critical images - load immediately */
.hero img,
.logo img {
    loading: eager;
}

/* Performance optimizations */
* {
    box-sizing: border-box;
}

/* Reduce layout shifts */
.aspect-ratio {
    aspect-ratio: 16/9;
}

/* Optimize animations */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Critical above-the-fold styles */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

/* Mobile-first responsive design */
@media (max-width: 768px) {
    .hero {
        padding: 2rem 0;
        min-height: 80vh;
    }
    
    .hero-content h1 {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .hero-description {
        font-size: 1rem;
        margin: 1rem 0;
    }
}

/* Preload critical resources */
.preload-fonts {
    font-family: 'Inter', sans-serif;
}

/* Optimize button interactions */
.btn {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

/* Optimize form interactions */
.form-group input,
.form-group textarea,
.form-group select {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    outline: none;
}

/* Optimize loading states */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-color);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Optimize scroll performance */
.smooth-scroll {
    scroll-behavior: smooth;
}

/* Optimize hover effects */
.feature-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Optimize text rendering */
body {
    text-rendering: optimizeSpeed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Optimize focus indicators */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Optimize print styles */
@media print {
    .header,
    .footer,
    .btn {
        display: none;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .hero {
        background: none;
        color: black;
    }
}

/* Optimize dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a1a;
        --text-color: #ffffff;
        --card-bg: #2a2a2a;
    }
}

/* Optimize reduced data usage */
@media (prefers-reduced-data: reduce) {
    .hero {
        background: var(--primary-color);
    }
    
    img {
        filter: grayscale(100%);
    }
}

/* Optimize high contrast mode */
@media (prefers-contrast: high) {
    .btn {
        border: 2px solid currentColor;
    }
    
    .feature-card {
        border: 1px solid currentColor;
    }
}

/* Critical CSS for above-the-fold content */
.hero-title {
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1rem;
}

.hero-description {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    line-height: 1.6;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.hero-stats {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-color);
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Optimize container queries for better performance */
@container (min-width: 768px) {
    .hero-content {
        max-width: 800px;
        margin: 0 auto;
    }
}

/* Optimize for Core Web Vitals */
.hero {
    contain: layout style paint;
}

.feature-card {
    contain: layout style;
}

/* Optimize for Largest Contentful Paint */
.hero-image {
    will-change: transform;
}

/* Optimize for Cumulative Layout Shift */
.hero-stats {
    min-height: 60px;
}

.hero-buttons {
    min-height: 50px;
}
