/* zehaojin.com
   Ink on paper, and one red seal.

   Two typefaces: Source Serif 4 for everything that is read (a text cut and a
   display cut), IBM Plex Mono for everything that is measured. No shadows, no
   gradients, no cards. Colour is spent in three places only: the seal in the
   masthead, the mark that ends an essay, and the path of an optimiser.

   Layout is one idea used on every page: a narrow margin column for labels
   and a text column for content, like a book with shoulder notes. */

/* ── Fonts ──────────────────────────────────────────────────────────────── */
@font-face { font-family: "ZJ Serif"; src: url(fonts/serif-text-v1.woff2) format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "ZJ Serif"; src: url(fonts/serif-text-italic-v1.woff2) format("woff2"); font-weight: 400 600; font-style: italic; font-display: swap; }
@font-face { font-family: "ZJ Display"; src: url(fonts/serif-display-v1.woff2) format("woff2"); font-weight: 300 500; font-style: normal; font-display: swap; }
@font-face { font-family: "ZJ Display"; src: url(fonts/serif-display-italic-v1.woff2) format("woff2"); font-weight: 300 500; font-style: italic; font-display: swap; }
@font-face { font-family: "ZJ Mono"; src: url(fonts/mono-v1.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "ZJ Han"; src: url(fonts/han-v1.woff2) format("woff2"); font-weight: 500; unicode-range: U+660A, U+6CFD, U+91D1; font-display: swap; }

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  color-scheme: light;
  --paper: #f5f5f1;
  --paper-2: #ecebe5;
  --ink: #1a1a18;
  --ink-2: #55554f;
  --ink-3: #6e6e67;
  --line: #dcdbd3;
  --line-2: #bdbcb3;
  --seal: #c2351f;

  --serif: "ZJ Serif", "ZJ Han", "Iowan Old Style", "Palatino Linotype", Palatino, "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", Georgia, serif;
  --display: "ZJ Display", "ZJ Serif", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: "ZJ Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --gutter: clamp(1.25rem, 5vw, 3.5rem);
  --margin: 10.5rem;
  --gap: 2.5rem;
  --measure: 41rem;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #141413;
  --paper-2: #1d1d1b;
  --ink: #e9e7e0;
  --ink-2: #a8a69e;
  --ink-3: #8b8981;
  --line: #2c2c29;
  --line-2: #45443f;
  --seal: #e2573c;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #141413;
    --paper-2: #1d1d1b;
    --ink: #e9e7e0;
    --ink-2: #a8a69e;
    --ink-3: #8b8981;
    --line: #2c2c29;
    --line-2: #45443f;
    --seal: #e2573c;
  }
}

/* ── Base ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 2rem; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.125rem/1.55 var(--serif);
  font-variant-numeric: oldstyle-nums proportional-nums;
  font-kerning: normal;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote, table { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
table { border-collapse: collapse; width: 100%; }
::selection { background: color-mix(in srgb, var(--seal) 20%, transparent); }
:focus-visible { outline: 1.5px solid var(--seal); outline-offset: 3px; border-radius: 1px; }

a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; text-decoration-color: var(--line-2); transition: color .12s, text-decoration-color .12s; }
a:hover { color: var(--seal); text-decoration-color: currentColor; }

.wrap { max-width: 78rem; margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: var(--gutter); top: -4rem; background: var(--ink); color: var(--paper); padding: .4rem .8rem; z-index: 10; text-decoration: none; }
.skip:focus { top: .75rem; color: var(--paper); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Small capitals carry every label on the site. */
.sc, .label, .nav a, .fig-n, .links, .more, .chips label, .toc-h, .facts dt, .pager span, .kicker {
  font-variant-caps: all-small-caps;
  font-variant-numeric: lining-nums;
  letter-spacing: .055em;
}
.num, time, .log th, .entry-m, .readout, .spot text, .scale text, .paper-n, .cos {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "zero" 0;
  letter-spacing: 0;
}

/* ── Masthead ───────────────────────────────────────────────────────────── */
.mast { display: flex; align-items: center; gap: 1.5rem; padding-block: 1.6rem; }
.mark { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; font-weight: 500; letter-spacing: .005em; margin-right: auto; }
.mark:hover { color: var(--ink); }
.seal { width: 1.45rem; height: 1.45rem; flex: none; }
.seal rect { fill: var(--seal); }
.seal path { fill: var(--paper); }
.nav { display: flex; gap: clamp(1rem, 3vw, 2rem); font-size: 1.0625rem; }
.nav a { text-decoration: none; color: var(--ink-2); padding-block: .25rem; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current] { color: var(--ink); box-shadow: 0 1px 0 var(--ink); }
.theme { width: 1.75rem; height: 1.75rem; display: grid; place-items: center; color: var(--ink-2); margin-right: -.35rem; }
.theme:hover { color: var(--ink); }
.theme svg { width: 1rem; height: 1rem; }
.no-js .theme { display: none; }

/* ── The two-column row ─────────────────────────────────────────────────── */
.row { display: grid; grid-template-columns: var(--margin) minmax(0, 1fr); column-gap: var(--gap); }
.row > .col { grid-column: 2; min-width: 0; }
.section { border-top: 1px solid var(--line); padding-top: 1.1rem; margin-top: 4.5rem; }
.label { font-size: 1.0625rem; font-weight: 400; color: var(--ink-2); line-height: 1.5rem; padding-top: .12rem; }
.label a { text-decoration: none; }
.label small { display: block; font-size: 1em; color: var(--ink-3); }
.label .han { margin-left: 0; }
.more { margin-top: 1.5rem; font-size: 1.0625rem; }
.more a { text-decoration: none; color: var(--ink-2); }
.more a::after { content: " →"; font-variant-caps: normal; }
.more a:hover { color: var(--seal); }
.measure { max-width: var(--measure); }

/* ── Page titles ────────────────────────────────────────────────────────── */
.page-head { padding-top: clamp(2.5rem, 7vw, 5.5rem); }
.page-head h1, .statement {
  font-family: var(--display);
  font-weight: 370;
  letter-spacing: -.012em;
  line-height: 1.08;
  text-wrap: balance;
  font-variant-numeric: lining-nums;
}
.page-head h1 { font-size: clamp(2.25rem, 1.5rem + 2.6vw, 3.4rem); }
.page-head .lede { margin-top: 1.25rem; }
.lede { font-size: 1.3125rem; line-height: 1.5; color: var(--ink-2); max-width: 38rem; text-wrap: pretty; }
.lede a { color: var(--ink); }
.lede a:hover { color: var(--seal); }
.kicker { font-size: 1.0625rem; color: var(--ink-2); }
.han { font-family: "ZJ Han", "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", serif; font-variant-caps: normal; letter-spacing: .12em; margin-left: .6em; font-size: .9em; font-weight: 500; }

/* ── Home ───────────────────────────────────────────────────────────────── */
.hero { padding-top: clamp(2.5rem, 7vw, 5.25rem); }
/* Leonardo beside the statement, on wide screens only */
.hero-art { display: none; }
@media (min-width: 62rem) {
  .hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 27rem); column-gap: clamp(2rem, 4vw, 4rem); align-items: end; }
  .hero .statement { font-size: clamp(2.5rem, 1rem + 2.7vw, 3.7rem); }
  .hero-art { display: block; }
  .hero-art > a { display: block; }
  .hero-art img { display: block; width: 100%; height: auto; }
  .hero-art figcaption { margin-top: .6rem; font-size: .8125rem; line-height: 1.45; color: var(--ink-3); }
  .hero-art figcaption i { color: var(--ink-2); }
  .hero-art .dot { margin: 0 .45em; }
  .hero-art .num { font-size: .7rem; }
  .hero-drip canvas { display: block; width: 100%; aspect-ratio: 1000 / 640; background: #c9b693; cursor: pointer; }
  .page-head.with-plate.with-art { grid-template-columns: minmax(0, 1fr) minmax(0, 24rem); }
  :root[data-theme="dark"] .hero-art img, :root[data-theme="dark"] .hero-drip canvas { filter: brightness(.88); }
}
@media (min-width: 62rem) and (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero-art img, :root:not([data-theme="light"]) .hero-drip canvas { filter: brightness(.88); } }
.statement { font-size: clamp(2.125rem, 1.05rem + 3.9vw, 4.05rem); max-width: 22ch; margin-top: 1.1rem; }
.hero .lede { margin-top: clamp(1.4rem, 3vw, 2.2rem); }

/* ── Figures ────────────────────────────────────────────────────────────── */
.fig figcaption { font-size: .9375rem; line-height: 1.5; color: var(--ink-2); margin-top: .9rem; text-wrap: pretty; }
.fig-n { color: var(--ink); margin-right: .5em; font-size: 1.0667em; }
.fig svg { overflow: visible; }

/* Fig. 1: the surface */
.fig-surface { margin-top: clamp(2.5rem, 5vw, 3.75rem); }
.plate { border-block: 1px solid var(--ink); position: relative; }
.surface { width: 100%; aspect-ratio: 16 / 7.6; overflow: hidden !important; touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.surface text { pointer-events: none; }
.js .surface { cursor: crosshair; }
.surface:focus { outline: none; }
.surface:focus-visible { outline: 1.5px solid var(--seal); outline-offset: 4px; }
.surface path, .surface circle { fill: none; vector-effect: non-scaling-stroke; }
.surface .c { stroke: var(--line-2); stroke-width: .75px; }
.surface .c.ix { stroke: color-mix(in srgb, var(--ink-3) 70%, var(--line-2)); }
.surface .spot path { stroke: var(--ink-2); stroke-width: 1px; }
.surface .spot text { font-size: 23px; fill: var(--ink-2); }
.surface .spot.g path { stroke: var(--seal); stroke-width: 1.5px; }
.surface .spot.g text { fill: var(--seal); }
.surface .run path { stroke: var(--ink-3); stroke-width: 1.25px; stroke-linejoin: round; stroke-linecap: round; }
.surface .run circle { stroke: var(--ink-3); stroke-width: 1.25px; fill: var(--paper); }
.surface .run .to { fill: var(--ink-3); }
.surface .run.live path, .surface .run.live circle { stroke: var(--seal); }
.surface .run.live path { stroke-width: 1.75px; }
.surface .run.live .to { fill: var(--seal); }
.surface .probe path { stroke: var(--ink); stroke-width: 1px; }
.surface .probe[hidden] { display: none; }   /* the hidden attribute alone does not hide SVG */
.surface-cap { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem 2.5rem; align-items: start; }
.controls { display: flex; flex-wrap: wrap; gap: .35rem 1.6rem; align-items: baseline; justify-content: flex-end; font-size: .9375rem; -webkit-user-select: none; user-select: none; }
.no-js .controls, .no-js .js-only { display: none; }
.seg { display: inline-flex; gap: .9rem; border: 0; padding: 0; margin: 0; }
.seg legend { float: left; padding: 0; margin-right: .9rem; color: var(--ink-3); }
.seg label { cursor: pointer; color: var(--ink-3); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg input:checked + span { color: var(--ink); box-shadow: 0 1px 0 var(--ink); }
.seg input:focus-visible + span { outline: 1.5px solid var(--seal); outline-offset: 3px; }
.seg label:hover span { color: var(--ink); }
.btn { color: var(--ink-3); }
.btn:hover { color: var(--seal); }
.readout { grid-column: 1 / -1; font-size: .78rem; color: var(--ink-3); min-height: 1.2em; white-space: pre-wrap; }

/* Plates: the illustrations that open Research and About */
.page-head.with-plate { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 35rem); column-gap: var(--gap); align-items: end; padding-top: clamp(1.75rem, 4vw, 3rem); }
.plate-fig figcaption { margin-top: .6rem; }
.plate-svg { width: 100%; height: auto; }
.plate-svg path { fill: none; vector-effect: non-scaling-stroke; }
.plate-svg .stipple { stroke: var(--ink-3); stroke-width: 1.6px; stroke-linecap: round; opacity: .7; }
.plate-svg .flow { stroke: var(--ink-2); stroke-width: .55px; stroke-linejoin: round; opacity: .8; }
.plate-svg .ends { stroke: var(--ink); stroke-width: 2.6px; stroke-linecap: round; }
.plate-svg .flow.hero { stroke: var(--seal); stroke-width: 1.4px; opacity: 1; }
.plate-svg .ends.hero { stroke: var(--seal); stroke-width: 5px; }
.plate-svg .axis { stroke: var(--line-2); stroke-width: 1px; }
.plate-svg .band { stroke: var(--ink-3); stroke-width: 1px; stroke-dasharray: 3 4; }
.plate-svg .tick { font: 22px var(--mono); fill: var(--ink-3); }
.plate-svg .lab { font: italic 32px var(--serif); fill: var(--ink-2); }
.plate-svg .sub { font-size: 21px; }

/* Fig. 5: computed drip paintings (colophon) */
.fig-drips { margin-top: clamp(2.5rem, 5vw, 3.75rem); }
.no-js .fig-drips { display: none; }
.drips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.75rem; }
.drip canvas { display: block; width: 100%; aspect-ratio: 1000 / 640; background: #c9b693; }
.drip canvas { transition: opacity .4s; }
.drip:not(.done) canvas { opacity: .55; }
.drip-cap { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-top: .5rem; font-size: .875rem; color: var(--ink-2); }
.drip-t { font-style: italic; }
.drip-cap .num { font-size: .75rem; color: var(--ink-3); }
.fig-drips figcaption { margin-top: 1.25rem; }
.fig-cons { margin-top: clamp(3rem, 6vw, 4.5rem); }
.con canvas { background: #ece6d7; }
.no-js .fig-cons { display: none; }
:root[data-theme="dark"] .drip canvas { filter: brightness(.9); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .drip canvas { filter: brightness(.9); } }

/* ── Papers ─────────────────────────────────────────────────────────────── */
.papers { counter-reset: paper; }
.paper { counter-increment: paper; display: grid; grid-template-columns: minmax(0, 1fr) 13.5rem; column-gap: var(--gap); padding-block: 1.5rem; border-top: 1px solid var(--line); position: relative; }
.paper:first-child { border-top: 0; padding-top: .1rem; }
.paper > * { grid-column: 1; max-width: var(--measure); }
.paper-t { font-size: 1.3125rem; line-height: 1.3; font-weight: 500; text-wrap: balance; letter-spacing: -.003em; font-variant-numeric: lining-nums; }
.paper-t a { text-decoration: none; }
.paper-a { margin-top: .45rem; color: var(--ink-2); font-size: 1.0625rem; }
.paper-a .me { color: var(--ink); font-weight: 600; }
.paper-a sup { line-height: 0; font-size: .75em; }
.paper-g { margin-top: .5rem; max-width: 36rem; text-wrap: pretty; }
.paper-m { margin-top: .6rem; display: flex; flex-wrap: wrap; gap: .1rem 1.4rem; align-items: baseline; font-size: 1.0625rem; }
.venue { font-style: italic; color: var(--ink-2); font-variant-numeric: lining-nums; }
.venue span + span::before { content: " · "; font-style: normal; color: var(--ink-3); }
.links { display: flex; flex-wrap: wrap; gap: .1rem 1rem; }
.links a { text-decoration: none; color: var(--ink-2); }
.links a:hover { color: var(--seal); }
.paper-fig { grid-column: 2; grid-row: 1 / span 4; align-self: start; justify-self: end; width: 100%; }
.paper-fig img { width: 100%; border: 1px solid var(--line); background: #fff; }
/* figures are shown as published; at night they are only dimmed a little, so a white panel does not glare */
:root[data-theme="dark"] .paper-fig img, :root[data-theme="dark"] .portrait { filter: brightness(.9); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .paper-fig img, :root:not([data-theme="light"]) .portrait { filter: brightness(.9); } }
.note { font-size: .9375rem; color: var(--ink-3); margin-top: 1rem; }

/* video drawer under a paper */
.watch { margin-top: .9rem; max-width: 36rem; }
.watch summary { cursor: pointer; list-style: none; color: var(--ink-2); font-size: 1.0625rem; font-variant-caps: all-small-caps; letter-spacing: .055em; }
.watch summary::-webkit-details-marker { display: none; }
.watch summary::before { content: "▸ "; font-variant-caps: normal; color: var(--ink-3); }
.watch[open] summary::before { content: "▾ "; }
.watch summary:hover { color: var(--seal); }
.watch iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 1px solid var(--line); margin-top: .8rem; background: var(--paper-2); }

/* ── Lists: essays, news ────────────────────────────────────────────────── */
.entries { max-width: 46rem; }
.entry { display: grid; grid-template-columns: 4.4rem minmax(0, 1fr) auto; column-gap: 1.25rem; align-items: baseline; padding-block: .8rem; border-top: 1px solid var(--line); }
.entry:first-child { border-top: 0; padding-top: .1rem; }
.entry time { font-size: .78rem; color: var(--ink-3); white-space: nowrap; }
.entries.dated .entry { grid-template-columns: 6.4rem minmax(0, 1fr) auto; }
.entry-t { font-size: 1.1875rem; line-height: 1.35; text-decoration: none; text-wrap: balance; font-variant-numeric: lining-nums; }
.entry-s { grid-column: 2; color: var(--ink-2); font-size: 1rem; line-height: 1.5; margin-top: .25rem; text-wrap: pretty; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.entry-m { grid-column: 3; grid-row: 1; display: inline-flex; align-items: baseline; gap: .7rem; font-size: .78rem; color: var(--ink-3); white-space: nowrap; }
.spark path, .rhythm path { stroke: currentColor; fill: none; }
.spark { align-self: center; color: var(--line-2); }
.spark path { stroke-width: .56; }
.entry:hover .spark, .entry:focus-within .spark { color: var(--ink-2); }

.log th, .log td { text-align: left; vertical-align: baseline; padding-block: .62rem; border-top: 1px solid var(--line); font-weight: 400; }
.log tr:first-child th, .log tr:first-child td { border-top: 0; padding-top: .1rem; }
.log th { width: 6.6rem; font-size: .78rem; color: var(--ink-3); white-space: nowrap; padding-right: 1rem; }
.log td { text-wrap: pretty; }
.log { max-width: 46rem; }
details.earlier { max-width: 46rem; }
details.earlier summary { cursor: pointer; list-style: none; margin-top: 1.2rem; color: var(--ink-2); font-variant-caps: all-small-caps; letter-spacing: .055em; font-size: 1.0625rem; }
details.earlier summary::-webkit-details-marker { display: none; }
details.earlier summary::after { content: " ↓"; font-variant-caps: normal; }
details.earlier[open] summary { display: none; }
details.earlier .log tr:first-child th, details.earlier .log tr:first-child td { border-top: 1px solid var(--line); padding-top: .62rem; }

/* ── Blog index ─────────────────────────────────────────────────────────── */
/* margin | list | map. The map stays in view while the list scrolls. */
.blog-grid { display: grid; grid-template-columns: var(--margin) minmax(0, 35rem) minmax(0, 1fr); column-gap: var(--gap); margin-top: 3.5rem; align-items: start; }
.chips { grid-column: 2; grid-row: 1; display: flex; flex-wrap: wrap; gap: .2rem 1.1rem; font-size: 1.0625rem; margin-bottom: 2.25rem; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips label { cursor: pointer; color: var(--ink-3); }
.chips label:hover { color: var(--ink); }
.chips sup { font-family: var(--mono); font-size: .62rem; font-variant-caps: normal; letter-spacing: 0; margin-left: .2em; color: var(--ink-3); }
.chips input:checked + label { color: var(--ink); box-shadow: 0 1px 0 var(--ink); }
.chips input:focus-visible + label { outline: 1.5px solid var(--seal); outline-offset: 3px; }
.years { grid-column: 1 / 3; grid-row: 2; }
.year { display: grid; grid-template-columns: var(--margin) minmax(0, 1fr); column-gap: var(--gap); border-top: 1px solid var(--line); padding-top: 1.1rem; margin-top: 2.5rem; }
.year:first-child { margin-top: 0; border-top-color: var(--ink); }
.year .label { font-family: var(--mono); font-variant-caps: normal; letter-spacing: 0; font-size: .78rem; color: var(--ink-2); padding-top: .25rem; }
.year .label small { font-size: 1em; }

.fig-map { grid-column: 3; grid-row: 1 / span 2; position: sticky; top: 1.5rem; max-width: 22rem; justify-self: end; width: 100%; }
.map { width: 100%; height: auto; overflow: visible; }
.map .tree path { stroke: var(--line-2); stroke-width: 1px; fill: none; vector-effect: non-scaling-stroke; }
.map .scale path { stroke: var(--ink-3); stroke-width: 1px; fill: none; vector-effect: non-scaling-stroke; }
.map .scale text { font-size: 15.5px; fill: var(--ink-3); }
.map .hit { fill: transparent; }
.map .dot { fill: var(--ink); stroke: var(--paper); stroke-width: 2; transition: fill .12s; }
.map .pt { transition: opacity .15s; }
.map .pt text { font: 500 19.5px var(--serif); fill: var(--ink); opacity: 0; pointer-events: none; font-variant-numeric: lining-nums; }
.map .pt:hover text, .map .pt:focus-visible text { opacity: 1; }
.map .pt:hover .dot, .map .pt:focus-visible .dot { fill: var(--seal); }
.map .pt:focus-visible { outline: none; }
.map a { text-decoration: none; }
.map .outlier .dot { fill: var(--seal); stroke: none; }
.map .outlier text { font-style: italic; font-weight: 400; fill: var(--ink-2); }

/* ── Essay ──────────────────────────────────────────────────────────────── */
.post-head { padding-top: clamp(2.25rem, 6vw, 4.75rem); }
.post-head h1 { font-family: var(--display); font-weight: 380; font-size: clamp(2.05rem, 1.35rem + 2.5vw, 3.2rem); line-height: 1.1; letter-spacing: -.012em; text-wrap: balance; max-width: 22em; font-variant-numeric: lining-nums; }
.dek { margin-top: 1.25rem; font-size: 1.25rem; line-height: 1.5; color: var(--ink-2); max-width: var(--measure); text-wrap: pretty; }
.post-meta { margin-top: 1.35rem; font: 400 .78rem/1.6 var(--mono); color: var(--ink-3); }
.post-meta span + span::before, .post-meta time + span::before { content: "  ·  "; white-space: pre; }
.post-body { margin-top: clamp(2.25rem, 5vw, 3.5rem); border-top: 1px solid var(--ink); padding-top: clamp(1.75rem, 4vw, 2.75rem); }

.toc { position: sticky; top: 2rem; align-self: start; font-size: .9375rem; line-height: 1.4; color: var(--ink-3); max-height: calc(100vh - 4rem); overflow: auto; }
.toc-h { font-size: 1.0625rem; color: var(--ink-2); margin-bottom: .6rem; }
.toc li { margin-top: .45rem; }
.toc li.l3 { padding-left: .9rem; }
.toc a { text-decoration: none; color: inherit; }
.toc a:hover { color: var(--ink); }

.prose { max-width: var(--measure); font-size: 1.25rem; line-height: 1.62; hanging-punctuation: first; }
.prose > * + * { margin-top: 1.15em; }
.prose p { text-wrap: pretty; }
.prose h2 { font-size: 1.45em; line-height: 1.22; font-weight: 600; letter-spacing: -.008em; margin-top: 2.3em; text-wrap: balance; font-variant-numeric: lining-nums; }
.prose h3 { font-size: 1.12em; line-height: 1.3; font-weight: 600; margin-top: 1.9em; text-wrap: balance; }
.prose h2 + *, .prose h3 + * { margin-top: .7em; }
.prose strong { font-weight: 600; }
.prose a { text-decoration-color: var(--ink-3); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose ul { list-style: none; }
.prose ul > li::before { content: "–"; position: absolute; margin-left: -1.3em; color: var(--ink-3); }
.prose ol { list-style: decimal; }
.prose ol > li::marker { font-variant-numeric: lining-nums tabular-nums; color: var(--ink-2); font-size: .9em; }
.prose li + li { margin-top: .45em; }
.prose li > p + p { margin-top: .6em; }
.prose blockquote { border-left: 1px solid var(--ink); padding-left: 1.3em; color: var(--ink-2); font-size: .95em; line-height: 1.6; }
.prose blockquote > * + * { margin-top: .8em; }
.prose blockquote em { color: var(--ink); }
.prose hr { border: 0; height: 1px; margin: 2.6em auto; overflow: visible; text-align: center; color: var(--ink-3); }
.prose hr::after { content: "·  ·  ·"; white-space: pre; display: inline-block; transform: translateY(-.82em); font-size: 1.1em; letter-spacing: .1em; }
.prose code { font: .82em var(--mono); background: var(--paper-2); padding: .1em .32em; border-radius: 2px; }
.prose pre { background: var(--paper-2); padding: 1em 1.15em; overflow-x: auto; font-size: .8em; line-height: 1.55; border-left: 1px solid var(--line-2); }
.prose pre code { background: none; padding: 0; font-size: 1em; }
.prose figure { margin-block: 2.1em; }
.prose figure img { width: auto; max-height: 82vh; margin-inline: auto; background: var(--paper-2); }
.prose figcaption { margin-top: .75em; font-size: .78em; line-height: 1.45; font-style: italic; color: var(--ink-2); text-align: center; text-wrap: balance; }
.prose table { font-size: .88em; font-variant-numeric: lining-nums tabular-nums; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); display: block; overflow-x: auto; }
.prose th, .prose td { padding: .5em .9em .5em 0; text-align: left; vertical-align: top; }
.prose thead th { border-bottom: 1px solid var(--line-2); font-weight: 600; }
.prose sup { font-size: .7em; line-height: 0; font-variant-numeric: lining-nums; }
.prose sup a { text-decoration: none; color: var(--seal); padding-inline: .1em; }
.footnote { margin-top: 3em; padding-top: 1.1em; border-top: 1px solid var(--line); font-size: .82em; line-height: 1.55; color: var(--ink-2); }
.footnote ol { padding-left: 1.3em; }
.footnote-backref { text-decoration: none; font-family: var(--mono); font-size: .85em; }
.qed { display: inline-block; width: .5em; height: .5em; background: var(--seal); margin-left: .5em; vertical-align: .06em; text-decoration: none; transition: transform .15s; }
.qed:hover { transform: scale(1.35); }
.qed-row { text-align: right; line-height: 1; }
:target { scroll-margin-top: 2rem; }

.post-end { margin-top: 4.5rem; border-top: 1px solid var(--ink); padding-top: 1.25rem; }
.fig-rhythm { max-width: var(--measure); }
.rhythm { width: min(100%, calc(var(--n) * 5px)); height: 2.5rem; color: var(--ink-2); }
.rhythm path { stroke-width: .62; }
.facts { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: .1rem 1.25rem; margin-top: 2.25rem; max-width: var(--measure); }
.facts dt { color: var(--ink-3); font-size: 1.0625rem; padding-block: .6rem; border-top: 1px solid var(--line); }
.facts dd { padding-block: .6rem; border-top: 1px solid var(--line); font-size: 1.0625rem; }
.facts dd a { text-decoration: none; }
.facts dd li { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.facts dd li + li { margin-top: .3rem; }
.cos { font-size: .74rem; color: var(--ink-3); white-space: nowrap; }
.words { color: var(--ink-2); font-style: italic; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 2.75rem; max-width: var(--measure); border-top: 1px solid var(--ink); padding-top: 1rem; }
.pager a { text-decoration: none; display: block; text-wrap: balance; line-height: 1.35; }
.pager span { display: block; color: var(--ink-3); font-size: 1.0625rem; margin-bottom: .2rem; }
.pager .next { text-align: right; grid-column: 2; }

/* reading progress: a hairline, pure CSS, where scroll timelines exist */
@supports (animation-timeline: scroll()) {
  .progress { position: fixed; inset: 0 0 auto 0; height: 2px; background: var(--seal); transform-origin: 0 50%; transform: scaleX(0); animation: grow linear both; animation-timeline: scroll(root); z-index: 5; }
  @keyframes grow { to { transform: scaleX(1); } }
}

/* ── Research, about, colophon ──────────────────────────────────────────── */
.threads { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.25rem; max-width: 60rem; }
.thread h3 { font-size: 1.1875rem; font-weight: 500; line-height: 1.3; }
.thread h3 i { font-style: italic; font-weight: 400; color: var(--ink-3); margin-right: .55em; font-variant-numeric: lining-nums; }
.thread p { margin-top: .45rem; color: var(--ink-2); font-size: 1.0625rem; text-wrap: pretty; }

.bio { display: grid; grid-template-columns: minmax(0, var(--measure)) auto; gap: var(--gap); align-items: start; }
.bio-text > p + p { margin-top: 1em; }
.bio-text { font-size: 1.1875rem; line-height: 1.6; text-wrap: pretty; }
.bio-text strong { font-weight: 600; }
.portrait { width: 8.75rem; aspect-ratio: 1; object-fit: cover; filter: saturate(.92) contrast(1.02); border: 1px solid var(--line); }
.epigraph { max-width: 30rem; margin-top: 1.5rem; }
.epigraph p { font-family: var(--display); font-size: clamp(1.5rem, 1.15rem + 1.1vw, 1.9rem); line-height: 1.25; color: var(--ink-2); font-style: italic; font-weight: 370; text-wrap: balance; letter-spacing: -.005em; }
.epigraph footer { margin-top: .9rem; font-size: 1rem; color: var(--ink-2); }

.items { max-width: 46rem; }
.item { padding-block: 1.15rem; border-top: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 1.5rem; align-items: baseline; }
.item:first-child { border-top: 0; padding-top: .1rem; }
.item h3 { font-size: 1.1875rem; font-weight: 500; line-height: 1.35; }
.item h3 a { text-decoration: none; }
.item .when { font: .78rem var(--mono); color: var(--ink-3); white-space: nowrap; }
.item .sub { grid-column: 1 / -1; color: var(--ink-2); font-size: 1.0625rem; margin-top: .1rem; }
.item ul { grid-column: 1 / -1; margin-top: .65rem; padding-left: 1.15rem; font-size: 1.0625rem; line-height: 1.55; }
.item ul li { position: relative; text-wrap: pretty; }
.item ul li::before { content: "–"; position: absolute; left: -1.15rem; color: var(--ink-3); }
.item ul li + li { margin-top: .4rem; }
.plain { max-width: 46rem; }
.plain li + li { margin-top: .4rem; }
.contact { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: .35rem 1rem; max-width: 46rem; }
.contact dt { color: var(--ink-3); font-variant-caps: all-small-caps; letter-spacing: .055em; }

.colophon .prose { font-size: 1.1875rem; }
.colophon .prose h2 { font-size: 1.3em; margin-top: 2em; }

/* ── 404 ────────────────────────────────────────────────────────────────── */
.lost { padding-block: clamp(3rem, 12vw, 9rem); }
.lost h1 { font-family: var(--display); font-weight: 370; font-size: clamp(2.4rem, 1.4rem + 4vw, 4.2rem); line-height: 1.05; letter-spacing: -.015em; }
.lost .lede { margin-top: 1.5rem; }
.lost code { font: .86em var(--mono); background: var(--paper-2); padding: .1em .35em; overflow-wrap: anywhere; }
.nn { margin-top: 2.5rem; max-width: 40rem; }
.nn h2 { font-size: 1.0625rem; font-weight: 400; color: var(--ink-2); font-variant-caps: all-small-caps; letter-spacing: .055em; border-bottom: 1px solid var(--ink); padding-bottom: .4rem; }
.nn li { display: flex; justify-content: space-between; gap: 1rem; padding-block: .6rem; border-bottom: 1px solid var(--line); align-items: baseline; }
.nn a { text-decoration: none; }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.foot { margin-top: clamp(5rem, 12vw, 9rem); padding-bottom: 3rem; }
.foot-in { border-top: 1px solid var(--ink); padding-top: 1.25rem; display: grid; grid-template-columns: var(--margin) minmax(0, 1fr) auto; column-gap: var(--gap); row-gap: 1.5rem; font-size: 1rem; color: var(--ink-2); }
.foot p { max-width: 30rem; text-wrap: pretty; }
.foot .links { font-size: 1.0625rem; align-content: start; }
.foot .zhat { font-style: italic; color: var(--ink); }
.foot-meta { grid-column: 2 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; font: .74rem/1.6 var(--mono); color: var(--ink-3); }
.foot-meta a { text-decoration: none; }
.rew { opacity: .55; padding: 0 .3em; }
.rew svg { display: inline-block; vertical-align: -.02em; }
.rew:hover { opacity: 1; }

/* ── Motion: almost none ────────────────────────────────────────────────── */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .16s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

/* ── Narrower screens ───────────────────────────────────────────────────── */
@media (max-width: 68rem) {
  /* no room beside the list: the list comes first, the map closes the page */
  .blog-grid { grid-template-columns: var(--margin) minmax(0, 1fr); }
  .years { grid-column: 1 / -1; }
  .fig-map { grid-column: 2; grid-row: 3; position: static; justify-self: start; margin-top: 4rem; }
  .paper { grid-template-columns: minmax(0, 1fr); }
  .paper-fig { grid-column: 1; grid-row: auto; justify-self: start; width: min(100%, 17rem); margin-top: 1rem; }
}
@media (max-width: 62rem) {
  :root { --margin: 8rem; --gap: 1.75rem; }
  .page-head.with-plate { grid-template-columns: minmax(0, 1fr); row-gap: 2.5rem; }
  .plate-fig { max-width: 38rem; }
  .bio { grid-template-columns: minmax(0, 1fr); }
  .portrait { grid-row: 1; width: 7rem; }
}
@media (max-width: 46rem) {
  body { font-size: 1.0625rem; }
  .row, .blog-grid, .year { grid-template-columns: minmax(0, 1fr); }
  .row > .col, .blog-grid > * { grid-column: 1; }
  .year .label { margin-bottom: .6rem; }
  .section { margin-top: 3.25rem; }
  .label { margin-bottom: 1rem; }
  .label small, .label .han { display: inline; margin-left: .6em; }
  .mast { padding-block: 1.1rem; gap: 1rem; }
  .mark span { display: none; }
  .surface { aspect-ratio: 4 / 3; }
  .surface .spot text { font-size: 44px; }
  .plate-svg .tick { font-size: 34px; }
  .plate-svg .lab { font-size: 42px; }
  .plate-svg .sub { font-size: 28px; }
  .surface .spot:not(.g) text { display: none; }
  .surface-cap { grid-template-columns: minmax(0, 1fr); }
  .controls { justify-content: flex-start; }
  .threads { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .drips { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
  .entry { grid-template-columns: minmax(0, 1fr) auto; column-gap: 1rem; }
  .entry time { grid-column: 1; grid-row: 1; margin-bottom: .1rem; }
  .entry-t { grid-column: 1 / -1; grid-row: 2; }
  .entry-s { grid-column: 1 / -1; grid-row: 3; }
  .entry-m { grid-column: 2; grid-row: 1; }
  .spark { display: none; }
  .log th { width: 5.4rem; }
  .prose { font-size: 1.125rem; line-height: 1.62; }
  .dek { font-size: 1.125rem; }
  .toc { display: none; }
  .post-end { margin-top: 3.5rem; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .facts dd { border-top: 0; padding-top: 0; }
  .foot-in { grid-template-columns: minmax(0, 1fr); }
  .foot-meta { grid-column: 1; }
  .contact { grid-template-columns: 6.5rem minmax(0, 1fr); }
}

@media print {
  .mast nav, .theme, .foot, .controls, .progress, .pager, .chips { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .row { display: block; }
  a { text-decoration: none; }
}
