/* Engineer's notebook: a dark title band, warm off-white pages, Instrument Sans
   for words, JetBrains Mono for labels and numbers, one orange accent. */
:root {
  --bg: #f5f5f4;
  --surface: #ffffff;
  --text: #161614;
  --muted: #45453f;
  --faint: #5c5c57;
  --rule: #d4d4cf;
  --card-rule: #e0e0db;
  --chip-rule: #c9c9c3;
  --accent: #ff6a2b;          /* fills and markers only; too light for text on white */
  --accent-ink: #c2410c;      /* accent as readable text on light pages */
  --ok: #2f6b45;
  --ink: #161614;             /* the dark band */
  --on-ink: #f5f5f4;
  --on-ink-muted: #c9c9c3;
  --on-ink-faint: #a3a39c;
  --on-ink-link: #d6d6d0;
  --ink-rule: #2e2e2b;
  --display: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --radius: 14px;
  --hi: var(--accent);
  --hi-on-dark: var(--accent);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1c1a;
    --surface: #242421;
    --text: #f0f0ec;
    --muted: #c9c9c3;
    --faint: #a3a39c;
    --rule: #34342f;
    --card-rule: #34342f;
    --chip-rule: #4a4a44;
    --accent-ink: #ff8a57;
    --ok: #86c79c;
    --ink: #111110;
    --ink-rule: #2a2a27;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration-color: currentColor; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-ink); }

/* One phrase per page gets an orange underline. */
mark, .hl {
  background: none;
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
}

img, video { max-width: 100%; display: block; }

.wrap { max-width: calc(1200px + 2 * clamp(16px, 4vw, 48px)); margin: 0 auto; padding: 0 clamp(16px, 4vw, 48px); }

/* Header: part of the dark band that opens every page. */
.site-header { background: var(--ink); color: var(--on-ink); }
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding-top: 24px;
  padding-bottom: 8px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--on-ink);
}
.brand:hover { color: var(--on-ink); }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1.5px solid currentColor;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
}
.site-nav { display: flex; flex-wrap: wrap; gap: 0 28px; font-size: 15px; }
.site-nav a { color: var(--on-ink-link); text-decoration: none; padding: 12px 0; }
.site-nav a:hover { color: #fff; }
.site-nav a[aria-current="page"] { color: #fff; box-shadow: inset 0 -2px 0 var(--accent); }

/* Type */
h1, h2, h3 { font-family: var(--display); font-weight: 600; text-wrap: balance; }
h1 { font-size: clamp(44px, 6vw, 80px); line-height: 0.98; letter-spacing: -0.035em; margin: 0 0 24px; }
h2 { font-size: clamp(32px, 3.6vw, 48px); line-height: 1.05; letter-spacing: -0.025em; margin: 0 0 16px; }
h3 { font-size: 22px; line-height: 1.25; letter-spacing: -0.015em; margin: 0 0 6px; }

/* Eyebrows and labels are set in mono caps. */
.eyebrow {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 12px;
}
.eyebrow a { color: inherit; }
.lede { font-size: clamp(17px, 1.5vw, 20px); line-height: 1.6; color: var(--muted); max-width: 34em; }
.muted { color: var(--muted); }

section { padding: clamp(64px, 9vw, 112px) 0 0; }
main > section:last-child { padding-bottom: clamp(64px, 9vw, 112px); }

/* Buttons are pills: orange for the main action, outlined for the rest. */
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 20px;
  border: 1.5px solid var(--text);
  border-radius: 999px;
  background: none;
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}
.btn:hover { color: var(--text); background: color-mix(in srgb, var(--text) 7%, transparent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #161614; }
.btn.primary::after { content: "→"; font-weight: 500; }
.btn.primary.mail::after { content: none; }
.btn.primary:hover { background: #ff7f47; border-color: #ff7f47; color: #161614; }
.btn.dark { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn.dark:hover { color: var(--bg); background: var(--faint); border-color: var(--faint); }
.more-link { font-size: 16px; font-weight: 600; text-underline-offset: 4px; }

/* The dark band: home hero and every page head. */
.hero, .page-head { background: var(--ink); color: var(--on-ink); }
.hero .lede, .page-head .lede { color: var(--on-ink-muted); }
.hero .eyebrow, .page-head .eyebrow { color: var(--on-ink-faint); }
.page-head a:hover, .hero a:hover { color: #fff; }
.hero .btn { color: var(--on-ink); border-color: #5c5c57; }
.hero .btn:hover { background: rgba(255, 255, 255, 0.08); }
.hero .btn.primary { color: #161614; border-color: var(--accent); }

.hero { padding: clamp(40px, 6vw, 80px) 0 0; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 300px); gap: 48px 64px; align-items: center; padding-bottom: clamp(40px, 6vw, 72px); }
.hero h1 { margin: 0 0 28px; max-width: 11em; }
.hero .hello { margin: 0 0 28px; font-size: clamp(20px, 1.8vw, 24px); color: var(--on-ink-muted); }
.hero .lede { margin: 0; }
.social { margin: 20px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 0 24px; font-family: var(--mono); font-size: 13px; }
.social a { color: var(--on-ink-faint); display: inline-block; padding: 12px 0; }

.portrait { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.portrait img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 20px; }
.portrait figcaption { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 12px; color: var(--on-ink-faint); }
.dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

.stats { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); border-top: 1px solid var(--ink-rule); }
.stat { padding: 28px 24px 40px 0; display: flex; flex-direction: column; gap: 8px; }
.stat dd { order: -1; }
.stat dd, .stat strong { margin: 0; font-size: clamp(40px, 4.4vw, 56px); font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.stat dt, .stat span { font-family: var(--mono); font-size: 13px; color: var(--on-ink-faint); }

.page-head { padding: clamp(40px, 6vw, 72px) 0 clamp(48px, 6vw, 80px); }
.page-head .stats { margin-top: 40px; }
.page-head .stat { padding-bottom: 0; }
.page-head .stat strong { font-size: clamp(32px, 3.4vw, 44px); }
.page-head h1 { font-size: clamp(40px, 5.4vw, 72px); margin-bottom: 20px; }
.page-head .lede { margin: 0; }

/* Section heads: title left, link right. */
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 40px; }
.section-head h2 { margin: 0; }

/* Home: numbered work rows. */
.work-list { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--text); }
.work { display: grid; grid-template-columns: 72px minmax(0, 1fr) minmax(200px, 260px); gap: 16px 32px; padding: 32px 0; border-bottom: 1px solid var(--rule); }
.work-num { display: flex; align-items: center; gap: 10px; height: 32px; font-family: var(--mono); font-size: 14px; }
.sq { width: 10px; height: 10px; background: var(--accent); }
.work h3 { font-size: 26px; margin-bottom: 10px; }
.work p { margin: 0; color: var(--muted); max-width: 40em; }
.work .more-link { display: inline-block; margin-top: 8px; padding: 8px 0; font-size: 15px; }

/* Chips: small mono labels in a hairline box. */
.chips { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px; }
.chip { font-family: var(--mono); font-size: 12px; line-height: 1.4; padding: 6px 10px; border: 1px solid var(--chip-rule); border-radius: 6px; color: inherit; }
a.chip { text-decoration: none; }
a.chip:hover { border-color: currentColor; }

/* Home: two-column split with a heading on the left. */
.split { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 32px 64px; align-items: start; }
.split-side h2 { margin-bottom: 16px; }
.split-side .muted { margin: 0 0 8px; }
.paper-list { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--text); }
.paper-list li { border-bottom: 1px solid var(--rule); }
.paper-list a { display: flex; flex-wrap: wrap; gap: 6px 24px; padding: 22px 0; text-decoration: none; }
.paper-list .t { flex: 999 1 360px; font-size: 19px; font-weight: 500; line-height: 1.35; }
.paper-list .v { flex: 0 0 auto; font-family: var(--mono); font-size: 13px; color: var(--faint); padding-top: 4px; }
.paper-list a:hover .t { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }

.facts { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.fact { background: var(--surface); border: 1px solid var(--card-rule); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 8px; min-height: 160px; }
.fact dt { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
.fact dd { margin: 0; font-size: 17px; line-height: 1.45; }

/* Grids and cards: white cards on the off-white page. */
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#path .grid.two { gap: 48px; }

.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--card-rule);
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none;
}
a.card:hover { color: inherit; border-color: var(--text); }
.card h3 { margin-top: 2px; }
.card p { margin: 8px 0 0; color: var(--muted); font-size: 16px; }
.card .tag { margin-bottom: 10px; }
.card .more { margin-top: 14px; font-size: 15px; font-weight: 600; }

/* Tags are mono caps labels. */
.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}
.tag.accepted { color: var(--ok); }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--text); }
.timeline li { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 4px 24px; padding: 20px 0; border-bottom: 1px solid var(--rule); }
.timeline .when { font-family: var(--mono); font-size: 14px; color: var(--faint); padding-top: 3px; }
.timeline .what strong { font-size: 18px; font-weight: 600; }
.timeline .what span { display: block; margin-top: 4px; color: var(--muted); font-size: 16px; }
#path .eyebrow { margin-bottom: 8px; }

/* Projects: the Rivian feature is a dark panel. */
.feature {
  background: var(--ink);
  color: var(--on-ink);
  border-radius: 20px;
  overflow: hidden;
}
.feature-media { position: relative; background: #000; }
.feature-media video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.feature-media figcaption {
  position: absolute;
  left: 12px;
  bottom: 12px;
  font-family: var(--mono);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(0, 0, 0, 0.6);
  border-radius: 6px;
  padding: 4px 10px;
}
.feature-media figcaption a { color: #fff; }
.yt-frame { position: relative; aspect-ratio: 16 / 9; overflow: hidden; }
.yt-frame iframe {
  position: absolute;
  /* Oversize the player slightly so YouTube's title bar and logo sit outside the frame. */
  top: -12%;
  left: 0;
  width: 100%;
  height: 124%;
  border: 0;
  pointer-events: none;
}
.yt-frame .fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  color: #ddd;
}
.yt-frame iframe ~ .fallback { display: none; }

/* Press quotes */
.press { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 28px; }
.quote {
  margin: 0;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--card-rule);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}
.quote::before { content: "\201C"; font-size: 48px; font-weight: 600; line-height: 0.6; color: var(--accent); height: 20px; }
.quote p { margin: 0; font-size: 18px; line-height: 1.45; font-weight: 500; letter-spacing: -0.005em; }
.quote cite { font-style: normal; font-family: var(--mono); font-size: 12px; color: var(--faint); }
.feature-body { padding: 40px; display: grid; grid-template-columns: 1fr 1.2fr; gap: 40px; }
.feature-body h2 { color: #fff; }
.feature-body .eyebrow { color: var(--on-ink-faint); }
.feature-body p { color: var(--on-ink-muted); }
.feature ul { margin: 0; padding: 0; list-style: none; }
.feature li {
  display: grid;
  grid-template-columns: 8px 1fr;
  column-gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--ink-rule);
  color: #d8d8d2;
  font-size: 16px;
  line-height: 1.55;
}
.feature li:first-child { border-top: 0; padding-top: 0; }
/* A small orange square marks each item, centered on its first line. */
.feature li::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-top: calc((1.55em - 8px) / 2);
  background: var(--accent);
}
.feature .chips { margin-top: 20px; }
.feature li.chip, .feature .chips li { display: block; padding: 6px 10px; border: 1px solid #45453f; border-top: 1px solid #45453f; color: #d8d8d2; }
.feature .chips li::before { content: none; }
.feature a.chip { color: #fff; }
.credit { font-family: var(--mono); font-size: 12px; color: var(--faint); margin-top: 16px; }

/* Papers */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 40px 0 8px; }
.filters button {
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--chip-rule);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.filters button .muted { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.filters button:hover { border-color: var(--text); }
.filters button[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.filters button[aria-pressed="true"] .muted { color: inherit; opacity: 0.7; }
.filters button:focus-visible, .btn:focus-visible, .site-nav a:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.field { padding: 56px 0 8px; }
.field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.field-head h2 { margin: 0; font-size: clamp(28px, 3vw, 36px); }
.field-head .count { font-family: var(--mono); font-size: 13px; color: var(--faint); white-space: nowrap; }
.field > p.muted { margin: 0 0 24px; max-width: 46em; }

/* Papers are rows under a heavy rule. */
.paper { border-top: 1px solid var(--rule); padding: 22px 0 20px; margin: 0; }
.field > .paper:first-of-type, .field-head + p + .paper { border-top: 1.5px solid var(--text); }
.paper h3 { font-size: 19px; font-weight: 500; letter-spacing: -0.005em; line-height: 1.35; }
.paper h3 a { text-decoration: none; }
.paper h3 a:hover { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; color: inherit; }
.paper .meta { font-size: 15px; color: var(--faint); margin: 4px 0 8px; }
.paper .meta .me { color: var(--text); font-weight: 600; }
.paper .venue { font-style: italic; }
.paper p.summary { margin: 0; color: var(--muted); font-size: 16px; max-width: 48em; }
.paper .kind { float: right; margin-left: 12px; padding: 4px 8px; border: 1px solid var(--chip-rule); border-radius: 6px; }

/* Places read as a list of chips. */
.places { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.places span { font-family: var(--mono); font-size: 12px; padding: 5px 9px; border: 1px solid var(--chip-rule); border-radius: 6px; color: var(--text); }

.photo { margin: 0; }
.photo img { width: 100%; border-radius: 10px; background: var(--rule); }
.photo figcaption { margin-top: 8px; font-family: var(--mono); font-size: 12px; color: var(--faint); }

/* Personal: the Arsenal crest on the Arsenal entry. */
.arsenal { position: relative; }
.crest { float: right; width: 72px; height: auto; margin: 2px 0 8px 16px; }

/* Personal: Books and Board games run down the right; the shorter entries stack on the left. */
@media (min-width: 861px) {
  .interests { grid-template-rows: auto auto auto 1fr; align-items: start; }
  .interests > .card { grid-column: 1; }
  .interests > #reading { grid-column: 2; grid-row: 1 / span 3; }
  .interests > #games { grid-column: 2; grid-row: 4; }
}

/* Footer: the dark band again, with a hello. */
.site-footer { background: var(--ink); color: var(--on-ink); margin-top: 0; }
.site-footer .wrap { padding-top: clamp(56px, 8vw, 96px); padding-bottom: 32px; display: flex; flex-direction: column; gap: 40px; }
.say-hello { display: flex; flex-wrap: wrap; align-items: center; gap: 24px 32px; }
.say-hello img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; object-position: 50% 30%; }
.say-hello > div { flex: 1 1 320px; }
.say-hello h2 { margin: 0 0 8px; font-size: clamp(32px, 4vw, 52px); color: var(--on-ink); }
.say-hello p { margin: 0; color: var(--on-ink-muted); }
.say-hello .btn { min-height: 52px; padding: 0 26px; font-size: 17px; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; padding-top: 24px; border-top: 1px solid var(--ink-rule); }
.footer-row nav { display: flex; flex-wrap: wrap; gap: 0 28px; font-size: 15px; }
.footer-row nav a { color: var(--on-ink-link); display: inline-block; padding: 12px 0; }
.footer-row nav a:hover { color: #fff; }
.fine { margin: 0; font-family: var(--mono); font-size: 12px; color: var(--on-ink-faint); }
.fine a { color: var(--on-ink-link); }

@media (max-width: 960px) {
  .work { grid-template-columns: 56px minmax(0, 1fr); }
  .work .chips { grid-column: 2; }
  .split { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .portrait { max-width: 340px; }
  .grid.two, .grid.three, .press { grid-template-columns: minmax(0, 1fr); }
  .feature-body { grid-template-columns: 1fr; padding: 28px 22px; gap: 20px; }
}

@media (max-width: 560px) {
  .site-nav { gap: 0 20px; }
  .work { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 28px 0; }
  .work .chips { grid-column: 1; }
  .work-num { height: auto; }
  .stat { padding: 20px 0; }
  .fact { min-height: 0; }
  .timeline li { grid-template-columns: minmax(0, 1fr); }
  .paper .kind { float: none; display: inline-block; margin: 0 0 8px; }
  .say-hello .btn { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Bookshelf */
.cover {
  position: relative;
  display: block;
  flex: none;
  width: 72px;
  aspect-ratio: 2 / 3;
  border-radius: 4px 6px 6px 4px;
  overflow: hidden;
  background: var(--rule);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.12);
}
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover .tile {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8% 9%;
  background: linear-gradient(160deg, #2b3a45, #1f2a33);
  color: #f1e8dc;
  border-left: 4px solid rgba(0, 0, 0, 0.25);
  overflow: hidden;
}
.cover .tile b { font-family: var(--display); font-weight: 600; font-size: 0.62rem; line-height: 1.2; }
.cover .tile i { font-style: normal; font-size: 0.5rem; opacity: 0.75; }
.cover .tile.pod { background: linear-gradient(160deg, #c27a34, #8a4b16); }
.cover.sm { width: 46px; }
.cover.sm .tile i { display: none; }
.cover.sm .tile b { font-size: 0.5rem; }
.cover.big { width: 100%; max-width: 220px; }
.cover.big .tile { padding: 22px 20px; }
.cover.big .tile b { font-size: 1.6rem; }
.cover.big .tile i { font-size: 0.9rem; }

.now-reading {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
  padding: 12px 20px 12px 12px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.now-reading .eyebrow { margin: 0 0 2px; font-size: 0.7rem; }
.now-reading strong { display: block; font-family: var(--display); font-weight: 600; font-size: 1.1rem; line-height: 1.2; }
.now-reading span { font-size: 0.86rem; color: var(--muted); }
.now-reading:empty { display: none; }

.sixteen { display: grid; grid-template-columns: 240px 1fr; gap: 40px; padding: 40px; align-items: center; }
.sixteen-cover { display: flex; justify-content: center; }
.sixteen-cover .cover { transform: rotate(-3deg); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5); }
.sixteen h2 { color: #fff; margin-bottom: 4px; font-size: clamp(1.9rem, 4vw, 2.6rem); }
.sixteen .eyebrow { color: var(--hi-on-dark); }
.sixteen p { color: #c7c9cc; max-width: 58ch; }
.sixteen .sixteen-by { color: #9aa0a6; margin-top: 0; font-size: 0.92rem; }
.sixteen-take {
  margin: 20px 0 0;
  padding-left: 16px;
  border-left: 3px solid var(--hi-on-dark);
  font-family: var(--display);
  font-size: 1.12rem;
  line-height: 1.45;
  color: #fff;
}

.club { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 28px; }
.club-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.club-item h3, .pod-card h3 { font-size: 1.02rem; margin: 0; }
.by { margin: 2px 0 6px; font-size: 0.82rem; color: var(--faint); }
.card p.by { color: var(--faint); font-size: 0.82rem; margin: 2px 0 6px; }
.take { margin: 0; font-size: 0.9rem; color: var(--muted); line-height: 1.5; }

.author .stack { display: flex; margin-bottom: 16px; padding-left: 10px; }
.author .stack .cover { margin-left: -10px; border: 2px solid var(--surface); box-sizing: content-box; }
.mini { list-style: none; margin: 14px 0 0; padding: 0; font-size: 0.9rem; }
.mini li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--rule); }
.mini li span:last-child { color: var(--accent-ink); font-weight: 600; white-space: nowrap; }

.shelf { margin-top: 36px; }
.shelf .field-head h3 { margin: 0; }
.shelf > p.muted { margin: 2px 0 0; font-size: 0.95rem; }
.shelf-row {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: 16px 2px 12px;
  -webkit-overflow-scrolling: touch;
}
.spine { margin: 0; width: 104px; flex: none; scroll-snap-align: start; }
.spine .cover { width: 104px; }
.spine figcaption { margin-top: 8px; font-size: 0.78rem; line-height: 1.35; }
.spine figcaption b { display: block; font-weight: 600; }
.spine figcaption span { color: var(--faint); }

.rating-group { border-top: 1px solid var(--rule); padding: 14px 0; }
.rating-group summary { cursor: pointer; font-family: var(--display); font-weight: 600; font-size: 1.2rem; }
.rating-group summary .count { font-family: var(--sans); font-size: 0.85rem; font-weight: 400; color: var(--faint); margin-left: 6px; }
.rating-group ul { list-style: none; margin: 10px 0 0; padding: 0; columns: 2; column-gap: 32px; }
.rating-group li { break-inside: avoid; padding: 4px 0; font-size: 0.93rem; }
.rating-group li span { color: var(--faint); font-size: 0.85rem; }

.book-quote { margin: 18px 0 0; padding: 16px 18px; border-left: 3px solid var(--accent); background: var(--bg); border-radius: 0 10px 10px 0; }
.book-quote p { margin: 0 0 8px; font-family: var(--display); font-size: 1.04rem; line-height: 1.45; color: var(--text); }
.book-quote cite { display: block; font-style: normal; font-family: var(--mono); font-size: 12px; color: var(--faint); }
.book-quote button {
  font: inherit;
  font-size: 0.82rem;
  margin-top: 8px;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--accent-ink);
  cursor: pointer;
}

@media (max-width: 860px) {
  .club { grid-template-columns: repeat(2, 1fr); }
  .sixteen { grid-template-columns: 1fr; padding: 28px 22px; gap: 24px; }
  .cover.big { max-width: 160px; }
  .cover.big .tile b { font-size: 1.2rem; }
}
@media (max-width: 560px) {
  .club { grid-template-columns: 1fr; }
  .rating-group ul { columns: 1; }
  .spine, .spine .cover { width: 92px; }
}

/* Bookshelf: quote wall */
.quote-wall { columns: 3 280px; column-gap: 20px; margin-top: 28px; }
.kept {
  break-inside: avoid;
  margin: 0 0 20px;
  padding: 20px 22px 18px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
}
.kept[hidden] { display: none; }
.kept p { margin: 0 0 10px; font-family: var(--display); font-size: 1.05rem; line-height: 1.45; }
.kept cite { display: block; font-style: normal; font-family: var(--mono); font-size: 12px; line-height: 1.4; color: var(--faint); }
button.btn { font: inherit; font-size: 1.05rem; color: var(--text); cursor: pointer; }
.home-quote { max-width: none; margin-top: 12px; background: var(--surface); border: 1px solid var(--card-rule); border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 20px 22px; }
.home-quote p { font-size: 18px; }

/* Design notes: a long-form page with a running contents list in the margin. */
.doc-meta { margin: 18px 0 0; font-size: 1rem; color: var(--faint); max-width: 62ch; }
.doc { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; padding-top: 24px; padding-bottom: 40px; }
.doc-toc { position: sticky; top: 24px; align-self: start; padding-top: 32px; }
.doc-toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; font-size: 0.98rem; }
.doc-toc li { counter-increment: toc; padding: 3px 0; display: flex; gap: 8px; }
.doc-toc li::before { content: counter(toc, decimal-leading-zero); font-family: var(--mono); font-size: 12px; padding-top: 3px; color: var(--faint); min-width: 1.8em; }
.doc-toc a { text-decoration: none; color: var(--muted); }
.doc-toc a:hover { color: var(--accent-ink); text-decoration: underline; }
.doc-body { max-width: 68ch; }
.doc-body section { padding: 32px 0 24px; }
.doc-body section + section { border-top: 1px solid var(--rule); }
.doc-body h2 { font-size: clamp(1.6rem, 2.8vw, 2rem); }
.doc-body h2 .num { font-family: var(--mono); font-size: 0.5em; font-weight: 400; color: var(--accent-ink); margin-right: 14px; vertical-align: 0.3em; }
.doc-body h3 { font-size: 1.15rem; font-weight: 400; color: var(--muted); margin-top: 22px; }
.doc-body p { margin: 0 0 14px; }
.doc-body code { font-family: var(--mono); color: var(--accent-ink); font-size: 0.88em; }
.doc-list { margin: 0 0 14px; padding-left: 1.1em; }
.doc-list li { margin: 0 0 8px; }
.doc-list strong, .doc-defs dt { font-weight: 600; }
.doc-steps { margin: 0 0 14px; padding-left: 1.4em; }
.doc-steps li { margin: 0 0 4px; }
.doc-steps li::marker { color: var(--faint); }
.doc-defs { margin: 0; }
.doc-defs dt { margin-top: 16px; }
.doc-defs dd { margin: 2px 0 0; color: var(--muted); }
.doc-back { margin-top: 28px; }

.doc-figure { margin: 24px 0 26px; padding: 16px 0 0; border-top: 1px solid var(--text); }
.doc-figure svg { width: 100%; height: auto; display: block; }
.doc-figure figcaption { margin-top: 10px; font-size: 0.95rem; color: var(--faint); }
.doc-figure text { font-family: var(--sans); font-size: 13px; fill: var(--text); }
.doc-figure .d-sub { font-size: 11px; fill: var(--muted); }
.doc-figure .d-label text { font-size: 11px; fill: var(--faint); }
.doc-figure .d-box rect { fill: none; stroke: var(--faint); stroke-width: 1; }
.doc-figure .d-box.strong rect { stroke: var(--text); }
.doc-figure .d-box.dashed rect { stroke-dasharray: 4 4; }
.doc-figure .d-arrow path { fill: none; stroke: var(--accent-ink); stroke-width: 1.2; }

@media (max-width: 860px) {
  .doc { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .doc-toc { position: static; padding-top: 8px; }
  .doc-toc ol { columns: 2; column-gap: 24px; }
}
@media (max-width: 560px) {
  .doc-toc ol { columns: 1; }
  .doc-figure { overflow-x: auto; }
  .doc-figure svg { min-width: 560px; }
}
.doc-shot { margin: 22px 0 26px; }
.doc-shot img { width: 100%; height: auto; border: 1px solid var(--rule); }
.doc-shot figcaption { margin-top: 8px; font-size: 0.95rem; color: var(--faint); }

/* Margin notes: a pencilled aside beside an entry. Inline below it on narrow
   screens; in a right-hand margin on wide ones. */
.margin-note {
  margin: 12px 0 0;
  padding-left: 12px;
  border-left: 1px solid var(--hi);
 
  font-size: 0.98rem;
  line-height: 1.45;
  color: var(--faint);
  max-width: 46em;
}
.card p.margin-note { color: var(--faint); font-size: 0.98rem; }
@media (min-width: 1100px) {
  .has-note { position: relative; padding-right: 16rem; }
  .has-note > .margin-note { position: absolute; top: 18px; right: 0; width: 13rem; margin: 0; }
}

/* Board games: shelf entries reuse the bibliography entry, plus a facts line. */
.game { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 24px; align-items: start; }
.game[hidden] { display: none; }
.game .box { display: block; }
.game .box img { width: 100%; height: auto; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18); }
.game .kind { float: right; margin-left: 12px; }
.game .game-x { margin: 6px 0 0; font-size: 0.98rem; color: var(--muted); }
.game .game-facts { margin: 6px 0 0; font-size: 0.98rem; color: var(--faint); }
#game-list { margin-top: 10px; }
@media (max-width: 560px) {
  .game { grid-template-columns: 76px minmax(0, 1fr); gap: 16px; }
  .game .kind { float: none; display: block; margin: 0 0 4px; }
}

/* Blog index: the latest post as a cover, then the photo archive. */
.post-feature { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 44px; align-items: end; padding-top: 28px; border-top: 1px solid var(--rule); text-decoration: none; color: inherit; }
.post-feature img { width: 100%; height: auto; border-radius: var(--radius); }
.post-feature h2 { font-size: clamp(2rem, 3.6vw, 2.7rem); margin: 0 0 14px; }
.post-feature p:not(.eyebrow) { font-size: 1.25rem; line-height: 1.55; color: var(--muted); margin: 0 0 18px; }
.post-feature:hover h2 { text-decoration: underline; text-decoration-color: var(--hi); text-decoration-thickness: 2px; text-underline-offset: 6px; }
.archive-head { margin-top: 48px; }
.archive-head:first-of-type { margin-top: 0; }
@media (max-width: 860px) {
  .post-feature { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}

/* Archive galleries show whole photos, flowing as columns. */
/* Justified rows: each photo grows in proportion to its width/height ratio
   (--r, set per figure), so photos in a row share one height uncropped. */
.gallery { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 24px; }
.gallery::after { content: ""; flex: 10 1 0; }
.gallery .photo { flex: var(--r, 0.75) 1 calc(var(--r, 0.75) * 260px); min-width: 0; }
.gallery .photo img { width: 100%; height: auto; aspect-ratio: auto; object-fit: contain; }
@media (max-width: 860px) { .gallery .photo { flex-basis: calc(var(--r, 0.75) * 150px); } .gallery { gap: 10px; } }

/* Blog posts read as a photo essay: a full-width opener, one big column of
   text, and photos set large between paragraphs. */
.essay-hero { position: relative; max-width: 1600px; margin: 0 auto; background: #111; }
.essay-hero video, .essay-hero img { display: block; width: 100%; height: auto; }
.essay-hero-text { position: absolute; inset: auto 0 0 0; padding: 120px 0 40px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.62)); color: #fff; }
.essay-hero h1 { color: #fff; margin: 0; font-size: clamp(2.6rem, 6.5vw, 4.8rem); max-width: 16ch; }
.essay-kicker { margin: 0 0 8px; font-size: 1.1rem; color: rgba(255, 255, 255, 0.85); }
.essay-kicker a { color: inherit; text-decoration-color: rgba(255, 255, 255, 0.5); }
.essay-credit { margin-top: 10px; color: var(--faint); font-size: 0.98rem; }
.essay article { padding: 40px 0 24px; }
.essay-text { max-width: 700px; margin: 0 auto; padding: 0 24px; }
.essay-text p { font-size: clamp(1.3rem, 2vw, 1.5rem); line-height: 1.6; color: var(--text); margin: 0 0 26px; }
.essay article > .essay-text:first-child p:first-child::first-letter { float: left; font-size: 4.7em; line-height: 0.8; padding: 0.08em 0.1em 0 0; }
.essay-fig, .essay-pair { margin: 20px auto 52px; padding: 0 24px; }
.essay-fig { max-width: 620px; }
.essay-pair { max-width: 920px; display: flex; gap: 18px; align-items: flex-start; }
.essay-pair .photo { flex: var(--r, 1) 1 0; min-width: 0; }
.essay .photo { margin: 0; }
.essay .photo img, .essay .photo video { display: block; width: 100%; height: auto; aspect-ratio: auto; object-fit: contain; border-radius: var(--radius); background: var(--rule); }
.essay-fig .photo img, .essay-fig .photo video { max-height: 86vh; width: auto; max-width: 100%; margin: 0 auto; }
.essay .photo figcaption { margin-top: 8px; font-size: 1.02rem; color: var(--faint); text-align: center; }
.essay-end { display: flex; gap: 6px 22px; padding-bottom: 72px; }
@media (max-width: 700px) {
  .essay-hero { background: none; }
  .essay-hero-text { position: static; padding: 18px 0 0; background: none; color: var(--text); }
  .essay-hero h1 { color: var(--text); }
  .essay-kicker { color: var(--faint); }
  .essay-kicker a { text-decoration-color: var(--faint); }
}
@media (max-width: 560px) {
  .essay-pair { gap: 10px; }
  .essay-text, .essay-fig, .essay-pair { padding: 0 16px; }
}

/* Click-to-zoom for blog photos. */
.zoomable { cursor: zoom-in; }
.lightbox { border: 0; padding: 0; margin: auto; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; background: transparent; }
.lightbox::backdrop { background: rgba(12, 12, 11, 0.92); }
.lightbox-inner { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; padding: 24px 64px; box-sizing: border-box; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 100px); object-fit: contain; }
.lightbox p { margin: 12px 0 0; color: #d8d4cb; font-size: 1.05rem; text-align: center; }
.lightbox button { position: absolute; top: 50%; transform: translateY(-50%); background: none; border: 0; color: #d8d4cb; font: inherit; font-size: 2.4rem; padding: 12px; cursor: pointer; }
.lightbox .lb-prev { left: 8px; }
.lightbox .lb-next { right: 8px; }
.lightbox .lb-close { top: 28px; right: 12px; transform: none; font-size: 1.8rem; }
@media (max-width: 560px) { .lightbox-inner { padding: 16px; } .lightbox .lb-prev, .lightbox .lb-next { display: none; } }

/* "Currently reading" sits in the dark page head. */
.page-head .now-reading { background: none; border-color: var(--ink-rule); color: var(--on-ink); }
.page-head .now-reading span { color: var(--on-ink-faint); }
.page-head .now-reading .eyebrow { color: var(--accent); }
.page-head .doc-meta { color: var(--on-ink-faint); }

/* CV page: each PDF page sits on a white card, drawn by assets/cv.js. */
.page-head .btn { color: var(--on-ink); border-color: #5c5c57; }
.page-head .btn:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.page-head .btn.primary { color: #161614; border-color: var(--accent); }
.page-head .btn.primary:hover { color: #161614; }
.cv-section { padding-top: clamp(32px, 5vw, 56px); }
.cv-pages { max-width: 880px; margin: 0 auto; }
.cv-page {
  position: relative;
  aspect-ratio: 8.5 / 11;
  background: #fff;
  border: 1px solid var(--card-rule);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(22, 22, 20, 0.04), 0 8px 24px rgba(22, 22, 20, 0.06);
}
.cv-page canvas { display: block; width: 100%; height: 100%; }
.cv-link { position: absolute; border-radius: 3px; }
.cv-link:hover, .cv-link:focus-visible { background: color-mix(in srgb, var(--accent) 18%, transparent); outline: none; }
.cv-page-no { margin: 10px 0 28px; text-align: center; font-family: var(--mono); font-size: 12px; color: var(--faint); }
.cv-embed { display: block; width: 100%; height: 80vh; border: 1px solid var(--card-rule); border-radius: var(--radius); background: #fff; }
.cv-fallback { max-width: 880px; margin: 0 auto; color: var(--muted); }
