/* Slow Web — antjanus.com redesign 052
   One column, one idea per stanza, a spacing beat everything snaps to, and pages that end. */

:root {
  /* primitives */
  --sand-50: #f5f1e8;
  --sand-100: #ece6d9;
  --sand-200: #ddd5c4;
  --sand-300: #c9bfab;
  --stone-500: #6a655b;
  --stone-700: #48453f;
  --stone-900: #23221f;
  --slate-600: #364f6a;
  --slate-700: #2a3f54;
  --slate-200: #cdd7e2;
  --night-900: #1a1a18;
  --night-800: #22221f;
  --night-700: #2d2c28;
  --night-600: #3b3a35;
  --moon-50: #ebe6db;
  --moon-200: #c8c1b3;
  --moon-400: #a19a8d;
  --mist-300: #a9bfd6;
  --mist-200: #c9d7e5;
  --moss-600: #4d6147;
  --moss-300: #a9bb9f;

  /* semantic: day */
  --bg: var(--sand-50);
  --bg-inset: var(--sand-100);
  --bg-raised: #fbf9f4;
  --text: var(--stone-900);
  --text-2: var(--stone-700);
  --text-3: var(--stone-500);
  --rule: var(--sand-200);
  --rule-strong: var(--sand-300);
  --accent: var(--slate-600);
  --accent-hover: var(--slate-700);
  --accent-wash: #e3e6e6;
  --on-accent: #f7f5f0;
  --leaf: var(--moss-600);
  --code-bg: #efe9dc;
  --focus: var(--slate-600);

  /* type */
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --fs-body: 1.1875rem;      /* 19px */
  --fs-prose: 1.25rem;       /* 20px article prose */
  --fs-small: 1rem;          /* 16px — never smaller for reading text */
  --fs-label: 0.875rem;      /* 14px — labels only */
  --fs-lede: 1.5rem;
  --fs-h3: 1.5rem;
  --fs-h2: 2.125rem;
  --fs-h1: clamp(2.5rem, 1.6rem + 3.6vw, 4.5rem);

  /* rhythm: one beat = one line of body text */
  --beat: 1.9rem;
  --measure: 36rem;
  --wide: 50rem;
  --label-col: 11rem;

  --ease: cubic-bezier(.2, .6, .2, 1);
  --slow: 420ms;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: var(--night-900);
    --bg-inset: var(--night-800);
    --bg-raised: var(--night-800);
    --text: var(--moon-50);
    --text-2: var(--moon-200);
    --text-3: var(--moon-400);
    --rule: var(--night-600);
    --rule-strong: #4b4943;
    --accent: var(--mist-300);
    --accent-hover: var(--mist-200);
    --accent-wash: #262b30;
    --on-accent: #16181a;
    --leaf: var(--moss-300);
    --code-bg: #232220;
    --focus: var(--mist-300);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: var(--night-900);
  --bg-inset: var(--night-800);
  --bg-raised: var(--night-800);
  --text: var(--moon-50);
  --text-2: var(--moon-200);
  --text-3: var(--moon-400);
  --rule: var(--night-600);
  --rule-strong: #4b4943;
  --accent: var(--mist-300);
  --accent-hover: var(--mist-200);
  --accent-wash: #262b30;
  --on-accent: #16181a;
  --leaf: var(--moss-300);
  --code-bg: #232220;
  --focus: var(--mist-300);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--bg);
  /* optional grain; page is complete without it */
  background-image: url("assets/paper-grain.png");
  background-size: 480px 480px;
  color: var(--text);
  font-family: var(--serif);
  font-size: var(--fs-body);
  line-height: var(--beat);
  font-optical-sizing: auto;
  overflow-x: hidden;
  transition: background-color var(--slow) var(--ease), color var(--slow) var(--ease);
}
:root[data-theme="dark"] body { background-blend-mode: soft-light; }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { color: var(--accent-hover); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--accent); color: var(--on-accent); }

h1, h2, h3, h4 { font-weight: 400; color: var(--text); margin: 0; text-wrap: balance; }
h1 { font-size: var(--fs-h1); line-height: 1.08; letter-spacing: -0.02em; }
h2 { font-size: var(--fs-h2); line-height: calc(var(--beat) * 1.5); letter-spacing: -0.01em; }
h3 { font-size: var(--fs-h3); line-height: var(--beat); }
p { margin: 0 0 var(--beat); text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--on-accent); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; top: 1rem; }

.label {
  font-family: var(--mono);
  font-size: var(--fs-label);
  line-height: 1.4;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 400;
}
.muted { color: var(--text-2); }
.quiet { color: var(--text-3); }
.num { font-variant-numeric: oldstyle-nums proportional-nums; }

/* ---------- chrome ---------- */
.site-head {
  max-width: 72rem;
  margin: 0 auto;
  padding: calc(var(--beat) * 1.25) 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.mark { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--text); }
.mark:hover { color: var(--text); }
.mark svg { width: 2.25rem; height: 2.25rem; flex: none; }
.mark-name { font-size: 1.25rem; line-height: 1.2; font-style: italic; }
.mark-name small { display: block; font-style: normal; font-family: var(--mono); font-size: var(--fs-label); letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }

.nav { display: flex; align-items: center; gap: .25rem; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem; }
.nav a {
  display: inline-block;
  padding: .55rem .75rem;
  min-height: 44px;
  color: var(--text-2);
  text-decoration: none;
  font-size: 1.0625rem;
  border-radius: 999px;
  transition: color 150ms, background-color 150ms;
}
.nav a:hover { color: var(--text); background: var(--bg-inset); }
.nav a[aria-current="page"] { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: .35em; }

.theme-toggle {
  font: inherit;
  font-size: 1rem;
  color: var(--text-2);
  background: transparent;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  min-height: 44px;
  padding: 0 1rem 0 .75rem;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  cursor: pointer;
  margin-left: .75rem;
  transition: border-color 150ms, color 150ms;
}
.theme-toggle:hover { color: var(--text); border-color: var(--text-3); }
.theme-toggle svg { width: 1.1rem; height: 1.1rem; }
.theme-toggle .when-dark { display: none; }
:root[data-theme="dark"] .theme-toggle .when-dark { display: inline; }
:root[data-theme="dark"] .theme-toggle .when-light { display: none; }

@media (max-width: 760px) {
  .site-head { flex-wrap: wrap; padding: var(--beat) 1rem calc(var(--beat) * .5); }
  .nav { width: 100%; order: 3; justify-content: space-between; flex-wrap: wrap; }
  .nav ul { gap: 0; margin-left: -.75rem; }
  .nav a { padding: .55rem .6rem; }
  .theme-toggle { position: absolute; top: calc(var(--beat) * .9); right: 1rem; margin: 0; }
  .site-head { position: relative; }
  .theme-toggle .tt-text { display: none; }
  .theme-toggle { padding: 0 .75rem; }
}

main { display: block; }

/* ---------- stanza: the unit of every page ---------- */
.stanza {
  display: grid;
  grid-template-columns: var(--label-col) minmax(0, var(--measure));
  column-gap: 4rem;
  justify-content: center;
  padding: calc(var(--beat) * 3) 1.5rem;
  max-width: 72rem;
  margin: 0 auto;
}
.stanza.wide { grid-template-columns: var(--label-col) minmax(0, var(--wide)); }
.stanza > .aside { padding-top: .45rem; }
.stanza > .aside .label { display: block; }
.stanza > .aside .count { display: block; margin-top: .5rem; color: var(--text-3); font-size: var(--fs-small); font-style: italic; }
.stanza + .stanza { border-top: 1px solid var(--rule); }
.stanza.tall { min-height: 70vh; align-content: center; }

@media (max-width: 900px) {
  .stanza, .stanza.wide { grid-template-columns: minmax(0, 1fr); padding: calc(var(--beat) * 2) 1rem; max-width: calc(var(--measure) + 2rem); }
  .stanza.wide { max-width: calc(var(--wide) + 2rem); }
  .stanza > .aside { padding: 0 0 calc(var(--beat) * .75); display: flex; gap: 1rem; align-items: baseline; flex-wrap: wrap; }
  .stanza > .aside .count { margin: 0; }
  .stanza.tall { min-height: 0; }
}

.lede { font-size: var(--fs-lede); line-height: calc(var(--beat) * 1.25); color: var(--text-2); }
.page-title { margin-bottom: var(--beat); }
.page-intro .lede { max-width: 32ch; }

/* rest mark (fermata): a held pause between stanzas */
.rest {
  display: flex; justify-content: center; align-items: center;
  padding: calc(var(--beat) * 1.5) 0;
  color: var(--text-3);
}
.rest svg { width: 3rem; height: 1.6rem; }
.rest + .stanza { border-top: 0; }

/* ---------- buttons & links ---------- */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.75rem; margin-top: calc(var(--beat) * 1.25); }
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  min-height: 48px;
  padding: 0 1.4rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-size: 1.0625rem;
  text-decoration: none;
  border: 1px solid var(--accent);
  cursor: pointer;
  transition: background-color 150ms, border-color 150ms;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--rule-strong); }
.btn.ghost:hover { border-color: var(--text-3); background: var(--bg-inset); color: var(--text); }
.link-underline { color: var(--text); text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.link-quiet { color: var(--text-3); text-decoration: none; }
.link-quiet:hover { color: var(--text); text-decoration: underline; }
.arrow::after { content: " \2192"; }

/* ---------- home ---------- */
.greeting { font-style: italic; color: var(--text-3); margin-bottom: calc(var(--beat) * .75); font-size: 1.25rem; }
.hero {
  max-width: 72rem; margin: 0 auto;
  padding: calc(var(--beat) * 3) 1.5rem calc(var(--beat) * 4);
  display: grid;
  grid-template-columns: minmax(0, 17rem) minmax(0, 40rem);
  gap: 5rem;
  justify-content: center;
  align-items: end;
  min-height: min(82vh, 52rem);
}
.hero h1 { margin-bottom: var(--beat); }
.hero .sub { font-size: 1.375rem; line-height: calc(var(--beat) * 1.15); color: var(--text-2); max-width: 34ch; }
.portrait {
  margin: 0;
  border-radius: 999px 999px 0.75rem 0.75rem;
  overflow: hidden;
  background: linear-gradient(180deg, var(--bg-inset), var(--rule));
  aspect-ratio: 3 / 4;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 22% 30%; filter: saturate(.8) contrast(1.02); }
.portrait-cap { margin-top: .75rem; font-size: var(--fs-small); color: var(--text-3); font-style: italic; }
.stat-line { margin-top: var(--beat); color: var(--text-2); font-size: 1.125rem; }
.stat-line strong { color: var(--text); font-weight: 500; }
@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: calc(var(--beat) * 1.5); min-height: 0; padding: calc(var(--beat) * 1.5) 1rem calc(var(--beat) * 2.5); max-width: 40rem; }
  .hero .portrait-wrap { max-width: 12rem; }
}

.one-thing { display: grid; gap: var(--beat); }
.one-thing .plate { margin: 0; border-radius: .75rem; overflow: hidden; background: var(--bg-inset); aspect-ratio: 16 / 9; }
.one-thing .plate img { width: 100%; height: 100%; object-fit: cover; }
.one-thing h2 a { color: var(--text); text-decoration: none; }
.one-thing h2 a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.meta-line { font-size: var(--fs-small); color: var(--text-3); margin-bottom: calc(var(--beat) * .5); }

/* quiet list: the replacement for every card grid */
.quiet-list { list-style: none; margin: 0; padding: 0; }
.quiet-list > li { padding: var(--beat) 0; border-top: 1px solid var(--rule); }
.quiet-list > li:first-child { border-top: 0; padding-top: 0; }
.quiet-list > li:last-child { padding-bottom: 0; }
.quiet-list h3 { font-size: 1.4375rem; line-height: calc(var(--beat) * 1.05); margin-bottom: calc(var(--beat) * .35); }
.quiet-list h3 a { color: var(--text); text-decoration: none; }
.quiet-list h3 a:hover { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.quiet-list p { color: var(--text-2); margin: 0; }
.quiet-list .when { font-size: var(--fs-small); color: var(--text-3); font-style: italic; margin-bottom: .25rem; display: block; }
.kind { font-family: var(--mono); font-size: var(--fs-label); text-transform: uppercase; letter-spacing: .06em; color: var(--leaf); }

/* year-grouped archive */
.year-group { display: grid; grid-template-columns: 5rem minmax(0, 1fr); gap: 1.5rem; padding: calc(var(--beat) * .75) 0 var(--beat); border-top: 1px solid var(--rule); }
.year-group:first-of-type { border-top: 0; }
.year-group > h3 { font-size: 1.5rem; color: var(--text-3); font-style: italic; line-height: calc(var(--beat) * 1.2); }
.archive-list { list-style: none; margin: 0; padding: 0; }
.archive-list li { padding: calc(var(--beat) * .5) 0; }
.archive-list li + li { border-top: 1px dotted var(--rule-strong); }
.archive-list a { color: var(--text); text-decoration: none; font-size: 1.25rem; }
.archive-list a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.archive-list .desc { display: block; color: var(--text-2); margin-top: .15rem; }
.archive-list .date { display: block; color: var(--text-3); font-size: var(--fs-small); font-style: italic; }
@media (max-width: 560px) {
  .year-group { grid-template-columns: minmax(0, 1fr); gap: .25rem; }
}

.end-of-page {
  text-align: center;
  padding: calc(var(--beat) * 4) 1.5rem calc(var(--beat) * 3);
  max-width: 40rem; margin: 0 auto;
}
.end-of-page .rest-big { color: var(--text-3); width: 5rem; height: 2.6rem; margin: 0 auto var(--beat); display: block; }
.end-of-page h2 { font-style: italic; margin-bottom: calc(var(--beat) * .5); font-size: 1.875rem; line-height: calc(var(--beat) * 1.3); }
.end-of-page p { color: var(--text-2); }

.horizon {
  height: 14rem;
  margin: 0 auto;
  max-width: 72rem;
  background:
    url("assets/ink-wash-foothills.webp") center bottom / cover no-repeat,
    linear-gradient(180deg, transparent 0 55%, var(--bg-inset) 55% 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
  position: relative;
}
.horizon svg { position: absolute; inset: auto 0 0 0; width: 100%; height: 100%; color: var(--rule-strong); }

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--rule); margin-top: 0; }
.foot-inner {
  max-width: 72rem; margin: 0 auto;
  padding: calc(var(--beat) * 2.5) 1.5rem calc(var(--beat) * 1.5);
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 3rem;
}
.foot-inner h2 { font-size: 1.375rem; line-height: var(--beat); margin-bottom: calc(var(--beat) * .5); }
.foot-inner ul { list-style: none; margin: 0; padding: 0; }
.foot-inner li a { display: inline-block; padding: .3rem 0; color: var(--text-2); text-decoration: none; }
.foot-inner li a:hover { color: var(--text); text-decoration: underline; }
.foot-inner p { color: var(--text-2); }
.foot-bottom { max-width: 72rem; margin: 0 auto; padding: 0 1.5rem calc(var(--beat) * 2); color: var(--text-3); font-size: var(--fs-small); display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem 2rem; }
@media (max-width: 820px) { .foot-inner { grid-template-columns: minmax(0, 1fr); gap: calc(var(--beat) * 1.25); padding-left: 1rem; padding-right: 1rem; } .foot-bottom { padding-left: 1rem; padding-right: 1rem; } }

.letter-form { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: .75rem; }
.letter-form label { width: 100%; }
.field {
  flex: 1 1 14rem;
  min-height: 48px;
  font: inherit; font-size: 1.0625rem;
  color: var(--text);
  background: var(--bg-raised);
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  padding: 0 1.1rem;
}
.field::placeholder { color: var(--text-3); }
.field:hover { border-color: var(--text-3); }
.form-note { width: 100%; font-size: var(--fs-small); color: var(--text-3); margin: .25rem 0 0; min-height: 1.5rem; }
.form-note.is-success { color: var(--leaf); }
.form-note.is-error { color: #a03227; }
:root[data-theme="dark"] .form-note.is-error { color: #ee8579; }

/* ---------- article ---------- */
.progress-edge {
  position: fixed; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--rule);
  z-index: 5;
}
.progress-edge span { display: block; width: 100%; height: 0; background: var(--accent); }

.article-head { max-width: calc(var(--measure) + 3rem); margin: 0 auto; padding: calc(var(--beat) * 2.5) 1.5rem calc(var(--beat) * 1.5); }
.crumb { margin-bottom: var(--beat); }
.crumb a { color: var(--text-3); text-decoration: none; font-size: 1.0625rem; }
.crumb a:hover { color: var(--text); text-decoration: underline; }
.article-head h1 { font-size: clamp(2.4rem, 1.8rem + 2.6vw, 3.75rem); margin-bottom: var(--beat); }
.article-head .lede { margin-bottom: var(--beat); }
.byline { color: var(--text-3); font-size: 1.0625rem; font-style: italic; }
.byline span + span::before { content: "·"; margin: 0 .6rem; font-style: normal; }

.article-plate { max-width: 52rem; margin: 0 auto calc(var(--beat) * 2); padding: 0 1.5rem; }
.article-plate figure { margin: 0; }
.article-plate img { width: 100%; border-radius: .75rem; aspect-ratio: 21 / 9; object-fit: cover; background: var(--bg-inset); filter: saturate(.85); }
.article-plate figcaption { margin-top: .6rem; font-size: var(--fs-small); color: var(--text-3); font-style: italic; }

.before-you-begin {
  max-width: calc(var(--measure) + 3rem); margin: 0 auto calc(var(--beat) * 2); padding: 0 1.5rem;
}
.before-you-begin .box { border-top: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule-strong); padding: var(--beat) 0; }
.before-you-begin p { color: var(--text-2); }
.toc { margin: calc(var(--beat) * .5) 0 0; padding: 0; list-style: none; counter-reset: toc; columns: 2; column-gap: 2rem; }
.toc li { counter-increment: toc; break-inside: avoid; padding: .2rem 0; }
.toc a { text-decoration: none; color: var(--text); display: inline-flex; gap: .6rem; min-height: 44px; align-items: center; }
.toc a::before { content: counter(toc); font-family: var(--mono); font-size: var(--fs-label); color: var(--text-3); width: 1.25rem; }
.toc a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
@media (max-width: 560px) { .toc { columns: 1; } }

.prose { max-width: calc(var(--measure) + 3rem); margin: 0 auto; padding: 0 1.5rem; font-size: var(--fs-prose); line-height: 1.75; }
.prose p { margin-bottom: 1.75em; }
.prose ol, .prose ul { margin: 0 0 1.75em; padding-left: 1.4em; }
.prose li { margin-bottom: .5em; padding-left: .25em; }
.prose li::marker { color: var(--text-3); font-family: var(--mono); font-size: .85em; }
.prose h2 {
  margin: calc(var(--beat) * 3) 0 calc(var(--beat) * .9);
  font-size: 2rem;
  line-height: 1.25;
  scroll-margin-top: 2rem;
}
.prose h2 .part { display: block; font-family: var(--mono); font-size: var(--fs-label); letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin-bottom: .6rem; line-height: 1.4; }
.prose h2::after { content: ""; display: block; width: 2.5rem; height: 1px; background: var(--accent); margin-top: .9rem; }
.prose code { font-family: var(--mono); font-size: .82em; background: var(--code-bg); padding: .1em .35em; border-radius: .3em; }
.prose em { font-style: italic; }

.callout { margin: 0 0 1.75em; padding: 1.1rem 1.4rem; border-radius: .6rem; background: var(--bg-inset); font-size: 1.125rem; line-height: 1.7; }
.callout p { margin: 0; }
.callout .callout-label { display: block; font-family: var(--mono); font-size: var(--fs-label); letter-spacing: .06em; text-transform: uppercase; margin-bottom: .4rem; color: var(--text-3); }
.callout.why { background: transparent; border-left: 2px solid var(--accent); border-radius: 0; padding: .3rem 0 .3rem 1.4rem; color: var(--text-2); font-style: italic; }
.callout.why .callout-label { color: var(--accent); font-style: normal; }
.callout.ask { background: transparent; border: 1px dashed var(--rule-strong); position: relative; padding-left: 3.6rem; }
.callout.ask::before {
  content: "?"; position: absolute; left: 1.1rem; top: 1rem;
  width: 1.75rem; height: 1.75rem; border-radius: 50%;
  border: 1px solid var(--leaf); color: var(--leaf);
  display: grid; place-items: center; font-size: 1.05rem; line-height: 1; font-style: italic;
}
.callout.ask .callout-label { color: var(--leaf); }
.callout.note .callout-label { color: var(--text-2); }

.code {
  margin: 0 -1.5rem 1.75em;
  background: var(--code-bg);
  border-radius: .75rem;
  border: 1px solid var(--rule);
  overflow: hidden;
}
@media (min-width: 900px) { .code { margin-left: -4rem; margin-right: -4rem; } }
@media (max-width: 640px) { .code { margin-left: -1rem; margin-right: -1rem; border-radius: 0; border-left: 0; border-right: 0; } }
.code-bar { display: flex; justify-content: space-between; align-items: center; padding: .25rem .5rem .25rem 1.25rem; border-bottom: 1px solid var(--rule); }
.code-bar .label { color: var(--text-3); }
.copy-btn {
  font-family: var(--mono); font-size: var(--fs-label); letter-spacing: .04em;
  background: transparent; color: var(--text-2);
  border: 0; border-radius: 999px;
  min-height: 40px; padding: 0 .9rem; cursor: pointer;
}
.copy-btn:hover { background: var(--bg); color: var(--text); }
.copy-btn.is-success { color: var(--leaf); }
.code pre { margin: 0; padding: 1.1rem 1.25rem 1.3rem; overflow-x: auto; font-family: var(--mono); font-size: .9375rem; line-height: 1.65; color: var(--text); tab-size: 2; }
.code pre .c { color: var(--text-3); font-style: italic; }

.filed { max-width: calc(var(--measure) + 3rem); margin: calc(var(--beat) * 2) auto 0; padding: 0 1.5rem; }
.tags { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: .5rem 0 0; }
.tags a, .tags span { display: inline-flex; align-items: center; min-height: 36px; padding: 0 .85rem; border: 1px solid var(--rule-strong); border-radius: 999px; font-family: var(--mono); font-size: var(--fs-label); color: var(--text-2); text-decoration: none; }
.tags a:hover { border-color: var(--accent); color: var(--text); }

.after-reading { max-width: calc(var(--measure) + 3rem); margin: 0 auto; padding: calc(var(--beat) * 3) 1.5rem 0; }
.after-reading .rest-big { color: var(--text-3); width: 4rem; height: 2rem; display: block; margin: 0 auto calc(var(--beat) * 1.5); }
.after-reading > h2 { text-align: center; font-style: italic; font-size: 1.75rem; margin-bottom: calc(var(--beat) * 1.5); }
.share-row { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: center; margin-bottom: calc(var(--beat) * 2); }
.share-row a, .share-row button { font: inherit; font-size: 1.0625rem; color: var(--text-2); background: none; border: 0; padding: .6rem 0; min-height: 44px; cursor: pointer; text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: .3em; }
.share-row a:hover, .share-row button:hover { color: var(--text); text-decoration-color: var(--accent); }
.letter-card { border: 1px solid var(--rule-strong); border-radius: 1rem; padding: calc(var(--beat) * 1.25) 1.5rem; margin-bottom: calc(var(--beat) * 2.5); background: var(--bg-raised); }
.letter-card h3 { font-size: 1.625rem; line-height: calc(var(--beat) * 1.2); margin-bottom: .5rem; }
.letter-card p { color: var(--text-2); margin-bottom: 0; }

/* ---------- projects ---------- */
.feature-block { display: grid; gap: var(--beat); }
.feature-block figure { margin: 0; border-radius: .75rem; overflow: hidden; background: var(--slate-700); aspect-ratio: 16/8; }
.feature-block figure img { width: 100%; height: 100%; object-fit: cover; }
.figures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--rule-strong); border: 1px solid var(--rule-strong); border-radius: .75rem; overflow: hidden; }
.figures > div { background: var(--bg); padding: .9rem 1.1rem; }
.figures .v { display: block; font-size: 2rem; line-height: 1.2; font-variant-numeric: lining-nums tabular-nums; }
@media (max-width: 420px) { .figures .v { font-size: 1.6rem; } .figures > div { padding: .75rem; } }

.shelf { border-top: 1px solid var(--rule); }
.shelf details { border-bottom: 1px solid var(--rule); }
.shelf summary {
  list-style: none; cursor: pointer;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: baseline;
  padding: calc(var(--beat) * .6) 0;
  min-height: 44px;
}
.shelf summary::-webkit-details-marker { display: none; }
.shelf summary .t { font-size: 1.3125rem; color: var(--text); }
.shelf summary .s { font-family: var(--mono); font-size: var(--fs-label); color: var(--text-3); text-align: right; }
.shelf summary::after { content: "+"; grid-column: 2; grid-row: 1; justify-self: end; display: none; }
.shelf summary:hover .t { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: .22em; }
.shelf summary .t::before { content: "\25B8"; color: var(--text-3); display: inline-block; width: 1.25rem; transition: transform 200ms var(--ease); }
.shelf details[open] summary .t::before { transform: rotate(90deg); }
.shelf .open-body { padding: 0 0 calc(var(--beat) * 1.1) 1.25rem; display: grid; gap: calc(var(--beat) * .6); }
.shelf .open-body p { color: var(--text-2); margin: 0; }
.shelf .open-body figure { margin: 0; border-radius: .6rem; overflow: hidden; background: #111; max-width: 32rem; }
.shelf .open-body figure img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem .5rem; list-style: none; margin: 0; padding: 0; }
.chips li { font-family: var(--mono); font-size: var(--fs-label); color: var(--text-2); border: 1px solid var(--rule); border-radius: .35rem; padding: .15rem .55rem; }

/* ---------- AI stories as a book's contents ---------- */
.book {
  border: 1px solid var(--rule-strong); border-radius: 1rem; overflow: hidden;
  background: var(--bg-raised);
}
.book figure { margin: 0; aspect-ratio: 21 / 9; background: var(--night-800); }
.book figure img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.8); }
.book-inner { padding: calc(var(--beat) * 1.25) 1.75rem calc(var(--beat) * 1.5); }
.book h3 { font-size: 2.25rem; line-height: calc(var(--beat) * 1.4); font-style: italic; }
.contents { list-style: none; margin: var(--beat) 0 0; padding: 0; }
.contents li { display: grid; grid-template-columns: 3rem minmax(0, 1fr); gap: 1rem; padding: calc(var(--beat) * .6) 0; border-top: 1px solid var(--rule); }
.contents .roman { font-style: italic; color: var(--text-3); font-size: 1.375rem; }
.contents a { color: var(--text); font-size: 1.25rem; text-decoration: none; }
.contents a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.contents p { color: var(--text-2); margin: .3rem 0 0; font-size: 1.0625rem; line-height: 1.65; }
.contents li.unwritten { color: var(--text-3); }
.contents li.unwritten .t { font-style: italic; font-size: 1.25rem; }
.notice { margin-top: var(--beat); padding: .9rem 1.2rem; border-left: 2px solid var(--leaf); color: var(--text-2); font-size: 1.0625rem; }

/* ---------- about ---------- */
.about-hero { max-width: 72rem; margin: 0 auto; padding: calc(var(--beat) * 2.5) 1.5rem calc(var(--beat) * 3); display: grid; grid-template-columns: minmax(0, 20rem) minmax(0, 36rem); gap: 5rem; justify-content: center; align-items: center; }
.about-hero .portrait { border-radius: 50%; aspect-ratio: 1; }
.about-hero .portrait img { object-position: 50% 30%; }
@media (max-width: 900px) { .about-hero { grid-template-columns: minmax(0, 1fr); gap: var(--beat); padding: var(--beat) 1rem calc(var(--beat) * 2); max-width: 40rem; } .about-hero .portrait-wrap { max-width: 11rem; } }

.phases { list-style: none; margin: 0; padding: 0; position: relative; }
.phases::before { content: ""; position: absolute; left: .35rem; top: .6rem; bottom: .6rem; width: 1px; background: var(--rule-strong); }
.phases > li { position: relative; padding: 0 0 calc(var(--beat) * 1.5) 2.25rem; }
.phases > li:last-child { padding-bottom: 0; }
.phases > li::before { content: ""; position: absolute; left: 0; top: .55rem; width: .75rem; height: .75rem; border-radius: 50%; background: var(--bg); border: 1px solid var(--accent); }
.phases > li:first-child::before { background: var(--accent); }
.phases h3 { margin-bottom: .2rem; }
.phases .period { font-family: var(--mono); font-size: var(--fs-label); color: var(--text-3); letter-spacing: .04em; display: block; margin-bottom: .5rem; }
.phases p { color: var(--text-2); margin-bottom: .6rem; }
.roles { list-style: none; margin: 0; padding: 0; }
.roles li { padding: .25rem 0; color: var(--text); }
.roles li small { color: var(--text-3); font-size: var(--fs-small); font-style: italic; }
.role-notes { margin: .5rem 0 0; padding-left: 1.2rem; color: var(--text-2); }
.role-notes li { margin-bottom: .4rem; }

.principles { list-style: none; margin: 0; padding: 0; counter-reset: pr; }
.principles li { counter-increment: pr; font-size: 1.75rem; line-height: 1.35; font-style: italic; padding: calc(var(--beat) * .8) 0; border-top: 1px solid var(--rule); display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); }
.principles li:first-child { border-top: 0; padding-top: 0; }
.principles li::before { content: counter(pr); font-family: var(--mono); font-style: normal; font-size: var(--fs-label); color: var(--text-3); padding-top: .6rem; }
@media (max-width: 560px) { .principles li { font-size: 1.4rem; } }

.caps { margin: 0; }
.caps > div { padding: calc(var(--beat) * .75) 0; border-top: 1px solid var(--rule); }
.caps > div:first-child { border-top: 0; padding-top: 0; }
.caps dt { font-size: 1.375rem; margin-bottom: .25rem; }
.caps dd { margin: 0; color: var(--text-2); }
.caps dd.skills { color: var(--text); margin-top: .4rem; font-size: 1.0625rem; }

.photo-pair { display: grid; gap: var(--beat); }
.photo-pair figure { margin: 0; border-radius: .75rem; overflow: hidden; aspect-ratio: 16/10; background: var(--bg-inset); }
.photo-pair img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }

/* ---------- patterns ---------- */
.three-ways { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; margin: var(--beat) 0; }
.three-ways h3 { font-size: 1.3125rem; margin-bottom: .3rem; }
.three-ways p { color: var(--text-2); font-size: 1.0625rem; line-height: 1.65; }
@media (max-width: 700px) { .three-ways { grid-template-columns: minmax(0, 1fr); gap: var(--beat); } }

.finder { display: grid; gap: .9rem; margin-bottom: calc(var(--beat) * 1.25); }
.finder .field { border-radius: .6rem; width: 100%; }
.filters { display: flex; flex-wrap: wrap; gap: .4rem; }
.filter-btn { font: inherit; font-size: 1.0625rem; min-height: 44px; padding: 0 1rem; border-radius: 999px; background: transparent; border: 1px solid var(--rule-strong); color: var(--text-2); cursor: pointer; }
.filter-btn:hover { border-color: var(--text-3); color: var(--text); }
.filter-btn[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.result-line { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem 1rem; color: var(--text-3); font-size: var(--fs-small); font-style: italic; }
.result-line button { font: inherit; font-style: normal; color: var(--accent); background: none; border: 0; text-decoration: underline; cursor: pointer; min-height: 44px; padding: 0 .25rem; }

.pattern-list { list-style: none; margin: 0; padding: 0; counter-reset: pat; }
.pattern-list li { display: grid; grid-template-columns: 2.75rem minmax(0, 1fr); gap: .5rem 1rem; padding: calc(var(--beat) * .7) 0; border-top: 1px solid var(--rule); }
.pattern-list li[hidden] { display: none; }
.pattern-list .n { font-family: var(--mono); font-size: var(--fs-label); color: var(--text-3); padding-top: .45rem; }
.pattern-list a { color: var(--text); text-decoration: none; font-size: 1.3125rem; }
.pattern-list a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.pattern-list p { color: var(--text-2); margin: .2rem 0 .35rem; }
.pattern-list .meta { font-family: var(--mono); font-size: var(--fs-label); color: var(--text-3); letter-spacing: .03em; }
.badge { font-family: var(--mono); font-size: var(--fs-label); letter-spacing: .04em; padding: .05rem .45rem; border-radius: .3rem; border: 1px solid currentColor; margin-left: .5rem; vertical-align: .15em; white-space: nowrap; }
.badge.new { color: var(--leaf); }
.badge.updated { color: var(--text-3); }
.empty-state { padding: calc(var(--beat) * 2) 0; text-align: center; color: var(--text-2); }
.empty-state[hidden] { display: none; }
.empty-state h3 { font-style: italic; margin-bottom: .5rem; }

.usecases { columns: 2; column-gap: 2rem; margin: 0; padding-left: 1.2rem; color: var(--text-2); }
.usecases li { margin-bottom: .35rem; break-inside: avoid; }
@media (max-width: 560px) { .usecases { columns: 1; } }

.panes { border: 1px solid var(--rule-strong); border-radius: .9rem; overflow: hidden; background: var(--bg-raised); }
.pane-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; padding: .5rem; border-bottom: 1px solid var(--rule); background: var(--bg-inset); }
.tablist { display: flex; flex-wrap: wrap; gap: .25rem; }
.tab { font: inherit; font-size: 1.0625rem; min-height: 44px; padding: 0 1rem; border-radius: 999px; background: transparent; border: 0; color: var(--text-2); cursor: pointer; }
.tab:hover { color: var(--text); background: var(--bg); }
.tab[aria-selected="true"] { background: var(--text); color: var(--bg); }
.pane-actions { display: flex; gap: .25rem; }
.pane-actions .copy-btn { border: 1px solid var(--rule-strong); }
.pane { padding: 1.5rem; }
.pane[hidden] { display: none; }
.pane pre { margin: 0; font-family: var(--mono); font-size: .9375rem; line-height: 1.65; overflow-x: auto; white-space: pre; color: var(--text); }
.pane .pane-note { color: var(--text-2); font-size: 1.0625rem; margin-bottom: 1rem; font-style: italic; }
.prompt-text { max-width: 38rem; }
.prompt-text p { color: var(--text); }

.neighbours { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.neighbours a { display: block; text-decoration: none; color: var(--text); padding: 1rem 0; }
.neighbours a:hover .t { text-decoration: underline; text-decoration-color: var(--accent); }
.neighbours .t { font-size: 1.25rem; display: block; }
.neighbours .next { text-align: right; }
@media (max-width: 560px) { .neighbours { grid-template-columns: 1fr; } .neighbours .next { text-align: left; } }

/* the demo pattern itself: hairline stat strip (token-mapped to this site) */
.hss-cap { color: var(--text-2); font-style: italic; font-size: 1.0625rem; margin-bottom: .75rem; }
.hss-strip { display: grid; gap: 1px; background: var(--rule-strong); border: 1px solid var(--rule-strong); border-radius: .6rem; overflow: hidden; grid-template-columns: minmax(0, 1fr); margin-bottom: 1.5rem; }
@media (min-width: 30rem) { .hss-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 56rem) { .hss-strip.four { grid-template-columns: repeat(4, minmax(0, 1fr)); } .hss-strip.five { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.hss-tile { background: var(--bg-raised); padding: .85rem 1rem; text-align: left; min-width: 0; }
.hss-tile .k { display: block; font-family: var(--mono); font-size: .8125rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.hss-tile .v { display: block; font-size: 1.6rem; line-height: 1.3; font-weight: 600; font-variant-numeric: lining-nums tabular-nums; }
.hss-tile .v.missing { color: var(--text-3); font-weight: 400; }
.hss-tile .u { display: block; font-size: 1rem; color: var(--text-2); }
button.hss-tile { font: inherit; color: var(--text); border: 0; cursor: pointer; }
button.hss-tile:hover { background: var(--bg-inset); }
button.hss-tile[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 16%, var(--bg-raised)); box-shadow: inset 0 -3px 0 var(--accent); }
.hss-list { list-style: none; padding: 0; margin: 0 0 .75rem; }
.hss-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-top: 1px solid var(--rule); font-size: 1.0625rem; }
.hss-list li[hidden] { display: none; }
.hss-list .st { font-family: var(--mono); font-size: var(--fs-label); color: var(--text-3); white-space: nowrap; }
.hss-status { color: var(--text-2); font-size: 1rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; scroll-behavior: auto !important; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
.year-group.months { grid-template-columns: 7.5rem minmax(0, 1fr); }
@media (max-width: 560px) { .year-group.months { grid-template-columns: minmax(0, 1fr); } }
.code pre code, .pane pre code { background: none; padding: 0; font-size: inherit; border-radius: 0; }
.kind + .kind-sep, .when .kind { margin-right: .35rem; }
.when .kind::after { content: " ·"; color: var(--text-3); }

.prose-fig { margin: 0 0 1.75em; }
.prose-fig img { display: block; width: 100%; height: auto; border-radius: .6rem; background: var(--bg-inset); }
.prose code { overflow-wrap: anywhere; }
