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

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

:root {
    --bg: #ffffff;
    --fg: #1a1a1a;
    --muted: #6b6b6b;
    --border: #e0e0e0;
    --accent: #0066cc;
    --code-bg: #f4f4f4;
    --sidebar-w: 240px;
    --header-h: 48px;
}

[data-theme="dark"] {
    --bg: #111111;
    --fg: #e8e8e8;
    --muted: #888888;
    --border: #2a2a2a;
    --accent: #4d9fff;
    --code-bg: #1a1a1a;
}

html { font-size: 15px; }

body {
    font-family: 'IBM Plex Sans', sans-serif;
    background: var(--bg);
    color: var(--fg);
    line-height: 1.6;
    transition: background 0.15s, color 0.15s;
}

/* HEADER */
header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-h);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 20px;
    background: var(--bg);
    z-index: 100;
    gap: 12px;
}

header .logo {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--fg);
    text-decoration: none;
}

header .version {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: var(--muted);
    border: 1px solid var(--border);
    padding: 2px 6px;
}

header nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 20px;
}

header nav a {
    font-size: 0.85rem;
    color: var(--muted);
    text-decoration: none;
}

header nav a:hover { color: var(--accent); }

#theme-btn {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: var(--muted);
    background: none;
    border: 1px solid var(--border);
    padding: 3px 8px;
    cursor: pointer;
    line-height: 1.4;
}

#theme-btn:hover { color: var(--fg); border-color: var(--fg); }

/* LAYOUT */
.layout {
    display: flex;
    margin-top: var(--header-h);
    min-height: calc(100vh - var(--header-h));
}

/* SIDEBAR */
aside {
    width: var(--sidebar-w);
    flex-shrink: 0;
    border-right: 1px solid var(--border);
    padding: 24px 0;
    position: sticky;
    top: var(--header-h);
    height: calc(100vh - var(--header-h));
    overflow-y: auto;
}

.nav-section { margin-bottom: 20px; }

.nav-section-title {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    padding: 0 20px;
    margin-bottom: 6px;
}

.nav-section a {
    display: block;
    font-size: 0.875rem;
    color: var(--fg);
    text-decoration: none;
    padding: 5px 20px;
}

.nav-section a:hover { color: var(--accent); }
.nav-section a.active {
    color: var(--accent);
    border-left: 2px solid var(--accent);
    padding-left: 18px;
}

/* CONTENT */
main {
    flex: 1;
    min-width: 0;
    padding: 48px 64px;
    max-width: 860px;
}

h1 { font-size: 1.75rem; font-weight: 500; margin-bottom: 8px; letter-spacing: -0.02em; }

.page-subtitle {
    color: var(--muted);
    font-size: 0.95rem;
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

h2 { font-size: 1.1rem; font-weight: 500; margin: 40px 0 12px; }
h3 { font-size: 0.95rem; font-weight: 500; margin: 24px 0 8px; color: var(--muted); }

p { margin-bottom: 14px; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* CODE */
pre {
    background: var(--code-bg);
    border: 1px solid var(--border);
    padding: 16px 20px;
    overflow-x: auto;
    margin: 16px 0 24px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.82rem;
    line-height: 1.65;
}

code {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85em;
    background: var(--code-bg);
    border: 1px solid var(--border);
    padding: 1px 5px;
}

pre code { background: none; border: none; padding: 0; font-size: 1em; }

/* TABLES */
table { width: 100%; border-collapse: collapse; margin: 16px 0 24px; font-size: 0.875rem; }

th {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    text-align: left;
    padding: 8px 12px;
    border-bottom: 2px solid var(--border);
    color: var(--muted);
    font-weight: 500;
}

td { padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
td code { font-size: 0.8rem; }

/* CALLOUT */
.note {
    border-left: 3px solid var(--border);
    padding: 10px 16px;
    margin: 16px 0;
    font-size: 0.875rem;
    color: var(--muted);
}

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

/* PAGINATION */
.pagination {
    display: flex;
    justify-content: space-between;
    margin-top: 64px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    font-size: 0.875rem;
}

.pagination a { color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.pagination a:hover { color: var(--accent); text-decoration: none; }
.pagination .label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
.pagination .title { color: var(--fg); font-weight: 500; }