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

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --text: #1f2937;
    --text-light: #6b7280;
    --border: #e5e7eb;
    --bg: #ffffff;
    --bg-alt: #f9fafb;
    --success: #10b981;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);

    /* UI token overrides */
    --nav-cta-bg: var(--text);
    --nav-cta-color: #ffffff;
    --footer-bg: var(--text);
    --footer-text: #9ca3af;
    --copy-bg: rgba(255,255,255,0.1);
    --copy-border: rgba(255,255,255,0.2);
    --copy-color: #ffffff;
    --code-bg: #282c34;
}

/* Dark theme variables (applied when html[data-theme="dark"]) */
html[data-theme="dark"] {
    --primary: #60a5fa;
    --primary-dark: #3b82f6;
    --text: #e6eef8;
    --text-light: #9ca3af;
    --border: #1f2937;
    --bg: #0b1220;
    --bg-alt: #071025;
    --success: #34d399;
    --shadow: 0 1px 3px rgba(0,0,0,0.6);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.6);
    --code-bg: #0f1724;
}

/* Theme toggle button */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-light);
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.18s, color 0.18s, transform 0.12s;
}

.theme-toggle:hover {
    background: rgba(0,0,0,0.04);
    color: var(--text);
    transform: translateY(-1px);
}

/* Mobile theme toggle link style */
.mobile-menu a#mobileThemeToggle {
    display: block;
    padding: 0.75rem;
    color: var(--text);
    text-decoration: none;
}

/* Make code blocks adapt to theme */
pre {
    background: var(--code-bg, #282c34);
}
pre code {
    color: var(--text-light, #abb2bf);
}

/* Smooth color transitions */
body, .nav-links a, .nav-github, .btn, .feature, .doc-card, .example, .footer, .arch-box {
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text);
    line-height: 1.6;
    background: var(--bg);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Navigation */
.navbar {
    position: sticky;
    top: 0;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Documentation layout: single-column main content */
.docs-layout {
    display: block;
}

/* Main content styling */
.main-content { padding: 2rem 1rem; background: transparent; }
.doc-card { background: var(--bg); }

/* Removed sidebar styles (single-column layout) */
/* If you later want a sidebar, re-introduce .docs-layout grid and .sidebar rules */

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text);
}

.nav-brand i {
    color: var(--primary);
    font-size: 1.25rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

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

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

.nav-github {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: var(--nav-cta-bg);
    color: var(--nav-cta-color) !important;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
}

.nav-github:hover {
    background: var(--primary);
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text);
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 61px;
    left: 0;
    right: 0;
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    z-index: 99;
}

.mobile-menu a {
    display: block;
    padding: 0.75rem;
    color: var(--text);
    text-decoration: none;
    border-radius: 6px;
}

.mobile-menu a:hover {
    background: var(--bg-alt);
}

/* Hero */
.hero {
    padding: 5rem 0 4rem;
    text-align: center;
}

.hero-content {
    max-width: 750px;
    margin: 0 auto;
}

/* Enhanced hero visuals */
.hero--enhanced {
    padding: 4.5rem 0 3.5rem;
    background: linear-gradient(180deg, rgba(37,99,235,0.06), transparent 40%);
}
.hero--enhanced .hero-content { max-width: 900px; margin: 0 auto; text-align: left; }
.hero--enhanced .hero-meta { color: var(--primary); font-weight:700; margin-bottom:0.5rem }
.hero--enhanced .hero-title { font-size: 2.25rem; color: var(--text); margin-bottom:0.5rem }
.hero--enhanced .hero-lead { color: var(--text-light); font-size:1.02rem; margin-bottom:1rem }
.hero-ctas { display:flex; gap:0.75rem; margin-bottom:1rem }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.hero-stats { display:flex; gap:1rem; margin-top:1rem; color:var(--text-light); }
.hero-stats div { background: var(--bg); padding:0.45rem 0.75rem; border-radius:8px; border:1px solid var(--border); font-size:0.95rem }

.badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1.25rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.hero-description {
    font-size: 1.15rem;
    color: var(--text-light);
    margin-bottom: 2rem;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-alt);
}

.hero-info {
    display: flex;
    gap: 2rem;
    justify-content: center;
    padding-top: 1rem;
}

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

.info-item i {
    color: var(--success);
}

/* Sections */
section {
    padding: 5rem 0;
}

.features {
    background: var(--bg-alt);
}

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

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.75rem;
}

.section-header p {
    font-size: 1.1rem;
    color: var(--text-light);
}

/* Features */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature {
    background: var(--bg);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: all 0.3s;
}

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

.feature-icon {
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.feature h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.feature p {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Installation */
.installation {
    background: var(--bg-alt);
}

.install-box,
.example-box {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tab {
    padding: 0.5rem 1.25rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

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

pre code {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #abb2bf;
}

.info-note {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text);
}

.info-note i {
    color: var(--primary);
}

.info-note code {
    background: rgba(37,99,235,0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--primary);
}

.example-box h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1rem;
}

/* Documentation */
.docs-grid {
    display: grid;
    gap: 2rem;
}

/* Components / Modules */
.components-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}

.component-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
}

.component-card h3 {
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.component-card p { color: var(--text-light); font-size: 0.95rem; margin-bottom: 0.5rem; }

.component-note { margin-top: 1rem; color: var(--text-light); }

.doc-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s;
}

.doc-card:hover {
    box-shadow: var(--shadow-lg);
}

.doc-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.doc-header i {
    color: var(--primary);
    font-size: 1.5rem;
}

.doc-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
}

.doc-card p {
    color: var(--text-light);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.doc-card pre {
    margin-top: 1rem;
}

/* Architecture */
.architecture {
    background: var(--bg-alt);
}

.arch-container {
    max-width: 400px;
    margin: 0 auto;
}

.arch-box {
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    text-align: center;
}

.arch-box.public {
    background: #dbeafe;
    border: 2px solid #3b82f6;
}

.arch-box.internal {
    background: #fce7f3;
    border: 2px solid #ec4899;
}

.arch-box.transport {
    background: #ddd6fe;
    border: 2px solid #8b5cf6;
}

.arch-box.core {
    background: #d1fae5;
    border: 2px solid #10b981;
}

.arch-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.7;
    margin-bottom: 0.25rem;
}

.arch-module {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}

.arch-modules {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.arch-modules span {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text);
}

.arch-arrow {
    text-align: center;
    font-size: 1.5rem;
    color: var(--text-light);
    margin: 0.25rem 0;
}

.arch-note {
    max-width: 600px;
    margin: 2rem auto 0;
    padding: 1rem;
    background: #fef3c7;
    border: 1px solid #fbbf24;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.arch-note i {
    color: #f59e0b;
}

.arch-note code {
    background: rgba(245,158,11,0.2);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.85rem;
}

/* Examples */
.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.example {
    background: var(--bg);
    padding: 2rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s;
    display: block;
}

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

.example i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.example h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.example p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.example .link {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Footer */
.footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 3rem 0 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: white;
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.footer-section p {
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-section a {
    display: block;
    color: var(--footer-text);
    text-decoration: none;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
}

.footer-bottom p {
    margin-bottom: 0.25rem;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .mobile-toggle {
        display: block;
    }
    
    .hero h1 {
        font-size: 2.25rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .hero-actions {
        flex-direction: column;
    }
    
    .hero-info {
        flex-direction: column;
        gap: 1rem;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
    
    .features-grid,
    .examples-grid {
        grid-template-columns: 1fr;
    }
}

html {
    scroll-behavior: smooth;
}

/* Copy button styles (copy-code) */
.copy-code {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: var(--copy-bg);
    border: 1px solid var(--copy-border);
    color: var(--copy-color);
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.copy-code:hover { background: rgba(255,255,255,0.18); }

.copy-code.copied {
    background: rgba(16,185,129,0.18) !important;
    border-color: rgba(16,185,129,0.4) !important;
}

/* Dark theme variable overrides */
html[data-theme="dark"] {
    --primary: #60a5fa;
    --primary-dark: #3b82f6;
    --text: #e6eef8;
    --text-light: #9ca3af;
    --border: #1f2937;
    --bg: #0b1220;
    --bg-alt: #071025;
    --success: #34d399;
    --shadow: 0 1px 3px rgba(0,0,0,0.6);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.6);
    --code-bg: #071025;
    --nav-cta-bg: #0f1724;
    --nav-cta-color: #e6eef8;
    --footer-bg: #071025;
    --footer-text: #9ca3af;
    --copy-bg: rgba(255,255,255,0.04);
    --copy-border: rgba(255,255,255,0.06);
    --copy-color: #e6eef8;
}

/* Adjust specific component backgrounds in dark mode for readable contrast */
html[data-theme="dark"] .info-note {
    background: rgba(255,255,255,0.02);
    border-color: rgba(255,255,255,0.04);
    color: var(--text-light);
}

/* Architecture boxes: use tinted dark backgrounds so text (var(--text)) is readable */
html[data-theme="dark"] .arch-box.public {
    background: rgba(59,130,246,0.12); /* tint of blue */
    border: 2px solid rgba(59,130,246,0.28);
}

html[data-theme="dark"] .arch-box.internal {
    background: rgba(236,72,153,0.06); /* tint of pink */
    border: 2px solid rgba(236,72,153,0.18);
}

html[data-theme="dark"] .arch-box.transport {
    background: rgba(139,92,246,0.06); /* tint of purple */
    border: 2px solid rgba(139,92,246,0.18);
}

html[data-theme="dark"] .arch-box.core {
    background: rgba(16,185,129,0.06); /* tint of green */
    border: 2px solid rgba(16,185,129,0.18);
}

html[data-theme="dark"] .arch-label,
html[data-theme="dark"] .arch-module,
html[data-theme="dark"] .arch-modules span {
    color: var(--text);
}

/* Arch note tonal adjustment */
html[data-theme="dark"] .arch-note {
    background: rgba(245,158,11,0.06);
    border: 1px solid rgba(245,158,11,0.12);
    color: var(--text);
}


/* Floating compact Table of Contents (TOC) */
.floating-toc {
    position: fixed;
    right: 20px;
    top: 140px;
    z-index: 120;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.floating-toc-toggle {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.floating-toc-panel {
    max-width: 260px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.5rem;
    box-shadow: var(--shadow-lg);
}

.floating-toc-panel ul { list-style: none; margin: 0; padding: 0.25rem; }
.floating-toc-panel li { margin: 0.25rem 0; }
.floating-toc-panel a { color: var(--text); text-decoration: none; display: block; padding: 0.35rem 0.5rem; border-radius: 6px; font-size: 0.95rem; }
.floating-toc-panel a:hover { background: var(--bg-alt); color: var(--text); }
.floating-toc-panel a.active { background: var(--primary); color: #fff; }

/* Hide on very small screens where it might obstruct content */
@media (max-width: 680px) {
    .floating-toc { right: 12px; top: auto; bottom: 16px; }
    .floating-toc-panel { display: none; }
}

/* Dark mode tweaks */
html[data-theme="dark"] .floating-toc-toggle { background: var(--nav-cta-bg); color: var(--nav-cta-color); border-color: rgba(255,255,255,0.04); }
html[data-theme="dark"] .floating-toc-panel { background: var(--bg-alt); border-color: var(--border); }

