/* Writing
   One fluid scale, stepped by the golden ratio (φ = 1.618). The title is the homepage
   size; everything below it is a φ-step down. Spacing uses :where() so it never
   out-ranks component rules. */

:root {
  --text: #1A1714;
  --soft: #6E6860;
  --display: "neue-haas-grotesk-display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --reading: "neue-haas-grotesk-text", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --title: clamp(2.125rem, 4.65vw, 4rem);             /* 34→64px; the homepage size from ~730px up */
  --dek:   calc(var(--title) / 1.618);                /* title ÷ φ                  */
  --body:  clamp(1.0625rem, .98rem + .38vw, 1.25rem); /* 17→20px                    */
  --small: calc(var(--body) / 1.272);                 /* body ÷ √φ                  */
  --measure: 34em;                                    /* ~68 characters a line      */
}

/* ---------- Index ---------- */
.writing-index ol { list-style: none; }
.writing-index li + li { margin-top: .382em; }       /* 1/φ² */
.writing-index a { text-wrap: balance; }
.writing-index .drafts-label { margin-top: 1.618em; color: var(--muted); }
.writing-index .drafts { margin-top: .382em; }
.writing-index .drafts a { color: var(--muted); }
.writing-index .drafts a:hover { color: var(--hot); }

/* ---------- Article ---------- */
main.post { max-width: none; font-size: var(--body); line-height: 1.618; letter-spacing: 0; }
:where(main.post) > * + * { margin-top: 0; }

.post-head .kicker { font-size: var(--small); line-height: 1.4; color: var(--muted); }
.post-head .kicker a { color: var(--ink); }
.post-head .kicker a:hover { color: var(--hot); }
.post-head h1 {
  margin-top: .382em;
  max-width: 14.5em;
  font: 500 var(--title)/1 var(--display);
  letter-spacing: -.018em;
  color: var(--ink);
  text-wrap: balance;
}
.post-head .dek {
  margin-top: .618em;
  max-width: var(--measure);
  font: 400 var(--body)/1.5 var(--reading);
  letter-spacing: 0;
  color: #4A4A4A;
  font-style: italic;
  text-wrap: balance;
}

/* A rule between the title block and the article */
.post-head::after { content: ""; display: block; margin-top: 1.618rem; max-width: var(--measure); height: 2px; background: var(--rule-gradient); filter: blur(.35px); }

/* Body: the Text cut of Neue Haas, set for reading */
.prose {
  margin-top: 2.618rem;                              /* φ² */
  max-width: var(--measure);
  font-family: var(--reading);
  font-weight: 400;
  color: var(--text);
  text-wrap: pretty;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  hanging-punctuation: first;
}
:where(.prose) > * + * { margin-top: 1em; }

/* Headings stay at body size, in bold, set apart by space alone */
.prose :is(h2, h3) { margin-top: 2.618em; font-size: 1em; font-weight: 700; line-height: 1.4; text-wrap: balance; }
.prose h3 { margin-top: 1.618em; }
:where(.prose) :is(h2, h3) + * { margin-top: .382em; }
.prose strong { font-weight: 700; }
.prose a { color: var(--ink); text-decoration: underline 1px; text-underline-offset: .18em; }
.prose a:hover, .prose a:active { color: var(--hot); }
.prose ul { padding-left: 1.1em; }
.prose li + li { margin-top: .382em; }

/* Pull quote: homepage grey at dek size, the page's one moment of drama */
.prose blockquote {
  margin-block: 1.618em;
  max-width: 17em;
  font: 500 var(--dek)/1.12 var(--display);
  letter-spacing: -.012em;
  color: var(--muted);
  text-wrap: balance;
}
:where(.prose) blockquote + * { margin-top: 0; }

/* Media: <figure>, <figure class="wide">, <div class="embed"><iframe …></div> */
.prose figure { margin-block: 1.618em; }
:where(.prose) figure + * { margin-top: 0; }
.prose :is(img, video, svg, canvas) { display: block; width: 100%; height: auto; }
.prose figure.wide { width: min(100vw - 2 * var(--gutter), 64rem); }
.prose figcaption { margin-top: .618em; font-size: var(--small); line-height: 1.45; color: var(--soft); }
.prose .embed { position: relative; aspect-ratio: 16 / 9; background: #000; }
.prose .embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Next article: back up to the homepage scale */
.post .read-next { margin-top: 4.236rem; padding-bottom: 2.618rem; font-family: var(--display); }
.read-next .label, .read-next .all { font-size: var(--small); }
.read-next .label { color: var(--muted); }
.read-next .title {
  margin-top: .25rem;
  max-width: 14.5em;
  font-size: var(--title);
  line-height: 1;
  letter-spacing: -.018em;
  text-wrap: balance;
}
.read-next .all { margin-top: 1.618rem; }

/* ---------- Long-form: contents, code, tables ---------- */
:root { --line: #E2E1DC; --paper: #EBEAE5; --accent: #9c463c; --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }

.prose ol { padding-left: 1.4em; }
.prose ol li + li { margin-top: .382em; }

.prose .toc { margin-bottom: 2.618em; padding-block: 1em; border-block: 1px solid var(--line); font-size: var(--small); }
.prose .toc p { color: var(--soft); }
.prose .toc ol { margin-top: .5em; columns: 2 14em; column-gap: 2em; padding-left: 1.6em; }
.prose .toc li { break-inside: avoid; margin: 0 !important; padding: .12em 0; }
.prose .toc a { text-decoration: none; }

.prose code { font: .86em/1 var(--mono); background: var(--paper); padding: .12em .32em; }
.prose pre { position: relative; white-space: pre-wrap; overflow-wrap: anywhere; padding: 1.1em 4.5em 1.1em 1.25em; background: var(--paper); font: .8em/1.6 var(--mono); tab-size: 2; }
.prose pre code { font: inherit; background: none; padding: 0; }

.prose .table { overflow-x: auto; }
.prose table { width: 100%; border-collapse: collapse; font-size: .9em; line-height: 1.45; }
.prose th, .prose td { padding: .65em 1em .65em 0; text-align: left; vertical-align: top; }
.prose th { font-weight: 700; border-bottom: 1px solid var(--ink); white-space: nowrap; }
.prose td { border-bottom: 1px solid var(--line); }
.prose td:first-child { font-weight: 700; }

/* ---------- Diagrams and charts (plain HTML, so they reflow on phones) ---------- */
.prose .fig-title { font-weight: 700; }
.tag { display: inline-block; font: 700 .68em/1 var(--reading); letter-spacing: .08em; text-transform: uppercase; color: var(--ink); }
.tag.next { color: var(--soft); }
.legend { display: flex; flex-wrap: wrap; gap: .5em 1.5em; margin-top: .8em; font-size: var(--small); color: var(--soft); }
.legend span::before { content: ""; display: inline-block; width: 1.6em; margin-right: .5em; vertical-align: middle; border-top: 2px solid var(--ink); }
.legend .dash::before { border-top-style: dashed; border-color: var(--soft); }

/* Steps: numbered, left to right, wrapping into rows */
.flow { list-style: none; padding: 0 !important; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.4em 1.1em; counter-reset: step; }
.flow li { counter-increment: step; padding-top: .6em; border-top: 2px solid var(--ink); font-size: .9em; line-height: 1.4; margin: 0 !important; }
.flow li.next { border-top: 2px dashed var(--soft); }
.flow li::before { content: counter(step, decimal-leading-zero); display: block; font: 500 1.9em/1 var(--display); letter-spacing: -.02em; color: var(--muted); margin-bottom: .35em; }
.flow b { display: block; }
.flow span { display: block; margin-top: .25em; color: var(--soft); font-size: .92em; }

/* System map: four stages, with services underneath */
.map { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.1em; }
.map .stage { font-size: .88em; line-height: 1.4; }
.map .stage > p:first-child { word-spacing: .18em; font: 500 1.5em/1 var(--display); letter-spacing: -.015em; color: var(--muted); margin-bottom: .45em; }
.map .node { border: 1px solid var(--ink); padding: .7em .8em; margin-top: .55em; }
.map .node.next { border: 1px dashed var(--soft); color: var(--soft); }
.map .node b { display: block; color: var(--ink); }
.map .node span { display: block; color: var(--soft); font-size: .92em; margin-top: .15em; }
@media (max-width: 720px) { .map, .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Source beside result */
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.split > div { background: var(--bg); padding: 1em 1.2em; min-width: 0; }
.split .label { font-size: var(--small); color: var(--soft); margin-bottom: .6em; }
.split pre { margin: 0; padding: 0; background: none; font-size: .78em; }
.split .render { font-size: .82em; line-height: 1.55; }
.split .render h4 { font: 700 1em/1.4 var(--reading); margin-top: 0; }
.split .render p + p, .split .render ul, .split .render blockquote { margin-top: .7em; }
.split .render ul { padding-left: 1.1em; }
.split .render blockquote { font: 500 1.5em/1.12 var(--display); letter-spacing: -.012em; color: var(--muted); max-width: none; margin-block: .7em 0; }
.split .render a { color: var(--ink); text-decoration: underline 1px; text-underline-offset: .18em; }

/* Horizontal bars: label | bar | value */
.bars { display: grid; grid-template-columns: max-content 1fr max-content; gap: .55em .9em; align-items: center; font-size: .86em; line-height: 1.3; }
.bars .bar { height: .95em; background: linear-gradient(90deg, var(--accent) 0 var(--free, 0%), var(--ink) var(--free, 0%) 100%); width: var(--w); min-width: 2px; }
.bars .val { text-align: right; font-variant-numeric: tabular-nums; }
.bars .val.free { color: var(--accent); font-weight: 700; }

/* Vertical columns, e.g. an archive growing month by month */
.columns { display: grid; grid-template-columns: repeat(12, 1fr); gap: .35em; align-items: end; height: 11em; border-bottom: 1px solid var(--ink); }
.columns i { display: block; height: var(--h); background: var(--ink); position: relative; }
.columns i:last-child { background: var(--accent); }
.columns i:last-child::after { content: attr(data-v); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); padding-bottom: .3em; font: 700 .8em/1 var(--reading); color: var(--accent); font-style: normal; }
.axis { display: grid; grid-template-columns: repeat(12, 1fr); gap: .35em; margin-top: .4em; font-size: .72em; color: var(--soft); text-align: center; font-variant-numeric: tabular-nums; }

/* Built vs next */
.status { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.4em 2em; font-size: .92em; line-height: 1.45; }
.status ul { list-style: none; padding: 0 !important; margin-top: .5em; }
.status li { padding-left: 1.3em; position: relative; margin-top: .45em !important; }
.status li::before { content: "●"; position: absolute; left: 0; top: -.05em; }
.status .next li { color: var(--soft); }
.status .next li::before { content: "○"; }

/* Copy button on code blocks (writing.js) */
.prose .copy { position: absolute; top: .7em; right: .7em; padding: .35em .6em; border: 1px solid var(--line); background: var(--bg); font: 500 .78em/1 var(--reading); color: var(--soft); cursor: pointer; }
.prose .copy:hover { color: var(--ink); border-color: var(--ink); }
.split pre { padding-right: 0; }

/* Quotation card: the words in display type, the source below, copyable (writing.js) */
.prose .quote { position: relative; margin-block: 1.618em; padding: 1.1em 0 1em; border-block: 1px solid var(--line); }
.prose .quote blockquote { margin: 0; max-width: 20em; font: 500 max(1.25rem, calc(var(--dek) * .8))/1.2 var(--display); letter-spacing: -.01em; color: var(--ink); }
.prose .quote blockquote p + p { margin-top: 0; }
.prose .quote figcaption { margin-top: .75em; padding-right: 5em; }
.prose .quote .copy { top: auto; bottom: .85em; right: 0; }
:where(.prose) .quote + * { margin-top: 0; }

/* Timeline: period, conversation, what a life is for, the tension */
.timeline { list-style: none; padding: 0 !important; margin-left: 4px; border-left: 1px solid var(--ink); }
.timeline li { position: relative; margin: 0 !important; padding: 0 0 1.2em 1.3em; font-size: .92em; line-height: 1.45; }
.timeline li::before { content: ""; position: absolute; left: -4px; top: .45em; width: 7px; height: 7px; background: var(--ink); border-radius: 50%; }
.timeline .when { display: block; font-size: .84em; color: var(--soft); font-variant-numeric: tabular-nums; }
.timeline b { display: block; }
.timeline .tension { display: block; margin-top: .2em; color: var(--soft); }
.timeline .tension::before { content: "Tension: "; font-weight: 700; color: var(--accent); }

/* Branching diagram: rows of boxes joined by arrows */
.tree { display: grid; gap: .45em; font-size: .88em; line-height: 1.35; text-align: center; }
.tree .row { display: grid; grid-template-columns: repeat(var(--n, 1), minmax(0, 1fr)); gap: .7em; }
.tree .box { border: 1px solid var(--ink); padding: .7em .8em; }
.tree .box.key { background: var(--ink); color: var(--bg); font-weight: 700; }
.tree .box.side { border-style: dashed; color: var(--soft); }
.tree .arrow { color: var(--soft); line-height: 1; }
.tree .loop { color: var(--accent); font-size: .92em; }

/* A step list that loops back to the start */
.flow li.return { border-top: 0; color: var(--accent); }
.flow li.return::before { content: "↺"; color: var(--accent); }

/* ---------- Field Layer: sign + phone mockups, layers, tiers, calculator ---------- */
.scene { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 2.2em; align-items: start; justify-items: center; }

/* Industrial wayfinding sign */
.sign { width: 100%; max-width: 19rem; border: 6px solid var(--ink); background: #fff; font-family: var(--display); color: var(--ink); }
.sign .stripe { height: 1.1rem; background: repeating-linear-gradient(-45deg, #111 0 12px, #f2c230 12px 24px); }
.sign .body { padding: 1rem 1.1rem 1.1rem; }
.sign .where { font: 500 .8rem/1.2 var(--reading); letter-spacing: .08em; text-transform: uppercase; }
.sign .label { margin-top: .2rem; font: 700 2.3rem/.95 var(--display); letter-spacing: -.02em; text-transform: uppercase; }
.sign .qr { display: block; width: 84%; height: auto; margin: 1.4rem auto 0; color: #000; shape-rendering: crispEdges; }
.sign .scan { margin-top: 1.3rem; font: 700 1rem/1.2 var(--reading); text-transform: uppercase; letter-spacing: .02em; }
.sign .url { margin-top: .15rem; font: .8rem/1.2 var(--mono); color: #444; }

/* Phone with a live card */
.phone { width: 100%; max-width: 19rem; border: 10px solid #151515; border-radius: 2.4rem; background: #fff; overflow: hidden; box-shadow: 0 1px 0 #151515; }
.phone .notch { width: 38%; height: 1.2rem; margin: 0 auto; background: #151515; border-radius: 0 0 .8rem .8rem; }
.card { padding: .7rem 1rem 1.2rem; font: 400 .8rem/1.4 var(--reading); color: var(--text); }
.card .proj { font: 700 .72rem/1.3 var(--reading); letter-spacing: .06em; text-transform: uppercase; }
.card .meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; margin-top: .45rem; color: var(--soft); font-size: .72rem; }
.card .pill { background: var(--ink); color: #fff; font-weight: 700; font-size: .66rem; letter-spacing: .08em; padding: .15rem .45rem; }
.card .alert { margin-top: .8rem; padding: .6rem .7rem; border-left: 3px solid var(--accent); background: var(--paper); }
.card .alert b { display: block; color: var(--accent); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; }
.card .play { display: block; margin-top: .55rem; padding: .5rem; border: 1px solid var(--ink); text-align: center; font-weight: 700; }
.card h5 { margin-top: .95rem; font: 700 .68rem/1.3 var(--reading); letter-spacing: .08em; text-transform: uppercase; color: var(--soft); }
.card ul { list-style: none; padding: 0 !important; margin-top: .3rem; }
.card li { margin: 0 !important; padding: .28rem 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: .5rem; }
.card li span { color: var(--soft); }
.card .actions { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; margin-top: .35rem; }
.card .actions span { border: 1px solid var(--line); padding: .4rem .45rem; font-size: .72rem; text-align: center; }
.card .actions span:first-child { background: var(--ink); color: #fff; border-color: var(--ink); }
.card .old { color: var(--soft); text-decoration: line-through; }

/* Stacked system layers */
.layers { display: grid; gap: .35em; font-size: .9em; line-height: 1.35; }
.layers div { display: grid; grid-template-columns: 2.2em 9.5em 1fr; gap: .8em; align-items: baseline; padding: .75em .9em; border: 1px solid var(--ink); }
.layers div:nth-child(1) { background: var(--ink); color: var(--bg); }
.layers i { font: 500 1.4em/1 var(--display); font-style: normal; color: var(--muted); }
.layers b { font-weight: 700; }
.layers span { color: var(--soft); }
.layers div:nth-child(1) span, .layers div:nth-child(1) i { color: #bbb; }
@media (max-width: 560px) { .layers div { grid-template-columns: 2em 1fr; } .layers span { grid-column: 2; } }

/* Roadmap columns */
.roadmap { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 1.4em; font-size: .9em; line-height: 1.4; }
.roadmap > div { border-top: 2px solid var(--ink); padding-top: .6em; }
.roadmap > div:nth-child(2) { border-top-style: dashed; }
.roadmap > div:nth-child(3) { border-top: 2px dotted var(--soft); }
.roadmap p:first-child { font: 500 1.7em/1 var(--display); letter-spacing: -.02em; }
.roadmap p + p { margin-top: .15em; color: var(--soft); }
.roadmap ul { margin-top: .6em; padding-left: 1em !important; }
.roadmap li { margin-top: .2em !important; }

/* Ratings */
.dots { letter-spacing: .12em; color: var(--ink); white-space: nowrap; }
.dots i { font-style: normal; color: var(--line); }

/* Pricing tiers */
.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); font-size: .88em; line-height: 1.45; }
.tiers > div { background: var(--bg); padding: 1.1em 1.1em 1.2em; }
.tiers .t { font-weight: 700; }
.tiers .p { margin-top: .3em; font: 500 1.6em/1.1 var(--display); letter-spacing: -.015em; }
.tiers .for { margin-top: .4em; color: var(--soft); }
.tiers ul { margin-top: .6em; padding-left: 1em !important; }
.tiers li { margin-top: .15em !important; }
.tiers > div.feature { background: var(--ink); color: var(--bg); }
.tiers > div.feature .for { color: #bbb; }

/* ROI calculator */
.calc { border: 1px solid var(--ink); padding: 1.2em; font-size: .9em; }
.calc .inputs { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .9em 1.2em; }
.calc label { display: grid; gap: .3em; font-size: .88em; color: var(--soft); }
.calc input { font: 500 1.35em/1.2 var(--display); color: var(--ink); border: 0; border-bottom: 1px solid var(--ink); padding: .1em 0; width: 100%; background: transparent; border-radius: 0; }
.calc input:focus { outline: none; border-bottom-width: 2px; }
.calc .out { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 1em; margin-top: 1.3em; padding-top: 1em; border-top: 1px solid var(--line); }
.calc .out p { font-size: .85em; color: var(--soft); }
.calc .out b { display: block; font: 500 2em/1 var(--display); letter-spacing: -.02em; color: var(--ink); }
.calc .out div:last-child b { color: var(--accent); }

/* The thesis, set as lines */
.lines { font: 500 var(--dek)/1.15 var(--display); letter-spacing: -.012em; }
.lines p { margin: 0 !important; }
.lines p:nth-child(odd) { color: var(--muted); }

/* ---------- The blog: /writing/, newest first, whole posts (after seths.blog) ---------- */
main.blog { max-width: none; font-size: var(--body); line-height: 1.618; letter-spacing: 0; }
:where(main.blog) > * + * { margin-top: 0; }
.blog-intro > p { max-width: 14.5em; font: 500 var(--title)/1 var(--display); letter-spacing: -.018em; color: var(--muted); text-wrap: balance; }
.blog-intro .subscribe { margin-top: 1.618rem; }
.blog-intro::after { content: ""; display: block; margin-top: 2rem; max-width: var(--measure); height: 2px; background: var(--rule-gradient); filter: blur(.35px); }
.stream { margin-top: 3.2rem; }
.entry { max-width: none; padding-bottom: 3.6rem; }
.entry + .entry { padding-top: 3.6rem; border-top: 1px solid var(--line); }
.entry-date { font-size: var(--small); color: var(--muted-small, var(--soft)); }
.entry-date a { color: inherit; }
.entry-title { margin-top: .382em; max-width: 14.5em; font: 500 var(--title)/1 var(--display); letter-spacing: -.018em; text-wrap: balance; }
.entry-title a { color: var(--ink); }
.entry-dek { margin-top: .618em; font: italic 400 var(--body)/1.5 var(--reading); color: #4A4A4A; text-wrap: balance; }
.entry-body { margin-top: 1.618rem; max-width: var(--measure); }

/* Long posts fold on the index; "Keep reading" opens them in place */
.entry.is-long:not(.open) .entry-body { max-height: 30em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.entry .more { margin-top: 1em; padding: .55em 1.1em; border: 1px solid var(--ink); background: none; color: var(--ink); font: 500 var(--small)/1 var(--reading); cursor: pointer; }
.entry .more:hover { color: var(--hot); border-color: var(--hot); }
.entry.open .more { display: none; }

/* The signature that closes every post */
.sig { display: block; width: clamp(110px, 12vw, 150px); height: auto; margin-top: 2rem; }
.post .sig { margin-top: 2.618rem; }

.entry-foot { display: flex; gap: 1.4em; margin-top: 1.2rem; font-size: var(--small); }
.entry-foot a, .entry-foot button { color: var(--muted-small, var(--soft)); }
.entry-foot button { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.entry-foot a:hover, .entry-foot button:hover { color: var(--hot); }

.older, .newer { font: 500 var(--dek)/1.1 var(--display); letter-spacing: -.012em; }
.older { margin-top: 1rem; padding-bottom: 3rem; }
.newer { margin-top: 2rem; }
.blog .empty { color: var(--muted); }

/* Sign-up */
.subscribe { max-width: 30rem; font-size: var(--small); }
.subscribe .label { color: var(--ink); font-weight: 600; }
.subscribe .row { display: flex; gap: .5em; margin-top: .5em; }
.subscribe input[type=email] { flex: 1; min-width: 0; padding: .7em .8em; border: 1px solid var(--ink); background: #fff; font: 400 1rem/1.2 var(--reading); color: var(--text); border-radius: 0; }
.subscribe button { padding: .7em 1.1em; border: 1px solid var(--ink); background: var(--ink); color: #fff; font: 600 1rem/1.2 var(--reading); cursor: pointer; border-radius: 0; }
.subscribe button:hover { background: var(--hot); border-color: var(--hot); }
.subscribe .note { margin-top: .5em; color: var(--muted-small, var(--soft)); }
.subscribe .note.ok { color: var(--ink); }
.subscribe .trap { position: absolute; left: -9999px; }
.share-post { margin-top: 1.2rem; display: flex; align-items: center; gap: .55rem; color: var(--ink); }
.share-post a, .share-post button { display: block; width: 24px; height: 24px; padding: 0; border: 0; background: none; color: var(--ink); cursor: pointer; }
.share-post svg { display: block; width: 24px; height: 24px; }
.share-post a:hover, .share-post button:hover { color: var(--hot); }
.share-post .share-msg { margin-left: .4rem; font-family: var(--display); font-size: var(--small); color: var(--muted-small); }
.post-subscribe { margin-top: 3.2rem; padding-top: 2rem; border-top: 1px solid var(--line); }

/* Plain lists written as ```list blocks: set, not code */
.prose pre:has(> code.language-list) { background: none; padding: .2em 0 .2em 1.25em; border-left: 2px solid var(--ink); font: 400 .92em/1.75 var(--mono); color: var(--text); }

/* Drafts index */
.drafts-index ol { list-style: none; margin-top: 1.618rem; }
.drafts-index li { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2em .6em; }
.drafts-index li + li { margin-top: .382em; }
.drafts-index li span { font-size: var(--small, 1rem); color: var(--muted); font-family: var(--reading); }
.drafts-index > p:first-child { color: var(--muted); }
.drafts-index > p:first-child code { font-size: .6em; }
.drafts-index .drafts-label { margin-top: 2.618rem; color: var(--muted); }
.drafts-index .published a { color: var(--muted); }

/* After the sign-off: a rule, then songs, further reading and footnotes */
.post .sig.signoff { margin-top: .4rem; }
.prose .cheers { margin-bottom: 0; }
.post-rule { margin: 2.618rem 0 0; max-width: var(--measure); border: 0; height: 2px; background: var(--rule-gradient); filter: blur(.35px); }
.prose.post-notes { margin-top: 2rem; }
.prose figure.plate { max-width: 440px; margin-inline: auto; }
.prose figure.plate figcaption { text-align: center; }
/* "Work with Nick" under every post */
.work-with { margin-top: 3.2rem; padding-top: 2rem; max-width: var(--measure); border-top: 2px solid transparent; border-image: var(--rule-gradient) 1; font-family: var(--reading); line-height: 1.5; color: var(--text); }
.work-with .label { color: var(--ink); font-weight: 600; font-family: var(--display); font-size: var(--small); }
.work-with p + p, .work-with ul + p, .work-with p + ul { margin-top: .8rem; }
.work-with ul { padding-left: 1.2em; }
.work-with li + li { margin-top: .3rem; }
.work-with a { color: var(--ink); text-decoration: underline; text-underline-offset: .18em; }
.work-with a:hover { color: var(--hot); }
.entry .sig.signoff { margin-top: .4rem; }
.entry-body .post-rule { margin-bottom: 2rem; }
.entry-body img.sig { display: block; width: clamp(110px, 12vw, 150px); height: auto; }
.blog-foot { max-width: var(--measure); padding-bottom: 2.618rem; }
/* A figure that hangs straight off the rule under the title (first thing in a post) */
.post-head + .prose > figure.flush-top:first-child, .prose > figure.flush-top:first-child { margin-top: -2.618rem; }
.prose > figure.flush-top:first-child img { display: block; width: 100%; height: auto; }

/* Dragons and Dampers: the field guide, the steps, the playable piano */
.prose figure.dragons dl { margin: 0; border-top: 1px solid var(--line); }
.prose figure.dragons dt { margin-top: 1em; font-weight: 700; }
.prose figure.dragons dd { margin: .25em 0 1em; padding-bottom: 1em; border-bottom: 1px solid var(--line); font-size: var(--small); line-height: 1.5; }
.prose figure.steps ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .4em .2em; counter-reset: s; }
.prose figure.steps li { margin: 0; counter-increment: s; display: inline-flex; align-items: baseline; gap: .35em; }
.prose figure.steps li::before { content: counter(s); font-size: .7em; color: var(--muted); }
.prose figure.steps li + li::after { content: none; }
.prose figure.steps li:not(:last-child)::after { content: "→"; margin-left: .35em; color: var(--muted); }
.prose figure.damper { margin-block: 2.618em; }
.prose figure.damper damper-piano { --damper-accent: var(--ember, #C43A3E); }
.prose figure.share { margin-block: 1.618em; padding-top: 1em; border-top: 1px solid var(--line); }
/* Posts that also have a spread: the "read as" switch, and the dark card in the stream */
.editions { display: inline-flex; align-items: center; gap: 2px; margin: 1em 0 0; padding: 3px; border: 1px solid var(--line); border-radius: 999px; font-size: var(--small); line-height: 1; }
.editions span { padding: 0 .7em 0 .6em; color: var(--muted); }
.editions a { padding: .45em .9em; border-radius: 999px; text-decoration: none; color: var(--muted); }
.editions a[aria-current] { background: var(--ink); color: var(--bg); }
.editions a:not([aria-current]):hover { color: var(--ink); }
.spread-card { display: grid; max-width: calc(var(--measure) + 8em); margin-top: .8rem; background: #0a0a0a; color: #ecebe7; text-decoration: none; border-radius: 4px; overflow: hidden; }
.spread-card img { width: 100%; aspect-ratio: 16 / 8; object-fit: cover; display: block; }
.spread-card span { padding: 0 22px; }
.spread-card .sc-k { margin-top: 18px; font: 400 11px/1 var(--reading); letter-spacing: .08em; text-transform: uppercase; color: #8f8b84; }
.spread-card .sc-t { margin-top: 10px; font: 400 clamp(34px, 6vw, 54px)/.98 "neue-haas-grotesk-display", sans-serif; letter-spacing: -.022em; text-transform: lowercase; }
.spread-card .sc-d { margin-top: 12px; font: 400 17px/1.3 "neue-haas-grotesk-display", sans-serif; color: #8f8b84; text-transform: lowercase; }
.spread-card .sc-cta { margin: 20px 0 22px; font: 400 14px/1 var(--reading); }
.spread-card:hover .sc-cta { text-decoration: underline; }

/* Research notes (/drafts/research/): parts, rules and small headings that posts don't use */
.prose hr { border: 0; height: 1px; background: var(--line); margin-block: 2.618em; max-width: var(--measure); }
:where(.prose) hr + * { margin-top: 0; }
.prose h2.part { font-size: calc(var(--dek) * 1.15); margin-top: 1.618em; padding-top: .8em; border-top: 2px solid var(--text); }
.prose h4 { font: 700 1em/1.4 var(--reading); margin-top: 1.618em; }
.research .prose pre code.language-text { font-size: .74em; line-height: 1.45; }
.research .prose blockquote { font: 400 1em/1.55 var(--reading); color: var(--text); letter-spacing: 0; border-left: 2px solid var(--line); padding-left: 1em; margin-left: 0; max-width: var(--measure); }
.research .prose blockquote p + p { margin-top: .618em; }
.research .prose pre { white-space: pre; overflow-x: auto; overflow-wrap: normal; }

/* ---------- Series (writing/series/*.md): Counterintuitive first ----------
   Scoped to .in-series, so a post without a series looks exactly as before.
   The plate is the series cover in miniature: the wordmark's top line sits on the paper,
   its bottom line breaks into the colour field below. */
.series-plate { position: relative; display: block; max-width: min(calc(var(--measure) * 1.236), 100%); margin-bottom: 2.618rem; }
.series-plate .sp-mark { position: relative; z-index: 2; display: block; width: 100%; height: auto; }
.series-plate .sp-type { font: 700 clamp(3rem, 11vw, 8rem)/.9 var(--display); color: var(--ink); text-transform: uppercase; letter-spacing: -.02em; }
.series-plate .sp-field {
  position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: .382em;
  margin-top: -15.875%;                           /* half the wordmark's height (1600×508): INTUITIVE sits on the field */
  aspect-ratio: 12 / 5;                           /* a letterbox on posts, so the title stays near the fold */
  padding: clamp(16px, 3.2vw, 36px);
  background: var(--field, var(--warm-gradient)) 50% 40% / cover, var(--warm-gradient);
  color: #fff;
  overflow: hidden;
}
.series-plate .sp-field::after {                   /* print grain, so the field reads as paper, not a screen gradient */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .16; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.series-plate .sp-no { position: relative; z-index: 1; font: 500 clamp(2rem, 6vw, 4.236rem)/1 var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.series-plate .sp-line { position: relative; z-index: 1; font: 500 var(--body)/1.3 var(--display); text-wrap: balance; }
.in-series .post-head .kicker .draft { white-space: nowrap; }

/* The landing page: a taller plate, like the poster */
.series-home .series-plate .sp-field { aspect-ratio: 4 / 3; }
.series-home .series-plate { max-width: min(calc(var(--measure) * 1.382), 100%); }
.series-home .post-head .dek { margin-top: 0; font: 500 var(--dek)/1.15 var(--display); font-style: normal; color: var(--ink); letter-spacing: -.01em; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* End of a series post: the rest of the series, then related posts */
.series-nav, .related-posts { max-width: var(--measure); margin-top: 4.236rem; font-family: var(--display); }
.series-nav .label, .related-posts .label { font-size: var(--small); color: var(--muted); }
.series-nav .label a { color: var(--ink); text-decoration: none; font-weight: 600; }
.series-nav ol, .related-posts ul { list-style: none; margin-top: .618em; border-top: 2px solid var(--ink); }
.series-nav li, .related-posts li { display: grid; grid-template-columns: 4.5em 1fr auto; gap: .618em; align-items: baseline; padding: .618em 0; border-bottom: 1px solid #D9D6CF; }
.series-nav li a { display: contents; color: var(--ink); text-decoration: none; }
.series-nav li a:hover .se-t { color: var(--hot); }
.series-nav .se-no { font-size: var(--small); color: var(--muted); font-variant-numeric: tabular-nums; }
.series-nav .se-t { font: 500 calc(var(--body) * 1.272)/1.2 var(--display); color: var(--ink); letter-spacing: -.01em; }
.series-nav [aria-current] .se-t { color: var(--ember); }
.series-nav .se-here { font-size: var(--small); color: var(--muted); }
.series-nav .se-soon .se-t { color: var(--muted); }
.series-nav .se-about { margin-top: .618em; font-size: var(--small); }
.series-nav .se-about a { color: var(--ink); }
.related-posts li { grid-template-columns: 1fr; gap: .2em; }
.related-posts a { font: 500 var(--body)/1.3 var(--display); color: var(--ink); text-decoration: none; }
.related-posts a:hover { color: var(--hot); }
.related-posts span { font-size: var(--small); color: var(--muted); }

/* Notes to the author inside a draft (the build refuses to publish a post that still has one) */
.prose .ci-note { padding: .618em .9em; border-left: 3px solid var(--ember); background: #EBE9E3; font-size: var(--small); color: var(--soft); font-style: italic; }

@media (max-width: 600px) {
  .series-plate { margin-left: calc(var(--gutter) * -1); margin-right: calc(var(--gutter) * -1); max-width: none; }
  .series-plate .sp-mark { width: calc(100% - var(--gutter) * 2); margin-left: var(--gutter); }
  .series-plate .sp-field { margin-top: calc((100% - var(--gutter) * 2) * -.15875); aspect-ratio: 4 / 5; }
  .series-home .series-plate { max-width: none; }
  .series-home .series-plate .sp-field { aspect-ratio: 4 / 5; }
  .series-nav li { grid-template-columns: 1fr; gap: .2em; }
}

/* A post timeline: one line per moment, each opens to its story (<ol class="dt-timeline"><li><details>…) */
.prose .dt-timeline { list-style: none; padding: 0; margin: 1.618em 0; border-left: 2px solid var(--line, #d9d4cc); }
.prose .dt-timeline li { margin: 0; padding: 0 0 0 1.25em; position: relative; }
.prose .dt-timeline li::before { content: ""; position: absolute; left: -7px; top: 1.1em; width: 12px; height: 12px; border-radius: 50%; background: var(--paper, #f4f1ec); border: 2px solid var(--text); }
.prose .dt-timeline details { padding: .5em 0; border-bottom: 1px solid var(--line, #d9d4cc); }
.prose .dt-timeline summary { cursor: pointer; list-style: none; display: grid; grid-template-columns: 1fr auto; column-gap: .75em; font-family: var(--display); font-weight: 500; line-height: 1.3; }
.prose .dt-timeline summary::-webkit-details-marker { display: none; }
.prose .dt-timeline summary::after { content: "+"; grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--soft); font-weight: 400; }
.prose .dt-timeline details[open] summary::after { content: "–"; }
.prose .dt-timeline summary:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.prose .dt-timeline time { grid-column: 1; font-size: var(--small); color: var(--soft); font-variant-numeric: tabular-nums; font-weight: 400; }
.prose .dt-timeline summary > :not(time) { grid-column: 1; }
.prose .dt-timeline details p { margin: .5em 0 .25em; font-size: var(--small); line-height: 1.55; }
.prose .dt-timeline details[open] { padding-bottom: .9em; }

/* Tap any post image to see it full screen */
.prose figure img { cursor: zoom-in; }
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(20, 18, 16, .94); display: flex; align-items: safe center; justify-content: safe center; padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); overflow: auto; cursor: zoom-out; touch-action: pan-x pan-y pinch-zoom; }
.lightbox img { max-width: none; max-height: none; width: auto; height: auto; max-inline-size: 100%; }
.lightbox img.wide { max-inline-size: none; width: 220vw; max-width: 2400px; }
.lightbox button { position: fixed; top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); background: #fff; color: #111; border: 0; border-radius: 999px; padding: .45em .9em; font: 500 .9rem var(--display); cursor: pointer; }

/* Film dialogue, set as a script: <blockquote class="dialogue"><p><b>Name:</b> line</p>… */
.prose blockquote.dialogue { font: 400 1em/1.5 var(--reading); color: var(--text); letter-spacing: 0; max-width: var(--measure); margin: 1.618em 0; padding: 1em 1.25em; border-left: 2px solid var(--line, #d9d4cc); background: rgba(26,23,20,.03); border-radius: 0 10px 10px 0; font-style: normal; }
.prose blockquote.dialogue p { margin: 0 0 .45em; font-size: var(--body); line-height: 1.5; color: var(--text); }
.prose blockquote.dialogue p:last-child { margin-bottom: 0; }
.prose blockquote.dialogue b { font-family: var(--display); font-weight: 600; letter-spacing: .02em; text-transform: uppercase; font-size: .78em; margin-right: .35em; color: var(--soft); }

/* A row of steps with drawn icons: <figure class="dt-flow"><ol><li><svg/><b/><span/></li>… */
.prose figure.dt-flow ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .75rem; counter-reset: step; }
.prose figure.dt-flow li { margin: 0; display: flex; flex-direction: column; align-items: center; text-align: center; gap: .35rem; position: relative; padding: 1rem .5rem; border: 1px solid var(--line, #d9d4cc); border-radius: 14px; background: rgba(255,255,255,.5); counter-increment: step; }
.prose figure.dt-flow li::before { content: counter(step); position: absolute; top: .45rem; left: .6rem; font: 500 .7rem var(--display); color: var(--soft); font-variant-numeric: tabular-nums; }
.prose figure.dt-flow svg { width: 40px; height: 40px; fill: none; stroke: var(--ink, #1A1714); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.prose figure.dt-flow li:first-child svg { stroke: var(--hot, #C43A3E); }
.prose figure.dt-flow b { font: 600 1rem/1.1 var(--display); }
.prose figure.dt-flow span { font-size: .78rem; line-height: 1.35; color: var(--soft); }
@media (max-width: 640px) {
  .prose figure.dt-flow ol { grid-template-columns: 1fr; gap: .5rem; }
  .prose figure.dt-flow li { flex-direction: row; text-align: left; align-items: center; gap: .9rem; padding: .7rem .9rem .7rem 2rem; }
  .prose figure.dt-flow li::before { top: 50%; transform: translateY(-50%); }
  .prose figure.dt-flow svg { width: 32px; height: 32px; flex: none; }
  .prose figure.dt-flow b { min-width: 3.6rem; }
}
