/* Base Styles */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #10b981;
    --accent: #f59e0b;
    --dark: #0f172a;
    --darker: #020617;
    --light: #f8fafc;
    --gray: #64748b;
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--darker);
    color: var(--light);
    overflow-x: hidden;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: radial-gradient(ellipse at center, #1e1b4b 0%, var(--darker) 70%);
}

.hero-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 50%;
    left: var(--x);
    top: var(--y);
    animation: float 6s ease-in-out infinite;
    animation-delay: var(--delay);
    opacity: 0.6;
}

.particle::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.3) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
}

@keyframes float {
    0%, 100% { transform: translateY(0) scale(1); opacity: 0.6; }
    50% { transform: translateY(-30px) scale(1.5); opacity: 1; }
}

.hero-content {
    text-align: center;
    z-index: 10;
    padding: 40px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 14px;
    margin-bottom: 32px;
    animation: fadeInUp 1s ease;
}

.pulse {
    width: 8px;
    height: 8px;
    background: var(--secondary);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

/* Glitch Effect */
.glitch {
    font-size: clamp(48px, 12vw, 120px);
    font-weight: 800;
    position: relative;
    text-transform: uppercase;
    letter-spacing: -2px;
    animation: fadeInUp 1s ease 0.2s backwards;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    animation: glitch-1 0.3s infinite linear alternate-reverse;
    color: #ff00ff;
    z-index: -1;
}

.glitch::after {
    animation: glitch-2 0.3s infinite linear alternate-reverse;
    color: #00ffff;
    z-index: -2;
}

@keyframes glitch-1 {
    0% { clip-path: inset(40% 0 61% 0); transform: translate(-2px, 2px); }
    20% { clip-path: inset(92% 0 1% 0); transform: translate(1px, -1px); }
    40% { clip-path: inset(43% 0 1% 0); transform: translate(-1px, 2px); }
    60% { clip-path: inset(25% 0 58% 0); transform: translate(2px, 1px); }
    80% { clip-path: inset(54% 0 7% 0); transform: translate(-2px, -2px); }
    100% { clip-path: inset(58% 0 43% 0); transform: translate(2px, -1px); }
}

@keyframes glitch-2 {
    0% { clip-path: inset(65% 0 8% 0); transform: translate(2px, -2px); }
    20% { clip-path: inset(10% 0 85% 0); transform: translate(-1px, 1px); }
    40% { clip-path: inset(78% 0 5% 0); transform: translate(1px, -2px); }
    60% { clip-path: inset(30% 0 62% 0); transform: translate(-2px, -1px); }
    80% { clip-path: inset(5% 0 89% 0); transform: translate(2px, 2px); }
    100% { clip-path: inset(47% 0 48% 0); transform: translate(-1px, 1px); }
}

.subtitle {
    font-size: clamp(18px, 3vw, 28px);
    color: var(--gray);
    margin-top: 16px;
    animation: fadeInUp 1s ease 0.4s backwards;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    margin-top: 48px;
    animation: fadeInUp 1s ease 0.6s backwards;
}

.stat {
    text-align: center;
}

.stat-number {
    font-size: 48px;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-suffix {
    font-size: 24px;
    color: var(--primary);
}

.stat-label {
    display: block;
    font-size: 14px;
    color: var(--gray);
    margin-top: 4px;
}

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

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
}

.mouse {
    width: 24px;
    height: 40px;
    border: 2px solid var(--gray);
    border-radius: 12px;
    position: relative;
}

.wheel {
    width: 4px;
    height: 8px;
    background: var(--primary);
    border-radius: 2px;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    animation: scroll 2s infinite;
}

@keyframes scroll {
    0% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(16px); }
}

/* Sections */
section {
    padding: 100px 0;
}

.section-title {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 700;
    text-align: center;
    margin-bottom: 16px;
}

.section-intro {
    text-align: center;
    color: var(--gray);
    font-size: 18px;
    max-width: 600px;
    margin: 0 auto 60px;
}

/* Problem Section */
.problem-section {
    background: linear-gradient(180deg, var(--darker) 0%, var(--dark) 100%);
}

.comparison-viz {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 32px;
    align-items: center;
    max-width: 1000px;
    margin: 0 auto;
}

.viz-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 32px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.viz-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.viz-card h3 {
    font-size: 24px;
    margin-bottom: 8px;
}

.viz-subtitle {
    color: var(--gray);
    font-size: 14px;
    margin-bottom: 24px;
}

.token-flow {
    margin: 24px 0;
}

.token-container {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 16px;
}

.token {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
}

.token-container:not(.parallel) .token {
    animation: sequentialPop 0.5s ease forwards;
}

.token-container:not(.parallel) .token:nth-child(1) { animation-delay: 0s; }
.token-container:not(.parallel) .token:nth-child(2) { animation-delay: 0.2s; }
.token-container:not(.parallel) .token:nth-child(3) { animation-delay: 0.4s; }
.token-container:not(.parallel) .token:nth-child(4) { animation-delay: 0.6s; }
.token-container:not(.parallel) .token:nth-child(5) { animation-delay: 0.8s; }

.token-container.parallel .token {
    animation: parallelPop 0.5s ease forwards;
}

@keyframes sequentialPop {
    0% { opacity: 0; transform: scale(0); background: rgba(99, 102, 241, 0.3); }
    100% { opacity: 1; transform: scale(1); background: rgba(239, 68, 68, 0.3); }
}

@keyframes parallelPop {
    0% { opacity: 0; transform: scale(0); background: rgba(99, 102, 241, 0.3); }
    100% { opacity: 1; transform: scale(1); background: rgba(16, 185, 129, 0.3); }
}

.time-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress {
    height: 100%;
    border-radius: 4px;
    animation: progressFill 2s ease forwards;
}

#auto-progress {
    background: linear-gradient(90deg, #ef4444, #f97316);
    width: 0%;
    animation: autoProgress 2s ease forwards;
}

#diff-progress {
    background: linear-gradient(90deg, #10b981, #34d399);
    width: 0%;
    animation: diffProgress 0.5s ease forwards;
}

@keyframes autoProgress {
    to { width: 100%; }
}

@keyframes diffProgress {
    to { width: 100%; }
}

.speed-indicator {
    text-align: center;
    padding: 16px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 12px;
    margin-top: 16px;
}

.speed-indicator.fast {
    background: rgba(16, 185, 129, 0.1);
}

.speed-value {
    font-size: 32px;
    font-weight: 700;
    color: #ef4444;
}

.speed-indicator.fast .speed-value {
    color: #10b981;
}

.speed-unit {
    display: block;
    font-size: 12px;
    color: var(--gray);
}

.feature-list {
    list-style: none;
    margin-top: 20px;
}

.feature-list li {
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
    color: var(--gray);
    font-size: 14px;
}

.feature-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary);
}

.vs-divider {
    font-size: 32px;
    font-weight: 700;
    color: var(--gray);
    padding: 20px;
}

/* Diffusion Section */
.diffusion-section {
    background: var(--dark);
}

.diffusion-demo {
    max-width: 1100px;
    margin: 0 auto;
}

.demo-controls {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 40px;
}

.demo-btn {
    padding: 12px 32px;
    background: var(--primary);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.demo-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.demo-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
}

.demo-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.diffusion-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.step {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
    min-width: 180px;
    opacity: 0.3;
    transition: all 0.5s ease;
}

.step.active {
    opacity: 1;
    transform: scale(1.05);
    border-color: var(--primary);
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.3);
}

.step-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 16px;
}

.step-content {
    font-family: monospace;
    font-size: 16px;
    min-height: 30px;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
}

.step-content span {
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.step-content.noise span {
    color: rgba(255, 255, 255, 0.2);
}

.step-content span.clear {
    color: var(--light);
    background: rgba(99, 102, 241, 0.2);
}

.coherence-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin-top: 16px;
    overflow: hidden;
}

.coherence-fill {
    height: 100%;
    background: var(--gradient-1);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.coherence-label {
    font-size: 12px;
    color: var(--gray);
    text-align: center;
    margin-top: 8px;
}

.step-arrow {
    font-size: 24px;
    color: var(--gray);
}

/* Graph Section */
.graph-section {
    background: linear-gradient(180deg, var(--dark) 0%, var(--darker) 100%);
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
    margin-bottom: 60px;
}

.chart-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
}

.chart-card h3 {
    font-size: 18px;
    margin-bottom: 24px;
    text-align: center;
}

.chart-card canvas {
    max-height: 300px;
}

/* Cost Comparison */
.cost-comparison h3 {
    text-align: center;
    margin-bottom: 32px;
}

.pricing-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    max-width: 800px;
    margin: 0 auto;
}

.pricing-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
    position: relative;
    transition: all 0.3s ease;
}

.pricing-card:hover {
    transform: translateY(-4px);
}

.pricing-card.highlight {
    border-color: var(--secondary);
    background: rgba(16, 185, 129, 0.05);
}

.model-name {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.price {
    font-weight: 600;
    color: #ef4444;
}

.price.low {
    color: var(--secondary);
}

.savings-badge {
    position: absolute;
    top: -12px;
    right: 16px;
    background: var(--secondary);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* Use Cases Section */
.usecases-section {
    background: var(--darker);
}

.usecases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.usecase-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 32px;
    transition: all 0.3s ease;
}

.usecase-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
}

.usecase-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.usecase-card h3 {
    font-size: 20px;
    margin-bottom: 12px;
}

.usecase-card p {
    color: var(--gray);
    font-size: 14px;
    margin-bottom: 20px;
}

.latency-bar .before,
.latency-bar .after {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 8px 0;
}

.latency-bar .bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.latency-bar .fill {
    height: 100%;
    background: #ef4444;
    border-radius: 4px;
}

.latency-bar .fill.fast {
    background: var(--secondary);
}

.agent-flow {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.agent-step {
    background: rgba(99, 102, 241, 0.2);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
}

.agent-arrow {
    color: var(--primary);
}

.time-saving {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.time-block {
    text-align: center;
    padding: 16px;
    border-radius: 12px;
}

.time-block.before-time {
    background: rgba(239, 68, 68, 0.1);
}

.time-block.after-time {
    background: rgba(16, 185, 129, 0.1);
}

.time-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
}

.time-label {
    font-size: 12px;
    color: var(--gray);
}

.throughput-viz {
    height: 120px;
}

/* Features Section */
.features-section {
    background: var(--dark);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.feature-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 32px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.feature-card:hover {
    border-color: var(--primary);
}

.feature-number {
    font-size: 64px;
    font-weight: 800;
    color: rgba(99, 102, 241, 0.1);
    position: absolute;
    top: -10px;
    right: 20px;
}

.feature-card h3 {
    font-size: 20px;
    margin-bottom: 12px;
    position: relative;
}

.feature-card p {
    color: var(--gray);
    font-size: 14px;
    position: relative;
}

/* Code Section */
.code-section {
    background: linear-gradient(180deg, var(--dark) 0%, var(--darker) 100%);
}

.code-comparison {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.code-block {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    max-width: 400px;
    width: 100%;
}

.code-block.highlight {
    border-color: var(--secondary);
}

.code-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.code-title {
    font-size: 14px;
    font-weight: 600;
}

.code-block pre {
    padding: 16px;
    overflow-x: auto;
}

.code-block code {
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    line-height: 1.6;
}

.code-arrow {
    font-size: 32px;
    color: var(--primary);
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    text-align: center;
    padding: 80px 24px;
}

.cta-section h2 {
    font-size: clamp(24px, 4vw, 36px);
    margin-bottom: 16px;
}

.cta-section p {
    color: var(--gray);
    margin-bottom: 32px;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: var(--light);
    color: var(--dark);
    padding: 16px 40px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.2);
}

/* Footer */
.footer {
    background: var(--darker);
    padding: 40px 24px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer p {
    color: var(--gray);
    font-size: 14px;
}

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

.footer .source {
    margin-top: 8px;
    font-size: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .comparison-viz {
        grid-template-columns: 1fr;
    }
    
    .vs-divider {
        transform: rotate(90deg);
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 24px;
    }
    
    .diffusion-steps {
        flex-direction: column;
    }
    
    .step-arrow {
        transform: rotate(90deg);
    }
    
    .code-comparison {
        flex-direction: column;
    }
    
    .code-arrow {
        transform: rotate(90deg);
    }
}

/* Animations */
.animate-fade-in {
    animation: fadeInUp 1s ease;
}

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}