:root {
  --bg: #f6f4ee;
  --surface: #fdfcf8;
  --ink: #1d211e;
  --muted: #5c645e;
  --line: #d9d6cb;
  --accent: #2f5d46;
  --accent-ink: #ffffff;
  --serif: "Newsreader", Georgia, serif;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151916;
    --surface: #1c211d;
    --ink: #e9ebe5;
    --muted: #a0a89f;
    --line: #333a34;
    --accent: #8fc7a6;
    --accent-ink: #12261b;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
}

a { color: var(--accent); text-underline-offset: 0.18em; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 0.75rem; z-index: 2; }

.top, main, .foot { width: min(68rem, 100% - 2rem); margin-inline: auto; }

.top {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding: 0.9rem 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  font-size: 0.9375rem;
}
.brand { color: var(--ink); font-weight: 600; text-decoration: none; }
.top nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.top nav a { color: var(--muted); text-decoration: none; }
.top nav a:hover { color: var(--accent); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 17rem;
  gap: 4rem;
  align-items: center;
  padding: 5.5rem 0 5rem;
}
.eyebrow, .when, .year, .lang {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--muted);
}
h1 {
  margin: 1rem 0 1.5rem;
  font: 400 clamp(2.4rem, 5.4vw, 4rem)/1.08 var(--serif);
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.lede { max-width: 38rem; font-size: 1.1875rem; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.button {
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 500;
  text-decoration: none;
}
.button.ghost { background: transparent; color: var(--accent); }
.button:hover { opacity: 0.85; }

.graph svg { display: block; width: 100%; height: auto; }
.graph figcaption { margin-top: 0.75rem; font-size: 0.875rem; line-height: 1.45; color: var(--muted); }
.edges path { fill: none; stroke: var(--muted); stroke-width: 1.25; }
.arrowhead { fill: var(--muted); }
.nodes circle { fill: var(--surface); stroke: var(--accent); stroke-width: 1.5; }
.nodes text { fill: var(--ink); font: 500 14px var(--mono); text-anchor: middle; }

.block {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 2rem;
  padding: 3.5rem 0;
  border-top: 1px solid var(--line);
}
h2 { font: 400 1.625rem/1.2 var(--serif); }
.content { max-width: 50rem; }

.role + .role { margin-top: 3rem; }
.role header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1.5rem; margin-bottom: 0.6rem; }
.role h3 { font-size: 1.125rem; font-weight: 600; line-height: 1.4; }
.role h3 span { display: block; font-weight: 400; color: var(--muted); }
.role ul { margin-top: 0.75rem; }
.role li { position: relative; padding-left: 1.1rem; }
.role li + li { margin-top: 0.35rem; }
.role li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 0.45rem; height: 1px; background: var(--accent); }
.stack { margin-top: 0.9rem; font: 400 0.8125rem/1.6 var(--mono); color: var(--muted); }

.earlier { margin-top: 3rem; padding-top: 1.25rem; border-top: 1px dashed var(--line); }
.earlier summary { cursor: pointer; font-weight: 500; }
.earlier dl { margin-top: 1rem; }
.earlier dt { font-weight: 500; margin-top: 0.85rem; }
.earlier dd { color: var(--muted); }

.skills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.75rem 2.5rem; }
.skills h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.25rem; }
.skills p { color: var(--muted); }

.intro { margin-bottom: 1.75rem; }
.papers li { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr); gap: 0.75rem; padding: 1rem 0; border-top: 1px solid var(--line); }
.papers .year { padding-top: 0.2rem; }
.papers a:not(.quiet), .paper-title { font-weight: 500; }
.papers p { font-size: 0.9375rem; color: var(--muted); }
.profiles { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin-top: 1.25rem; }

.sub { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; }
.sub:not(:first-child) { margin-top: 2.5rem; }
.repos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.repo {
  display: block;
  padding: 1.1rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  text-decoration: none;
}
.repo:hover { border-color: var(--accent); }
.repo strong { font-family: var(--mono); font-weight: 500; color: var(--accent); overflow-wrap: anywhere; }
.repo .lang { margin-left: 0.6rem; }
.repo p { margin-top: 0.4rem; font-size: 0.9375rem; color: var(--muted); }

.studies li { padding: 0.55rem 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9375rem; }
.studies a { font-family: var(--mono); margin-right: 0.35rem; }

.education dt { font-weight: 500; }
.education dt span { display: block; font: 400 0.8125rem/1.6 var(--mono); color: var(--muted); }
.education dd { margin-bottom: 1.25rem; color: var(--muted); }
.education dd:last-child { margin-bottom: 0; }

.about { display: grid; grid-template-columns: 10rem minmax(0, 1fr); gap: 2.5rem; align-items: center; }
.about img { display: block; width: 100%; max-width: 10rem; height: auto; border-radius: 4px; }
.big-quote { margin-bottom: 0.75rem; font: 400 clamp(1.5rem, 3.4vw, 2.25rem)/1.2 var(--serif); }

.big { font: 400 clamp(1.4rem, 4.2vw, 2.25rem)/1.2 var(--serif); overflow-wrap: anywhere; }

.foot { padding: 1.75rem 0 2.5rem; border-top: 1px solid var(--line); font-size: 0.9375rem; color: var(--muted); }

@media (max-width: 820px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 2.5rem; padding: 3rem 0; }
  .graph { max-width: 15rem; }
  .block { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; padding: 2.5rem 0; }
}

@media (max-width: 560px) {
  .skills, .repos, .about { grid-template-columns: minmax(0, 1fr); }
  .about { gap: 1.5rem; }
}

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

@media print {
  .top, .actions, .graph { display: none; }
  .hero { grid-template-columns: minmax(0, 1fr); padding: 1rem 0; }
  details > * { display: block; }
}
