:root {
  --paper: #fbfaf7;
  --ink: #16150f;
  --ink-2: #4a4840;
  --ink-3: #7a776c;
  --rule: #dcd8cc;
  --rule-strong: #16150f;
  --accent: #a3271f;
  --link: #16150f;
  --card: #f3f1ea;
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --measure: 40rem;
  --wide: 72rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #13130f;
    --ink: #ecebe4;
    --ink-2: #bdbab0;
    --ink-3: #8c897e;
    --rule: #34332c;
    --rule-strong: #ecebe4;
    --accent: #e57a6b;
    --link: #ecebe4;
    --card: #1c1c17;
  }
}
:root[data-theme="dark"] {
  --paper: #13130f;
  --ink: #ecebe4;
  --ink-2: #bdbab0;
  --ink-3: #8c897e;
  --rule: #34332c;
  --rule-strong: #ecebe4;
  --accent: #e57a6b;
  --link: #ecebe4;
  --card: #1c1c17;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
  overflow-wrap: break-word;
}

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--accent); }

.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-narrow { max-width: calc(var(--measure) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Masthead */
.masthead { border-bottom: 1px solid var(--rule-strong); margin-bottom: 2.5rem; }
.masthead-top {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font: 500 0.75rem/1 var(--sans); letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-3); padding-top: 1rem; padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--rule);
}
.wordmark {
  display: block; text-align: center; text-decoration: none; color: var(--ink);
  font: 600 clamp(3rem, 11vw, 6.5rem)/1 var(--serif); letter-spacing: -0.03em;
  padding: 1.25rem 0 1rem;
}
.wordmark:hover { color: var(--ink); }
.sections {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 0.25rem 1.75rem;
  border-top: 1px solid var(--rule); padding-top: 0.75rem; padding-bottom: 0.75rem;
  font: 500 0.875rem/1.2 var(--sans);
}
.sections a { text-decoration: none; color: var(--ink-2); }
.sections a:hover, .sections a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }

/* Shared type */
.kicker {
  margin: 0 0 0.5rem; font: 600 0.75rem/1.3 var(--sans);
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent);
}
.kicker a { color: inherit; text-decoration: none; }
.headline {
  font: 600 clamp(2rem, 5vw, 3rem)/1.08 var(--serif); letter-spacing: -0.015em;
  margin: 0 0 0.75rem; text-wrap: balance;
}
.headline a { text-decoration: none; }
.headline-xl { font-size: clamp(2.25rem, 6vw, 4rem); }
.dateline { margin: 0; color: var(--ink-3); font-size: 0.875rem; }
.dateline a { color: inherit; }
.section-title {
  font: 600 0.8125rem/1 var(--sans); letter-spacing: 0.1em; text-transform: uppercase;
  border-top: 2px solid var(--rule-strong); padding-top: 0.75rem; margin: 0 0 1.5rem;
}

/* Front page */
.front-top {
  display: grid; gap: 2.5rem; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  padding-bottom: 3rem; border-bottom: 1px solid var(--rule);
}
.lead .dek { font: 400 1.25rem/1.5 var(--serif); color: var(--ink-2); margin: 0 0 1rem; }
.more { font: 600 0.875rem/1 var(--sans); }
.rail { border-left: 1px solid var(--rule); padding-left: 2rem; }
.rail-title { font: 600 0.8125rem/1 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; margin: 0 0 1rem; }
.headlines { list-style: none; margin: 0; padding: 0; }
.headlines li { padding: 0.875rem 0; border-top: 1px solid var(--rule); }
.headlines li:first-child { border-top: 0; padding-top: 0; }
.headlines a { display: block; font: 600 1.125rem/1.25 var(--serif); text-decoration: none; }
.headlines time { display: block; margin-top: 0.25rem; font-size: 0.8125rem; color: var(--ink-3); }

.band { padding: 2.5rem 0 1rem; }
.cards {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 0; grid-template-columns: repeat(3, minmax(0, 1fr));
}
.card { padding: 0 1.5rem 1.75rem; border-left: 1px solid var(--rule); }
.card:nth-child(3n + 1) { border-left: 0; padding-left: 0; }
.card h3 { font: 600 1.375rem/1.2 var(--serif); margin: 0 0 0.5rem; text-wrap: balance; }
.card h3 a { text-decoration: none; }
.card p { margin: 0 0 0.5rem; color: var(--ink-2); font-size: 0.9375rem; }
.card .kicker { color: var(--ink-3); }
.card .meta a { font-size: 0.8125rem; color: var(--accent); }

.years { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem 1.5rem; }
.year { border-top: 1px solid var(--rule); padding-top: 0.75rem; }
.year h3 { margin: 0 0 0.5rem; font: 600 1.75rem/1 var(--serif); display: flex; align-items: baseline; justify-content: space-between; }
.year h3 a { text-decoration: none; }
.year h3 span { font: 400 0.75rem/1 var(--sans); color: var(--ink-3); }
.year ul { list-style: none; margin: 0; padding: 0; }
.year li { margin: 0.5rem 0; font: 400 1rem/1.3 var(--serif); }
.year li a { text-decoration: none; }
.year li a:hover { text-decoration: underline; }

/* Story */
.story-head { margin-bottom: 2rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--rule); }
.prose { font: 400 1.25rem/1.65 var(--serif); }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose table, .prose pre { margin: 0 0 1.25rem; }
.prose h2, .prose h3, .prose h4 { font-family: var(--serif); line-height: 1.2; margin: 2rem 0 0.75rem; }
.prose img { max-width: 100%; height: auto; }
.prose img[align="right"], .prose table[align="right"] { float: right; margin: 0.25rem 0 1rem 1.25rem; max-width: 45%; }
.prose img[align="left"], .prose table[align="left"] { float: left; margin: 0.25rem 1.25rem 1rem 0; max-width: 45%; }
.prose blockquote { border-left: 3px solid var(--rule); margin-left: 0; padding-left: 1.25rem; color: var(--ink-2); }
.prose table { max-width: 100%; border-collapse: collapse; }
.prose table, .prose td, .prose th { background: none !important; }
.prose td, .prose th { padding: 0.25rem; vertical-align: top; }
.prose font { font: inherit; color: inherit; }
.prose [align="center"] { text-align: center; }
.prose iframe, .prose embed, .prose object, .prose video { max-width: 100%; }
.prose pre, .prose code { font-size: 0.875em; }
.prose pre { overflow-x: auto; }
.prose .more-about-this-post {
  float: right; width: 15rem; margin: 0 0 1rem 1.5rem; padding: 1rem;
  background: var(--card); font: 400 0.875rem/1.4 var(--sans);
}
.prose .more-about-this-post ul { margin: 0.5rem 0 0; padding-left: 1rem; }
.prose .story { font-style: normal; }
.prose .storypic { float: right; margin: 0 0 1rem 1.25rem; max-width: 45%; }
.prose::after { content: ""; display: block; clear: both; }

.comments { margin-top: 3rem; border-top: 2px solid var(--rule-strong); padding-top: 1rem; }
.comments h2 { font: 600 0.8125rem/1 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; margin: 0 0 0.5rem; }
.comments .note { color: var(--ink-3); font-size: 0.875rem; margin: 0 0 1.5rem; }
.comments ol { list-style: none; margin: 0; padding: 0; }
.comments li { padding: 1rem 0; border-top: 1px solid var(--rule); font-size: 0.9375rem; color: var(--ink-2); }
.comment-meta { margin: 0 0 0.375rem; font-size: 0.8125rem; color: var(--ink-3); }
.comment-meta strong { color: var(--ink); font-weight: 600; margin-right: 0.5rem; }
.comment-body p { margin: 0 0 0.5rem; }
.comment-body img { max-width: 100%; height: auto; }

.story-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem;
  margin: 3rem 0 0; padding-top: 1.25rem; border-top: 1px solid var(--rule);
}
.story-nav a { text-decoration: none; font: 600 1.0625rem/1.3 var(--serif); }
.story-nav span { display: block; font: 600 0.75rem/1 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 0.375rem; }
.story-nav .next { text-align: right; }

/* Archive */
.year-jump { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; margin: 0 0 2.5rem; font: 500 0.9375rem/1 var(--sans); }
.year-jump a { text-decoration: none; color: var(--ink-2); }
.year-jump a[aria-current="page"] { color: var(--accent); }
.archive-year > h2 { font: 600 2.25rem/1 var(--serif); margin: 2.5rem 0 0.5rem; padding-top: 1rem; border-top: 2px solid var(--rule-strong); }
.archive-year > h2 a { text-decoration: none; }
.archive-month { scroll-margin-top: 1rem; }
.archive-month h3, .archive-month > h2 {
  font: 600 0.75rem/1 var(--sans); letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-3); margin: 1.75rem 0 0.5rem;
}
.archive-month ul { list-style: none; margin: 0; padding: 0; }
.archive-month ul li { display: flex; gap: 1rem; padding: 0.375rem 0; border-top: 1px solid var(--rule); font: 400 1.0625rem/1.35 var(--serif); }
.archive-month ul time { flex: 0 0 1.5rem; color: var(--ink-3); font: 400 0.8125rem/1.7 var(--sans); text-align: right; }
.archive-month ul a { text-decoration: none; }
.archive-month ul a:hover { text-decoration: underline; }
.archive-month:target h3 { color: var(--accent); }
.year-list { list-style: none; margin: 0; padding: 0; }
.year-list li { padding: 1.25rem 0; border-top: 1px solid var(--rule); }
.year-list h3 { font: 600 1.5rem/1.2 var(--serif); margin: 0 0 0.375rem; }
.year-list h3 a { text-decoration: none; }
.year-list p { margin: 0; color: var(--ink-2); }
.year-list .kicker { color: var(--ink-3); margin-bottom: 0.375rem; }

/* 404 search */
.search { display: flex; gap: 0.5rem; margin-top: 1rem; }
.search input[type="search"] {
  flex: 1; min-width: 0; font: inherit; font-family: var(--sans); font-size: 1rem;
  padding: 0.625rem 0.75rem; border: 1px solid var(--rule); background: var(--paper); color: var(--ink);
}
.search button {
  font: 600 0.875rem/1 var(--sans); padding: 0 1rem; border: 0;
  background: var(--ink); color: var(--paper); cursor: pointer;
}

/* Footer */
.colophon {
  margin-top: 4rem; padding-top: 1.5rem; padding-bottom: 3rem; border-top: 1px solid var(--rule-strong);
  font-size: 0.8125rem; color: var(--ink-3);
}
.colophon p { margin: 0 0 0.375rem; }
.colophon a { color: inherit; }

@media (max-width: 900px) {
  .front-top { grid-template-columns: 1fr; }
  .rail { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); padding-top: 1.5rem; }
  .cards { grid-template-columns: 1fr 1fr; }
  .card, .card:nth-child(3n + 1) { border-left: 0; padding: 0 0 1.5rem; }
  .cards { gap: 0 1.5rem; }
  .years { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .cards, .years { grid-template-columns: 1fr; }
  .masthead-top span:last-child { display: none; }
  .prose { font-size: 1.125rem; }
  .prose img[align], .prose table[align], .prose .more-about-this-post, .prose .storypic {
    float: none; max-width: 100%; width: auto; margin: 0 0 1rem;
  }
  .story-nav { grid-template-columns: 1fr; }
  .story-nav .next { text-align: left; }
}
