:root {
    --ink: #1a1a1a;
    --paper: #ffffff;
    --accent: #0a5ea8;
    --panel: #f6f8fa;
    --border: #d0d7de;
    --diagnostic: #a40e26;
    --sidebar-width: 16rem;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font: 17px/1.6 Georgia, 'Times New Roman', serif;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    overflow-y: auto;
    padding: 1.5rem 1rem;
    border-right: 1px solid var(--border);
    background: var(--panel);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.9rem;
}

.sidebar .book-title {
    margin: 0 0 1rem;
    font-weight: 700;
}

.sidebar .book-title a { color: var(--ink); text-decoration: none; }

.sidebar ol { margin: 0; padding-left: 1.5rem; }
.sidebar li { margin: 0.25rem 0; }
.sidebar li a { color: var(--accent); text-decoration: none; }
.sidebar li a:hover { text-decoration: underline; }
.sidebar li.current > a { color: var(--ink); font-weight: 700; }

main {
    max-width: 44rem;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 5rem;
    margin-left: calc(var(--sidebar-width) + 2rem);
}

h1, h2, h3, h4 {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.25;
}

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

pre {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    overflow-x: auto;
}

code {
    font: 0.85em/1.5 ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

p code, li code {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.05em 0.3em;
}

/* TODO: token-level highlighting for .language-hirundo once a real
   Hirundo grammar exists. Deliberately no JS highlighter yet. */
.example { margin: 1.25rem 0; }
.example > pre { margin: 0; border-radius: 6px 6px 0 0; }

.run-result {
    border: 1px solid var(--border);
    border-top: 0;
    border-radius: 0 0 6px 6px;
    background: #ffffff;
}

.run-result > pre {
    margin: 0;
    border: 0;
    background: transparent;
}

.run-result::before {
    content: 'run result';
    display: block;
    padding: 0.3rem 1rem 0;
    font: 600 0.7rem/1.4 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6e7781;
}

.run-result .diagnostic { color: var(--diagnostic); }

blockquote {
    margin: 1.25rem 0;
    padding: 0.25rem 1rem;
    border-left: 4px solid var(--accent);
    background: var(--panel);
}

@media (max-width: 60rem) {
    .sidebar { position: static; width: auto; border-right: 0; }
    main { margin-left: auto; }
}