:root {
  color-scheme: light dark;
  --bg: #fbf9f6;
  --surface: #ffffff;
  --ink: #1a1613;
  --muted: #6b625a;
  --line: #e8e1d8;
  --accent: #b4500f;
  --accent-ink: #ffffff;
  --chip: #f4ebe1;
  --head-bg: #0f0d0b;
  --head-ink: #f3ede6;
  --head-muted: #b3a79b;
  --head-line: #2a241f;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #100e0c;
    --surface: #181512;
    --ink: #f1ebe4;
    --muted: #a3978b;
    --line: #2b2520;
    --accent: #ee8a2a;
    --accent-ink: #1a1009;
    --chip: #2a2019;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--sans); }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, p, ol, ul { margin: 0; padding: 0; }
ol, ul { list-style: none; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 10; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 6px; }

/* Masthead */
.masthead { background: var(--head-bg); color: var(--head-ink); }
.masthead-row { display: flex; align-items: center; gap: 16px; padding: 14px 0; }
.brand { display: inline-flex; flex: none; }
.logo { height: 54px; width: auto; display: block; }
.search { margin-left: auto; display: flex; align-items: center; background: #1c1814; border: 1px solid var(--head-line); border-radius: 999px; padding: 0 4px 0 14px; min-width: 0; }
.search input { background: transparent; border: 0; color: var(--head-ink); font: inherit; font-size: 15px; width: 200px; min-width: 0; padding: 8px 0; }
.search input::placeholder { color: var(--head-muted); }
.search input:focus { outline: none; }
.search:focus-within { border-color: #ee8a2a; }
.search button { background: transparent; border: 0; color: var(--head-muted); cursor: pointer; padding: 8px 10px; display: flex; border-radius: 999px; }
.search button:hover { color: #ee8a2a; }
.follow { flex: none; font-size: 14px; font-weight: 600; color: #1a1009; background: #ee8a2a; padding: 8px 14px; border-radius: 999px; }
.follow:hover { color: #1a1009; background: #f7a24d; }
.sections { border-top: 1px solid var(--head-line); }
.sections-row { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.sections-row::-webkit-scrollbar { display: none; }
.sections a { flex: none; padding: 11px 12px; font-size: 14px; font-weight: 600; color: var(--head-muted); border-bottom: 2px solid transparent; }
.sections a:first-child { padding-left: 0; }
.sections a:hover { color: var(--head-ink); }
.sections a[aria-current="page"] { color: var(--head-ink); border-bottom-color: #ee8a2a; }

main { padding: 28px 0 56px; }

/* Shared bits */
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.chip { background: var(--chip); color: var(--accent); font-weight: 700; font-size: 12px; letter-spacing: .02em; padding: 3px 9px; border-radius: 999px; }
.chip:hover { background: var(--accent); color: var(--accent-ink); }

/* Top of the front page */
.top { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 32px; padding-bottom: 28px; margin-bottom: 28px; border-bottom: 1px solid var(--line); }
.lead h2 { font: 700 clamp(28px, 4vw, 42px)/1.14 var(--serif); letter-spacing: -.01em; margin: 12px 0 14px; text-wrap: balance; }
.lead p { font-size: 18px; color: var(--muted); max-width: 60ch; }
.featured { display: grid; align-content: start; }
.featured li { padding: 14px 0; border-top: 1px solid var(--line); }
.featured li:first-child { border-top: 0; padding-top: 0; }
.featured a:not(.chip) { display: block; margin-top: 7px; font: 700 18px/1.3 var(--serif); }

/* Pictures */
.lead-image, .item-image { display: block; overflow: hidden; border-radius: 10px; background: var(--chip); }
.lead-image { margin-bottom: 18px; aspect-ratio: 16 / 9; }
.lead-image img, .item-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.item-image { width: 150px; aspect-ratio: 3 / 2; align-self: start; }
.hero { margin: 0 0 26px; }
.hero img { display: block; width: 100%; height: auto; border-radius: 10px; background: var(--chip); }
.hero figcaption { margin-top: 8px; font-size: 13px; color: var(--muted); }

/* Columns */
.columns { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; align-items: start; }
.side { display: grid; gap: 28px; position: sticky; top: 20px; }
.box h2 { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding-bottom: 10px; border-bottom: 2px solid var(--accent); margin-bottom: 4px; }
.ranked { counter-reset: rank; }
.ranked li { counter-increment: rank; display: grid; grid-template-columns: 30px 1fr; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--line); font: 600 15px/1.35 var(--sans); }
.ranked li::before { content: counter(rank); font: 700 22px/1 var(--serif); color: var(--accent); }
.cats { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 12px; }
.cats a { display: block; border: 1px solid var(--line); background: var(--surface); padding: 6px 12px; border-radius: 999px; font-size: 14px; font-weight: 600; }
.cats a:hover { border-color: var(--accent); }
.related li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.related a { display: block; font: 600 15px/1.35 var(--sans); }
.related time { font-size: 13px; color: var(--muted); }

/* Timeline */
.day { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding-bottom: 10px; border-bottom: 2px solid var(--ink); margin-top: 36px; }
.feed > .day:first-of-type, .fresh + .day { margin-top: 0; }
.item { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 14px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.item.has-image { grid-template-columns: 58px minmax(0, 1fr) 150px; }
.item-time { font: 700 15px/1.6 var(--sans); color: var(--accent); font-variant-numeric: tabular-nums; }
.item h3 { font: 700 21px/1.27 var(--serif); text-wrap: balance; }
.item p { color: var(--muted); margin: 7px 0 10px; }
.fresh { margin-bottom: 20px; }
.fresh a { display: block; text-align: center; background: var(--accent); color: var(--accent-ink); font-weight: 700; padding: 10px; border-radius: 8px; }
.fresh a:hover { color: var(--accent-ink); filter: brightness(1.08); }
.pager { display: flex; justify-content: space-between; padding-top: 24px; font-weight: 700; }
.pager a { border: 1px solid var(--line); background: var(--surface); padding: 10px 16px; border-radius: 8px; }
.pager a:hover { border-color: var(--accent); }

.page-head { margin-bottom: 28px; }
.page-head h1 { font: 700 clamp(28px, 4vw, 38px)/1.15 var(--serif); }
.page-head p { color: var(--muted); margin-top: 6px; }

.empty { text-align: center; padding: 64px 16px; }
.empty h1, .empty h2 { font: 700 26px/1.2 var(--serif); margin-bottom: 8px; }
.empty p { color: var(--muted); }
.button { display: inline-block; margin-top: 18px; background: var(--accent); color: var(--accent-ink); font-weight: 700; padding: 10px 18px; border-radius: 8px; }
.button:hover { color: var(--accent-ink); filter: brightness(1.08); }
.narrow { max-width: 760px; margin-inline: auto; }

/* Article */
.story { max-width: 720px; }
.story.plain { margin-inline: auto; }
.crumbs { display: flex; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.crumbs a:last-child { color: var(--accent); font-weight: 700; }
.story h1 { font: 700 clamp(30px, 4.6vw, 44px)/1.12 var(--serif); letter-spacing: -.01em; text-wrap: balance; }
.spot { font-size: 20px; line-height: 1.45; color: var(--muted); margin-top: 16px; }
.byline { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; color: var(--muted); padding: 14px 0; margin: 20px 0 24px; border-block: 1px solid var(--line); }
.prose { font: 19px/1.7 var(--serif); }
.prose p + p, .prose h2 + p, .prose p + h2 { margin-top: 20px; }
.prose h2 { font: 700 22px/1.25 var(--serif); }
.source { margin-top: 26px; font-size: 15px; color: var(--muted); }
.source a { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.tags a { display: block; border: 1px solid var(--line); background: var(--surface); padding: 5px 12px; border-radius: 999px; font-size: 14px; }
.tags a:hover { border-color: var(--accent); }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 14px; }
.share span { color: var(--muted); margin-right: 4px; }
.share a, .share button { font: inherit; font-weight: 600; color: var(--ink); background: var(--surface); border: 1px solid var(--line); padding: 7px 13px; border-radius: 8px; cursor: pointer; }
.share a:hover, .share button:hover { border-color: var(--accent); color: var(--accent); }
.note { margin-top: 22px; font-size: 13px; color: var(--muted); }

/* Lists inside a story, explainer links, guides, statistics */
.stories { margin-top: 28px; }
.stories h2 { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding-bottom: 10px; border-bottom: 2px solid var(--accent); }
.stories li { padding: 11px 0; border-bottom: 1px solid var(--line); font: 600 16px/1.35 var(--sans); }
.explain { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.explain a { display: inline-block; background: var(--chip); color: var(--accent); font-weight: 700; font-size: 14px; padding: 7px 13px; border-radius: 8px; }
.explain a:hover { background: var(--accent); color: var(--accent-ink); }
.guides { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px 32px; }
.guides li { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line); align-items: start; }
.guides .item-image { width: 120px; }
.guides h2 { font: 700 19px/1.27 var(--serif); }
.guides p { color: var(--muted); font-size: 15px; margin-top: 6px; }
.story.wide { max-width: 900px; }
.story.wide h2 { font: 700 20px/1.3 var(--serif); margin: 30px 0 10px; }
.stats { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.stats th, .stats td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.stats th { color: var(--muted); font-size: 13px; }

/* About and legal pages */
.about { max-width: 760px; margin-inline: auto; }
.about-head { padding-bottom: 26px; margin-bottom: 8px; border-bottom: 2px solid var(--accent); }
.about-head h1 { font: 700 clamp(32px, 5vw, 46px)/1.1 var(--serif); letter-spacing: -.01em; }
.about-head p { font: 21px/1.5 var(--serif); color: var(--muted); margin-top: 16px; text-wrap: pretty; }
.info { padding: 28px 0; border-bottom: 1px solid var(--line); }
.info:last-child { border-bottom: 0; }
.info h2 { font: 700 13px/1.3 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.info p { font-size: 17px; line-height: 1.65; }
.info p + p { margin-top: 12px; }
.info a { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.steps { counter-reset: step; display: grid; gap: 16px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 14px; }
.steps li::before { content: counter(step); grid-row: 1 / span 2; width: 40px; height: 40px; border-radius: 50%; background: var(--chip); color: var(--accent); font: 700 18px/40px var(--serif); text-align: center; }
.steps strong { font-size: 17px; }
.steps span { color: var(--muted); font-size: 16px; line-height: 1.6; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 28px 0 40px; font-size: 14px; color: var(--muted); }
.footer-row { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.footer strong { color: var(--ink); font-size: 16px; }
.footer p { max-width: 52ch; margin-top: 6px; }
.footer nav { display: flex; gap: 18px; flex-wrap: wrap; font-weight: 600; }

@media (max-width: 900px) {
  .top { grid-template-columns: 1fr; gap: 24px; }
  .columns { grid-template-columns: 1fr; gap: 36px; }
  .side { position: static; }
}
@media (max-width: 600px) {
  main { padding-top: 20px; }
  .masthead-row { gap: 10px; padding: 10px 0; }
  .logo { height: 42px; }
  .follow { display: none; }
  .search input { width: 100%; }
  .search { flex: 1; max-width: 220px; }
  .item { grid-template-columns: 46px minmax(0, 1fr); gap: 10px; padding: 16px 0; }
  .item.has-image { grid-template-columns: 46px minmax(0, 1fr) 96px; }
  .item-image { width: 96px; }
  .item.has-image p { display: none; }
  .item h3 { font-size: 19px; }
  .item-time { font-size: 14px; }
  .prose { font-size: 18px; }
  .spot { font-size: 18px; }
}
