/* Layout: institutional single column (max 64rem), quiet header with text nav,
   research as image-left / teaser-right rows. Neutral cool greys, one slate accent. */
:root {
  --bg: #fafbfb;
  --surface: #ffffff;
  --fg: #1c2023;
  --muted: #5a636a;
  --rule: #dde1e3;
  --accent: #3b5566;
  --accent-soft: #eef2f4;
  --exp: #7a5a3a;
  --font-display: "Newsreader", "Iowan Old Style", Georgia, serif;
  --font-body: "Public Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: 2.2rem;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15181a; --surface: #1c2023; --fg: #e4e7e9; --muted: #9aa3a9;
    --rule: #2e3438; --accent: #9fbccc; --accent-soft: #222a2f; --exp: #d0b08e; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15181a; --surface: #1c2023; --fg: #e4e7e9; --muted: #9aa3a9;
  --rule: #2e3438; --accent: #9fbccc; --accent-soft: #222a2f; --exp: #d0b08e; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--font-body); font-size: var(--step-0); line-height: 1.6;
}
a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
img { max-width: 100%; height: auto; display: block; }

.wrap { max-width: 64rem; margin: 0 auto; padding-inline: 1.25rem; }

/* Header */
.site-header { border-bottom: 1px solid var(--rule); background: var(--surface); }
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 0.75rem 2rem; padding-block: 1.25rem;
}
.brand { text-decoration: none; color: var(--fg); display: grid; gap: 0.1rem; }
.brand-name { font-family: var(--font-display); font-size: var(--step-2); font-weight: 500; line-height: 1.1; }
.brand-sub { font-size: var(--step--1); color: var(--muted); letter-spacing: 0.02em; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
.site-nav a { text-decoration: none; color: var(--muted); font-size: 0.95rem; padding-block: 0.25rem; border-bottom: 2px solid transparent; }
.site-nav a:hover { color: var(--fg); }
.site-nav a[aria-current="page"] { color: var(--fg); border-bottom-color: var(--accent); }

main { padding-block: 2.5rem 4rem; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; line-height: 1.2; text-wrap: balance; margin: 0; }
h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }
p { margin: 0; }
.lede { font-size: 1.125rem; color: var(--fg); max-width: 40rem; }
.stack { display: grid; gap: 1rem; }
.section { display: grid; gap: 1.25rem; padding-top: 2.5rem; margin-top: 2.5rem; border-top: 1px solid var(--rule); }
.eyebrow { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); font-size: 0.9em; }

/* Home: topic strip */
.topic-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); gap: 1rem; }
.topic-link { display: grid; gap: 0.5rem; text-decoration: none; color: var(--fg); }
.topic-link .thumb { aspect-ratio: 4 / 3; background: #ffffff; border: 1px solid var(--rule); display: grid; place-items: center; padding: 0.5rem; overflow: hidden; }
.topic-link .thumb img { width: 100%; height: 100%; object-fit: contain; }
.topic-link span { font-size: 0.95rem; line-height: 1.35; }
.topic-link:hover span { color: var(--accent); }

/* News */
.news { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.news li { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding-block: 0.75rem; border-bottom: 1px solid var(--rule); }
.news li > * { min-width: 0; }
.news time { color: var(--muted); font-size: var(--step--1); font-variant-numeric: tabular-nums; padding-top: 0.1rem; }

/* Research */
.toc { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0; margin: 0; list-style: none; }
.toc a { display: inline-block; text-decoration: none; font-size: var(--step--1); padding: 0.3rem 0.75rem; border: 1px solid var(--rule); border-radius: 999px; color: var(--fg); background: var(--surface); }
.toc a:hover { border-color: var(--accent); color: var(--accent); }
.topic { display: grid; grid-template-columns: 17rem 1fr; gap: 1rem 1.75rem; padding-block: 2rem; border-top: 1px solid var(--rule); scroll-margin-top: 1rem; }
.topic:first-of-type { border-top: 0; }
.topic > * { min-width: 0; }
.topic > .topic-h { grid-column: 1 / -1; }
.topic figure { margin: 0; display: grid; gap: 0.5rem; align-content: start; }
.topic .frame { background: #ffffff; border: 1px solid var(--rule); aspect-ratio: 4 / 3; display: grid; place-items: center; padding: 0.6rem; overflow: hidden; }
.topic .frame img { width: 100%; height: 100%; object-fit: contain; }
.topic figcaption { font-size: 0.8rem; color: var(--muted); line-height: 1.45; }
.topic .body { display: grid; gap: 0.75rem; align-content: start; }
.topic .body p { max-width: 38rem; }
.refs { font-size: var(--step--1); color: var(--muted); display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
.refs a { white-space: nowrap; }

/* People */
.pi { display: grid; grid-template-columns: 9rem 1fr; gap: 1.5rem; align-items: start; }
.pi > * { min-width: 0; }
.pi > img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border: 1px solid var(--rule); }
.photo-ph { aspect-ratio: 4 / 5; background: var(--accent-soft); border: 1px dashed var(--rule); display: grid; place-items: center; color: var(--muted); font-size: 0.75rem; text-align: center; padding: 0.5rem; }
.members { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; }
.member { background: var(--surface); border: 1px solid var(--rule); padding: 1.1rem 1.25rem; display: grid; gap: 0.35rem; align-content: start; }
.member .role { font-size: var(--step--1); color: var(--muted); }
.links { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; font-size: var(--step--1); }
.table-scroll { overflow-x: auto; }
table.alumni { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
table.alumni th, table.alumni td { text-align: left; vertical-align: top; padding: 0.55rem 0.75rem 0.55rem 0; border-bottom: 1px solid var(--rule); }
table.alumni th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 500; }
table.alumni td.yr { font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
table.alumni td.thesis { color: var(--muted); font-style: italic; min-width: 16rem; }
.postdocs { columns: 2 16rem; column-gap: 2rem; margin: 0; padding-left: 1.1rem; }
.postdocs li { break-inside: avoid; padding-block: 0.15rem; }

/* Publications */
.pubs { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.pubs li { padding-block: 0.9rem; border-bottom: 1px solid var(--rule); display: grid; gap: 0.2rem; }
.pubs .t { font-weight: 600; }
.pubs .a { color: var(--muted); font-size: 0.95rem; }
.pubs .j { font-size: 0.95rem; }
.pubs .j em { font-style: italic; }
.pubs .tag { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.ext { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.btn { display: inline-block; text-decoration: none; padding: 0.5rem 1rem; border: 1px solid var(--accent); color: var(--accent); font-size: 0.95rem; }
.btn:hover { background: var(--accent-soft); }

/* Footer */
.site-footer { border-top: 1px solid var(--rule); background: var(--surface); font-size: var(--step--1); color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; padding-block: 1.75rem; }
.site-footer address { font-style: normal; line-height: 1.55; }
.site-footer .contact { user-select: all; }

@media (max-width: 40rem) {
  .topic { grid-template-columns: 1fr; gap: 1rem; }
  .pi { grid-template-columns: 1fr; }
  .pi .photo-ph, .pi > img { max-width: 9rem; }
  .news li { grid-template-columns: 1fr; gap: 0.15rem; }
  h1 { font-size: 1.85rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* Computation / Experiment */
.kind { display: inline-block; justify-self: start; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 0.12rem 0.5rem; border: 1px solid var(--rule); color: var(--muted); background: var(--surface); }
.kind-exp { border-color: var(--exp); color: var(--exp); }
.kind-comp { border-color: var(--accent); color: var(--accent); }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1.25rem; margin-top: 2.5rem; }
.half { background: var(--surface); border: 1px solid var(--rule); border-top: 3px solid var(--accent); padding: 1.5rem; display: grid; gap: 0.75rem; align-content: start; }
.half:last-child { border-top-color: var(--exp); }
.half > * { min-width: 0; }
.mini { list-style: none; margin: 0.25rem 0 0; padding: 0; display: grid; gap: 0.6rem; }
.mini a { display: grid; grid-template-columns: 4.5rem 1fr; gap: 0.85rem; align-items: center; text-decoration: none; color: var(--fg); }
.mini img { width: 4.5rem; height: 3.4rem; object-fit: contain; background: #ffffff; border: 1px solid var(--rule); padding: 0.2rem; }
.mini a:hover span { color: var(--accent); }
.small { font-size: var(--step--1); }
.toc-group { display: grid; gap: 0.4rem; }
.group-h { margin-top: 2.5rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--fg); font-size: var(--step-1); text-transform: uppercase; letter-spacing: 0.08em; font-family: var(--font-body); font-weight: 600; scroll-margin-top: 1rem; }
.filter { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.filter button { font: inherit; font-size: var(--step--1); padding: 0.3rem 0.85rem; border: 1px solid var(--rule); background: var(--surface); color: var(--fg); border-radius: 999px; cursor: pointer; }
.filter button[aria-pressed="true"] { border-color: var(--fg); background: var(--fg); color: var(--bg); }
