/* ═══════════════════════════════════════════════════════════
   CSharpDB Website — Design System & Styles
   ═══════════════════════════════════════════════════════════ */

/* ─── CSS Variables (Dark Theme) ─── */
:root,
[data-theme="dark"] {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-tertiary: #1a2234;
    --bg-card: #151d2e;
    --bg-card-hover: #1c2740;
    --bg-code: #0d1321;
    --bg-nav: rgba(10, 14, 23, 0.85);

    --text-primary: #e8ecf4;
    --text-secondary: #94a3b8;
    --text-muted: #8b9bb0;

    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.15);
    --accent-soft: rgba(99, 102, 241, 0.1);
    --accent-2: #06b6d4;
    --accent-2-glow: rgba(6, 182, 212, 0.15);

    --border: #1e293b;
    --border-light: #2a3650;

    --code-keyword: #c084fc;
    --code-string: #86efac;
    --code-type: #67e8f9;
    --code-comment: #8b9bb0;
    --code-number: #fbbf24;

    --success: #22c55e;
    --warning: #f59e0b;
    --info: #3b82f6;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 14px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.5);

    --nav-height: 64px;
    --sidebar-width: 240px;
    --content-max: 1200px;
}

/* ─── Light Theme ─── */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-code: #f8fafc;
    --bg-nav: rgba(255, 255, 255, 0.9);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;

    --accent: #4f46e5;
    --accent-hover: #6366f1;
    --accent-glow: rgba(79, 70, 229, 0.08);
    --accent-soft: rgba(79, 70, 229, 0.06);

    --border: #e2e8f0;
    --border-light: #cbd5e1;

    --code-keyword: #7c3aed;
    --code-string: #059669;
    --code-type: #0891b2;
    --code-comment: #64748b;
    --code-number: #d97706;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 14px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.1);
}

/* ─── Reset & Base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
    transition: background 0.3s, color 0.3s;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); }

code {
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.88em;
    background: var(--bg-tertiary);
    padding: 2px 7px;
    border-radius: 4px;
    color: var(--accent-hover);
}

/* ─── Layout ─── */
.container {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 24px;
}

.center { text-align: center; }

.page { min-height: calc(100vh - var(--nav-height)); padding-top: var(--nav-height); }

/* ─── Docs Hub ─── */
.hub-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 32px;
}

.hub-card {
    display: block;
    padding: 32px 28px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all 0.3s;
    color: inherit;
    text-decoration: none;
}
.hub-card:hover {
    border-color: var(--accent);
    background: var(--bg-card-hover);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px var(--accent-glow);
    color: inherit;
}

.hub-card .hub-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-glow);
    border-radius: var(--radius-md);
    color: var(--accent);
    margin-bottom: 20px;
    font-size: 1.4rem;
}

.hub-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}

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

/* ─── Callout Variants ─── */
.callout-warning {
    background: rgba(245, 158, 11, 0.08);
    border-color: var(--warning);
    color: var(--text-secondary);
}
.callout-success {
    background: rgba(34, 197, 94, 0.08);
    border-color: var(--success);
    color: var(--text-secondary);
}

/* ─── Architecture Layers (extended) ─── */
.arch-layer-client { background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), rgba(168, 85, 247, 0.05)); border-color: rgba(168, 85, 247, 0.3); }
.arch-layer-engine { background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(99, 102, 241, 0.05)); border-color: rgba(99, 102, 241, 0.3); }
.arch-layer-execution { background: linear-gradient(135deg, rgba(6, 182, 212, 0.1), rgba(6, 182, 212, 0.05)); border-color: rgba(6, 182, 212, 0.3); }
.arch-layer-pipeline { background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.05)); border-color: rgba(245, 158, 11, 0.3); }

@media (max-width: 1024px) {
    .hub-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .hub-grid { grid-template-columns: 1fr; }
}

/* ─── Navbar ─── */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--bg-nav);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: background 0.3s, border-color 0.3s;
}

.nav-container {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.15rem;
    margin-right: 32px;
    flex-shrink: 0;
}

.logo-icon { color: var(--accent); display: flex; }

.nav-links { display: flex; gap: 4px; flex: 1; }

.nav-link {
    color: var(--text-secondary);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}
@media (max-width: 1200px) {
    .nav-link { padding: 8px 8px; font-size: 0.82rem; }
    .nav-logo { margin-right: 12px; }
}
.nav-link:hover { color: var(--text-primary); background: var(--accent-soft); }
.nav-link.active { color: var(--accent); background: var(--accent-glow); }

.nav-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; flex-shrink: 0; }

/* ─── Theme Toggle ─── */
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 7px;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.theme-toggle:hover { color: var(--text-primary); border-color: var(--border-light); }

[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }

/* ─── Mobile Toggle ─── */
.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.mobile-toggle span {
    width: 22px;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: all 0.3s;
}
.mobile-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.mobile-toggle.open span:nth-child(2) { opacity: 0; }
.mobile-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: all 0.25s;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 20px var(--accent-glow);
}
.btn-primary:hover {
    background: var(--accent-hover);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 24px rgba(99, 102, 241, 0.3);
}

.btn-ghost {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}
.btn-ghost:hover {
    background: var(--accent-soft);
    color: var(--text-primary);
    border-color: var(--accent);
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-outline:hover { color: var(--text-primary); border-color: var(--border-light); }

.btn-sm { padding: 6px 14px; font-size: 0.82rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }

/* ═══════════════════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════════════════ */
.hero {
    position: relative;
    padding: 100px 0 80px;
    text-align: center;
    overflow: hidden;
}

.hero-bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.3;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 20%, transparent 70%);
}

.hero-badge {
    display: inline-block;
    padding: 6px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-glow);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 100px;
    margin-bottom: 28px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 640px;
    margin: 0 auto 36px;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.hero-install {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 20px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.copy-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    border-radius: 4px;
    transition: all 0.2s;
}
.copy-btn:hover { color: var(--accent); background: var(--accent-glow); }

/* ═══════════════════════════════════════════════════════════
   SECTIONS
   ═══════════════════════════════════════════════════════════ */
.section { padding: 80px 0; }
.section-alt { background: var(--bg-secondary); }

.section-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 48px;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

/* ─── Features Grid ─── */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    transition: all 0.3s;
}
.feature-card:hover {
    border-color: var(--accent);
    background: var(--bg-card-hover);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px var(--accent-glow);
}

.feature-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-glow);
    border-radius: var(--radius-md);
    color: var(--accent);
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
}

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

/* ─── Code Block ─── */
.code-showcase { max-width: 720px; margin: 0 auto; }

.code-block {
    background: var(--bg-code);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 24px;
}

.code-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
}

.code-dots { display: flex; gap: 6px; }
.code-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border-light);
}
.code-dots span:nth-child(1) { background: #ef4444; opacity: 0.7; }
.code-dots span:nth-child(2) { background: #f59e0b; opacity: 0.7; }
.code-dots span:nth-child(3) { background: #22c55e; opacity: 0.7; }

.code-filename {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.code-block pre {
    padding: 20px 24px;
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.7;
}

.code-block code {
    background: none;
    padding: 0;
    border-radius: 0;
    color: var(--text-primary);
    font-size: inherit;
}

/* Syntax Highlighting */
.kw { color: var(--code-keyword); }
.str { color: var(--code-string); }
.tp { color: var(--code-type); }
.cm { color: var(--code-comment); font-style: italic; }
.num { color: var(--code-number); }

/* ─── Stats ─── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    text-align: center;
}

.stat {
    padding: 32px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ─── CTA ─── */
.section-cta {
    background: linear-gradient(135deg, var(--accent-glow), var(--accent-2-glow));
    border-top: 1px solid var(--border);
}
.section-cta h2 { margin-bottom: 12px; }
.section-cta p { color: var(--text-secondary); margin-bottom: 28px; }

/* ═══════════════════════════════════════════════════════════
   DOCUMENTATION LAYOUT
   ═══════════════════════════════════════════════════════════ */
.doc-container {
    display: flex;
    gap: 40px;
    padding-top: 40px;
    padding-bottom: 80px;
}

.doc-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    position: sticky;
    top: calc(var(--nav-height) + 40px);
    height: fit-content;
    max-height: calc(100vh - var(--nav-height) - 80px);
    overflow-y: auto;
}

.sidebar-header {
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 0 12px;
    margin-bottom: 12px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-group-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 16px 12px 6px;
}

.sidebar-link {
    display: block;
    padding: 8px 12px;
    color: var(--text-secondary);
    font-size: 0.88rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    border-left: 2px solid transparent;
}
.sidebar-link:hover { color: var(--text-primary); background: var(--accent-soft); }
.sidebar-link.active {
    color: var(--accent);
    background: var(--accent-glow);
    border-left-color: var(--accent);
    font-weight: 500;
}

.doc-content {
    flex: 1;
    min-width: 0;
}
.doc-content.full-width { max-width: 900px; margin: 0 auto; }

.doc-content h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.doc-content h2 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-top: 48px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.doc-content h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-top: 32px;
    margin-bottom: 12px;
}

.doc-content h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-top: 24px;
    margin-bottom: 8px;
}

.lead {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.7;
}

.doc-content p {
    margin-bottom: 16px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ─── Doc Table ─── */
.doc-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
    font-size: 0.9rem;
}

.doc-table th {
    text-align: left;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-bottom: 2px solid var(--border);
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.doc-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

.doc-table tr:hover td { background: var(--accent-soft); }

/* ─── Callout ─── */
.callout {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    font-size: 0.9rem;
    border-left: 3px solid;
}
.callout-info {
    background: rgba(59, 130, 246, 0.08);
    border-color: var(--info);
    color: var(--text-secondary);
}
.callout strong { color: var(--text-primary); }

/* ─── Doc Sections (toggle) ─── */
.doc-section { display: none; }
.doc-section.active { display: block; }

.api-section { display: none; }
.api-section.active { display: block; }

/* ─── Next Steps ─── */
.next-steps { margin-top: 60px; }

.next-steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 20px;
}

.next-step-card {
    display: block;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all 0.3s;
    color: inherit;
}
.next-step-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    color: inherit;
}
.next-step-card h4 {
    margin: 0 0 8px;
    color: var(--text-primary);
}
.next-step-card p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════
   ARCHITECTURE PAGE
   ═══════════════════════════════════════════════════════════ */
.arch-diagram {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    max-width: 600px;
    margin: 32px auto 48px;
}

.arch-layer {
    width: 100%;
    padding: 20px 24px;
    border-radius: var(--radius-md);
    text-align: center;
    border: 1px solid var(--border);
    transition: all 0.3s;
}
.arch-layer:hover { transform: scale(1.02); }

.arch-label {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 4px;
}

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

.arch-layer-app { background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(99, 102, 241, 0.05)); border-color: rgba(99, 102, 241, 0.3); }
.arch-layer-catalog { background: linear-gradient(135deg, rgba(6, 182, 212, 0.1), rgba(6, 182, 212, 0.05)); border-color: rgba(6, 182, 212, 0.3); }
.arch-layer-storage { background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(34, 197, 94, 0.05)); border-color: rgba(34, 197, 94, 0.3); }
.arch-layer-wal { background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.05)); border-color: rgba(245, 158, 11, 0.3); }
.arch-layer-device { background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05)); border-color: rgba(239, 68, 68, 0.3); }

.arch-arrow {
    color: var(--text-muted);
    font-size: 1.2rem;
    padding: 4px 0;
}

/* Split rows inside arch layers */
.arch-split {
    display: flex;
    gap: 8px;
    width: 100%;
}
.arch-split .arch-layer {
    flex: 1;
    padding: 14px 16px;
}
.arch-split-2 .arch-layer { flex: 1; }
.arch-split-3 .arch-layer { flex: 1; }

.arch-sub {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
    justify-content: center;
}
.arch-tag {
    display: inline-block;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    color: var(--text-muted);
    border: 1px solid rgba(255,255,255,0.08);
}

@media (max-width: 600px) {
    .arch-split { flex-direction: column; gap: 0; }
}

/* ─── Format Diagrams ─── */
.format-diagram {
    margin: 24px 0 48px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.format-row {
    display: flex;
    min-height: 60px;
}
.format-row + .format-row { border-top: 1px solid var(--border); }
.format-row-fade { opacity: 0.5; }

.format-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    font-size: 0.82rem;
    font-weight: 500;
    text-align: center;
    border-right: 1px solid var(--border);
}
.format-cell:last-child { border-right: none; }

.format-cell small { color: var(--text-muted); font-weight: 400; font-size: 0.72rem; margin-top: 4px; }

.format-header { background: rgba(99, 102, 241, 0.1); color: var(--accent); }
.format-pointers { background: rgba(6, 182, 212, 0.08); color: var(--accent-2); }
.format-free { background: var(--bg-tertiary); color: var(--text-muted); }
.format-cells { background: rgba(34, 197, 94, 0.08); color: var(--success); }

.format-arrow-right, .format-arrow-left { font-size: 1.1rem; }

.format-legend {
    display: flex;
    gap: 24px;
    padding: 12px 20px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    font-size: 0.78rem;
    color: var(--text-muted);
}

.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    margin-right: 6px;
    vertical-align: middle;
}
.legend-header { background: rgba(99, 102, 241, 0.4); }
.legend-pointers { background: rgba(6, 182, 212, 0.4); }
.legend-free { background: var(--border-light); }
.legend-cells { background: rgba(34, 197, 94, 0.4); }

/* ─── Transaction Flow ─── */
.flow-container {
    display: flex;
    gap: 40px;
    margin: 32px 0 48px;
}

.flow-column { flex: 1; }
.flow-column h3 {
    text-align: center;
    margin-bottom: 24px;
    font-size: 1.1rem;
}

.flow-steps {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.flow-step {
    width: 100%;
    padding: 14px 20px;
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.2s;
}
.flow-step:hover { border-color: var(--accent); background: var(--bg-card-hover); }
.flow-step-alt {
    border-style: dashed;
    color: var(--text-muted);
}

.flow-connector {
    width: 2px;
    height: 16px;
    background: var(--border-light);
}

.flow-divider {
    width: 2px;
    background: var(--border);
    margin: 48px 0;
}

/* ═══════════════════════════════════════════════════════════
   BENCHMARKS
   ═══════════════════════════════════════════════════════════ */
.bench-chart-container {
    margin: 20px 0 48px;
}

.bench-chart {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bench-bar-group {
    display: flex;
    align-items: center;
    gap: 16px;
}

.bench-label {
    width: 180px;
    flex-shrink: 0;
    font-size: 0.88rem;
    color: var(--text-secondary);
    text-align: right;
    font-weight: 500;
}

.bench-bar-track {
    flex: 1;
    height: 40px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}

.bench-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 14px;
    min-width: 120px;
    transition: width 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.bench-bar-accent {
    background: linear-gradient(90deg, var(--accent-2), #22d3ee);
}

.bench-value {
    font-size: 0.78rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.bench-table-container {
    margin: 20px 0 48px;
    overflow-x: auto;
}

.bench-env {
    margin-top: 48px;
    padding: 20px 24px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}
.bench-env h3 {
    font-size: 0.9rem;
    margin-bottom: 8px;
}
.bench-env p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

/* ═══════════════════════════════════════════════════════════
   API REFERENCE
   ═══════════════════════════════════════════════════════════ */
.api-class {
    margin-bottom: 32px;
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.api-class-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.api-class-header h3 {
    margin: 0;
    font-size: 1.15rem;
    font-family: 'JetBrains Mono', monospace;
}

.api-badge {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 10px;
    border-radius: 100px;
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
}
.api-badge-struct { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.api-badge-class { background: rgba(59, 130, 246, 0.15); color: var(--info); }

.api-class > p {
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.api-members {
    margin-top: 16px;
}

.api-members h4 {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-top: 16px;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border);
}

.api-member {
    padding: 8px 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    border-radius: var(--radius-sm);
    margin-bottom: 2px;
    transition: background 0.2s;
}
.api-member:hover { background: var(--accent-soft); }

.api-member code {
    background: none;
    padding: 0;
    color: var(--text-primary);
    font-size: inherit;
}

.api-sep { color: var(--text-muted); margin: 0 4px; }
.api-return { color: var(--accent-2); font-size: 0.78rem; }

/* ═══════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════ */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 60px 0 32px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 40px;
}

.footer-brand .logo-text {
    font-size: 1.2rem;
    font-weight: 700;
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-col h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.footer-col a {
    display: block;
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 4px 0;
    transition: color 0.2s;
}
.footer-col a:hover { color: var(--accent); }

.footer-bottom {
    padding-top: 24px;
    border-top: 1px solid var(--border);
}
.footer-bottom p {
    color: var(--text-muted);
    font-size: 0.82rem;
    text-align: center;
}

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

.hero-badge,
.hero-title,
.hero-subtitle,
.hero-actions,
.hero-install {
    animation: fadeInUp 0.6s ease-out both;
}
.hero-badge { animation-delay: 0.1s; }
.hero-title { animation-delay: 0.2s; }
.hero-subtitle { animation-delay: 0.3s; }
.hero-actions { animation-delay: 0.4s; }
.hero-install { animation-delay: 0.5s; }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
    .next-steps-grid { grid-template-columns: 1fr; }
    .flow-container { flex-direction: column; }
    .flow-divider {
        width: 100%;
        height: 2px;
        margin: 16px 0;
    }
}

@media (max-width: 1024px) {
    .mobile-toggle { display: flex; }

    .nav-links {
        display: none;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: var(--bg-nav);
        backdrop-filter: blur(16px);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 12px;
    }
    .nav-links.open { display: flex; }

    .btn-outline.btn-sm { display: none; }
}

@media (max-width: 768px) {
    .features-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }

    .hero-title { font-size: 2.2rem; }
    .hero-install {
        flex-direction: column;
        font-size: 0.8rem;
    }

    .doc-container { flex-direction: column; }
    .doc-sidebar {
        width: 100%;
        position: static;
        max-height: none;
        border-bottom: 1px solid var(--border);
        padding-bottom: 16px;
        margin-bottom: 24px;
    }
    .sidebar-nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
    .sidebar-group-label { display: none; }

    .bench-bar-group { flex-direction: column; align-items: flex-start; gap: 6px; }
    .bench-label { width: auto; text-align: left; }
    .bench-bar-track { width: 100%; }

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

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .hero { padding: 60px 0 40px; }
    .section { padding: 48px 0; }
}

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