:root {
  color-scheme: light dark;
  --bg: #fbfaf7; --fg: #1c1b19; --muted: #6b6760; --line: #e4e1da;
  --accent: #b3471c; --accent-soft: #f6e6dd; --code-bg: #f1efe9;
  --max: 42rem;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #161514; --fg: #ebe8e1; --muted: #9c978d; --line: #2c2a27; --accent: #f08a5d; --accent-soft: #2e211b; --code-bg: #1f1e1c; }
}
* { box-sizing: border-box; }
html { font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%; }
body { margin: 0 auto; max-width: var(--max); padding: 0 1.25rem; background: var(--bg); color: var(--fg); display: flex; flex-direction: column; min-height: 100vh; }
a { color: var(--accent); text-underline-offset: 2px; }
img, video { max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.25; letter-spacing: -0.01em; margin: 2rem 0 0.75rem; }
h1 { font-size: 1.9rem; margin-top: 0; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p, ul, ol, blockquote, pre, table, figure { margin: 0 0 1.1rem; }
.muted, small { color: var(--muted); }
.lede { font-size: 1.15rem; color: var(--muted); margin-bottom: 2rem; }

.site-header { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1.5rem 0 1rem; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--fg); text-decoration: none; letter-spacing: -0.02em; }
.brand:hover { color: var(--accent); }
.site-header nav a { color: var(--muted); text-decoration: none; margin-left: 1.1rem; }
.site-header nav a:hover, .site-header nav a[aria-current="page"] { color: var(--fg); }
main { flex: 1; padding: 1rem 0 3rem; }
.site-footer { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-top: 1px solid var(--line); padding: 1.25rem 0 2rem; font-size: 0.9rem; color: var(--muted); }
.site-footer a { color: var(--muted); }

.post-list { list-style: none; padding: 0; margin: 0; }
.post-list li { padding: 0.9rem 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 8rem 1fr; gap: 0.25rem 1rem; align-items: baseline; }
.post-list li:last-child { border-bottom: 1px solid var(--line); }
.post-list time { color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.post-list a { color: var(--fg); text-decoration: none; font-weight: 600; }
.post-list a:hover { color: var(--accent); }
.post-list .desc { grid-column: 2; color: var(--muted); font-size: 0.95rem; }
@media (max-width: 30rem) { .post-list li { grid-template-columns: 1fr; } .post-list .desc { grid-column: 1; } }

.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; padding: 0; margin: 0.5rem 0 0; }
.tags a { display: inline-block; padding: 0.1rem 0.6rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent); text-decoration: none; font-size: 0.85rem; }
.tags.large a { font-size: 1rem; padding: 0.2rem 0.8rem; }
.draft { background: var(--accent); color: #fff; border-radius: 4px; padding: 0 0.4rem; font-size: 0.8rem; }

article header { margin-bottom: 2rem; }
article .meta { color: var(--muted); font-size: 0.95rem; }
.prose blockquote { border-left: 3px solid var(--line); margin-left: 0; padding-left: 1rem; color: var(--muted); }
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 4px; }
.prose pre { padding: 1rem; border-radius: 6px; overflow-x: auto; font-size: 0.9rem; line-height: 1.5; }
.prose pre code { background: none; padding: 0; }
.prose table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; font-size: 0.95rem; }
.prose th, .prose td { text-align: left; padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { color: var(--muted); font-weight: 600; }
.prose .footnote-definition { font-size: 0.9rem; color: var(--muted); }
.prose .footnote-definition p { display: inline; }
.post-footer { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: 0.9rem; display: flex; gap: 1.5rem; }
