@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:wght@400;500;600;700&family=Newsreader:opsz,wght@6..72,400;6..72,500;6..72,600&display=swap');

:root {
  color-scheme: light;
  --paper: #f9f8f5;
  --ink: #22241f;
  --muted: #777a72;
  --line: #deded7;
  --accent: #b94e31;
  --accent-soft: #f1e5de;
  --code: #f0efeb;
  --serif: 'Newsreader', Georgia, serif;
  --sans: 'DM Sans', Arial, sans-serif;
  --mono: 'DM Mono', monospace;
}

html[data-theme='dark'] {
  color-scheme: dark;
  --paper: #1d1e1b;
  --ink: #ecece4;
  --muted: #aaa9a0;
  --line: #3a3d36;
  --accent: #e89879;
  --accent-soft: #372820;
  --code: #292b27;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
a { color: inherit; }
button { cursor: pointer; }
::selection { background: var(--accent-soft); color: var(--ink); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.site-shell { width: min(100% - 48px, 1080px); margin: 0 auto; }

.site-header { height: 103px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.site-name { font-family: var(--serif); font-size: 29px; font-weight: 600; letter-spacing: -.055em; text-decoration: none; line-height: 1; }
.site-name-dot, .heading-period { color: var(--accent); }
.site-nav { display: flex; align-items: center; gap: 32px; }
.site-nav a { font-size: 13px; font-weight: 600; text-decoration: none; transition: color .2s; }
.site-nav a:hover, .site-nav a[aria-current='page'] { color: var(--accent); }
.theme-toggle { display: grid; place-items: center; width: 34px; height: 34px; margin-left: 2px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--ink); transition: background .2s, border-color .2s; }
.theme-toggle:hover { background: var(--accent-soft); border-color: var(--accent); }
.theme-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }

.eyebrow { margin: 0; font: 500 10px/1.5 var(--mono); letter-spacing: .17em; color: var(--accent); }
.intro { max-width: 810px; padding: 111px 0 106px; }
.intro h1 { margin: 25px 0 26px; font: 500 clamp(65px, 8vw, 116px)/.94 var(--serif); letter-spacing: -.065em; }
.intro h1 em { color: var(--accent); font-weight: 400; }
.intro-copy { max-width: 515px; margin: 0; color: var(--muted); font: 400 17px/1.75 var(--sans); }

.writing { padding: 36px 0 100px; border-top: 1px solid var(--line); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.section-heading h2 { margin: 12px 0 0; font: 500 clamp(37px, 5vw, 52px)/1.05 var(--serif); letter-spacing: -.055em; }
.post-count { color: var(--muted); font: 400 11px/1.6 var(--mono); white-space: nowrap; padding-bottom: 7px; }
.archive-controls { display: flex; gap: 26px; justify-content: space-between; align-items: end; margin: 38px 0 22px; }
.search-field { display: flex; align-items: center; gap: 10px; width: 250px; border-bottom: 1px solid var(--line); padding: 0 0 10px; color: var(--muted); }
.search-field:focus-within { border-color: var(--accent); }
.search-field svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.search-field input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.search-field input::placeholder { color: var(--muted); opacity: 1; }
.search-field kbd { font: 10px/1 var(--mono); border: 1px solid var(--line); padding: 3px 5px; border-radius: 3px; }
.tag-filters { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.tag-filter { border: 1px solid var(--line); border-radius: 100px; padding: 7px 12px; background: transparent; color: var(--muted); font-size: 11px; line-height: 1; transition: color .2s, border-color .2s, background .2s; }
.tag-filter:hover { color: var(--accent); border-color: var(--accent); }
.tag-filter[aria-pressed='true'] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.post-list { border-top: 1px solid var(--line); }
.post-row { display: grid; grid-template-columns: 1fr 104px; gap: 28px; padding: 31px 0 34px; border-bottom: 1px solid var(--line); }
.post-row-content { min-width: 0; }
.post-row-meta { display: flex; flex-wrap: wrap; gap: 13px; align-items: center; color: var(--muted); font: 400 10px/1.5 var(--mono); letter-spacing: .015em; }
.post-row-meta .topic { color: var(--accent); }
.post-row h3 { margin: 11px 0 7px; font: 500 clamp(24px, 3vw, 31px)/1.18 var(--serif); letter-spacing: -.025em; }
.post-row h3 a { text-decoration: none; transition: color .2s; }
.post-row h3 a:hover { color: var(--accent); }
.post-row p { max-width: 680px; margin: 0; color: var(--muted); font: 400 13px/1.7 var(--sans); }
.post-row-date { padding-top: 3px; text-align: right; color: var(--muted); font: 400 10px/1.5 var(--mono); white-space: nowrap; }
.empty-state { padding: 42px 0; color: var(--muted); font-size: 14px; }

.about { display: grid; grid-template-columns: 260px 1fr; column-gap: 65px; padding: 60px 0 90px; border-top: 1px solid var(--line); }
.about .eyebrow { padding-top: 11px; }
.about h2 { grid-column: 2; margin: 0 0 12px; font: 500 39px/1.1 var(--serif); letter-spacing: -.04em; }
.about > p:not(.eyebrow), .about .text-link { grid-column: 2; }
.about > p:not(.eyebrow) { max-width: 550px; margin: 0 0 19px; color: var(--muted); font: 14px/1.8 var(--sans); }
.text-link { width: fit-content; color: var(--accent); font-size: 13px; font-weight: 600; text-underline-offset: 5px; }
.site-footer { min-height: 100px; display: flex; align-items: center; justify-content: space-between; gap: 25px; border-top: 1px solid var(--line); color: var(--muted); font: 400 10px/1.5 var(--mono); }
.site-footer a { color: var(--ink); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }

/* Article pages use a deliberately narrow measure, like the reference essay. */
.article-main { max-width: 704px; margin: 0 auto; padding: 62px 0 88px; }
.back-link { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font: 500 11px/1.5 var(--mono); text-decoration: none; }
.back-link:hover { color: var(--accent); }
.article-header { padding: 62px 0 38px; border-bottom: 1px solid var(--line); }
.article-header .article-meta { color: var(--accent); font: 500 10px/1.6 var(--mono); letter-spacing: .035em; text-transform: uppercase; }
.article-header h1 { margin: 18px 0 16px; font: 500 clamp(49px, 6.5vw, 77px)/1.04 var(--serif); letter-spacing: -.055em; }
.article-deck { margin: 0 0 22px; color: var(--muted); font: 400 18px/1.65 var(--sans); }
.article-byline { display: flex; flex-wrap: wrap; gap: 9px; color: var(--muted); font: 400 11px/1.6 var(--mono); }
.article-body { padding: 25px 0 50px; font: 400 19px/1.72 var(--serif); }
.article-body p { margin: 24px 0; }
.article-body h2 { margin: 46px 0 16px; font: 500 34px/1.15 var(--serif); letter-spacing: -.035em; }
.article-body h3 { margin: 36px 0 12px; font: 500 27px/1.2 var(--serif); letter-spacing: -.025em; }
.article-body a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.article-body ul, .article-body ol { padding-left: 26px; }
.article-body li { padding-left: 5px; margin: 9px 0; }
.article-body blockquote { margin: 32px 0; padding: 3px 0 3px 22px; border-left: 2px solid var(--accent); color: var(--muted); font-style: italic; }
.article-body blockquote p { margin: 0; }
.article-body pre { overflow-x: auto; padding: 20px 23px; border: 1px solid var(--line); border-radius: 5px; background: var(--code); font: 13px/1.65 var(--mono); }
.article-body code { padding: 2px 4px; border-radius: 3px; background: var(--code); font: .76em/1.5 var(--mono); }
.article-body pre code { padding: 0; background: transparent; font-size: inherit; }
.article-end { border-top: 1px solid var(--line); padding-top: 32px; }
.article-end p { margin: 0 0 25px; color: var(--muted); font: 13px/1.7 var(--sans); }
.next-post { display: block; padding: 25px 0; border-top: 1px solid var(--line); text-decoration: none; }
.next-post .eyebrow { margin-bottom: 7px; }
.next-post strong { font: 500 26px/1.2 var(--serif); letter-spacing: -.025em; }
.next-post:hover strong { color: var(--accent); }
.not-found { padding: 120px 0; }
.not-found h1 { font: 500 48px/1.1 var(--serif); }

@media (max-width: 700px) {
  .site-shell { width: min(100% - 36px, 1080px); }
  .site-header { height: 76px; }
  .site-name { font-size: 26px; }
  .site-nav { gap: 18px; }
  .site-nav a { font-size: 12px; }
  .intro { padding: 85px 0 85px; }
  .intro h1 { font-size: clamp(59px, 13vw, 83px); }
  .intro-copy { font-size: 15px; }
  .writing { padding-bottom: 78px; }
  .archive-controls { align-items: stretch; flex-direction: column; gap: 20px; }
  .search-field { width: 100%; }
  .tag-filters { justify-content: flex-start; }
  .about { grid-template-columns: 1fr; padding: 47px 0 70px; }
  .about .eyebrow, .about h2, .about > p:not(.eyebrow), .about .text-link { grid-column: 1; }
  .about .eyebrow { margin-bottom: 19px; }
  .about h2 { font-size: 35px; }
  .article-main { padding-top: 40px; }
  .article-header { padding-top: 44px; }
  .article-body { font-size: 18px; }
}
@media (max-width: 480px) {
  .post-row { grid-template-columns: 1fr; gap: 5px; padding: 26px 0; }
  .post-row-date { grid-row: 1; text-align: left; }
  .post-row h3 { font-size: 27px; }
  .site-footer { flex-wrap: wrap; justify-content: space-between; padding: 25px 0; min-height: 0; }
  .site-footer span:nth-child(2) { display: none; }
  .article-header h1 { font-size: clamp(47px, 12vw, 64px); }
  .article-deck { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
