:root {
    /* GitHub Elite Theme - Structural Restoration */
    --gh-bg: #0d1117;          /* Deep Slate */
    --gh-header: #010409;      /* Midnight */
    --gh-surface: #161b22;     /* Surface Gray */
    --gh-surface-hover: #1c2128; /* Hover state */
    --gh-border: #30363d;      /* Subtle Border */
    --gh-border-bold: #484f58;  /* Bold Border */
    --gh-text: #c9d1d9;        /* Text Primary */
    --gh-text-dim: #8b949e;    /* Text Dim */
    --gh-text-muted: #7d8590;  /* Text Muted */
    --gh-text-bright: #f0f6fc; /* Text Bright */
    --gh-blue: #388bfd;        /* Heritage Blue */
    --gh-green: #3fb950;       /* System Green */
    --gh-red: #f85149;         /* Error Red */
    --gh-orange: #f78166;      /* Refined Coral */
    --gh-purple: #a371f7;      /* GitHub Purple */
    
    /* GitHub-like shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 3px 6px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
    
    /* Heroic Scaling Tokens */
    --container-max: 1280px; 
    --container-wide: 1440px;
    --header-h: 64px;
    --sec-padding: 64px;
    --radius-sm: 6px;
    --radius-md: 8px;
}

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

/* GLOBAL SCROLLBAR */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--gh-bg); }
::-webkit-scrollbar-thumb { background: var(--gh-border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gh-border-bold); }

body {
    background-color: var(--gh-bg);
    color: var(--gh-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.mono { font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace; }

.container { max-width: var(--container-max); margin: 0 auto; padding: 0 40px; }
.container-wide { max-width: var(--container-wide); margin: 0 auto; padding: 0 40px; }

/* FIX: FIXED HEADER - GitHub Style */
nav.main-nav {
    height: var(--header-h);
    background: var(--gh-header);
    border-bottom: 1px solid var(--gh-border);
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(8px);
}

.nav-content { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    width: 100%; 
    padding: 0 24px;
    max-width: var(--container-wide);
    margin: 0 auto;
}

.logo { 
    font-size: 1.1rem; 
    font-weight: 600; 
    color: var(--gh-text-bright); 
    text-decoration: none; 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    transition: opacity 0.2s;
}

.logo:hover {
    opacity: 0.8;
}

.logo img {
    height: 28px;
    width: auto;
}

.nav-menu { display: flex; gap: 24px; align-items: center; }
.nav-menu a {
    text-decoration: none;
    color: var(--gh-text-dim);
    font-size: 0.875rem;
    font-weight: 400;
    position: relative;
    padding: 4px 0;
    transition: color 0.2s;
}

.nav-menu a:hover {
    color: var(--gh-text-bright);
}

.nav-menu a.active { color: var(--gh-text-bright); font-weight: 500; }
.nav-menu a.active::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gh-orange);
    border-radius: 0;
}

/* HERO: GitHub Style Clean Layout */
.hero { 
    padding: 96px 24px 128px; 
    border-bottom: 1px solid var(--gh-border);
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(180deg, var(--gh-header) 0%, var(--gh-bg) 100%);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 64px;
    align-items: center;
    max-width: var(--container-max);
    margin: 0 auto;
    width: 100%;
}

.hero-text { 
    text-align: left;
    margin-top: 0;
}

.hero-tagline {
    color: var(--gh-green);
    font-weight: 500;
    margin-bottom: 16px;
    display: inline-block;
    font-size: 0.875rem;
    padding: 4px 12px;
    background: rgba(63, 185, 80, 0.1);
    border: 1px solid rgba(63, 185, 80, 0.4);
    border-radius: var(--radius-sm);
}

.cta-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 600;
    color: var(--gh-text-bright);
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 24px;
}

.hero p {
    font-size: 1.25rem;
    color: var(--gh-text-dim);
    margin-bottom: 32px;
    line-height: 1.5;
    max-width: 540px;
}

/* HERO TERMINAL MOCKUP */
.hero-terminal {
    background: #000;
    border: 1px solid var(--gh-border);
    border-radius: 6px;
    padding: 24px;
    font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, monospace;
    font-size: 0.85rem;
    color: #a5d6ff;
    height: 360px; /* Fixed height to prevent expansion */
    overflow-y: auto; /* Enable vertical scrolling */
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    margin-top: 60px;
}

/* Custom Scrollbar for Professionalism */
.hero-terminal::-webkit-scrollbar { width: 4px; }
.hero-terminal::-webkit-scrollbar-track { background: transparent; }
.hero-terminal::-webkit-scrollbar-thumb { background: var(--gh-border); border-radius: 4px; }
.hero-terminal::-webkit-scrollbar-thumb:hover { background: var(--gh-border-bold); }


.term-header { display: flex; gap: 6px; margin-bottom: 16px; opacity: 0.3; }
.term-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

/* REFINED CARDS & SECTIONS - GitHub Style */
section { padding: var(--sec-padding) 24px; border-bottom: 1px solid var(--gh-border); }
.section-title { 
    font-size: 1.5rem; 
    font-weight: 600; 
    color: var(--gh-text-bright); 
    margin-bottom: 32px;
    letter-spacing: -0.01em;
}

.f-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card {
    background: var(--gh-surface);
    border: 1px solid var(--gh-border);
    padding: 24px;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.card:hover {
    border-color: var(--gh-border-bold);
    background: var(--gh-surface-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--gh-text-bright);
}

.card p {
    font-size: 0.875rem;
    color: var(--gh-text-muted);
    line-height: 1.5;
}

/* BENCHMARK BARS */
.bar-container { margin-bottom: 24px; }
.bar-label { display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 8px; color: var(--gh-text-muted); }
.bar-bg { background: #161b22; height: 8px; border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; transition: 1s cubic-bezier(0.16, 1, 0.3, 1); }

/* NEW LAYOUT CLASSES */
.bench-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 100px;
    align-items: start;
}

.bench-stats-card {
    background: #000 !important;
    border-color: var(--gh-border-bold) !important;
    padding: 48px;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 16px;
}

.bench-section {
    background: var(--gh-surface);
    padding: 100px 0;
}

.ecosystem-logos {
    display: flex;
    justify-content: center;
    gap: 64px;
    opacity: 0.5;
}

.footer-info p {
    color: var(--gh-text-dim);
    font-size: 0.85rem;
    max-width: 300px;
}

/* BUTTONS - GitHub Style */
.btn {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    text-decoration: none;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    line-height: 1.5;
    white-space: nowrap;
}

.btn-primary { 
    background: var(--gh-green); 
    color: #fff; 
    border: 1px solid rgba(63, 185, 80, 0.4);
}

.btn-primary:hover {
    background: #2ea043;
    border-color: #3fb950;
}

.btn-outline { 
    background: var(--gh-surface); 
    color: var(--gh-text-bright); 
    border: 1px solid var(--gh-border);
}

.btn-outline:hover {
    background: var(--gh-surface-hover);
    border-color: var(--gh-border-bold);
}

/* FOOTER SYSTEM - GitHub Style */
footer { padding: 40px 24px; border-top: 1px solid var(--gh-border); }
.pre-footer-cta {
    padding: 64px 24px;
    border-top: 1px solid var(--gh-border);
    text-align: center;
    background-color: var(--gh-surface);
}
.footer-grid { 
    display: grid; 
    grid-template-columns: repeat(4, 1fr); 
    gap: 32px; 
    margin-bottom: 40px; 
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
}
.footer-col h4, .footer-grid div h4 { 
    font-size: 0.75rem; 
    font-weight: 600; 
    text-transform: uppercase; 
    color: var(--gh-text-dim); 
    margin-bottom: 16px; 
    letter-spacing: 0.05em; 
}
.footer-col ul, .footer-grid div ul { list-style: none; }
.footer-col ul li, .footer-grid div ul li { margin-bottom: 8px; }
footer ul li a { 
    text-decoration: none; 
    color: var(--gh-text-muted); 
    font-size: 0.75rem; 
    transition: 0.2s; 
    display: flex;
    align-items: center;
    gap: 6px;
}
footer ul li a i { font-size: 0.65rem; width: 12px; text-align: center; opacity: 0.7; }
footer ul li a:hover { color: var(--gh-blue); }

.footer-bottom {
    border-top: 1px solid var(--gh-border);
    padding-top: 24px;
    margin-top: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--gh-text-muted);
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
}
.system-status { display: flex; align-items: center; gap: 6px; font-weight: 500; color: var(--gh-green); }
.status-dot-small { width: 6px; height: 6px; background: var(--gh-green); border-radius: 50%; }


/* --- RESPONSIVE DESIGN & MOBILE OPTIMIZATION --- */

/* Navigation Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--gh-text-bright);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    z-index: 1100;
}

@media (max-width: 1100px) {
    .container, .container-wide { padding: 0 24px; }
    
    .hero { padding: 40px 0 80px; }
    .hero h1 { font-size: 3rem; }
    .hero p { font-size: 1.2rem; }
    
    .hero-grid { grid-template-columns: 1fr; gap: 48px; }
    .hero-terminal { height: 300px; } /* Smaller on tablet */
    
    .f-grid { grid-template-columns: repeat(2, 1fr); }
    
    .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 32px; }
    .footer-grid div:first-child { grid-column: span 2; margin-bottom: 24px; }
    
    .bench-grid { grid-template-columns: 1fr; gap: 48px; }
}

@media (max-width: 768px) {
    :root {
        --header-h: 60px;
        --sec-padding: 48px;
    }

    html, body {
        overflow-x: hidden;
        width: 100%;
    }

    .main-nav { padding: 0 16px; }
    .nav-content { padding: 0 16px; }

    /* Hamburger Menu visible on Mobile/Tablet */
    .menu-toggle {
        display: block;
    }

    .nav-menu {
        position: fixed;
        top: var(--header-h);
        left: 0;
        width: 100%;
        height: calc(100vh - var(--header-h));
        background: var(--gh-header);
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 0;
        padding: 24px;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 999;
        border-top: 1px solid var(--gh-border);
    }

    .nav-menu.active {
        transform: translateX(0);
    }

    .nav-menu a {
        font-size: 1rem;
        padding: 12px 0;
        width: 100%;
        border-bottom: 1px solid var(--gh-border);
    }

    .nav-menu a.active::after {
        display: none;
    }

    /* Terminal handling: "The terminal window will close in mobile and tablet view." */
    .hero-terminal {
        display: none;
    }

    .hero {
        padding: 64px 16px;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .hero-text {
        text-align: left;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding: 0;
    }

    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }

    .cta-group {
        flex-direction: column;
        width: 100%;
        max-width: 100% !important;
        padding: 0;
    }

    #downloads .cta-group {
        padding: 0 20px;
        flex-wrap: wrap;
        gap: 12px;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .f-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
    
    .footer-info {
        grid-column: span 2;
        text-align: left;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 24px;
    }

    .section-title {
        font-size: 1.25rem;
        text-align: left;
    }

    .bench-section {
        padding: 48px 0;
    }

    .ecosystem-logos {
        gap: 24px;
        flex-wrap: wrap;
    }

    .bench-grid {
        gap: 32px;
    }

    .bench-stats-card {
        padding: 16px;
    }

    .stat-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .stat-header div:last-child {
        text-align: left !important;
    }

    /* Table responsiveness */
    .spec-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .spec-table th, .spec-table td {
        padding: 12px 16px;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    /* Info grid responsiveness */
    .info-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Page headers on mobile */
    .page-header {
        padding: 16px 0;
    }
    
    .page-header h1 {
        font-size: 1.75rem !important;
    }

    /* Code blocks */
    .code-box {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        font-size: 0.8rem;
    }

    /* Main content padding */
    main, .container, .container-wide {
        padding-left: 16px;
        padding-right: 16px;
        width: 100%;
        overflow-x: hidden;
    }

    /* Blog posts */
    .blog-post {
        padding: 16px;
        margin-bottom: 16px;
    }
    
    .blog-post h2 {
        font-size: 1.25rem;
    }

    /* Param tables */
    .param-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    section {
        padding: var(--sec-padding) 16px;
    }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 2rem; }
    .hero p { font-size: 1.1rem; }
    .container, .container-wide { padding: 0 16px; }
}

/* Visibility Utilities */
.mobile-only-btn { display: none !important; }

@media (max-width: 768px) {
    .mobile-only-btn { display: inline-flex !important; }
    .nav-extra { display: none !important; }
    
    /* Docs Sidebar Adjustment */
    .docs-container { flex-direction: column; }
    .docs-sidebar { 
        width: 100%; 
        height: auto; 
        position: relative; 
        top: 0; 
        border-right: none; 
        border-bottom: 1px solid var(--gh-border);
        padding: 24px;
    }
    .docs-main { padding: 40px 24px; }
    
    /* Blog page mobile */
    main {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
    
    .blog-item {
        padding: 24px 0;
    }
    
    .blog-item h2 {
        font-size: 1.25rem;
    }
    
    /* Specs page mobile */
    .page-header h1 {
        font-size: 2rem !important;
    }
    
    .tech-section {
        padding-bottom: 40px;
    }
    
    .tech-section h2 {
        font-size: 1.5rem;
    }
}
