:root {
    color-scheme: light;
    --paper: #faf8f3;
    --ink: #302e29;
    --muted: #706b61;
    --line: #ddd7cb;
    --accent: #976019;
    --link: #315e80;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.75 'Lora', Georgia, serif; border-top: 4px solid var(--accent); }
a { color: var(--link); text-underline-offset: .22em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
.site { max-width: 808px; min-height: calc(100vh - 4px); margin: auto; padding: 0 32px; display: flex; flex-direction: column; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.site-name { font-size: 25px; font-weight: 600; letter-spacing: -.05em; color: var(--ink); text-decoration: none; }
nav { display: flex; flex-wrap: wrap; gap: 24px; font: 14px/1.5 'Inter', system-ui, sans-serif; }
nav a { padding: 10px 0; color: var(--muted); text-decoration: none; }
nav a:hover, nav a[aria-current] { color: var(--accent); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 8px; }
main { padding: 52px 0 64px; flex: 1; min-width: 0; }
h1, h2, h3 { line-height: 1.3; font-weight: 500; }
h1 { font-size: clamp(30px, 5vw, 40px); letter-spacing: -.035em; margin: 0 0 16px; overflow-wrap: anywhere; }
.site-title { margin: 0; line-height: inherit; }
h2 { font-size: 24px; margin: 0; }
p { margin: 0 0 20px; }
.eyebrow { font: 12px/1.5 'Inter', system-ui, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 16px; }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.section-heading a, .back-link, .meta, .post-list time, .site-footer, .tag-links, .topic-list { font: 13px/1.7 'Inter', system-ui, sans-serif; }
.page-header { margin-bottom: 32px; }
.page-header p:not(.eyebrow) { color: var(--muted); }
.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li { display: grid; grid-template-columns: 110px minmax(0, 1fr); column-gap: 24px; padding: 23px 0; border-bottom: 1px solid var(--line); }
.post-list time { color: var(--muted); padding-top: 5px; }
.post-list h2 { font-size: 21px; line-height: 1.45; }
.post-list h2 a { text-decoration: none; }
.post-list h2 a:hover { text-decoration: underline; }
.post-list p { font-size: 15px; line-height: 1.75; color: var(--muted); margin: 8px 0 0; }
.list-footer { margin-top: 24px; font: 14px/1.7 'Inter', system-ui, sans-serif; }
.back-link { display: inline-block; margin-bottom: 24px; }
.post-header { padding-bottom: 28px; margin-bottom: 32px; border-bottom: 1px solid var(--line); }
.meta { display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); }
.tag-links { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 14px; }
.prose { overflow-wrap: anywhere; }
.prose h1 { font-size: 30px; margin-top: 40px; }
.prose h2 { font-size: 26px; margin: 36px 0 16px; }
.prose h3 { font-size: 21px; margin: 28px 0 12px; }
.prose p, .prose ul, .prose ol { margin: 0 0 24px; }
.prose ul, .prose ol { padding-left: 24px; }
.prose li { margin: 6px 0; }
code, pre { font-family: 'SFMono-Regular', Consolas, monospace; font-size: .85em; }
code { background: #eee9df; padding: 2px 4px; border-radius: 2px; }
pre, .codehilite { background: #f0ece3; overflow-x: auto; padding: 20px; margin: 24px 0; line-height: 1.65; }
.codehilite pre { padding: 0; margin: 0; font-size: 1em; }
pre code { background: none; padding: 0; font-size: 1em; }
.prose blockquote { margin: 24px 0; padding: 8px 0 8px 20px; border-left: 3px solid var(--accent); color: var(--muted); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose img { max-width: 100%; height: auto; }
.prose hr { border: 0; height: 12px; margin: 40px 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='6'%3E%3Cg fill='%23976019'%3E%3Ccircle cx='5' cy='3' r='2'/%3E%3Ccircle cx='20' cy='3' r='2'/%3E%3Ccircle cx='35' cy='3' r='2'/%3E%3C/g%3E%3C/svg%3E") center / auto 6px no-repeat; }
.prose a[href^="http"]::after { content: ""; display: inline-block; width: .7em; height: .7em; margin-left: .15em; background: var(--accent); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' fill='none' stroke='black' stroke-width='1.5'%3E%3Cpath d='M2 8L8 2M3 2h5v5'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' fill='none' stroke='black' stroke-width='1.5'%3E%3Cpath d='M2 8L8 2M3 2h5v5'/%3E%3C/svg%3E") center / contain no-repeat; }
.heading-anchor { margin-left: .4em; color: var(--accent); font-weight: 600; text-decoration: none; opacity: .45; }
.prose h2:hover .heading-anchor, .prose h3:hover .heading-anchor, .heading-anchor:focus { opacity: 1; }
.prose table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 24px 0; }
.prose th, .prose td { border: 1px solid var(--line); padding: 10px 14px; text-align: left; }
.prose th { background: #f0ece3; }
.katex-display { overflow-x: auto; overflow-y: hidden; padding: 8px 0; }
.post-footer { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.post-footer .back-link { margin: 0; }
.topic-list { list-style: none; padding: 0; margin: 0; font-size: 16px; }
.topic-list a { display: flex; justify-content: space-between; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.topic-list a:hover { text-decoration: underline; }
.topic-list span { color: var(--muted); font-size: 13px; }
.archive-layout { display: grid; grid-template-columns: minmax(0, 1fr) 160px; gap: 40px; align-items: start; }
.topics-sidebar { padding-top: 24px; }
.topics-sidebar h2 { font: 12px/1.5 'Inter', system-ui, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.topics-sidebar .topic-list a { padding: 8px 0; }
.empty-state { border-left: 3px solid var(--accent); padding: 8px 0 8px 24px; margin-top: 40px; }
.empty-state p:last-child { margin-bottom: 0; }
.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding: 24px 0; color: var(--muted); }
.til-icon { color: var(--paper); background: var(--accent); padding: 3px; border-radius: 50%; margin-right: 8px; vertical-align: -3px; box-sizing: content-box; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; top: -100px; left: 16px; padding: 8px 16px; background: var(--paper); z-index: 1; }
.skip-link:focus { top: 12px; }
@media (max-width: 540px) {
    .site { padding: 0 22px; }
    .site-header { align-items: flex-start; flex-direction: column; gap: 10px; padding: 20px 0 16px; }
    nav { gap: 28px; }
    main { padding: 36px 0 48px; }
    .archive-layout { grid-template-columns: 1fr; gap: 24px; }
    .post-list li { grid-template-columns: 1fr; gap: 6px; padding: 20px 0; }
    .post-list time { padding: 0; }
}
