:root {
    --color-bg: #ffffff;
    --color-bg-alt: #f6f7f9;
    --color-text: #1c2128;
    --color-text-muted: #57606a;
    --color-border: #d8dee4;
    --color-accent: #e8792a;
    --color-accent-dark: #c25f16;
    --color-blue: #4f74b5;
    --color-blue-dark: #33518a;
    --color-code-bg: #1c2128;
    --color-code-text: #e6edf3;
    --sidebar-width: 260px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --color-bg: #14171c;
        --color-bg-alt: #1b1f26;
        --color-text: #e6edf3;
        --color-text-muted: #9aa5b1;
        --color-border: #2d333b;
        --color-code-bg: #0d1117;
        --color-code-text: #e6edf3;
    }
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 1.5rem;
}

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

a {
    color: var(--color-blue);
}

@media (prefers-color-scheme: dark) {
    a {
        color: #7ea6e0;
    }
}

code, pre {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.88em;
}

p code, li code, td code {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 0.1em 0.4em;
}

pre {
    background: var(--color-code-bg);
    color: var(--color-code-text);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    overflow-x: auto;
    line-height: 1.55;
}

pre code {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
}

.layout {
    display: flex;
    min-height: 100vh;
    max-width: 1280px;
    margin: 0 auto;
}

.nav-toggle {
    display: none;
}

.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    padding: 1.75rem 1.25rem;
    border-right: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
    text-decoration: none;
    color: var(--color-text);
}

.sidebar-brand img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.sidebar-brand span {
    font-weight: 700;
    font-size: 1.15rem;
}

.sidebar-tagline {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin: -1.1rem 0 1.5rem 3.1rem;
}

.sidebar nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar nav li a {
    display: block;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    text-decoration: none;
    color: var(--color-text-muted);
    font-size: 0.92rem;
}

.sidebar nav li a:hover {
    background: var(--color-bg-alt);
    color: var(--color-text);
}

.sidebar nav .nav-number {
    display: inline-block;
    width: 1.4rem;
    color: var(--color-accent);
    font-weight: 600;
}

.sidebar-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.78rem;
    color: var(--color-text-muted);
}

main {
    flex: 1;
    min-width: 0;
    padding: 0 3rem 6rem;
}

.hero {
    text-align: center;
    padding: 3.5rem 1rem 3rem;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 3rem;
}

.hero img {
    width: 160px;
    height: auto;
    margin-bottom: 0.5rem;
}

.hero h1 {
    font-size: 2.4rem;
    margin: 0.5rem 0 0.5rem;
}

.hero p {
    color: var(--color-text-muted);
    font-size: 1.05rem;
    max-width: 560px;
    margin: 0 auto;
}

.badges {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.25rem;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
}

section.doc-section {
    padding-top: 2.5rem;
    margin-top: -2.5rem;
    margin-bottom: 3rem;
}

section.doc-section:first-of-type {
    margin-top: 0;
}

.doc-section h2 {
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.6rem;
}

.doc-section h2 .section-number {
    color: var(--color-accent);
    font-variant-numeric: tabular-nums;
}

.doc-section h3 {
    font-size: 1.15rem;
    margin-top: 2rem;
}

.tree {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.85rem;
    overflow-x: auto;
    white-space: pre;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.92rem;
}

th, td {
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--color-border);
}

th {
    color: var(--color-text-muted);
    font-weight: 600;
}

.callout {
    border-left: 3px solid var(--color-accent);
    background: var(--color-bg-alt);
    padding: 0.85rem 1.1rem;
    border-radius: 0 8px 8px 0;
    margin: 1.25rem 0;
    font-size: 0.92rem;
}

.callout strong {
    color: var(--color-accent-dark);
}

@media (prefers-color-scheme: dark) {
    .callout strong {
        color: var(--color-accent);
    }
}

footer.site-footer {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    padding: 2rem 1rem 0;
}

@media (max-width: 900px) {
    .nav-toggle-label {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1rem 1.25rem;
        border-bottom: 1px solid var(--color-border);
        cursor: pointer;
        font-weight: 700;
    }

    .layout {
        flex-direction: column;
    }

    .sidebar {
        position: relative;
        height: auto;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--color-border);
        display: none;
    }

    .nav-toggle:checked ~ .layout .sidebar {
        display: block;
    }

    main {
        padding: 0 1.25rem 4rem;
    }
}

@media (min-width: 901px) {
    .nav-toggle-label {
        display: none;
    }
}
