/* Newsreader is self-hosted; system fallbacks keep the journal readable while it loads. */
@font-face { font-family: "Newsreader"; src: url("../fonts/newsreader-latin-400-normal.woff2") format("woff2"); font-style: normal; font-weight: 400; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("../fonts/newsreader-latin-600-normal.woff2") format("woff2"); font-style: normal; font-weight: 600 900; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("../fonts/newsreader-latin-400-italic.woff2") format("woff2"); font-style: italic; font-weight: 400; font-display: swap; }
:root {
  color-scheme: light;
  --paper: #f5f2e9;
  --paper-raised: #fcfaf4;
  --ink: #242621;
  --muted: #64665c;
  --line: #d3d2c5;
  --line-strong: #8b8e80;
  --accent: #ad3d21;
  --accent-soft: #efe1d4;
  --blue: #263eb4;
  --green: #50724c;
  --figure-bg: #263eb4;
  --figure-accent: #f6c17b;
  --selection: #f2ca9e;
  --status-halo: #e3e7d9;
  --feed-bg: #ebeefa;
  --feed-ink: #414d77;
  --inline-code-bg: #e8e5db;
  --inline-code-ink: #89391f;
  --table-bg: #eae7dd;
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #191d1b;
  --paper-raised: #212722;
  --ink: #e8e5d9;
  --muted: #abb1a3;
  --line: #384039;
  --line-strong: #707c6b;
  --accent: #efa17e;
  --accent-soft: #352a24;
  --blue: #a2b2ff;
  --green: #a4c48a;
  --selection: #81472e;
  --status-halo: #303c2c;
  --feed-bg: #242d44;
  --feed-ink: #c0c9ea;
  --inline-code-bg: #292f29;
  --inline-code-ink: #f1bc95;
  --table-bg: #262e27;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 2rem; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 1rem; line-height: 1.65; }
::selection { background: var(--selection); color: var(--ink); }
a { color: var(--blue); text-underline-offset: .22em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
a, button, input { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--blue); outline-offset: 5px; }
h1, h2, h3, h4, h5, h6 { font-family: var(--serif); line-height: 1.15; text-wrap: pretty; }
p { margin: 0 0 1rem; }
img, svg { max-width: 100%; }
img { height: auto; }
button, input { font: inherit; }
[hidden] { display: none !important; }
.site-header, .site-main, .site-footer { width: min(1180px, calc(100% - 6rem)); margin-inline: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 1rem; left: 1rem; transform: translateY(-200%); z-index: 10; padding: .75rem 1rem; background: var(--ink); color: var(--paper); }
.skip-link:focus { transform: none; color: var(--paper); }
.eyebrow { font: .72rem/1.5 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.accent-text { color: var(--accent); }
.text-link { font: .78rem/1.5 var(--mono); text-decoration: none; }
.text-link:hover { text-decoration: underline; }

/* A ruled masthead rather than an app toolbar. */
.masthead-strip { display: flex; justify-content: space-between; gap: 1rem; padding: .8rem 0; border-bottom: 1px solid var(--line); color: var(--muted); font: .65rem/1.5 var(--mono); letter-spacing: .03em; }
.masthead-strip a { color: inherit; text-decoration: none; }
.masthead-strip a:hover { color: var(--accent); text-decoration: underline; }
.header-inner { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1.5rem; padding: 1.5rem 0; border-bottom: 1px solid var(--ink); }
.wordmark { display: inline-flex; align-items: center; color: var(--ink); font: 700 1.85rem/1 var(--mono); letter-spacing: -.08em; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 37px; height: 37px; margin-right: .8rem; padding-right: 3px; background: var(--accent); color: var(--paper-raised); font: 700 1.9rem/1 var(--serif); letter-spacing: -.07em; }
.wordmark-cursor { color: var(--accent); }
.site-nav { justify-self: end; }
.site-nav ul { display: flex; flex-wrap: wrap; gap: 1.8rem; list-style: none; margin: 0; padding: 0; }
.site-nav a { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; color: var(--muted); text-decoration: none; font: .78rem/1.5 var(--mono); }
.site-nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: .55rem; }
.site-nav a:hover { color: var(--accent); }
.nav-number { color: var(--muted); font-size: .62rem; }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-width: 44px; min-height: 44px; padding: .5rem .65rem; border: 1px solid var(--line-strong); border-radius: 0; background: var(--paper-raised); color: var(--ink); font: .72rem/1.5 var(--mono); white-space: nowrap; cursor: pointer; }
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle-track { position: relative; width: 1.75rem; height: 1rem; border: 1px solid var(--line-strong); border-radius: 1rem; }
.theme-toggle-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: .625rem; height: .625rem; border-radius: 50%; background: var(--ink); }
.theme-toggle[aria-checked="true"] .theme-toggle-track { border-color: var(--accent); background: var(--accent); }
.theme-toggle[aria-checked="true"] .theme-toggle-track::after { transform: translateX(.75rem); background: var(--paper); }

/* The illustration is decorative and static: no animation or canvas required. */
.home-intro { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr); align-items: center; gap: 3rem; padding: 4.3rem 0 4rem; }
.intro-copy .eyebrow { display: flex; align-items: center; gap: .6rem; margin-bottom: 1.65rem; color: var(--muted); }
.status-dot { width: 6px; height: 6px; background: var(--green); box-shadow: 0 0 0 3px var(--status-halo); }
.home-intro h1 { margin: 0 0 1.5rem; font-family: var(--serif); font-size: clamp(2.7rem, 5.6vw, 4.9rem); font-weight: 400; line-height: 1.04; letter-spacing: -.055em; }
.home-intro h1 em { color: var(--accent); font-weight: 400; }
.intro-description { max-width: 32rem; margin-bottom: 1.65rem; color: var(--muted); font-size: 1rem; line-height: 1.8; }
.button-link { display: inline-flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 44px; padding: .65rem 1rem; border: 1px solid var(--ink); background: var(--ink); color: var(--paper-raised); font: .78rem/1.6 var(--mono); text-decoration: none; }
.button-link:hover { background: var(--accent); border-color: var(--accent); color: var(--paper-raised); }
.intro-aside { display: block; margin-top: 1rem; color: var(--muted); font: .65rem/1.6 var(--mono); }
.intro-figure { margin: 0; padding: 1.2rem 1.4rem; background: var(--figure-bg); color: #f5f2e9; border: 1px solid var(--figure-bg); box-shadow: 7px 7px 0 var(--paper), 8px 8px 0 var(--line-strong); }
.figure-label { display: flex; align-items: center; justify-content: space-between; gap: .5rem; border-bottom: 1px solid #7e8dd6; padding-bottom: .7rem; font: .62rem/1.5 var(--mono); letter-spacing: .07em; }
.document-art { display: block; width: 100%; margin: .65rem 0; }
.art-guide { opacity: .35; }
.intro-figure figcaption { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .4rem; padding-top: .75rem; border-top: 1px solid #7e8dd6; font: .62rem/1.5 var(--mono); }
.intro-figure figcaption span { color: var(--figure-accent); }
.journal-divider { display: flex; justify-content: space-between; gap: 1rem; padding: .75rem 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); color: var(--muted); font: .65rem/1.5 var(--mono); }

/* The document and index share a grid; the page itself remains the scroll container. */
.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 3rem; padding: 3rem 0 4rem; }
.main-content { min-width: 0; }
.inner-page { padding-top: 3.5rem; }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 1rem; margin-bottom: .5rem; }
.section-heading h2 { margin: 0; font: 400 2.5rem/1.2 var(--serif); letter-spacing: -.04em; }
.page-heading { padding-bottom: 1.5rem; border-bottom: 1px solid var(--ink); }
.page-heading h1, .main-content > h1 { margin: 0 0 1rem; font: 400 clamp(2.5rem, 5vw, 3.8rem)/1.12 var(--serif); letter-spacing: -.04em; }
.page-heading .eyebrow { color: var(--accent); }
.page-heading p:last-child { margin-bottom: 0; color: var(--muted); }
.postlist { list-style: none; margin: 0; padding: 0; }
.postlist-item { display: grid; grid-template-columns: 2rem minmax(0, 1fr); gap: 1rem; padding: 2rem 0; border-bottom: 1px solid var(--line); }
.post-number { padding-top: .1rem; color: var(--muted); font: .72rem/1.6 var(--mono); }
.postlist-content { min-width: 0; }
.post-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; margin-bottom: .8rem; color: var(--muted); font: .75rem/1.6 var(--mono); }
.latest-label { margin-left: auto; color: var(--accent); font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; }
.postlist-title { margin: 0 0 .75rem; font: 400 clamp(1.65rem, 2.5vw, 2.15rem)/1.2 var(--serif); letter-spacing: -.025em; overflow-wrap: anywhere; }
.postlist-link { color: var(--ink); text-decoration: none; }
.postlist-link:hover { color: var(--accent); text-decoration: underline; }
.post-arrow { color: var(--accent); font: 400 .75em var(--mono); white-space: nowrap; }
.post-description { max-width: 60ch; margin: 0 0 1rem; color: var(--muted); font-size: .94rem; line-height: 1.75; }
.postlist-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .75rem; }
.post-tags { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem; }
.post-tag, .category-label { display: inline-block; min-height: 26px; padding: .2rem .5rem; border: 1px solid var(--line); color: var(--muted); font: .66rem/1.6 var(--mono); text-decoration: none; }
.post-tag:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.share-link { padding: .25rem 0; color: var(--muted); font: .65rem/1.6 var(--mono); text-decoration: none; }
.share-link:hover { text-decoration: underline; }
.list-colophon { margin: 1.3rem 0 0; color: var(--muted); font: .68rem/1.7 var(--mono); }
.empty-state { padding: 2rem 0; color: var(--muted); }

.sidebar { min-width: 0; border-left: 1px solid var(--line); padding-left: 1.75rem; }
.sidebar-section { padding-bottom: 1.6rem; margin-bottom: 1.6rem; border-bottom: 1px solid var(--line); }
.sidebar-section h2 { margin: 0 0 1rem; font-weight: 400; }
.sidebar-section h2 span { color: var(--accent); margin-right: .4rem; }
.sidebar p { color: var(--muted); font-size: .85rem; line-height: 1.8; }
.sidebar .sidebar-intro { margin-bottom: .6rem; color: var(--ink); font: 400 1.7rem/1.25 var(--serif); letter-spacing: -.03em; }
.sidebar .text-link { font-size: .7rem; }
.topic-list, .elsewhere-links { list-style: none; padding: 0; margin: 0; }
.topic-list a { display: flex; align-items: baseline; gap: .65rem; padding: .5rem 0; color: var(--ink); font: .75rem/1.6 var(--mono); text-decoration: none; }
.topic-list a:hover { color: var(--accent); }
.topic-leader { flex: 1; border-bottom: 1px dotted var(--line-strong); }
.topic-count { color: var(--muted); font-size: .68rem; }
.elsewhere-links a { display: flex; justify-content: space-between; gap: .5rem; padding: .5rem 0; color: var(--muted); font: .74rem/1.6 var(--mono); text-decoration: none; }
.elsewhere-links a:hover { color: var(--accent); text-decoration: underline; }
.feed-note { padding: 1.15rem; border: 1px solid var(--blue); color: var(--blue); background: var(--feed-bg); }
.feed-note h2 { margin: .5rem 0; font: 400 1.65rem/1.2 var(--serif); letter-spacing: -.03em; }
.feed-note p { margin-bottom: .75rem; color: var(--feed-ink); font-size: .8rem; }
.feed-note a { display: inline-block; padding: .3rem 0; font: .68rem/1.6 var(--mono); }

/* Search stays inline, with honest status text and no focus trap. */
.search-bar label { display: block; margin-bottom: .65rem; }
.search-input-group { display: flex; align-items: center; gap: .5rem; padding: .6rem .65rem; border: 1px solid var(--line-strong); background: var(--paper-raised); }
.search-input-group:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
.search-icon { flex-shrink: 0; color: var(--muted); }
#search-input { min-width: 0; width: 100%; border: 0; border-radius: 0; padding: .15rem 0; background: transparent; color: var(--ink); font-size: .8rem; }
#search-input:focus { outline: none; }
#search-input::placeholder { color: var(--muted); opacity: 1; }
kbd { border: 1px solid var(--line); padding: 0 .25rem; color: var(--muted); font: .65rem/1.6 var(--mono); }
.sidebar .search-status { margin: .6rem 0 0; font: .62rem/1.7 var(--mono); }
#search-results { list-style: none; padding: 0; margin: 0; }
#search-results li { padding: .8rem 0; border-bottom: 1px dashed var(--line); overflow-wrap: anywhere; }
#search-results a { display: inline-block; font-size: .85rem; line-height: 1.5; }
#search-results .search-result-description { margin: .4rem 0 0; font-size: .75rem; }

/* RFC-like metadata, with a comfortable reading measure for long-form notes. */
.document-header { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--ink); }
.document-header .eyebrow { margin-bottom: 1.5rem; }
.document-header .eyebrow a { color: var(--accent); text-decoration: none; }
.document-header .eyebrow a:hover { text-decoration: underline; }
.document-header h1 { margin: 0 0 1.25rem; font: 400 clamp(2.25rem, 4.4vw, 3.65rem)/1.1 var(--serif); letter-spacing: -.04em; overflow-wrap: anywhere; }
.document-summary { color: var(--muted); font-family: var(--serif); font-size: 1.05rem; }
.document-meta { display: flex; flex-wrap: wrap; gap: 1rem 2rem; margin: 1.75rem 0 1rem; font: .7rem/1.7 var(--mono); }
.document-meta dt { color: var(--muted); text-transform: uppercase; font-size: .6rem; letter-spacing: .06em; }
.document-meta dd { margin: .2rem 0 0; }
.prose { max-width: 70ch; font-family: var(--serif); font-size: 1.02rem; line-height: 1.85; overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol { margin-bottom: 1.4rem; }
.prose h2 { margin: 2.5rem 0 1rem; padding-top: 1rem; border-top: 1px solid var(--line); font: 400 2rem/1.25 var(--serif); letter-spacing: -.025em; }
.prose h3 { margin: 2rem 0 .8rem; font: 600 1.2rem/1.4 var(--serif); }
.prose h4 { font-size: 1rem; }
.prose li { margin-bottom: .4rem; }
.prose li > ul, .prose li > ol { margin-block: .5rem; }
.prose blockquote { margin: 1.5rem 0; padding: .8rem 1.2rem; border-left: 3px solid var(--accent); background: var(--accent-soft); }
.prose blockquote p:last-child { margin-bottom: 0; }
hr { margin: 2rem 0; border: 0; border-top: 1px solid var(--line); }
code, pre { font-family: var(--mono); }
:not(pre) > code, :not(pre) > code[class*="language-"] { padding: .12em .32em; border-radius: 2px; background: var(--inline-code-bg); color: var(--inline-code-ink); font-size: .87em; white-space: break-spaces; overflow-wrap: anywhere; }
pre, pre[class*="language-"] { max-width: 100%; padding: 1.3rem; margin: 1.5rem 0; overflow: auto; border: 1px solid #414940; border-radius: 0; background: #242b27; color: #eeeee4; font-size: .84rem; line-height: 1.75; tab-size: 2; }
pre code, code[class*="language-"] { background: transparent; font: inherit; color: inherit; text-shadow: none; white-space: pre; word-break: normal; overflow-wrap: normal; }
pre.line-numbers { padding-left: 3.8em; }
.line-numbers .line-numbers-rows { border-color: #576055; }
.line-numbers-rows > span::before { color: #abb3a7; }
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #abb3a7; }
.token.keyword, .token.boolean, .token.atrule { color: #c5b7ff; }
.token.string, .token.attr-value { color: #bed59c; }
.token.function, .token.class-name { color: #f4c888; }
.token.number, .token.constant { color: #f2af91; }
.token.punctuation, .token.operator { color: #e3e7db; }
.heading-link { color: inherit; text-decoration: none; }
.heading-link:hover { color: var(--accent); text-decoration: underline; }
.post-thumbnail { display: block; width: 100%; height: auto; margin: 1.5rem 0; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; margin-block: 1.5rem; font-size: .85rem; overflow-wrap: anywhere; }
th, td { padding: .65rem; text-align: left; border: 1px solid var(--line); }
th { background: var(--table-bg); font-weight: 600; }
.document-end { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-top: 3rem; padding: 1rem 0; border-block: 1px solid var(--line); }
.document-end .eyebrow { color: var(--muted); }
.document-end a { font: .72rem/1.5 var(--mono); }
.post-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 1.5rem; margin-top: 1.5rem; }
.post-nav-link { font: 400 1.4rem/1.3 var(--serif); color: var(--ink); text-decoration: none; }
.post-nav-link .eyebrow { display: block; color: var(--muted); margin-bottom: .5rem; }
.post-nav-link:hover { color: var(--accent); text-decoration: underline; }
.tag-directory { list-style: none; padding: 0; margin: 1.5rem 0; }
.tag-directory a { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line); color: var(--ink); font: 400 1.7rem/1.3 var(--serif); text-decoration: none; }
.tag-directory a:hover { color: var(--accent); }
.tag-directory .topic-count { font-family: var(--mono); }

.site-footer { border-top: 1px solid var(--ink); }
.footer-main { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 1.5rem 2rem; padding: 1.75rem 0; }
.footer-main p { margin: 0; font-size: .75rem; line-height: 1.9; color: var(--muted); }
.footer-main strong { font: 700 1rem/1.8 var(--mono); letter-spacing: -.05em; color: var(--ink); }
.back-to-top { display: inline-flex; gap: 1rem; padding: .5rem 0; color: var(--ink); font: .7rem/1.5 var(--mono); text-decoration: none; }
.back-to-top:hover { text-decoration: underline; }
.footer-colophon { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; padding: 1rem 0 1.5rem; border-top: 1px solid var(--line); color: var(--muted); font: .6rem/1.6 var(--mono); }
.web-badge { border: 1px solid var(--line-strong); padding: .2rem .45rem; }

/* Images remain dimensional even before they load. Only index previews are cropped. */
.featured-note { padding: 1.4rem; margin-bottom: 2.5rem; border: 1px solid var(--line-strong); background: var(--paper-raised); }
.featured-note > .eyebrow { color: var(--accent); }
.featured-note h2 { font-size: 2.2rem; font-weight: 400; margin: 1.2rem 0 .7rem; }
.featured-note h2 a { color: var(--ink); text-decoration: none; }
.featured-note h2 a:hover { color: var(--accent); text-decoration: underline; }
.featured-note p:not(.eyebrow) { color: var(--muted); font-size: .94rem; }
.featured-image, .featured-image picture { display: block; }
.featured-thumbnail { display: block; width: 100%; height: auto; max-height: 350px; object-fit: contain; background: var(--paper); }
.postlist-image { float: right; display: block; width: min(30%, 160px); margin: 0 0 1rem 1.25rem; }
.postlist-thumbnail { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border: 1px solid var(--line); }
.postlist-footer { clear: both; }
.follow-note { padding: 1.25rem 0; margin-top: 1rem; border-top: 1px solid var(--line); }
.follow-note h2 { font-size: 1.65rem; font-weight: 400; margin: 0 0 .7rem; }
.sidebar .uses-link { margin: .65rem 0 0; }
.not-found-actions { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: center; margin: 1.5rem 0 2.5rem; }

/* Native disclosures keep sharing and document navigation usable without JavaScript. */
.share-menu { position: relative; margin-inline-start: auto; font-family: var(--mono); }
.share-menu summary { min-height: 32px; padding: .35rem .25rem; cursor: pointer; }
.share-options { position: absolute; right: 0; z-index: 5; width: 220px; max-width: calc(100vw - 3rem); padding: .75rem; border: 1px solid var(--line-strong); background: var(--paper-raised); box-shadow: 3px 3px 0 var(--line); }
.share-options a, .copy-link { display: block; width: 100%; min-height: 36px; padding: .5rem; border: 0; background: transparent; color: var(--blue); font: .75rem/1.5 var(--mono); text-align: left; text-decoration: none; }
.share-options a:hover, .copy-link:hover { background: var(--accent-soft); color: var(--accent); }
.copy-link, .copy-code { cursor: pointer; }
.copy-status { display: block; color: var(--muted); font: .68rem/1.6 var(--mono); }
.copy-status:empty { display: none; }
.copy-link-fallback { width: 100%; padding: .5rem; border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); font: .75rem var(--mono); }
mark { background: var(--selection); color: var(--ink); }
.toc-mobile { display: none; }
.toc-section { position: sticky; top: 1.5rem; max-height: calc(100vh - 3rem); overflow-y: auto; padding: .4rem; background: var(--paper); scrollbar-width: thin; }
.toc-section summary, .toc-mobile summary { min-height: 44px; padding-block: .7rem; cursor: pointer; color: var(--accent); }
.toc-list { list-style: none; padding: 0; margin: .5rem 0 1rem; }
.toc-list a { display: block; padding: .4rem .25rem; color: var(--muted); font: .74rem/1.5 var(--mono); text-decoration: none; overflow-wrap: anywhere; }
.toc-list a:hover, .toc-list a[aria-current] { color: var(--accent); text-decoration: underline; }
.toc-level-3 { margin-left: .8rem; border-left: 1px solid var(--line); padding-left: .5rem; }
.toc-follow { display: grid; gap: .7rem; border-top: 1px solid var(--line); padding: 1rem 0 .5rem; font: .72rem/1.5 var(--mono); }
.reading-progress { position: fixed; inset: 0 0 auto; z-index: 20; height: 3px; background: var(--line); pointer-events: none; }
.reading-progress span { display: block; width: 100%; height: 100%; transform: scaleX(0); transform-origin: left; background: var(--accent); }
.code-block { margin: 1.5rem 0; }
.code-block pre, .code-block pre[class*="language-"] { margin: 0; }
.code-toolbar { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: .75rem; padding: .45rem .75rem; background: #242b27; border: 1px solid #414940; border-bottom: 0; color: #eeeee4; }
.code-filename { margin-right: auto; overflow-wrap: anywhere; font: .72rem/1.5 var(--mono); }
.copy-code { padding: .35rem .6rem; min-height: 32px; border: 1px solid #abb3a7; background: transparent; color: #eeeee4; font: .72rem/1.5 var(--mono); }
.copy-code:hover { background: #414940; }
.code-toolbar .copy-status { flex-basis: 100%; color: #eeeee4; }
.copy-code:focus-visible, pre:focus-visible { outline-color: #c5b7ff; }

@media (min-width: 1600px) {
  .site-header, .site-main, .site-footer { width: min(1280px, calc(100% - 8rem)); }
  .content-grid { grid-template-columns: minmax(0, 1fr) 290px; gap: 4rem; }
  .home-intro { gap: 5rem; }
}
@media (max-width: 1000px) {
  .site-header, .site-main, .site-footer { width: calc(100% - 3rem); }
  .content-grid { grid-template-columns: minmax(0, 1fr) 230px; gap: 1.75rem; }
  .sidebar { padding-left: 1.25rem; }
  .home-intro { gap: 2rem; }
  .site-nav ul { gap: 1rem; }
}
@media (max-width: 760px) {
  .toc-section { display: none; }
  .toc-mobile { display: block; border-block: 1px solid var(--line); padding: .5rem; margin-bottom: 1.5rem; }
  .toc-mobile .toc-list { max-height: 50vh; overflow: auto; }
  .sidebar.article-sidebar { display: block; }
  .site-nav { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; }
  .site-nav ul { justify-content: space-between; }
  .theme-toggle { grid-column: 3; grid-row: 1; }
  .home-intro { grid-template-columns: minmax(0, 1fr) minmax(0, .7fr); gap: 1.5rem; padding-block: 3rem; }
  .home-intro h1 { font-size: clamp(2.45rem, 6.5vw, 3.5rem); }
  .intro-figure { padding: .8rem; box-shadow: 4px 4px 0 var(--paper), 5px 5px 0 var(--line-strong); }
  .intro-figure figcaption { font-size: .55rem; }
  .figure-label { font-size: .55rem; }
  .content-grid { grid-template-columns: minmax(0, 1fr); gap: 2.5rem; padding-block: 2rem 3rem; }
  .sidebar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 1.75rem; padding: 2rem 0 0; border-left: 0; border-top: 1px solid var(--ink); }
  .sidebar-section { margin: 0; height: 100%; }
  .search-bar { grid-column: 1 / -1; }
  .feed-note { align-self: start; }
  .postlist-title { font-size: 2rem; }
  .document-header h1 { font-size: clamp(2.25rem, 6vw, 3.3rem); }
}
@media (max-width: 560px) {
  .site-header, .site-main, .site-footer { width: calc(100% - 2rem); }
  .masthead-strip { font-size: .58rem; }
  .masthead-strip > span { max-width: 13ch; }
  .masthead-strip a { max-width: 23ch; text-align: right; }
  .header-inner { gap: .8rem; padding: 1.2rem 0 .65rem; }
  .theme-toggle-label { display: none; }
  .wordmark { font-size: 1.65rem; }
  .site-nav { width: 100%; }
  .site-nav ul { justify-content: space-between; gap: .5rem; }
  .site-nav a { font-size: .73rem; }
  .home-intro { grid-template-columns: minmax(0, 1fr); padding-block: 2.5rem; gap: 2rem; }
  .home-intro h1 { font-size: clamp(2.7rem, 10vw, 3.7rem); }
  .intro-copy .eyebrow { margin-bottom: 1.3rem; }
  .intro-description { font-size: .94rem; }
  .intro-figure { width: 100%; padding: 1rem 1.2rem; }
  .document-art { height: 155px; margin: .2rem 0; }
  .figure-label, .intro-figure figcaption { font-size: .62rem; }
  .journal-divider { font-size: .6rem; }
  .journal-divider > span:first-child { max-width: 24ch; }
  .journal-divider > span:last-child { text-align: right; }
  .section-heading h2 { font-size: 2.1rem; }
  .section-heading .text-link { font-size: .7rem; }
  .postlist-item { grid-template-columns: 1.3rem minmax(0, 1fr); gap: .6rem; padding-block: 1.7rem; }
  .postlist-title { font-size: 1.75rem; }
  .post-meta { font-size: .7rem; }
  .latest-label { margin-left: 0; }
  .post-description { font-size: .88rem; }
  .sidebar { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .document-meta { gap: 1rem 1.4rem; }
  .prose { font-size: 1rem; }
  .prose h2 { font-size: 1.8rem; }
  pre, pre[class*="language-"] { font-size: .78rem; padding: 1rem; }
  pre.line-numbers { padding-left: 3.8em; }
  .footer-main { flex-direction: column; gap: 1rem; }
}
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  html { scroll-behavior: smooth; }
  a { transition: color .15s ease, background-color .15s ease, border-color .15s ease; }
  .postlist-link { background-image: linear-gradient(var(--accent), var(--accent)); background-repeat: no-repeat; background-position: 0 100%; background-size: 0 1px; transition: color .15s ease, background-size .2s ease; }
  .postlist-link:hover { background-size: 100% 1px; text-decoration: none; }
  .intro-figure { transition: transform .2s ease; }
  .intro-figure:hover { transform: translateY(-3px); }
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
@media print {
  :root, :root[data-theme="dark"] {
    color-scheme: light;
    --paper: #fff;
    --paper-raised: #fff;
    --ink: #000;
    --muted: #444;
    --accent: #000;
    --accent-soft: #f4f4f4;
    --blue: #000;
    --line: #aaa;
    --inline-code-bg: #f4f4f4;
    --inline-code-ink: #000;
    --table-bg: #f4f4f4;
  }
  .site-header, .site-footer, .sidebar, .intro-figure, .skip-link, .share-menu, .post-nav, .document-end, .toc-mobile, .reading-progress, .copy-code, .copy-status { display: none; }
  .code-toolbar { background: #f4f4f4; color: #000; border-color: #aaa; }
  .site-main { width: 100%; }
  .content-grid, .home-intro { display: block; padding: 0; }
  .prose { max-width: none; }
  a { color: #000; }
  pre, pre[class*="language-"] { white-space: pre-wrap; background: #f4f4f4; color: #000; border-color: #aaa; break-inside: avoid; }
  pre code, pre code[class*="language-"] { white-space: pre-wrap; }
  .token { color: #000 !important; }
}
