:root {
    /* Colors */
    --bg-dark: #050505;
    --bg-card: #0a0a0a;
    --text-main: #e0e0e0;
    --text-muted: #888;
    
    --neon-cyan: #00f3ff;
    --neon-purple: #bd00ff;
    --neon-green: #00ff9d;
    
    --font-ui: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --grid-gap: 24px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-ui);
    line-height: 1.6;
    overflow-x: hidden;
}

/* --- Scanline Overlay --- */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0),
        rgba(255, 255, 255, 0) 50%,
        rgba(0, 0, 0, 0.1) 50%,
        rgba(0, 0, 0, 0.1)
    );
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 999;
}

/* --- Utilities --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.highlight-cyan {
    color: var(--neon-cyan);
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.4);
}

.glass {
    background: rgba(20, 20, 20, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* --- Navigation --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
}

.logo {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -1px;
}

.blinking-cursor {
    animation: blink 1s step-end infinite;
    color: var(--neon-cyan);
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 2rem;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--neon-cyan);
}

/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px;
    position: relative;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    width: 100%;
}

h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    letter-spacing: -2px;
    margin-bottom: 1.5rem;
}

.hero-sub {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 500px;
}

.cta-group {
    display: flex;
    gap: 1rem;
}

.btn-primary {
    background: transparent;
    border: 1px solid var(--neon-cyan);
    color: var(--neon-cyan);
    padding: 12px 24px;
    font-family: var(--font-mono);
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.1);
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-primary:hover {
    background: rgba(0, 243, 255, 0.1);
    box-shadow: 0 0 25px rgba(0, 243, 255, 0.3);
}

.btn-secondary {
    padding: 12px 24px;
    color: var(--text-main);
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: var(--font-ui);
    transition: 0.3s;
}

.btn-secondary:hover {
    border-color: var(--text-main);
}

/* Terminal Window */
.terminal-wrapper {
    background: #0f0f0f;
    border-radius: 8px;
    border: 1px solid #333;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    overflow: hidden;
    font-family: var(--font-mono);
}

.terminal-header {
    background: #1a1a1a;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dot { width: 12px; height: 12px; border-radius: 50%; }
.red { background: #ff5f56; }
.yellow { background: #ffbd2e; }
.green { background: #27c93f; }
.term-title { margin-left: auto; font-size: 0.8rem; color: #555; }

.terminal-body {
    padding: 20px;
    min-height: 300px;
    color: #ccc;
    font-size: 0.9rem;
}

.cursor-block {
    display: inline-block;
    color: var(--neon-cyan);
    animation: blink 1s step-end infinite;
}

/* --- Architecture --- */
.architecture-section {
    padding: 100px 0;
    overflow: hidden;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 3rem;
    border-left: 4px solid var(--neon-purple);
    padding-left: 20px;
}

.arch-diagram {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    height: 150px;
}

.node {
    background: #111;
    border: 1px solid #333;
    padding: 15px 30px;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
    z-index: 2;
    position: relative;
}

.node.cache { border-color: var(--neon-green); box-shadow: 0 0 15px rgba(0, 255, 157, 0.1); }
.node.vectordb { border-color: var(--neon-cyan); box-shadow: 0 0 15px rgba(0, 243, 255, 0.1); }
.node.llm { border-color: var(--neon-purple); }

.small { font-size: 0.8rem; color: var(--text-muted); font-weight: 400; }

/* Connecting Lines */
.connection {
    position: absolute;
    height: 2px;
    background: #222;
    z-index: 1;
    top: 50%;
}

.user-cache { width: 33%; left: 0; }
.cache-vector { width: 33%; left: 33%; }
.vector-llm { width: 33%; left: 66%; }

/* Packets */
.packet {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    top: -2px;
}

.fast-packet {
    background: var(--neon-green);
    animation: flow 2s infinite linear;
}

.slow-packet {
    background: var(--neon-cyan);
    animation: flow 4s infinite linear;
}

.delay-packet { animation-delay: 2s; }

@keyframes flow {
    0% { left: 0; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { left: 100%; opacity: 0; }
}

.legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 40px;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.dot-legend { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 8px; }
.dot-legend.green { background: var(--neon-green); }
.dot-legend.blue { background: var(--neon-cyan); }

/* --- Bento Grid --- */
.features-section { padding: 100px 0; }

.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 240px;
    gap: var(--grid-gap);
}

.bento-card {
    background: rgba(20, 20, 20, 0.4);
    border: 1px solid #222;
    padding: 30px;
    border-radius: 12px;
    transition: transform 0.3s;
    position: relative;
    overflow: hidden;
}

.bento-card:hover {
    transform: translateY(-5px);
    border-color: #444;
}

.bento-card.wide { grid-column: span 2; }
.bento-card.tall { grid-row: span 2; }

.glow-border::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
    opacity: 0.5;
}

.card-icon { font-size: 2rem; margin-bottom: 20px; }
.bento-card h3 { font-size: 1.25rem; margin-bottom: 10px; }
.bento-card p { color: var(--text-muted); font-size: 0.95rem; }

/* --- Docs Tabs --- */
.docs-section { padding: 100px 0; padding-bottom: 150px; }

.tabs-container {
    border-radius: 12px;
    overflow: hidden;
}

.tabs-header {
    background: rgba(255, 255, 255, 0.03);
    padding: 10px;
    display: flex;
    gap: 5px;
    border-bottom: 1px solid #222;
}

.tab-btn {
    background: transparent;
    border: none;
    color: #666;
    padding: 10px 20px;
    cursor: pointer;
    font-family: var(--font-ui);
    font-weight: 600;
    transition: 0.3s;
    border-radius: 6px;
}

.tab-btn.active {
    background: #222;
    color: var(--neon-cyan);
}

.tabs-content {
    padding: 40px;
    min-height: 400px;
}

.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadeIn 0.4s ease; }

.tab-desc {
    margin-bottom: 20px;
    color: var(--text-muted);
}

/* Code Highlighting Sim */
.code-block {
    background: #0d0d0d;
    padding: 20px;
    border-radius: 6px;
    font-family: var(--font-mono);
    border: 1px solid #222;
    white-space: pre;
    color: #fff;
    overflow-x: auto;
}

.term-block {
    background: #000;
    padding: 20px;
    border-radius: 6px;
    font-family: var(--font-mono);
    color: #0f0;
    white-space: pre-wrap;
    border: 1px solid #333;
}

.keyword { color: var(--neon-purple); }
.string { color: var(--neon-green); }
.comment { color: #555; font-style: italic; }
.class { color: var(--neon-cyan); }
.function { color: #f1fa8c; }
.self { color: #ff79c6; }

/* Animations */
@keyframes blink { 50% { opacity: 0; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.fade-in { opacity: 0; transform: translateY(20px); transition: 0.8s ease-out; }
.fade-up { opacity: 0; transform: translateY(40px); transition: 0.8s ease-out; }

.visible { opacity: 1; transform: translateY(0); }

.delay-1 { transition-delay: 0.2s; }
.delay-2 { transition-delay: 0.4s; }
.delay-3 { transition-delay: 0.6s; }

/* --- Footer --- */
footer {
    border-top: 1px solid #222;
    margin-top: 50px;
    padding: 40px 0;
    background: #050505;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-left h4 {
    color: var(--text-main);
    margin-bottom: 5px;
    font-family: var(--font-mono);
}

.footer-left p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-right {
    display: flex;
    gap: 20px;
}

.footer-right a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: 0.3s;
}

.footer-right a:hover {
    color: var(--neon-cyan);
}

/* Responsive */
@media (max-width: 768px) {
    /* Layout */
    .container { padding: 0 20px; }
    
    /* Navbar */
    .navbar {
        position: fixed;
        flex-direction: column;
        padding: 15px;
        background: rgba(5, 5, 5, 0.95);
        backdrop-filter: blur(10px);
        height: auto;
    }
    
    .nav-links {
        width: 100%;
        display: flex;
        justify-content: center;
        gap: 20px;
        margin-top: 10px;
    }
    
    .nav-links a { margin-left: 0; font-size: 0.9rem; }

    /* Hero */
    .hero { 
        padding-top: 140px; 
        min-height: auto;
        padding-bottom: 60px;
    }

    .hero-grid { grid-template-columns: 1fr; text-align: center; gap: 3rem; }
    .hero-text { margin-bottom: 0; }
    .hero h1 { font-size: 2.5rem; }
    .hero-sub { margin: 0 auto 2rem auto; }
    .cta-group { justify-content: center; width: 100%; flex-wrap: wrap; }
    
    /* Terminal */
    .terminal-wrapper { margin-top: 20px; }

    /* Bento Grid */
    .bento-grid { grid-template-columns: 1fr; }
    .bento-card.wide, .bento-card.tall { grid-column: span 1; grid-row: span 1; }
    
    /* Architecture Diagram */
    .arch-diagram { flex-direction: column; height: auto; gap: 0; padding: 20px 0; }
    
    .node { width: 100%; margin-bottom: 0; z-index: 2; }
    .node.user { order: 1; }
    .node.cache { order: 3; }
    .node.vectordb { order: 5; }
    .node.llm { order: 7; }

    .connection { 
        position: relative !important;
        width: 2px !important; 
        height: 60px !important; 
        left: auto !important; 
        top: auto !important;
        margin: 0 auto !important;
        z-index: 1;
        background: #222;
    }
    
    .connection.user-cache { order: 2; }
    .connection.cache-vector { order: 4; }
    .connection.vector-llm { order: 6; }

    .packet { 
        animation: flowDown 2s infinite linear;
        left: 50% !important;
        transform: translateX(-50%);
    }
    
    /* Docs Tabs */
    .tabs-header { 
        flex-direction: column; 
        gap: 5px; 
    }
    .tab-btn { width: 100%; text-align: left; }
    
    /* Footer */
    .footer-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .footer-right {
        justify-content: center;
    }
    
    @keyframes flowDown {
        0% { top: 0; opacity: 0; }
        10% { opacity: 1; }
        90% { opacity: 1; }
        100% { top: 100%; opacity: 0; }
    }
}

.api-header {
    margin-top: 25px;
    margin-bottom: 5px;
    color: var(--neon-cyan);
    font-family: var(--font-mono);
    font-size: 1rem;
    border-bottom: 1px solid rgba(0, 243, 255, 0.2);
    padding-bottom: 3px;
    display: inline-block;
}

.api-text {
    margin-bottom: 15px;
    color: #ccc;
    font-size: 0.9rem;
    padding-left: 10px;
    border-left: 2px solid #333;
}
