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

:root {
    --bg-primary: #1a1b26;
    --bg-secondary: #24283b;
    --bg-tertiary: #414868;
    --fg-primary: #a9b1d6;
    --fg-secondary: #565f89;
    --accent-blue: #7aa2f7;
    --accent-green: #9ece6a;
    --accent-cyan: #7dcfff;
    --accent-purple: #bb9af7;
    --accent-red: #f7768e;
    --accent-orange: #ff9e64;
    --accent-yellow: #e0af68;
    --prompt: #7aa2f7;
    --path: #9ece6a;
    --comment: #565f89;
    --border: #292e42;
    --sidebar-width: 260px;
    --transition: 0.2s ease;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'JetBrains Mono', monospace;
    font-size: 15px;
    line-height: 1.7;
    background: var(--bg-primary);
    color: var(--fg-primary);
    min-height: 100vh;
    min-width: 0;
    display: flex;
    overflow-x: hidden;
}

.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition);
}

.sidebar-header {
    padding: 24px 20px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}

.prompt {
    color: var(--prompt);
}

.path {
    color: var(--path);
    margin-left: 4px;
}

.cursor {
    color: var(--fg-primary);
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

.nav-menu {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
}

.nav-item {
    display: block;
    padding: 10px 20px;
    color: var(--fg-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: all var(--transition);
    border-left: 2px solid transparent;
}

.nav-item:hover {
    color: var(--fg-primary);
    background: rgba(122, 162, 247, 0.05);
}

.nav-item.active {
    color: var(--accent-blue);
    border-left-color: var(--accent-blue);
    background: rgba(122, 162, 247, 0.1);
}

.nav-item.external {
    color: var(--accent-orange);
}

.nav-divider {
    height: 1px;
    background: var(--border);
    margin: 12px 20px;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--comment);
}

.mobile-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 200;
    width: 40px;
    height: 40px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.mobile-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--fg-primary);
    border-radius: 2px;
    transition: all var(--transition);
}

.content {
    margin-left: max(var(--sidebar-width), calc((100vw - 900px) / 2));
    margin-right: auto;
    flex: 0 1 900px;
    padding: 48px clamp(20px, 5vw, 64px);
    max-width: 900px;
    min-width: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.docs-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.docs-section.active {
    display: flex;
    flex-direction: column;
    flex: 1;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero {
    text-align: center;
    padding: 40px 0 60px;
}

.logo {
    margin-bottom: 24px;
    overflow-x: auto;
    max-width: 100%;
}

.logo pre {
    font-size: clamp(12px, 3.5vw, 18px);
    line-height: 1.4;
    color: var(--fg-primary);
}

.logo .kw { color: var(--accent-purple); }
.logo .type { color: var(--accent-cyan); }
.logo .cm { color: var(--comment); }
.logo .str { color: var(--accent-green); }

.tagline {
    color: var(--fg-secondary);
    font-size: 16px;
    margin-bottom: 32px;
}

.cta-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
    margin-bottom: 48px;
    width: 100%;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px clamp(16px, 4vw, 28px);
    width: 100%;
    min-width: 0;
    max-width: 100%;
    font-family: inherit;
    font-size: clamp(14px, 2.5vw, 15px);
    font-weight: 500;
    text-decoration: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-arrow {
    color: var(--fg-primary);
    opacity: 0.8;
}

.btn-arrow-download {
    color: #fff;
}

.btn-primary {
    background: var(--accent-blue);
    color: #fff;
    border: none;
}

.btn-primary:hover {
    background: #89b4ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(122, 162, 247, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--fg-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.hero-overview {
    width: 100%;
    max-width: 520px;
    margin: 0 auto 48px;
    color: var(--fg-secondary);
    font-size: clamp(14px, 2.5vw, 15px);
    line-height: 1.7;
}

.section-footer {
    margin-top: auto;
    padding-top: 24px;
    padding-bottom: 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.section-footer .btn.nav-page {
    display: inline-flex;
    width: auto;
    min-width: 0;
    max-width: none;
}

h1 {
    font-size: 28px;
    font-weight: 600;
    color: var(--fg-primary);
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--accent-cyan);
    margin: 32px 0 16px;
}

h2 .prompt {
    margin-right: 8px;
}

p {
    margin-bottom: 16px;
    color: var(--fg-primary);
}

.docs-section a:not(.btn) {
    color: var(--accent-cyan);
    text-decoration: none;
}

.docs-section a:not(.btn):hover {
    color: var(--accent-blue);
    text-decoration: underline;
}

ul, ol {
    margin: 16px 0;
    padding-left: 24px;
}

li {
    margin-bottom: 8px;
    color: var(--fg-primary);
}

code {
    font-family: inherit;
    background: var(--bg-tertiary);
    color: var(--accent-orange);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.9em;
}

pre {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 16px;
    overflow-x: auto;
    max-width: 100%;
    margin: 16px 0;
}

pre code {
    background: none;
    padding: 0;
    color: var(--fg-primary);
}

kbd {
    font-family: inherit;
    background: var(--bg-tertiary);
    color: var(--accent-purple);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    border: 1px solid var(--border);
    margin: 0 2px;
}

.keybindings {
    display: grid;
    gap: 8px;
    margin: 16px 0;
}

.keybind {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: 4px;
    font-size: clamp(12px, 2vw, 14px);
}

.keybind span {
    color: var(--fg-secondary);
    margin-left: auto;
}

.callout {
    padding: 16px 20px;
    border-radius: 6px;
    margin: 24px 0;
    font-size: 14px;
    border-left: 3px solid;
}

.callout-info {
    background: rgba(125, 207, 255, 0.1);
    border-color: var(--accent-cyan);
}

.callout-warning {
    background: rgba(255, 158, 100, 0.1);
    border-color: var(--accent-orange);
}

.callout strong {
    color: var(--fg-primary);
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .content {
        margin-left: auto;
        margin-right: auto;
        padding: 72px 20px 40px;
    }

    .mobile-toggle {
        display: flex;
    }

    .cta-group {
        max-width: 100%;
    }

    .section-footer {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .content {
        padding: 72px 16px 40px;
    }

    .hero {
        padding: 24px 0 40px;
    }
}
