/* The Back Catalogue: cool paper, cyanotype ink, one marigold mark for top picks. */
/* Fonts are self-hosted (SIL Open Font License, see fonts/). */
@font-face { font-family: "Literata"; font-style: normal; font-display: swap; font-weight: 200 900; src: url(fonts/literata-latin.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Literata"; font-style: normal; font-display: swap; font-weight: 200 900; src: url(fonts/literata-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Schibsted Grotesk"; font-style: normal; font-display: swap; font-weight: 400 900; src: url(fonts/schibsted-latin.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Schibsted Grotesk"; font-style: normal; font-display: swap; font-weight: 400 900; src: url(fonts/schibsted-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --ink: #1a2130;
  --muted: #5b6477;
  --rule: #d9dde5;
  --accent: #2446a6;
  --accent-soft: #e3e8f6;
  --visited: #6a4c9c;
  --pick: #d39400;
  --bar: #2446a6;
  --bar-dim: #b9c3df;
  --serif: "Literata", "Iowan Old Style", Georgia, serif;
  --sans: "Schibsted Grotesk", "Segoe UI", system-ui, sans-serif;
  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: 1.125rem;
  --step-2: 1.5rem;
  --step-3: 2.25rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #10141c; --surface: #161b25; --ink: #e1e5ed; --muted: #97a0b2; --rule: #283040;
    --accent: #95abff; --accent-soft: #1d2640; --visited: #bca5ea; --pick: #f1b42c; --bar: #95abff; --bar-dim: #3a4566;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #10141c; --surface: #161b25; --ink: #e1e5ed; --muted: #97a0b2; --rule: #283040;
  --accent: #95abff; --accent-soft: #1d2640; --visited: #bca5ea; --pick: #f1b42c; --bar: #95abff; --bar-dim: #3a4566;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 var(--step-0)/1.5 var(--sans);
  font-feature-settings: "kern", "liga";
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 6px 10px; z-index: 9; }
.n { color: var(--muted); font-variant-numeric: tabular-nums; font-size: var(--step--1); font-weight: 400; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* masthead */
.masthead { border-bottom: 1px solid var(--rule); background: var(--surface); }
.mast-row { display: flex; align-items: center; gap: 24px; min-height: 56px; flex-wrap: wrap; }
.brand { font: 650 1.25rem/1 var(--serif); color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.nav { display: flex; gap: 4px 18px; flex-wrap: wrap; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 500; padding: 4px 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current] { color: var(--ink); border-bottom-color: var(--accent); }
.theme { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 4px; }
.theme:hover { color: var(--ink); }

main.wrap { padding-top: 36px; padding-bottom: 48px; min-height: 60vh; }
.foot { border-top: 1px solid var(--rule); padding-top: 18px; padding-bottom: 40px; color: var(--muted); font-size: var(--step--1); }
.foot p { margin: 0 0 6px; max-width: 72ch; }
.foot a { margin-right: 16px; }

/* home intro */
.intro { max-width: 62rem; margin: 12px 0 44px; }
.lede { font: 500 var(--step-3)/1.15 var(--serif); letter-spacing: -0.015em; margin: 0 0 20px; max-width: 24em; font-variation-settings: "opsz" 60; }
.sub-lede { color: var(--muted); max-width: 64ch; margin: 14px 0 0; }
.bigsearch { display: flex; gap: 8px; max-width: 40rem; margin-bottom: 14px; }
.bigsearch input {
  flex: 1; min-width: 0; font: 400 var(--step-1)/1.3 var(--sans); padding: 11px 14px;
  border: 1px solid var(--rule); border-radius: 6px; background: var(--surface); color: var(--ink);
}
.bigsearch input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.bigsearch button { font: 500 var(--step-0) var(--sans); padding: 0 18px; border-radius: 6px; border: 0; background: var(--accent); color: var(--surface); cursor: pointer; }

/* columns */
.cols { display: grid; gap: 40px; }
@media (min-width: 960px) { .cols { grid-template-columns: minmax(0, 1fr) 320px; gap: 56px; } }
.col-side > section + section { margin-top: 36px; }
.sect { font: 650 var(--step-1)/1.3 var(--sans); margin: 0 0 4px; }
.note { color: var(--muted); font-size: var(--step--1); margin: 0 0 16px; max-width: 64ch; }
.narrow { max-width: 760px; }

/* All posts / Top picks (build.py top_toggle): radio buttons, no script */
.rfbar { display: flex; gap: 18px; margin: 0 0 14px; font: 500 var(--step--1)/1.2 var(--sans); }
.rfbar label { cursor: pointer; }
.rf-top { display: none; }
.rf:has(input[value=top]:checked) .rf-all { display: none; }
.rf:has(input[value=top]:checked) .rf-top { display: block; }
.rf.filter:has(input[value=top]:checked) .post:not(.top),
.rf.filter:has(input[value=top]:checked) .day:not(:has(.top)) { display: none; }

/* river */
/* month pages hold up to ~12,000 posts: the browser lays out only the days near the screen (the size is a guess until
   a day has been shown once) */
.day { margin-bottom: 26px; content-visibility: auto; contain-intrinsic-size: auto 900px; }
.dayhead {
  font: 500 var(--step--1)/1 var(--sans); color: var(--muted); margin: 0 0 8px; padding-bottom: 6px;
  border-bottom: 1px solid var(--rule); position: sticky; top: 0; background: var(--bg); padding-top: 8px; z-index: 1;
}
.posts { list-style: none; margin: 0; padding: 0; }
.post { padding: 7px 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
.ptitle { font: 400 1.0625rem/1.4 var(--serif); color: var(--ink); text-decoration: none; max-width: 46em; }
.ptitle:hover { color: var(--accent); text-decoration: underline; }
.ptitle:visited { color: var(--visited); }
.pmeta { font-size: var(--step--1); color: var(--muted); display: inline-flex; gap: 10px; align-items: baseline; }
.pmeta .blog { color: var(--muted); text-decoration: none; }
.pmeta .blog:hover { color: var(--accent); text-decoration: underline; }
.post.more a { font-size: var(--step--1); color: var(--muted); }
.otd .post { display: grid; grid-template-columns: 3.2em 1fr; }
.otd .pmeta { grid-column: 2; }
.yr { font: 500 var(--step--1) var(--sans); color: var(--muted); font-variant-numeric: tabular-nums; }
.morelink a { margin-right: 18px; }

/* the top-pick mark */
.pick { display: inline-block; width: 0.5em; height: 0.5em; border-radius: 50%; background: var(--pick); margin-right: 0.4em; vertical-align: 0.12em; flex: none; }
.title .pick { width: 0.32em; height: 0.32em; vertical-align: 0.3em; }

/* categories sidebar */
.cats { list-style: none; margin: 8px 0 0; padding: 0; }
.cats li { padding: 6px 0; border-bottom: 1px solid var(--rule); }
.cats .cat { font-weight: 500; color: var(--ink); text-decoration: none; display: flex; justify-content: space-between; }
.cats .cat:hover { color: var(--accent); }
.cats .sub { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 3px; font-size: var(--step--1); }
.cats .sub a { color: var(--muted); text-decoration: none; }
.cats .sub a:hover { color: var(--accent); text-decoration: underline; }
.cats .sub .n { margin-left: 3px; }

/* page titles */
.crumbs { font-size: var(--step--1); color: var(--muted); margin: 0 0 6px; }
.crumbs a { color: var(--muted); }
.title { font: 600 var(--step-3)/1.1 var(--serif); letter-spacing: -0.015em; margin: 0 0 10px; font-variation-settings: "opsz" 60; overflow-wrap: anywhere; }
.summary { color: var(--muted); max-width: 70ch; margin: 0 0 18px; }
.summary a { margin-left: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 22px; }
.chip, .tag {
  display: inline-flex; gap: 6px; align-items: baseline; padding: 3px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); text-decoration: none; font-size: var(--step--1); font-weight: 500;
}
.chip:hover, .tag:hover { text-decoration: underline; }
.pager { display: flex; gap: 18px; font-size: var(--step--1); }

/* blog rows */
.grp { font: 650 var(--step-0) var(--sans); margin: 26px 0 4px; }
/* category pages: the folded category's blogs (build.py FOLD_CATEGORY), and its own pages' topic groups */
.fold > summary, .tgrp > summary { cursor: pointer; margin: 26px 0 4px; }
.fold > summary .grp, .tgrp > summary .grp { display: inline; margin: 0; }
.fold { border-top: 1px solid var(--rule); }
.nt { color: var(--muted); font-weight: 400; font-size: var(--step--1); margin-left: 6px; }
.grp:first-child { margin-top: 0; }
.blogs { list-style: none; margin: 0; padding: 0; }
.brow { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px 24px; padding: 11px 0; border-bottom: 1px solid var(--rule); }
@media (min-width: 720px) { .brow { grid-template-columns: minmax(0, 1fr) 200px; } }
.brow .blog { font: 500 var(--step-1)/1.3 var(--serif); color: var(--ink); text-decoration: none; }
.brow .blog:hover { color: var(--accent); text-decoration: underline; }
.host { color: var(--muted); font-size: var(--step--1); margin-left: 8px; overflow-wrap: anywhere; }
.bdesc { margin: 3px 0 0; color: var(--muted); font-size: 0.9375rem; max-width: 62ch; }
.brow-side { display: flex; flex-direction: column; gap: 3px; }
.bmeta { font-size: var(--step--1); color: var(--muted); }

/* the strip: posts per year on a shared axis */
.strip { display: block; color: var(--bar); overflow: visible; }
.strip path { fill: var(--bar); }
.strip .axis { fill: none; stroke: var(--rule); stroke-width: 1; }

/* blog page */
.bloghead { margin-bottom: 18px; }
.visit { margin: 0 0 10px; font-size: var(--step-1); overflow-wrap: anywhere; }
.history { margin: 0 0 22px; padding: 14px 0 0; border-top: 1px solid var(--rule); overflow-x: auto; }
.bars { display: flex; align-items: flex-end; gap: 3px; min-height: 86px; }
.yl { min-height: 1.2em; white-space: nowrap; }
.yb { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; flex: 1 1 0; min-width: 0; max-width: 44px; text-decoration: none; }
.yb .bar { display: block; width: 100%; background: var(--bar); border-radius: 2px 2px 0 0; }
.yb:hover .bar { background: var(--ink); }
.yb.empty .bar { height: 1px !important; background: var(--rule); }
.yl { font-size: 0.6875rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.yb:hover .yl { color: var(--ink); }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 18px; margin: 0 0 30px; font-size: 0.9375rem; max-width: 52rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.facts.wide { grid-template-columns: 11em minmax(0, 1fr); }
.year { margin-bottom: 24px; scroll-margin-top: 12px; }
.yhead { font: 600 var(--step-2)/1.2 var(--serif); margin: 0 0 6px; padding-bottom: 6px; border-bottom: 1px solid var(--rule); }
.mhead { font: 650 var(--step--1) var(--sans); color: var(--muted); margin: 18px 0 4px; }
.plist { list-style: none; margin: 0; padding: 0; max-width: 54rem; }
.plist li { display: grid; grid-template-columns: 4.2em minmax(0, 1fr); gap: 12px; padding: 4px 0; }
.plist time, .plist .nodate { color: var(--muted); font-size: var(--step--1); font-variant-numeric: tabular-nums; padding-top: 0.2em; white-space: nowrap; }
.plist a { font: 400 1rem/1.45 var(--serif); color: var(--ink); text-decoration: none; }
.plist a:hover { color: var(--accent); text-decoration: underline; }
.plist a:visited { color: var(--visited); }
.empty-note { color: var(--muted); max-width: 60ch; }

/* categories index */
.catgrid { display: grid; gap: 8px 40px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.catblock { padding: 14px 0; border-top: 1px solid var(--rule); }
.catblock h2 { font: 600 var(--step-2)/1.2 var(--serif); margin: 0 0 8px; }
.catblock h2 a { color: var(--ink); text-decoration: none; }
.catblock h2 a:hover { color: var(--accent); text-decoration: underline; }
.catblock .chips { margin-bottom: 8px; }
.best { margin: 0; font-size: 0.9375rem; color: var(--muted); }
.best .blog { color: var(--ink); }

/* directory */
.filters { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: flex-end; margin: 0 0 16px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; }
.filters label { display: flex; flex-direction: column; gap: 3px; font-size: var(--step--1); color: var(--muted); }
.filters label.check { flex-direction: row; align-items: center; gap: 6px; color: var(--ink); padding-bottom: 6px; }
.filters input[type=search], .filters select { font: 400 0.9375rem var(--sans); padding: 6px 8px; border: 1px solid var(--rule); border-radius: 4px; background: var(--bg); color: var(--ink); min-width: 11em; }
.count { margin-left: auto; color: var(--muted); font-size: var(--step--1); padding-bottom: 6px; }
.tablewrap { overflow-x: auto; }
.dir { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.dir th { text-align: left; font: 500 var(--step--1) var(--sans); color: var(--muted); padding: 6px 10px 8px; border-bottom: 1px solid var(--ink); white-space: nowrap; vertical-align: bottom; position: relative; }
.dir th button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 0.2em; }
.dir th button[aria-sort] { color: var(--ink); }
.dir th button[aria-sort=ascending]::after { content: " ↑"; }
.dir th button[aria-sort=descending]::after { content: " ↓"; }
.dir td { padding: 7px 10px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.dir .c-name .blog { font: 500 1rem var(--serif); color: var(--ink); text-decoration: none; }
.dir .c-name .blog:hover { color: var(--accent); text-decoration: underline; }
.dir .c-name .host { display: block; margin: 0; }
.dir .c-tag, .dir .c-st { color: var(--muted); white-space: nowrap; }
.dir .c-last { color: var(--muted); }
.dir th.c-hist { min-width: 140px; }
.dir th .axis { position: relative; display: block; height: 1em; margin-top: 2px; width: 128px; }
.dir th .axis span { position: absolute; transform: translateX(-50%); font-size: 0.6875rem; }
.dir tr[hidden] { display: none; }
@media (max-width: 720px) { .dir .c-tag, .dir .c-st, .dir .c-last { display: none; } .bars { gap: 2px; } .filters label:not(.check) { flex: 1 1 40%; } .filters input[type=search], .filters select { min-width: 0; width: 100%; } }

/* month calendar */
.cal { border-collapse: separate; border-spacing: 3px; font-size: var(--step--1); }
.cal th { color: var(--muted); font-weight: 500; padding: 2px 6px; text-align: center; }
.cal th[scope=row] { text-align: right; }
.cal td { width: 3.6em; height: 2.1em; text-align: center; border-radius: 3px; padding: 0; }
.cal td a { display: block; line-height: 2.1em; text-decoration: none; color: inherit; border-radius: 3px; }
.cal td a:hover { outline: 2px solid var(--ink); }
.cal .l0 { background: transparent; }
.cal .l1 { background: color-mix(in srgb, var(--bar) 12%, transparent); }
.cal .l2 { background: color-mix(in srgb, var(--bar) 26%, transparent); }
.cal .l3 { background: color-mix(in srgb, var(--bar) 45%, transparent); }
.cal .l4 { background: color-mix(in srgb, var(--bar) 68%, transparent); color: var(--surface); }
.cal .l5 { background: var(--bar); color: var(--surface); }
.cal .tot { color: var(--muted); padding-left: 10px; width: auto; }

/* feeds, about */
.feedlist { list-style: none; padding: 0; margin: 0 0 24px; }
.feedlist li { padding: 6px 0; border-bottom: 1px solid var(--rule); }
.feedlist.big li { font-size: var(--step-1); }
.feedlist.cols3 { columns: 3 220px; column-gap: 32px; }
.feedlist.cols3 li { break-inside: avoid; }
.prose { max-width: 68ch; }
.prose h2 { font: 650 var(--step-1) var(--sans); margin: 28px 0 6px; }
.prose p { font: 400 1.0625rem/1.65 var(--serif); margin: 0 0 12px; }

/* search */
#sblogs:not(:empty) { margin: 0 0 20px; padding: 10px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
#sblogs .lab, .sres-head { font-size: var(--step--1); color: var(--muted); margin: 0 0 6px; }
#sblogs a { margin-right: 14px; }
.sres .post { flex-direction: column; gap: 1px; }
.sres mark { background: var(--accent-soft); color: inherit; border-radius: 2px; padding: 0 1px; }
.loadmore { font: 500 var(--step-0) var(--sans); padding: 8px 16px; border-radius: 6px; border: 1px solid var(--rule); background: var(--surface); color: var(--ink); cursor: pointer; margin-top: 12px; }

@media (max-width: 600px) {
  :root { --step-3: 1.75rem; }
  .mast-row { gap: 6px 16px; padding: 10px 16px; }
  .nav { order: 3; flex-basis: 100%; gap: 2px 14px; font-size: 0.9375rem; }
  .bigsearch button { padding: 0 12px; }
  /* all blogs: a narrower history strip and long names that wrap, so the table fits without sideways scrolling */
  .dir th, .dir td { padding-left: 6px; padding-right: 6px; }
  .dir th.c-hist { min-width: 0; }
  .dir .strip { width: 84px; height: auto; }
  .dir th .axis { width: 84px; }
  .dir th .axis span:nth-child(2) { display: none; }   /* 2000 and 2020 only: three labels collide at this width */
  .dir .c-name, .dir .c-name .blog { overflow-wrap: anywhere; }
}
@media (max-width: 740px) {
  /* by month: short counts (1.5k, from data-s; a cached page without it keeps its numbers), no yearly total column */
  .cal { border-spacing: 2px; font-size: 0.6875rem; }
  .cal th { padding: 2px 1px; }
  .cal td { width: auto; }
  .cal td a[data-s] { font-size: 0; line-height: 2.1rem; }
  .cal td a[data-s]::after { content: attr(data-s); font-size: 0.625rem; }
  .cal .tot, .cal thead th:last-child { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

/* suggest / remove forms */
.sform { display: grid; gap: 16px; max-width: 36rem; margin-top: 8px; }
.sform label { display: grid; gap: 5px; font-weight: 500; }
.sform .opt { font-weight: 400; color: var(--muted); font-size: var(--step--1); }
.sform input, .sform textarea { font: 400 var(--step-0)/1.4 var(--sans); padding: 9px 11px; border: 1px solid var(--rule); border-radius: 6px; background: var(--surface); color: var(--ink); }
.sform input:focus, .sform textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.sform button { justify-self: start; font: 500 var(--step-0) var(--sans); padding: 10px 18px; border-radius: 6px; border: 0; background: var(--accent); color: var(--surface); cursor: pointer; }
.sform button:disabled { opacity: 0.6; cursor: wait; }
.sform .hp { position: absolute; left: -9999px; }
.formstatus { margin: 0; min-height: 1.5em; color: var(--muted); }
.formstatus.done { color: var(--ink); }
.formstatus.err { color: #b3261e; }
:root[data-theme="dark"] .formstatus.err { color: #ff8a80; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .formstatus.err { color: #ff8a80; } }
