:root {
    --paper: #e4ece8;
    --ink: #1c2421;
    --muted: #5c6b66;
    --signal: #b8431f;
    --line: #c5d1cb;
    --code: #d5e0da;
    --lamp: #d85a2a;
    --focus: #b8431f;
    color-scheme: light;
}

[data-theme="dark"] {
    --paper: #121816;
    --ink: #e6eeea;
    --muted: #9aaba4;
    --signal: #e07a4c;
    --line: #2a3531;
    --code: #1c2622;
    --lamp: #e07a4c;
    --focus: #e07a4c;
    color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: "Literata", "Iowan Old Style", Georgia, serif;
    font-size: 1.125rem;
    line-height: 1.65;
}

.skip {
    position: absolute;
    left: 1rem;
    top: -4rem;
    background: var(--ink);
    color: var(--paper);
    padding: 0.4rem 0.7rem;
}

.skip:focus { top: 1rem; }

.binding {
    position: fixed;
    inset: 0 auto 0 0;
    width: 0.55rem;
    background: #1c2421;
}

.wrap {
    width: min(46rem, calc(100% - 3.2rem));
    margin: 0 auto;
    padding: 1.6rem 0 3rem;
}

.top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2.4rem;
}

.mark {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: inherit;
    text-decoration: none;
    font-family: "Familjen Grotesk", "Arial Narrow", sans-serif;
    font-weight: 700;
    letter-spacing: -0.03em;
    font-size: 1.35rem;
}

.lamp {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: var(--lamp);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--lamp) 25%, transparent);
}

.top-right {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    font-family: "Familjen Grotesk", sans-serif;
    font-size: 0.95rem;
}

nav a { color: var(--muted); text-decoration: none; }
nav a[aria-current="page"],
nav a:hover { color: var(--ink); }

.theme-toggle {
    width: 2.2rem;
    height: 2.2rem;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--ink);
    border-radius: 999px;
    cursor: pointer;
    display: grid;
    place-items: center;
}

.theme-toggle svg { width: 1rem; height: 1rem; }

.lede h1,
.post h1,
.log h2 {
    font-family: "Familjen Grotesk", sans-serif;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.lede h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); margin: 0.2rem 0 0.6rem; }
.eyebrow {
    margin: 0;
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--signal);
}

.lede p { margin: 0; color: var(--muted); max-width: 38rem; }

.log {
    list-style: none;
    margin: 2rem 0 0;
    padding: 0;
}

.log li {
    display: grid;
    grid-template-columns: 8.2rem 1fr;
    gap: 1rem;
    padding: 1.1rem 0 1.1rem 0.8rem;
    border-left: 3px solid var(--line);
}

.log time,
.meta,
.colophon,
.pager,
.terms span {
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 0.82rem;
    color: var(--muted);
}

.log h2 { font-size: 1.35rem; margin: 0 0 0.25rem; }
.log h2 a { color: inherit; text-decoration: none; }
.log h2 a:hover { color: var(--signal); }
.log p { margin: 0.15rem 0 0.35rem; }

.meta { margin: 0.35rem 0 0; }
.meta a { color: var(--signal); text-decoration: none; }
.sep { margin: 0 0.25rem; }

.stamp { font-family: "IBM Plex Mono", ui-monospace, monospace; }

.prose { margin-top: 1.4rem; }
.prose h2, .prose h3 {
    font-family: "Familjen Grotesk", sans-serif;
    letter-spacing: -0.02em;
    line-height: 1.25;
    margin: 1.8rem 0 0.5rem;
}
.prose a { color: var(--signal); }
.prose ul, .prose ol { padding-left: 1.2rem; }
.prose li { margin: 0.25rem 0; }
.prose table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.98rem;
}
.prose th, .prose td {
    text-align: left;
    padding: 0.35rem 0.6rem;
    border-bottom: 1px solid var(--line);
}
.prose code {
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 0.86em;
    background: var(--code);
    padding: 0.05em 0.3em;
}
.prose pre {
    overflow: auto;
    background: var(--code);
    padding: 0.9rem 1rem;
    font-size: 0.86rem;
    line-height: 1.45;
}
.prose pre code { background: none; padding: 0; }
.prose blockquote {
    margin: 1rem 0;
    padding-left: 0.9rem;
    border-left: 3px solid var(--signal);
    color: var(--muted);
}

.terms { list-style: none; padding: 0; margin: 1.5rem 0 0; }
.terms li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--line);
}
.terms a { color: inherit; }

.pager { display: flex; gap: 1rem; margin-top: 1.5rem; }
.pager a { color: var(--signal); }

.colophon {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}
.colophon p { margin: 0; }
.colophon a { color: var(--muted); margin-right: 0.7rem; }

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

@media (max-width: 680px) {
    .wrap { width: min(100% - 2.2rem, 46rem); }
    .top { align-items: flex-start; }
    .log li { grid-template-columns: 1fr; gap: 0.2rem; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}
