:root {
  --ink: #16202A;
  --ink-2: #3D4955;
  --muted: #5B6672;
  --line: #E3E7EC;
  --line-2: #C9D1DA;
  --bg: #FFFFFF;
  --panel: #F8FAFB;
  --placeholder: #EEF1F4;
  --tint: #E8F0F8;
  --accent: #0B4F8A;
  --accent-hover: #06335C;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
img { max-width: 100%; }
.mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 24px; }

/* Header & footer */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px 32px; padding-top: 18px; padding-bottom: 18px;
}
.site-name { font-weight: 600; font-size: 18px; color: var(--ink); }
.site-name:hover { text-decoration: none; color: var(--ink); }
nav { display: flex; flex-wrap: wrap; gap: 4px 22px; font-size: 15px; }
nav a { color: var(--ink-2); padding: 10px 0; }
nav a[aria-current="page"] { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
.site-footer { border-top: 1px solid var(--line); margin-top: 48px; }
.site-footer .wrap {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  padding-top: 28px; padding-bottom: 40px; font-size: 14px; color: var(--muted);
}

/* Type */
section { border-top: 1px solid var(--line); padding: 48px 0; }
section:first-of-type { border-top: 0; }
h1 { margin: 0; font-size: 44px; line-height: 1.12; font-weight: 600; letter-spacing: -0.01em; }
h2 { margin: 0 0 24px; font-size: 24px; font-weight: 600; line-height: 1.3; }
h3 { margin: 0 0 8px; font-size: 18px; font-weight: 600; line-height: 1.4; }
.lede { margin: -16px 0 24px; color: var(--ink-2); max-width: 700px; }
.lede-lg { margin: 0; font-size: 19px; color: var(--ink-2); max-width: 720px; }
.kicker { font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent); }
.note { font-size: 14px; color: var(--muted); margin-top: 16px; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 24px; }
.section-head h2 { margin: 0; }
.crumb { display: inline-block; margin-top: 32px; font-size: 14px; }

/* Page header (subpages) */
.page-head { display: flex; flex-direction: column; gap: 14px; padding: 24px 0 36px; }

/* Hero (home) */
.hero { display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-start; padding: 64px 0 56px; }
.headshot {
  flex: 0 0 200px; height: 240px; border-radius: 10px; object-fit: cover;
  background: var(--placeholder); display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 14px;
}
.hero-text { flex: 999 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.bio { margin: 0; font-size: 18px; color: var(--ink-2); max-width: 700px; }
.links { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 15px; padding-top: 4px; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }
.chips a {
  font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 13px;
  padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 6px; color: var(--ink);
}
.chips a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.tags li { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--tint); color: var(--accent-hover); }

/* Organism cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.card {
  display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; background: var(--bg); color: var(--ink);
}
a.card:hover { text-decoration: none; border-color: var(--accent); color: var(--ink); }
.card .body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card .body p { margin: 0; color: var(--ink-2); font-size: 15px; }
.card .more { margin-top: auto; padding-top: 6px; font-size: 14px; color: var(--accent); }
.card h3 { margin: 0; }
.media {
  position: relative; aspect-ratio: 16 / 10; background: var(--tint); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media .fallback { font-style: italic; font-size: 22px; color: var(--accent-hover); padding: 16px; text-align: center; }
.media img + .fallback { display: none; }
.cards.compact { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.cards.compact .media { aspect-ratio: 16 / 9; }
.cards.compact .body { padding: 12px 14px 16px; gap: 4px; }
.cards.compact h3 { font-size: 16px; }
.cards.compact .body p { font-size: 14px; }
/* Keeps cards at column width when there are only one or two (LLM-fun page). */
.cards.fill { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

/* Long-form pages */
.prose { max-width: 720px; }
.prose p, .prose li { color: var(--ink-2); }
.prose h2 { margin: 40px 0 12px; font-size: 22px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose blockquote { margin: 0; padding-left: 16px; border-left: 3px solid var(--line-2); color: var(--muted); }
figure { margin: 28px 0; }
figure img { display: block; width: 100%; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); }
figcaption { margin-top: 10px; font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.credit { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); }
.lead-figure { max-width: 720px; }
.lead-figure img { max-height: 520px; object-fit: contain; }
.fig-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; align-items: start; margin: 28px 0; }
.fig-row figure { margin: 0; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 24px; margin: 8px 0 0; }
.facts dt { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.facts dd { margin: 2px 0 0; }
.refs { font-size: 14px; }
.refs li { margin-bottom: 8px; }

/* News & updates */
.news { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.news li { display: flex; flex-wrap: wrap; gap: 4px 24px; line-height: 1.5; }
.news .date { flex: 0 0 96px; font-size: 14px; color: var(--muted); padding-top: 2px; }
.news .item { flex: 1 1 400px; min-width: 0; }
.post-list { list-style: none; margin: 0; padding: 0; }
.post-list .year { font-size: 14px; font-weight: 600; color: var(--muted); padding: 28px 0 8px; border-bottom: 1px solid var(--line); }
.post-list .entry { display: flex; flex-wrap: wrap; gap: 4px 24px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.post-list .date { flex: 0 0 96px; font-size: 14px; color: var(--muted); padding-top: 3px; }
.post-list .text { flex: 1 1 420px; min-width: 0; }
.post-list h3 { margin: 0 0 4px; }
.post-list p { margin: 0; color: var(--ink-2); font-size: 15px; }
.post-list .kind { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }

/* Publications */
.pubs { display: flex; flex-direction: column; gap: 28px; }
.pub h3 { margin-bottom: 6px; }
.pub .meta { font-size: 15px; color: var(--ink-2); line-height: 1.5; }
.pub .chips { padding-top: 10px; }
.me { font-weight: 600; color: var(--ink); }
.subhead { margin: 36px 0 14px; font-size: 15px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.plain { margin: 0; padding-left: 20px; color: var(--ink-2); font-size: 15px; display: flex; flex-direction: column; gap: 8px; }

/* Embedded simulation */
.sim-frame {
  display: block; width: 100%; height: 600px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--panel);
}
.sim-caption { margin-top: 10px; font-size: 14px; color: var(--muted); }

/* Tables */
.table-box { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 15px; }
th { background: var(--panel); text-align: left; font-weight: 600; padding: 12px 16px; }
td { padding: 14px 16px; border-top: 1px solid var(--line); vertical-align: top; }
td.muted { color: var(--ink-2); }
td.date { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 13px; color: var(--muted); white-space: nowrap; }

/* Positions */
.cv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 32px; }
.cv-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.cv-list .when { font-size: 13px; color: var(--muted); }
.cv-list .what { font-weight: 600; }
.cv-list .where { color: var(--ink-2); font-size: 15px; }

@media (max-width: 560px) {
  h1 { font-size: 34px; }
  .headshot { flex-basis: 100%; height: 220px; }
}
