:root {
    color-scheme: light;
    --bg: #f8f8f8;
    --panel: #f2f2f2;
    --panel-strong: #ededed;
    --text: #0f1214;
    --muted: #666;
    --border: #ddd;
    --accent: #e7a15a;
    --accent-strong: #c9823f;
    --link: #0f1214;
    --code-bg: #ebebeb;
    --code-border: #f0f0f0;
    --title-size: 1.8rem;
    --title-line: 1.2;
}

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    margin: 0;
    font-family: "IBM Plex Mono", "JetBrains Mono", "Fira Mono", "SF Mono", Menlo,
        Consolas, "Liberation Mono", monospace;
    color: var(--text);
    background-color: var(--bg);
    line-height: 1.6;
}

img,
video {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--link);
    text-decoration: underline;
    text-decoration-thickness: 0.12em;
    text-underline-offset: 0.25em;
}

a:hover {
    color: var(--bg);
    background-color: var(--text);
    text-decoration-color: var(--text);
}

a:focus-visible {
    outline: 2px solid var(--accent-strong);
    outline-offset: 3px;
}

.page {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    align-self: start;
    padding: 24px 20px;
    background: var(--panel);
    overflow-y: auto;
}

.brand {
    padding-bottom: 16px;
    margin-bottom: 16px;
}

.brand-link {
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    letter-spacing: 0.1em;
    font-size: var(--title-size);
    line-height: var(--title-line);
}

.brand-link:hover {
    color: var(--bg);
    background-color: var(--text);
    text-decoration-color: var(--text);
}

.brand-tagline {
    margin-top: 6px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--muted);
}

.nav-section {
    font-size: 0.72rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 10px;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-item {
    margin: 0;
}

.nav-link {
    display: block;
    padding: 4px 2px;
    text-decoration: none;
    color: var(--text);
    overflow-wrap: anywhere;
}

.nav-link:hover {
    color: var(--bg);
    background-color: var(--text);
    text-decoration-color: var(--text);
}

.nav-home .nav-link {
    font-weight: 600;
    color: var(--accent-strong);
}

.nav-home .nav-link:hover {
    color: var(--bg);
    background-color: var(--text);
    text-decoration-color: var(--text);
}

.nav-path {
    display: block;
    font-size: 0.68rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 2px;
}

.nav-title {
    display: block;
    font-size: 0.92rem;
}

.content {
    padding: 24px 56px 80px;
    background: transparent;
}

.content-inner {
    max-width: 72ch;
    overflow-wrap: anywhere;
}

#title-block-header {
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 12px;
}

#title-block-header .title {
    margin: 0;
    font-size: var(--title-size);
    line-height: var(--title-line);
    letter-spacing: -0.02em;
    text-wrap: balance;
}

h1,
h2,
h3,
h4 {
    font-weight: 700;
    line-height: 1.4;
    margin: 1.6rem 0 0.6rem;
    letter-spacing: -0.02em;
    text-wrap: balance;
    scroll-margin-top: 1.2rem;
}

h1 {
    font-size: 1.8rem;
}

h2 {
    font-size: 1.35rem;
    color: var(--text);
}

h3 {
    font-size: 1.15rem;
    color: var(--text);
}

p {
    margin: 0.7rem 0 1rem;
    font-size: 1rem;
}

ul,
ol {
    margin: 0.4rem 0 1rem;
    padding-left: 1.4rem;
}

ul {
    list-style: square;
}

li {
    margin: 0.2rem 0;
    font-size: 1rem;
}

li::marker {
    color: var(--accent);
}

blockquote {
    margin: 1.2rem 0;
    padding: 0.6rem 1rem;
    border-left: 2px solid var(--accent);
    background: transparent;
    color: var(--muted);
}

code {
    font-family: inherit;
    font-size: 0.92rem;
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: 4px;
    padding: 0.1em 0.35em;
}

pre {
    background: var(--code-bg);
    border: 2px inset var(--code-border);
    border-radius: 6px;
    padding: 12px 14px;
    overflow: auto;
}

pre code {
    background: transparent;
    border: 0;
    padding: 0;
}

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.8rem 0;
}

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

th,
td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

thead th {
    color: var(--muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.7rem;
}

img {
    border-radius: 4px;
    border: 1px solid var(--border);
    background: #fff;
}

@media (max-width: 980px) {
    .page {
        display: block;
        grid-template-columns: 1fr;
        min-height: auto;
        align-content: start;
    }

    .sidebar {
        position: static;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .nav-list {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }

    .content {
        padding: 32px 28px 60px;
        align-self: start;
    }
}

@media (max-width: 640px) {
    .content {
        padding: 24px 18px 50px;
    }

    .nav-list {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
}
