:root {
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Animations */
.reveal-on-scroll {
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal-on-scroll.visible {
    opacity: 1;
    transform: translate(0, 0) scale(1);
}

.slide-up { transform: translateY(60px); }
.slide-left { transform: translateX(-60px); }
.slide-right { transform: translateX(60px); }
.zoom-in { transform: scale(0.9); }

.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }

/* --- Navbar --- */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

nav.scrolled {
    padding: 15px 5%;
    background: rgba(15, 23, 42, 0.95);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-blue);
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--text-main);
}

.btn-primary {
    background: var(--accent-blue);
    color: white !important;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.39);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

/* --- Hero Section --- */
.hero {
    padding: 180px 5% 100px;
    text-align: center;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(59,130,246,0.15) 0%, rgba(15,23,42,0) 70%);
    z-index: -1;
    pointer-events: none;
}

.hero-badge {
    display: inline-block;
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 24px;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.hero h1 {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -1px;
}

.hero h1 span {
    color: var(--accent-blue);
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin: 0 auto 40px;
    max-width: 700px;
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s;
}

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

/* --- Dashboard Mockup --- */
.mockup-container {
    margin: 0 auto 100px;
    max-width: 1100px;
    padding: 0 5%;
    perspective: 1000px;
}

.mockup-image {
    width: 100%;
    height: 600px;
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: rotateX(5deg);
    transition: transform 0.5s ease;
}

.mockup-container:hover .mockup-image {
    transform: rotateX(0deg);
}

.mockup-container.visible .mockup-image {
    /* When visible, starts animating towards 0 if hovered, else 5deg */
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px) rotateX(5deg); }
    50% { transform: translateY(-15px) rotateX(2deg); }
    100% { transform: translateY(0px) rotateX(5deg); }
}

.mockup-header {
    height: 20px;
    background: rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 6px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }

.mockup-body {
    flex: 1;
    padding: 40px;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    background: repeating-linear-gradient(45deg, rgba(255,255,255,0.02) 0px, rgba(255,255,255,0.02) 2px, transparent 2px, transparent 10px);
}

.chart-placeholder {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    transition: transform 0.3s;
}

.chart-placeholder:hover {
    transform: scale(1.02);
    background: rgba(255, 255, 255, 0.05);
}

.chart-long { grid-column: 1 / -1; height: 200px; }

/* --- API Showcase Section --- */
.showcase {
    padding: 100px 5%;
    background: #0b1121; /* Slightly darker */
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto;
}

.showcase-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto 100px;
}

.showcase-text h3 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: var(--accent-blue);
}

.showcase-text p {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.showcase-features {
    list-style: none;
    margin-top: 30px;
}

.showcase-features li {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.05rem;
}

.showcase-features li::before {
    content: '✓';
    color: var(--accent-blue);
    font-weight: bold;
    background: rgba(59, 130, 246, 0.1);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.code-window {
    background: #1e1e1e;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.05);
    position: relative;
}

.code-window::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.05), transparent);
    transform: skewX(-20deg);
    animation: shine 4s infinite;
}

@keyframes shine {
    0% { left: -100%; }
    20% { left: 200%; }
    100% { left: 200%; }
}

.code-header {
    background: #2d2d2d;
    padding: 10px 16px;
    font-family: monospace;
    color: #858585;
    font-size: 0.85rem;
    border-bottom: 1px solid #1e1e1e;
    display: flex;
    align-items: center;
    gap: 8px;
}

.code-header::before {
    content: '';
    display: block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ff5f56;
    box-shadow: 16px 0 0 #ffbd2e, 32px 0 0 #27c93f;
    margin-right: 32px;
}

.code-content {
    padding: 20px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #d4d4d4;
    overflow-x: auto;
}

.code-content .keyword { color: #569cd6; }
.code-content .string { color: #ce9178; }
.code-content .function { color: #dcdcaa; }
.code-content .comment { color: #6a9955; }

/* --- Stats Section --- */
.stats {
    padding: 80px 5%;
    background: var(--accent-blue);
    display: flex;
    justify-content: center;
    gap: 100px;
    flex-wrap: wrap;
    position: relative;
    overflow: hidden;
}

.stats::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMSIgY3k9IjEiIHI9IjEiIGZpbGw9InJnYmEoMjU1LDI1NSwyNTUsMC4xKSIvPjwvc3ZnPg==');
    pointer-events: none;
}

.stat-item {
    text-align: center;
    z-index: 1;
}

.stat-number {
    font-size: 3.5rem;
    font-weight: 800;
    color: white;
    line-height: 1;
    margin-bottom: 8px;
}

.stat-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.125rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- Features Section --- */
.features {
    padding: 100px 5%;
    max-width: 1200px;
    margin: 0 auto;
}

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

.feature-card {
    background: var(--bg-card);
    padding: 40px 30px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--accent-blue);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-8px);
    background: #253347;
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 24px;
    transition: transform 0.3s ease, background 0.3s ease;
}

.feature-card:hover .icon-wrapper {
    transform: scale(1.1) rotate(5deg);
    background: rgba(59, 130, 246, 0.2);
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 12px;
    color: white;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.7;
}

/* --- CTA Bottom --- */
.cta-bottom {
    padding: 120px 5%;
    text-align: center;
    background: linear-gradient(to top, #0b1121, var(--bg-dark));
}

.cta-box {
    background: var(--bg-card);
    max-width: 800px;
    margin: 0 auto;
    padding: 60px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.cta-box::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(59,130,246,0.1) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.cta-box h2, .cta-box p, .cta-box a {
    position: relative;
    z-index: 1;
}

.cta-box h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.cta-box p {
    color: var(--text-muted);
    font-size: 1.125rem;
    margin-bottom: 30px;
}

/* --- Footer --- */
footer {
    padding: 60px 5% 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: #0b1121;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto 60px;
}

.footer-brand h4 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: white;
}

.footer-brand p {
    color: var(--text-muted);
    max-width: 300px;
}

.footer-links h5 {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

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

.footer-links a:hover {
    color: var(--accent-blue);
    padding-left: 5px;
}

.footer-bottom {
    text-align: center;
    color: var(--text-muted);
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

@media (max-width: 900px) {
    .showcase-grid { 
        grid-template-columns: 1fr; 
        gap: 40px; 
    }
    .stats {
        gap: 50px;
    }
}

@media (max-width: 768px) {
    nav {
        flex-direction: column;
        gap: 15px;
        padding: 15px 5%;
    }
    nav.scrolled {
        padding: 10px 5%;
    }
    .nav-links {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    .hero {
        padding: 140px 5% 60px;
    }
    .hero h1 { 
        font-size: 2.5rem; 
    }
    .hero p {
        font-size: 1.1rem;
    }
    .hero-buttons {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
    .hero-buttons a {
        width: 100%;
        text-align: center;
    }
    .mockup-image { 
        height: 300px; 
        transform: rotateX(0deg); /* Disable 3D tilt on smaller screens */
    }
    .mockup-container:hover .mockup-image, 
    .mockup-container.visible .mockup-image {
        animation: none;
        transform: none;
    }
    .mockup-body {
        grid-template-columns: 1fr;
    }
    .chart-placeholder {
        grid-column: 1 / -1 !important;
    }
    .footer-grid { 
        grid-template-columns: 1fr;
        text-align: center;
    }
    .footer-brand p {
        margin: 0 auto;
    }
    .footer-links {
        margin-top: 20px;
    }
    .cta-box h2 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }
    .stat-number {
        font-size: 2.5rem;
    }
    .features-grid {
        grid-template-columns: 1fr;
    }
    .section-header h2 {
        font-size: 2rem;
    }
}