/* =============================================
   LLM Benchmark — cbrian.es
   Dark theme · Cyber/tech aesthetic
   ============================================= */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a26;
    --bg-card-hover: #222233;
    --text-primary: #e8e8f0;
    --text-secondary: #9898b0;
    --text-muted: #686880;
    --accent: #00d4aa;
    --accent2: #7c3aed;
    --accent3: #f59e0b;
    --accent4: #ef4444;
    --m1-color: #60a5fa;
    --m2-color: #34d399;
    --m3-color: #f472b6;
    --m4-color: #a78bfa;
    --m5-color: #f59e0b;
    --nvidia-color: #10b981;
    --amd-color: #ef4444;
    --mac-color: #3b82f6;
    --gradient-1: linear-gradient(135deg, #00d4aa, #7c3aed);
    --gradient-2: linear-gradient(135deg, #7c3aed, #f472b6);
    --gradient-hero: linear-gradient(135deg, #0a0a1a 0%, #1a1030 50%, #0a1a20 100%);
    --border: 1px solid rgba(255,255,255,0.06);
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0,0,0,0.3);
    --transition: 0.2s ease;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

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

/* ========== NAVBAR ========== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 2rem;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: var(--border);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.logo-icon { font-size: 1.5rem; }

.logo-text .accent {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links { display: flex; gap: 1.5rem; }

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color var(--transition);
}

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

/* ========== HERO ========== */
.hero {
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6rem 2rem 4rem;
    background: var(--gradient-hero);
    gap: 3rem;
    flex-wrap: wrap;
}

.hero-content { flex: 1; min-width: 300px; }

.hero-content h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1rem;
}

.gradient-text {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 550px;
    margin-bottom: 2rem;
}

.hero-stats {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hero-visual {
    flex: 1;
    min-width: 300px;
    max-width: 500px;
}

.floating-chart {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: var(--border);
    box-shadow: var(--shadow);
}

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

.section-alt {
    background: var(--bg-secondary);
    max-width: 100%;
    padding-left: calc((100% - 1200px) / 2 + 2rem);
    padding-right: calc((100% - 1200px) / 2 + 2rem);
}

@media (max-width: 1240px) {
    .section-alt {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 600px;
    margin: 0 auto;
}

.section-source {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.section-source a {
    color: var(--accent);
    text-decoration: none;
}

.section-source a:hover { text-decoration: underline; }

/* ========== MODELS GRID ========== */
.models-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

.model-card {
    background: var(--bg-card);
    border: var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: all var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.model-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-1);
    opacity: 0;
    transition: opacity var(--transition);
}

.model-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

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

.model-rank {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
}

.model-card:nth-child(-n+3) .model-rank {
    color: var(--accent);
    border: 1px solid var(--accent);
}

.model-name {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    padding-right: 3rem;
}

.model-family {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    margin-bottom: 0.75rem;
}

.family-google, .family-gemma { background: rgba(66,133,244,0.15); color: #4285f4; }
.family-qwen { background: rgba(0,212,170,0.15); color: #00d4aa; }
.family-deepseek { background: rgba(124,58,237,0.15); color: #7c3aed; }
.family-mistral { background: rgba(245,158,11,0.15); color: #f59e0b; }
.family-openai { background: rgba(16,163,127,0.15); color: #10a37f; }
.family-microsoft { background: rgba(0,120,212,0.15); color: #0078d4; }
.family-nvidia { background: rgba(118,185,0,0.15); color: #76b900; }
.family-glm { background: rgba(239,68,68,0.15); color: #ef4444; }

.model-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.model-sizes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.model-size {
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--bg-secondary);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    color: var(--text-secondary);
}

.model-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: var(--border);
}

.model-downloads {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--accent);
}

.model-downloads-label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.model-stars {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ========== CHARTS ========== */
.chart-container {
    background: var(--bg-card);
    border: var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    position: relative;
    box-shadow: var(--shadow);
}

.chart-container canvas {
    width: 100% !important;
    max-height: 500px;
}

#gpuCompareChart {
    min-height: 650px;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.dot.m1 { background: var(--m1-color); }
.dot.m2 { background: var(--m2-color); }
.dot.m3 { background: var(--m3-color); }
.dot.m4 { background: var(--m4-color); }
.dot.m5 { background: var(--m5-color); }
.dot.nvidia { background: var(--nvidia-color); }
.dot.amd { background: var(--amd-color); }
.dot.mac { background: var(--mac-color); }

/* ========== COMPARE GRID ========== */
.compare-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.compare-card {
    background: var(--bg-card);
    border: var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    transition: all var(--transition);
}

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

.compare-gen {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    margin-bottom: 0.5rem;
    opacity: 0.7;
}

.gen-m1 { color: var(--m1-color); }
.gen-m2 { color: var(--m2-color); }
.gen-m3 { color: var(--m3-color); }
.gen-m4 { color: var(--m4-color); }

.compare-chip {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.compare-tokens {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0.5rem 0;
}

.compare-unit {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.compare-bar-bg {
    background: var(--bg-secondary);
    height: 6px;
    border-radius: 3px;
    margin-top: 1rem;
    overflow: hidden;
}

.compare-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 1s ease;
}

.compare-bar-fill.m1 { background: var(--m1-color); }
.compare-bar-fill.m2 { background: var(--m2-color); }
.compare-bar-fill.m3 { background: var(--m3-color); }
.compare-bar-fill.m4 { background: var(--m4-color); }

/* ========== ABOUT ========== */
.about-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.about-card {
    background: var(--bg-card);
    border: var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.about-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.about-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.about-card code {
    background: var(--bg-secondary);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--accent);
}

/* ========== FOOTER ========== */
footer {
    border-top: var(--border);
    padding: 2rem;
    text-align: center;
    background: var(--bg-secondary);
}

.footer-content p {
    margin-bottom: 0.25rem;
    color: var(--text-secondary);
}

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

.footer-small {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: 5rem;
    }
    .hero-content h1 { font-size: 2rem; }
    .hero-stats { justify-content: center; }
    .hero-visual { max-width: 100%; }
    .nav-links { display: none; }
    .section { padding: 3rem 1rem; }
    .section-alt { padding: 3rem 1rem; }
    .models-grid { grid-template-columns: 1fr; }
    .about-content { grid-template-columns: 1fr; }
    .compare-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .compare-grid { grid-template-columns: 1fr; }
    .chart-legend { flex-wrap: wrap; gap: 1rem; }
}

/* ========== ANIMATIONS ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.model-card {
    animation: fadeInUp 0.5s ease backwards;
}

.model-card:nth-child(1) { animation-delay: 0.05s; }
.model-card:nth-child(2) { animation-delay: 0.1s; }
.model-card:nth-child(3) { animation-delay: 0.15s; }
.model-card:nth-child(4) { animation-delay: 0.2s; }
.model-card:nth-child(5) { animation-delay: 0.25s; }
.model-card:nth-child(6) { animation-delay: 0.3s; }
.model-card:nth-child(7) { animation-delay: 0.35s; }
.model-card:nth-child(8) { animation-delay: 0.4s; }
.model-card:nth-child(9) { animation-delay: 0.45s; }
.model-card:nth-child(10) { animation-delay: 0.5s; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--bg-card-hover); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
