:root {
  --bg: #faf8f4;
  --ink: #1c1b18;
  --muted: #78736a;
  --line: #e6e1d7;
  --card: #ffffff;
  --gold: #a8720a;
  --gold-soft: #f4ead2;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131210;
    --ink: #e8e4dc;
    --muted: #8f887c;
    --line: #2a2721;
    --card: #1b1916;
    --gold: #e0b04f;
    --gold-soft: #2e2718;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131210;
  --ink: #e8e4dc;
  --muted: #8f887c;
  --line: #2a2721;
  --card: #1b1916;
  --gold: #e0b04f;
  --gold-soft: #2e2718;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.7 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  max-width: 680px;
  margin: 0 auto;
  padding: 2.25rem 1.25rem 4rem;
  -webkit-font-smoothing: antialiased;
}

#progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: var(--gold); z-index: 10;
}

/* ---- header ---- */
.site-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 2.5rem;
}
.wordmark {
  font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em;
  color: var(--ink); text-decoration: none;
}
.wordmark span { color: var(--gold); font-weight: 600; }
.site-head nav { display: flex; gap: 1rem; }
.site-head nav a {
  color: var(--muted); text-decoration: none; font-size: 0.9rem; font-weight: 600;
}
.site-head nav a:hover { color: var(--gold); }
#theme-btn {
  background: none; border: none; cursor: pointer; color: var(--muted);
  padding: 0.15rem; line-height: 1;
}
#theme-btn:hover { color: var(--gold); }
#theme-btn svg { width: 1.05em; height: 1.05em; display: block; }

.tagline { color: var(--muted); font-size: 0.95rem; margin-bottom: 2rem; }

/* ---- home bio ---- */
.bio { margin-bottom: 2.5rem; }
.bio .hi { font-size: 1.15rem; line-height: 1.6; margin-bottom: 0.75rem; }
.bio .social { font-size: 0.85rem; color: var(--muted); margin-bottom: 1rem; }
.bio .social a { color: var(--muted); text-decoration: none; font-weight: 600; }
.bio .social a:hover { color: var(--gold); }
.now { font-size: 0.88rem; color: var(--muted); }
.now-label {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--gold);
  background: var(--gold-soft); border-radius: 99px; padding: 0.12rem 0.55rem;
  margin-right: 0.35rem;
}
.year {
  font-size: 0.8rem; font-weight: 700; color: var(--ink);
  margin: 1.1rem 0 0.15rem; font-variant-numeric: tabular-nums;
}
.more-link { margin-top: 0.6rem; font-size: 0.85rem; }
.more-link a { color: var(--gold); text-decoration: none; font-weight: 600; }
.more-link a:hover { text-decoration: underline; }

/* ---- cards (shared language with antifeed) ---- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.5rem 1.5rem 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.kicker {
  display: flex; gap: 0.6rem; align-items: baseline; flex-wrap: wrap;
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--gold); font-weight: 700; margin-bottom: 0.75rem;
}
.kicker .meta { color: var(--muted); font-weight: 500; letter-spacing: 0.05em; }
.card h2 { font-size: 1.45rem; line-height: 1.25; letter-spacing: -0.015em; margin-bottom: 0.5rem; }
.card h2 a { color: inherit; text-decoration: none; }
.card h2 a:hover { color: var(--gold); }
.card .hook { font-size: 1rem; color: var(--ink); margin-bottom: 1.25rem; }
.actions { display: flex; gap: 0.5rem; align-items: center; }
.go {
  background: var(--ink); color: var(--bg);
  border: none; border-radius: 10px; padding: 0.55rem 1.1rem;
  font-weight: 700; font-size: 0.92rem; text-decoration: none;
}

/* ---- lists ---- */
.list-section { margin-top: 2.5rem; }
.section-label {
  font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); margin: 1.5rem 0 0.5rem;
}
.page-title { font-size: 1.6rem; letter-spacing: -0.02em; margin-bottom: 0.5rem; }
.rows { list-style: none; padding: 0; }
.rows li { border-bottom: 1px solid var(--line); }
.rows li.exp { cursor: pointer; }
.rows .row {
  display: flex; gap: 0.85rem; align-items: baseline;
  padding: 0.85rem 0; text-decoration: none; color: inherit;
}
.rows .when {
  color: var(--muted); font-size: 0.78rem; white-space: nowrap; flex: none;
  font-variant-numeric: tabular-nums; min-width: 6.2em;
}
.rows .t { display: flex; flex-direction: column; gap: 0.1rem; flex: 1; min-width: 0; }
.rows .rt {
  font-weight: 600; font-size: 0.98rem; line-height: 1.35;
  color: inherit; text-decoration: none;
}
.rows .rt:hover, .rows .row:hover .rt { color: var(--gold); }
.rows .sub { color: var(--muted); font-size: 0.8rem; }

/* ---- projects: gallery of tiles (card language), image on top when there is one ---- */
.projects { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; align-items: start; }
.tile {
  display: flex; flex-direction: column; overflow: hidden; height: 100%;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04); color: inherit; text-decoration: none;
}
.tile .shot { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border-bottom: 1px solid var(--line); }
.tile .body { display: flex; flex-direction: column; gap: 0.2rem; padding: 0.9rem 1rem 1rem; }
.tile .rt { font-weight: 700; font-size: 1rem; line-height: 1.35; letter-spacing: -0.01em; }
.tile .sub { color: var(--muted); font-size: 0.86rem; line-height: 1.45; }
.tile .links { display: flex; gap: 0.9rem; margin-top: 0.5rem; }
.tile .go {
  background: none; padding: 0; border-radius: 0;
  font-size: 0.82rem; font-weight: 600; color: var(--gold); text-decoration: none;
}
.tile .go:hover { text-decoration: underline; }

/* ---- row expansion (shared language with antifeed) ---- */
.expand { margin: 0 0 0.9rem; animation: reveal 0.18s ease-out; cursor: default; }
@keyframes reveal {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: none; }
}
.card.mini { padding: 1.1rem 1.15rem 0.95rem; }
.card.mini .kicker { margin-bottom: 0.5rem; }
.card.mini .hook { font-size: 0.95rem; margin-bottom: 1rem; }
.card.mini .go { font-size: 0.85rem; padding: 0.45rem 0.95rem; }

/* ---- filters (traces) ---- */
.filters { display: flex; gap: 0.25rem; margin-bottom: 0.75rem; }
.filters button {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font: inherit; font-size: 0.82rem; font-weight: 600;
  padding: 0.25rem 0.55rem; border-radius: 8px;
}
.filters button.active { background: var(--gold-soft); color: var(--gold); }

/* ---- shelf: rows that link out, note always visible ---- */
.prose.intro { font-size: 0.95rem; color: var(--muted); margin-bottom: 1.5rem; }
.prose.intro p { margin-bottom: 0.75rem; }
.rows .ext::after { content: "\a0\2197"; color: var(--muted); font-weight: 500; font-size: 0.8em; }
.rows .note { font-size: 0.92rem; line-height: 1.55; margin-top: 0.35rem; }
.rows .note p, .rows .note blockquote { margin-bottom: 0.4rem; }
.rows .note > :last-child { margin-bottom: 0; }

/* ---- prose (posts) ---- */
.prose { font-size: 1.02rem; }
.prose h1 { font-size: 1.7rem; line-height: 1.2; letter-spacing: -0.02em; margin: 0.25rem 0 1.5rem; }
.prose h2 { font-size: 1.25rem; margin: 2rem 0 0.6rem; letter-spacing: -0.01em; }
.prose h3 { font-size: 1.05rem; margin: 1.5rem 0 0.5rem; }
.prose p, .prose ul, .prose ol { margin-bottom: 1.05rem; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose img {
  max-width: 100%; border-radius: 12px; border: 1px solid var(--line);
  margin: 0.5rem 0;
}
.prose blockquote {
  border-left: 3px solid var(--gold); padding: 0.1rem 0 0.1rem 1rem;
  color: var(--muted); margin-bottom: 1.05rem;
}
.prose code {
  background: var(--gold-soft); border-radius: 5px; padding: 0.1em 0.35em;
  font-size: 0.88em; font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.prose pre {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 1rem; overflow-x: auto; margin-bottom: 1.05rem;
}
.prose pre code { background: none; padding: 0; }
.prose hr { border: none; border-top: 1px solid var(--line); margin: 1.75rem 0; }

.post-tags { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.prose .chip { text-decoration: none; }
.chip {
  font-size: 0.75rem; color: var(--muted); text-decoration: none;
  border: 1px solid var(--line); border-radius: 99px; padding: 0.15rem 0.65rem;
  white-space: nowrap;
}
.chip:hover { color: var(--gold); border-color: var(--gold); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1rem; }

/* ---- talks: one row per talk, blurb always shown; the page leads with the slides ---- */
.talks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.talk {
  display: grid; grid-template-columns: 11rem 1fr; gap: 1.1rem; align-items: start;
  padding: 0.75rem; margin: 0 -0.75rem; border-radius: 12px; color: inherit; text-decoration: none;
  transition: background 0.15s;
}
.talk:hover { background: var(--card); }
.talk:hover .rt { color: var(--gold); }
.talk .poster { display: block; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--gold-soft); aspect-ratio: 16 / 10; }
.talk .poster img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.talk-body { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.talk-body .kicker { margin: 0; }
.talk-body .rt { font-weight: 700; font-size: 1.05rem; line-height: 1.35; letter-spacing: -0.01em; }
.talk-body .snip { color: var(--muted); font-size: 0.9rem; line-height: 1.5; }
.talk-body .has { font: 600 0.7rem/1 ui-monospace, Menlo, monospace; letter-spacing: 0.05em; text-transform: uppercase; color: var(--gold); margin-top: 0.3rem; }
.talk-head { margin-bottom: 1.5rem; }
.talk-title { font-size: 1.8rem; line-height: 1.15; letter-spacing: -0.025em; margin: 0.3rem 0 0.6rem; text-wrap: balance; }
.talk-head .lede { color: var(--muted); font-size: 1rem; line-height: 1.55; }
.talk-photo { display: block; width: 100%; border-radius: 12px; border: 1px solid var(--line); margin-bottom: 1.5rem; }

/* the slide viewer (markup: core/talk.js; behaviour: /deck-viewer.js). The slide
   runs wider than the text column; the chrome under it is ours, not the deck's */
.deck { margin: 0 -2.5rem 1.75rem; }
.deck .screen { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #0c1927; box-shadow: 0 1px 0 var(--line), 0 18px 40px -18px rgba(20, 16, 8, 0.45); }
.deck .screen iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.deck .screen:fullscreen { border-radius: 0; }
.deck .bar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.45rem 1rem; padding: 0.75rem 0.25rem 0; }
.deck .count { display: flex; align-items: center; gap: 0.25rem; font: 500 0.8rem/1 ui-monospace, Menlo, monospace; color: var(--muted); font-variant-numeric: tabular-nums; }
.deck .count b { color: var(--ink); font-weight: 700; }
.deck .num { padding: 0 0.35rem; }
.deck .arrow, .deck .full {
  background: none; border: 1px solid var(--line); color: var(--ink); width: 1.9rem; height: 1.9rem; border-radius: 50%;
  cursor: pointer; display: grid; place-items: center; font-size: 1rem; line-height: 1; padding: 0;
}
.deck .arrow:hover, .deck .full:hover { border-color: var(--gold); color: var(--gold); }
.deck button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.deck .rail { display: flex; gap: 3px; align-items: center; min-width: 0; height: 1.9rem; }
.deck .tick { flex: 1; height: 4px; border: 0; border-radius: 2px; background: var(--line); cursor: pointer; padding: 0; transition: background 0.15s, height 0.15s; }
.deck .tick:hover { height: 8px; }
.deck .tick.on { background: var(--gold); }
.deck .now-title { grid-column: 1 / -1; font-size: 0.82rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deck-out a { color: var(--gold); font-weight: 600; }
.extras { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0.75rem; margin-top: 1rem; }
.extra { display: flex; gap: 0.8rem; align-items: center; padding: 0.6rem; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: inherit; text-decoration: none; font-size: 0.9rem; }
.extra:hover b { color: var(--gold); }
.extra img, .extra .play-ic { width: 4.5rem; height: 3rem; object-fit: cover; border-radius: 6px; flex: none; }
.extra b { display: block; }
.extra .sub { color: var(--muted); font-size: 0.8rem; }
.extra .play-ic { background: var(--gold-soft); color: var(--gold); display: grid; place-items: center; }
@media (max-width: 760px) { .deck { margin-inline: -0.5rem; } }
@media (max-width: 480px) {
  .talk { grid-template-columns: 6.5rem 1fr; gap: 0.8rem; }
  .talk-title { font-size: 1.45rem; }
  .deck .screen { border-radius: 10px; }
}

/* ---- archived / previewed copy of the site ---- */
.frame-banner {
  font-size: 0.85rem; color: var(--muted); background: var(--gold-soft);
  border-radius: 10px; padding: 0.6rem 0.9rem; margin-bottom: 1.75rem;
}
.frame-banner a { color: var(--gold); font-weight: 600; text-decoration: none; }
.frame-banner a:hover { text-decoration: underline; }

/* ---- footer ---- */
footer { margin-top: 4rem; color: var(--muted); font-size: 0.78rem; }
footer a { color: var(--gold); text-decoration: none; font-weight: 600; }
footer a:hover { text-decoration: underline; }

@media (max-width: 480px) {
  body { padding: 1.5rem 1rem 3rem; }
  .card { padding: 1.15rem 1.1rem 1rem; }
  .rows .when { min-width: 5em; }
  .projects { grid-template-columns: 1fr; }
}

/* a talk with a video and no slides: the still, a play mark, and the way out */
.deck-video { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; margin-bottom: 1.5rem; background: #0c1927; color: #fff; text-decoration: none; border-radius: 12px; }
.deck-video img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.deck-video .play { position: absolute; inset: 0; margin: auto; width: 4rem; height: 4rem; border-radius: 50%; background: rgba(0, 0, 0, 0.6); display: grid; place-items: center; transition: transform 0.15s, background 0.15s; }
.deck-video .play svg { width: 1.8rem; height: 1.8rem; margin-left: 0.2rem; }
.deck-video:hover .play { transform: scale(1.06); background: var(--gold); }
.deck-video .watch { position: absolute; left: 0.75rem; bottom: 0.75rem; font-size: 0.85rem; font-weight: 700; background: rgba(0, 0, 0, 0.6); padding: 0.3rem 0.65rem; border-radius: 99px; }
