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

/* Performance optimizations */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

*,
*::before,
*::after {
    will-change: auto;
}

/* Dark theme (default) */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #22d3ee;
    --dark: #0f172a;
    --light: #f8fafc;
    --gray: #64748b;
    --bg-main: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.5);
    --bg-card-hover: rgba(255, 255, 255, 0.05);
    --text-primary: #f8fafc;
    --text-secondary: #64748b;
    --border-color: rgba(255, 255, 255, 0.1);
    --nav-bg: rgba(15, 23, 42, 0.8);
    --nav-bg-scrolled: rgba(15, 23, 42, 0.95);
    --hero-bg: radial-gradient(ellipse at bottom, #1b2735 0%, #090a0f 100%);
    --particle-color: #22d3ee;
    --stat-card-bg: rgba(99, 102, 241, 0.1);
    --stat-card-border: rgba(99, 102, 241, 0.3);
    --stat-card-hover-bg: rgba(99, 102, 241, 0.2);
}

/* Light theme */
@media (prefers-color-scheme: light) {
    :root {
        --primary: #4f46e5;
        --primary-dark: #3730a3;
        --secondary: #0891b2;
        --dark: #ffffff;
        --light: #1e293b;
        --gray: #475569;
        --bg-main: #ffffff;
        --bg-card: rgba(248, 250, 252, 0.8);
        --bg-card-hover: rgba(99, 102, 241, 0.05);
        --text-primary: #0f172a;
        --text-secondary: #334155;
        --border-color: rgba(15, 23, 42, 0.1);
        --nav-bg: rgba(255, 255, 255, 0.9);
        --nav-bg-scrolled: rgba(255, 255, 255, 0.95);
        --hero-bg: radial-gradient(ellipse at bottom, #e2e8f0 0%, #f1f5f9 100%);
        --particle-color: #0891b2;
        --stat-card-bg: rgba(79, 70, 229, 0.1);
        --stat-card-border: rgba(79, 70, 229, 0.2);
        --stat-card-hover-bg: rgba(79, 70, 229, 0.15);
    }

    /* Light mode specific gradient overrides */
    .hero h1 {
        background: linear-gradient(135deg, #0f172a 0%, #4f46e5 100%) !important;
        -webkit-background-clip: text !important;
        -webkit-text-fill-color: transparent !important;
        background-clip: text !important;
    }

    .section-title {
        background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-main);
    overflow-x: hidden;
}

/* Animated Background */
.bg-animation {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0.1;
}

.bg-animation::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.5; }
    50% { transform: scale(1.5) rotate(180deg); opacity: 0.3; }
}

/* Navigation */
nav {
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

nav.scrolled {
    background: var(--nav-bg-scrolled);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger-line {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: var(--hero-bg);
}

.hero-content {
    text-align: center;
    z-index: 1;
    max-width: 800px;
    padding: 2rem;
}

.hero h1 {
    font-size: clamp(2.5rem, 8vw, 5rem);
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #fff 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 1s ease;
}

.hero .tagline {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease 0.2s both;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 1s ease 0.4s both;
}

.btn {
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    display: inline-block;
    position: relative;
    overflow: hidden;
    will-change: transform;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    transform: translateY(-3px);
}

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

/* Floating particles */
.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--particle-color);
    border-radius: 50%;
    animation: float 20s infinite linear;
}

@keyframes float {
    from {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    to {
        transform: translateY(-100vh) translateX(100px);
        opacity: 0;
    }
}

/* Sections */
section {
    padding: 5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 3rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Services */
.services {
    background: var(--bg-card);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
}

.service-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.service-card {
    background: var(--bg-card-hover);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    gap: 2rem;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.service-card:hover {
    transform: translateX(10px);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.3);
}

.service-card:hover::before {
    opacity: 0.1;
}

.service-icon {
    font-size: 3rem;
    min-width: 80px;
    text-align: center;
}

.service-icon img {
    width: 3rem;
    height: 3rem;
    object-fit: contain;
}

.service-content {
    flex: 1;
}

.service-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
}

.service-description {
    color: var(--text-secondary);
    position: relative;
    z-index: 1;
    line-height: 1.6;
}

/* About */
.about {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.stat-card {
    background: var(--stat-card-bg);
    border: 1px solid var(--stat-card-border);
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    background: var(--stat-card-hover-bg);
    transform: scale(1.05);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* Contact */
.contact {
    background: var(--bg-card);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    text-align: center;
}

.contact-cta {
    padding: 2rem 0;
}

.btn-large {
    font-size: 1.2rem;
    padding: 1.2rem 3rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    background: var(--bg-card);
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
}

.social-links a {
    color: var(--text-secondary);
    font-size: 1.5rem;
    transition: all 0.3s ease;
    text-decoration: none;
    padding: 0.5rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
}

.social-links a:hover {
    color: var(--primary);
    transform: translateY(-3px);
    background: rgba(99, 102, 241, 0.1);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .nav-links {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: var(--nav-bg-scrolled);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 3rem;
        z-index: 999;
        animation: slideIn 0.3s ease;
    }

    /* Ensure nav bar stays visible over the mobile menu */
    @media (max-width: 768px) {
        nav {
            z-index: 1001;
        }

        .mobile-menu-toggle {
            z-index: 1002;
            position: relative;
        }
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links a {
        font-size: 1.5rem;
        padding: 1rem;
    }

    @keyframes slideIn {
        from {
            opacity: 0;
            transform: translateY(-20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .about {
        grid-template-columns: 1fr;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
}