@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Fira+Code:wght@400;500&display=swap');

:root {
    --bg-base: #09090b;
    --bg-surface: #121214;
    --bg-surface-hover: #1e1e24;
    --border: #27272a;
    --text-primary: #f8fafc;
    --text-secondary: #a1a1aa;
    --text-tertiary: #71717a;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --code-bg: #000000;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'Fira Code', monospace;
    --content-max-width: 900px;
}

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

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
}

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

/* Sidebar */
.sidebar {
    width: 280px;
    height: 100vh;
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    overflow-y: auto;
    padding: 2.5rem 1.5rem;
    z-index: 100;
}

.sidebar-logo {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #60a5fa, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.toc-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.toc-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
}

.toc-link:hover {
    color: var(--text-primary);
    background-color: var(--bg-surface-hover);
}

.toc-link.active {
    color: var(--accent);
    background-color: rgba(59, 130, 246, 0.1);
    border-left: 2px solid var(--accent);
}

.toc-sublink {
    padding-left: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

/* Main Content */
.main-content {
    margin-left: 280px;
    padding: 3rem 4rem;
    max-width: calc(100vw - 280px);
    width: 100%;
    display: flex;
    justify-content: center;
}

.container {
    width: 100%;
    max-width: var(--content-max-width);
}

section {
    margin-bottom: 5rem;
    scroll-margin-top: 4rem;
}

h1, h2, h3, h4 {
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: -0.02em;
}

h1 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

h2 {
    font-size: 2rem;
    margin-top: 4rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

h3 {
    font-size: 1.4rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #e2e8f0;
}

p, li {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 1.05rem;
}

ul {
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
}

strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Code Blocks */
pre, code {
    font-family: var(--font-mono);
}

code {
    background-color: var(--bg-surface-hover);
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-size: 0.9em;
    color: #e2e8f0;
}

pre {
    background-color: var(--code-bg);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

pre code {
    background-color: transparent;
    padding: 0;
    color: #cbd5e1;
    font-size: 0.95rem;
}

/* Callouts / Highlights */
.callout {
    background-color: rgba(59, 130, 246, 0.1);
    border-left: 4px solid var(--accent);
    padding: 1.5rem;
    border-radius: 0 8px 8px 0;
    margin: 1.5rem 0;
}

.callout p {
    margin: 0;
    color: #bfdbfe;
    font-size: 0.95rem;
}

/* Benchmarks Grid */
.benchmark-grid {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    margin-top: 2rem;
}

.benchmark-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.benchmark-item {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.benchmark-item:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
}

.benchmark-item img {
    width: 100%;
    display: block;
    border-bottom: 1px solid var(--border);
}

.benchmark-title {
    padding: 1rem;
    text-align: center;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.benchmark-header {
    text-align: center;
    margin-bottom: 1rem;
}

/* Problem Cards */
.problem-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: background-color 0.2s;
}

.problem-card:hover {
    background-color: var(--bg-surface-hover);
}

.problem-card h4 {
    color: #fca5a5;
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.problem-card p {
    margin-bottom: 0;
    font-size: 0.95rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

section {
    animation: fadeIn 0.6s ease-out forwards;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 1.5rem;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .main-content {
        margin-left: 0;
        max-width: 100%;
        padding: 2rem 1.5rem;
    }
    .benchmark-row {
        grid-template-columns: 1fr;
    }
}
