:root {
  color-scheme: light dark;
  --bg: #f7f4ed;
  --ink: #17191e;
  --muted: #5b6270;
  --rule: #ddd6c6;
  --accent: #b42318;
  --accent-soft: #fbe9e6;
  --focus: #1a56db;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(16px, 4vw, 28px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101216;
    --ink: #ebe8e1;
    --muted: #9aa3b2;
    --rule: #2a2f38;
    --accent: #ff7a6e;
    --accent-soft: #3a1b18;
    --focus: #8ab4ff;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
}
a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
[hidden] { display: none !important; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); }
.skip {
  position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg);
  padding: 8px 12px; z-index: 10;
}
.skip:focus { left: 8px; }

/* Masthead */
.masthead { border-top: 6px solid var(--ink); padding-top: 18px; }
.masthead .top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 24px; }
.wordmark { margin: 0; font: 800 clamp(2.1rem, 6vw, 3.3rem)/1 var(--sans); letter-spacing: -0.045em; }
.wordmark a { text-decoration: none; }
.wordmark .fock { color: var(--accent); }
.status { font-size: 0.82rem; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; }
.status a { text-decoration: none; border-bottom: 1px solid var(--rule); }
.status a:hover { border-bottom-color: currentColor; }
.lede { margin: 12px 0 0; max-width: 62ch; color: var(--muted); font-size: 1rem; }

.views { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 6px; }
.views a {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border: 1px solid var(--rule);
  border-radius: 999px; text-decoration: none; font-size: 0.9rem; font-weight: 600;
}
.views a:hover { border-color: var(--ink); }
.views a[aria-current] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.views a.misuse-view[aria-current] { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.views .count { font-weight: 500; opacity: 0.75; font-variant-numeric: tabular-nums; }

.stale {
  margin: 12px 0 0; padding: 8px 12px; border-radius: 6px; background: var(--accent-soft);
  color: var(--accent); font-size: 0.85rem;
}

/* Mobile pane switch (only with JS and below the two-column breakpoint). Stays on screen while scrolling. */
.tabs {
  display: none; gap: 8px; position: sticky; top: 0; z-index: 5; background: var(--bg);
  padding: 10px 0; border-bottom: 1px solid var(--rule);
}
.tabs button {
  flex: 1; font: inherit; font-weight: 600; font-size: 0.9rem; padding: 9px 12px; border: 1px solid var(--rule);
  background: transparent; color: var(--ink); border-radius: 8px; cursor: pointer;
}
.tabs button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
@media (max-width: 880px) {
  .js .tabs { display: flex; }
  .js .columns[data-pane="new"] .col-pop,
  .js .columns[data-pane="pop"] .col-new { display: none; }
  .js .columns .col + .col { margin-top: 0; }
  .col-head { position: static; }
}

/* Columns */
.columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 8px; }
.col + .col { border-left: 1px solid var(--rule); padding-left: 44px; }
.col:first-child { padding-right: 44px; }
@media (max-width: 880px) {
  .columns { grid-template-columns: minmax(0, 1fr); }
  .col + .col { border-left: 0; padding-left: 0; margin-top: 36px; }
  .col:first-child { padding-right: 0; }
}

.col-head {
  position: sticky; top: 0; z-index: 2; background: var(--bg); min-height: 52px; padding-top: 8px;
  border-bottom: 2px solid var(--ink); display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 6px 12px;
}
.col-head h2 { margin: 0; font: 800 0.85rem/1.2 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; }
.col-note { margin: 8px 0 0; font-size: 0.8rem; color: var(--muted); }
.windows { display: none; gap: 6px; }
.js .windows { display: flex; }
.windows button {
  font: inherit; font-size: 0.78rem; padding: 3px 10px; border: 1px solid var(--rule); background: transparent;
  color: var(--muted); border-radius: 999px; cursor: pointer;
}
.windows button:hover { border-color: var(--ink); color: var(--ink); }
.windows button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* Stories */
.stories { list-style: none; margin: 0; padding: 0; }
.story {
  position: relative; padding: 14px 0 14px 14px; border-bottom: 1px solid var(--rule);
  content-visibility: auto; contain-intrinsic-size: auto 96px;
}
.story.misuse { box-shadow: inset 3px 0 0 var(--accent); }
.story .title {
  font: 600 1.075rem/1.3 var(--serif); text-decoration: none; overflow-wrap: anywhere;
}
.story .title:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.story .title:visited { color: var(--muted); }
.meta {
  margin: 6px 0 0; font-size: 0.8rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px;
  align-items: center;
}
.meta .source { font-weight: 700; color: var(--ink); }
.tag {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.02em; padding: 1px 8px; border-radius: 999px;
  border: 1px solid currentColor; color: var(--accent); white-space: nowrap;
}
.tag.soft { color: var(--muted); font-weight: 600; }
.excerpt { margin: 6px 0 0; font-size: 0.88rem; color: var(--muted); }
.signals, .also { margin: 5px 0 0; font-size: 0.78rem; color: var(--muted); }
.signals { font-variant-numeric: tabular-nums; }
.signals a, .also a { text-decoration: none; border-bottom: 1px solid var(--rule); }
.signals a:hover, .also a:hover { border-bottom-color: currentColor; color: var(--ink); }
.empty { padding: 22px 0; color: var(--muted); font-size: 0.9rem; border-bottom: 1px solid var(--rule); }

.ranked { counter-reset: rank; }
.ranked .story { counter-increment: rank; padding-left: 52px; }
.ranked .story::before {
  content: counter(rank); position: absolute; left: 12px; top: 11px; width: 30px; text-align: right;
  font: 700 1.4rem/1 var(--serif); color: var(--muted); opacity: 0.55; font-variant-numeric: tabular-nums;
}

/* Footer */
.foot { margin-top: 56px; border-top: 1px solid var(--rule); padding: 26px 0 56px; font-size: 0.85rem; color: var(--muted); }
.foot .grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 44px; }
@media (max-width: 880px) { .foot .grid { grid-template-columns: minmax(0, 1fr); } }
.foot p { margin: 0 0 10px; max-width: 70ch; }
.foot strong { color: var(--ink); }
.foot .links { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px 18px; }

/* Phones: a lighter masthead so stories start sooner */
@media (max-width: 600px) {
  .masthead { padding-top: 12px; }
  .lede { font-size: 0.92rem; margin-top: 8px; }
  .views { margin: 12px 0 8px; gap: 6px; }
  .views a { padding: 6px 12px; font-size: 0.85rem; }
  .story .title { font-size: 1.04rem; }
}

/* Listings: archive and topic pages */
.listing { padding-top: 22px; }
.list-title { margin: 0; font: 800 1.5rem/1.2 var(--sans); letter-spacing: -0.02em; }
.list-title .count, .month h3 .count, .chips .count, .topics .count {
  font-weight: 500; opacity: 0.7; font-variant-numeric: tabular-nums; font-size: 0.8em;
}
.list-note { margin: 6px 0 0; color: var(--muted); font-size: 0.9rem; max-width: 70ch; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 8px; }
.chips a {
  display: inline-flex; gap: 6px; align-items: baseline; padding: 5px 12px; border: 1px solid var(--rule);
  border-radius: 999px; text-decoration: none; font-size: 0.82rem; font-weight: 600;
}
.chips a:hover { border-color: var(--ink); }
.chips a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.jump { margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; font-size: 0.85rem; }
.jump .yr { font-weight: 800; }
.jump a { color: var(--muted); text-decoration: none; }
.jump a:hover { color: var(--ink); text-decoration: underline; }
.month { margin-top: 30px; max-width: 840px; }
.month h3 {
  margin: 0; padding-bottom: 8px; border-bottom: 2px solid var(--ink);
  font: 800 0.85rem/1.2 var(--sans); letter-spacing: 0.14em; text-transform: uppercase;
}
.stories.compact .story { padding-top: 10px; padding-bottom: 10px; contain-intrinsic-size: auto 62px; }
.topics { list-style: none; margin: 22px 0 0; padding: 0; max-width: 840px; }
.topics li { padding: 16px 0; border-bottom: 1px solid var(--rule); }
.topics .topic-name { font: 700 1.15rem/1.3 var(--serif); text-decoration: none; }
.topics .topic-name:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.topics .count { color: var(--muted); margin-left: 8px; }
.topics p { margin: 4px 0 0; color: var(--muted); font-size: 0.92rem; }
