/* ─── MAIN LAYOUT ─── */

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    overflow-x: hidden;
}

/* WebGL canvas — fixed behind everything */
#webgl-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}

/* Content layer above WebGL */
.content-layer {
    position: relative;
    z-index: 1;
}

/* ─── NAVIGATION ─── */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 16px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(10, 10, 15, 0.75);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.3s ease;
}

.nav.scrolled {
    background: rgba(10, 10, 15, 0.92);
}

.nav-brand {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 900;
    letter-spacing: -1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-brand .accent {
    color: var(--accent-red);
    display: inline-block;
    animation: brand-float 3.3s ease-in-out infinite;
}

.nav-links {
    display: flex;
    gap: 32px;
    align-items: center;
}

.nav-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    transition: color 0.2s ease;
    cursor: pointer;
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-cta {
    padding: 10px 24px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 700;
    background: var(--accent-red);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s var(--ease-out-expo);
    box-shadow: 0 4px 15px var(--accent-red-glow);
}

.nav-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--accent-red-glow);
}

.nav-mobile-toggle {
    display: none;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm);
    color: white;
    width: 40px;
    height: 40px;
    font-size: 18px;
    cursor: pointer;
}

/* ─── SECTIONS ─── */
.section {
    padding: var(--space-4xl) var(--space-xl);
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

.section-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 800;
    color: var(--indigo);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: var(--space-lg);
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 900;
    letter-spacing: -2px;
    line-height: 1.1;
    margin-bottom: var(--space-md);
}

.section-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 600px;
    line-height: 1.6;
    margin: 0 auto;
}

/* ─── HERO ─── */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: var(--space-4xl) var(--space-xl);
    position: relative;
}

.hero-headline {
    font-family: var(--font-display);
    font-size: clamp(40px, 7vw, 80px);
    font-weight: 900;
    letter-spacing: -3px;
    line-height: 1.05;
    margin-bottom: var(--space-lg);
    max-width: 900px;
}

.hero-headline .gradient-text {
    background: var(--gradient-accent);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 6s ease infinite;
}

.hero-sub {
    font-size: clamp(16px, 2vw, 20px);
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto var(--space-xl);
    line-height: 1.6;
}

.hero-typed {
    font-family: var(--font-mono);
    color: var(--cyan);
    font-size: clamp(14px, 1.5vw, 18px);
    margin-bottom: var(--space-2xl);
    min-height: 28px;
}

.hero-typed .cursor {
    animation: blink 1s step-end infinite;
    color: var(--cyan);
}

.hero-ctas {
    display: flex;
    gap: var(--space-md);
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-primary {
    padding: 16px 40px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 800;
    background: var(--accent-red);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s var(--ease-out-expo);
    box-shadow: 0 8px 30px var(--accent-red-glow);
    letter-spacing: 0.02em;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(255, 62, 62, 0.4);
}

.btn-secondary {
    padding: 16px 40px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 700;
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    transition: all 0.3s var(--ease-out-expo);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* ─── FLOATING STAT CARDS ─── */
.hero-stats {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-3xl);
    flex-wrap: wrap;
    justify-content: center;
}

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 20px 28px;
    text-align: center;
    min-width: 140px;
    transition: all 0.3s var(--ease-out-expo);
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.1);
}

.stat-value {
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 900;
    letter-spacing: -2px;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 4px;
    letter-spacing: 0.03em;
}

/* ─── FEATURE CARDS GRID ─── */
.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
    margin-top: var(--space-2xl);
}

.features-grid--2col {
    grid-template-columns: repeat(2, 1fr);
}

.features-grid--3col {
    grid-template-columns: repeat(3, 1fr);
}

.feature-card {
    background: var(--glass-bg);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 36px 32px;
    transition: all 0.4s var(--ease-out-expo);
    cursor: default;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-accent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-6px);
    border-color: rgba(99, 102, 241, 0.25);
    box-shadow: var(--shadow-lg);
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-icon {
    font-size: 32px;
    margin-bottom: var(--space-md);
    display: inline-block;
}

.feature-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: var(--space-sm);
}

.feature-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.feature-badge {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    margin-top: var(--space-md);
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: var(--indigo);
}

/* ─── FULL-WIDTH DEMO SECTIONS ─── */
.demo-section {
    padding: var(--space-3xl) 0;
    position: relative;
}

.demo-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-xl);
}

.demo-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

/* ─── TECH STACK BADGES ─── */
.tech-badges {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    justify-content: center;
    margin-top: var(--space-xl);
}

.tech-badge {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.tech-badge:hover {
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.08);
}

/* ─── PRICING TEASER ─── */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
    margin-top: var(--space-2xl);
}

.pricing-card {
    background: var(--glass-bg);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 32px 24px;
    text-align: center;
    transition: all 0.3s var(--ease-out-expo);
    position: relative;
}

.pricing-card.featured {
    border-color: var(--indigo);
    box-shadow: 0 0 40px var(--indigo-glow);
}

.pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.pricing-name {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 800;
    margin-bottom: var(--space-sm);
}

.pricing-price {
    font-family: var(--font-display);
    font-size: 42px;
    font-weight: 900;
    letter-spacing: -2px;
    margin-bottom: 4px;
}

.pricing-period {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
}

.pricing-feature {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 6px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.popular-badge {
    position: absolute;
    top: 0;
    right: 24px;
    background: var(--indigo);
    color: white;
    font-size: 10px;
    font-weight: 800;
    padding: 5px 14px;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    letter-spacing: 0.05em;
}

/* ─── CTA SECTION ─── */
.cta-section {
    text-align: center;
    padding: var(--space-4xl) var(--space-xl);
    position: relative;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 400px;
    background: radial-gradient(ellipse, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.cta-title {
    font-family: var(--font-display);
    font-size: clamp(36px, 5vw, 60px);
    font-weight: 900;
    letter-spacing: -2px;
    margin-bottom: var(--space-md);
}

/* ─── FOOTER ─── */
.footer {
    text-align: center;
    padding: var(--space-xl);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 13px;
    color: var(--text-dim);
}

.footer a {
    color: var(--text-muted);
    transition: color 0.2s;
}

.footer a:hover {
    color: var(--text-primary);
}

.footer-links {
    display: flex;
    gap: var(--space-lg);
    justify-content: center;
    margin-bottom: var(--space-md);
}

/* ─── RESPONSIVE ─── */
@media (max-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .pricing-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav {
        padding: 12px 20px;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(10, 10, 15, 0.97);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        padding: 16px 20px;
        gap: 0;
        z-index: 999;
    }

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

    .nav-links .nav-link {
        padding: 14px 0;
        font-size: 15px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .nav-links .nav-cta {
        margin-top: 12px;
        text-align: center;
        width: 100%;
    }

    .nav-mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .section {
        padding: var(--space-2xl) var(--space-md);
    }

    .section-title {
        font-size: clamp(24px, 6vw, 36px);
        letter-spacing: -1px;
    }

    .section-subtitle {
        font-size: 14px;
    }

    .hero {
        padding: var(--space-3xl) var(--space-md);
        min-height: 80vh;
    }

    .hero-headline {
        font-size: clamp(28px, 8vw, 48px);
        letter-spacing: -1.5px;
    }

    .features-grid,
    .features-grid--2col,
    .features-grid--3col {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    .feature-card {
        padding: 24px 20px;
    }

    .feature-title {
        font-size: 17px;
    }

    .feature-desc {
        font-size: 13px;
    }

    .pricing-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    .pricing-card {
        padding: 24px 18px;
    }

    .hero-stats {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--space-sm);
        width: 100%;
        max-width: 400px;
    }

    .stat-card {
        width: auto;
        max-width: none;
        padding: 14px 12px;
        min-width: 0;
    }

    .stat-value {
        font-size: 20px;
        letter-spacing: -1px;
    }

    .stat-label {
        font-size: 10px;
    }

    /* Orphaned grids outside .section need side padding */
    .features-grid:not(.section .features-grid) {
        padding: 0 var(--space-md);
    }

    .showcase-grid {
        padding: 0 var(--space-md);
    }

    .demo-container {
        padding: 0 var(--space-md);
    }

    .demo-section {
        padding: var(--space-2xl) 0;
    }

    .tech-badges {
        gap: 6px;
    }

    .tech-badge {
        padding: 6px 10px;
        font-size: 10px;
    }

    /* Hide WebGL canvas on mobile — prevents black empty space */
    #webgl-canvas {
        display: none;
    }

    .cta-title {
        font-size: clamp(24px, 6vw, 40px);
    }

    .footer-links {
        flex-direction: column;
        gap: var(--space-sm);
    }
}