:root {
  --bg: #ffffff;
  --text: #1d2127;
  --muted: #626a75;
  --accent: #1a4b8c;
  --rule: #e4e6ea;
  --card: #f6f7f9;
  --badge-bg: #e8f0fb;
  --badge-text: #163f77;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171b;
    --text: #e3e6ea;
    --muted: #9aa2ad;
    --accent: #8fb8f0;
    --rule: #2a3038;
    --card: #1c2026;
    --badge-bg: #1f2f47;
    --badge-text: #b9d3f7;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16.5px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.wrap { max-width: 960px; margin: 0 auto; padding: 0 24px 64px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

nav {
  display: flex; flex-wrap: wrap; gap: 4px 22px; align-items: baseline;
  padding: 20px 0 14px; border-bottom: 1px solid var(--rule); font-size: 15px;
}
nav .name { font-weight: 650; margin-right: auto; color: var(--text); }
nav a:not(.name) { color: var(--muted); }
nav a:not(.name):hover { color: var(--accent); text-decoration: none; }

h1 { font-size: 2.1rem; line-height: 1.2; margin: 36px 0 6px; letter-spacing: -0.01em; }
h2 {
  font-size: 1.3rem; margin: 52px 0 14px; padding-bottom: 6px;
  border-bottom: 1px solid var(--rule); letter-spacing: -0.005em;
}
h3 { font-size: 1.12rem; line-height: 1.35; margin: 26px 0 4px; }
p { margin: 10px 0; }
.sub, .meta { color: var(--muted); }
.meta { font-size: 0.92rem; }

/* homepage header */
.intro { display: flex; gap: 32px; align-items: flex-start; margin-top: 40px; }
.intro h1 { margin-top: 0; }
.intro .sub { margin-top: 0; font-size: 1.05rem; }
.intro img {
  width: 210px; height: 210px; flex: none; border-radius: 10px; object-fit: cover;
  background: var(--card); border: 1px solid var(--rule);
}
@media (max-width: 620px) {
  .intro { flex-direction: column; gap: 18px; }
  .intro img { width: 150px; height: 150px; }
}

/* link buttons */
.links, .plinks { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; font-size: 14.5px; }
.links { margin: 16px 0 0; }
.plinks { margin: 12px 0 0; }
.links a, .plinks a, .soon {
  display: inline-block; padding: 4px 13px; border-radius: 999px;
  border: 1px solid var(--rule); background: var(--card); line-height: 1.5;
}
.links a:hover, .plinks a:hover { border-color: var(--accent); text-decoration: none; }
.plinks a.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.soon { color: var(--muted); border-style: dashed; background: none; }

/* dated lists: news, education, honors */
ul.dated { list-style: none; padding: 0; margin: 0; }
ul.dated li { display: flex; gap: 18px; padding: 6px 0; }
ul.dated .when { flex: none; width: 112px; color: var(--muted); font-size: 0.92rem; padding-top: 1px; }
ul.dated .what { flex: 1; min-width: 0; }
ul.dated .what .meta { display: block; }
@media (max-width: 520px) { ul.dated li { flex-direction: column; gap: 0; } }

/* publications: the whole teaser figure, then text */
.pub { margin: 26px 0 48px; }
.pub .teaser {
  display: block; background: #fff; border: 1px solid var(--rule); border-radius: 10px;
  overflow: hidden; padding: 14px;
}
.pub .teaser.flush { padding: 0; }
.pub .teaser img { display: block; width: 100%; height: auto; }
.pub .teaser.stack > img + img { margin-top: 12px; padding-top: 12px; border-top: 1px solid #e4e6ea; }
.pub .teaser .pair {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid #e4e6ea;
}
/* animations get the thin black frame that the plotted result panels carry in the image itself */
.pub .teaser .pair img { border: 1px solid #222; }
@media (max-width: 620px) { .pub .teaser .pair { grid-template-columns: 1fr; } }
.pub .teaser.narrow img { max-width: 760px; margin: 0 auto; }
/* method figure on the left, two rows of three square results on the right
   (two latent sweeps and a generated video per system); the column ratio is the
   figure's aspect ratio, so both sides come out the same height */
.pub .teaser.split { display: grid; grid-template-columns: 2.553fr 1.5fr; gap: 12px; align-items: center; }
.pub .teaser.split .quad { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.pub .teaser.split .quad img { aspect-ratio: 1; object-fit: cover; }
@media (max-width: 620px) { .pub .teaser.split { grid-template-columns: 1fr; } }
.pub h3 { margin: 16px 0 4px; }
.pub h3 a { color: var(--text); }
.pub h3 a:hover { color: var(--accent); text-decoration: none; }
.pub p { margin: 4px 0 0; }
.pub .authors { font-size: 0.97rem; }
p.venue { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 6px; }
.badge {
  display: inline-block; padding: 1px 10px; border-radius: 4px; font-size: 0.84rem; font-weight: 600;
  background: var(--badge-bg); color: var(--badge-text); white-space: nowrap;
}
.pub p.tldr { margin-top: 8px; }
.pub p.plinks { margin-top: 12px; }

/* project pages */
.back { margin-top: 28px; }
.phead h1 { margin-top: 18px; }
.phead .authors { font-size: 1.02rem; margin: 10px 0 2px; }
.phead .plinks { margin-top: 16px; }
.result {
  margin: 18px 0; padding: 6px 20px; background: var(--card);
  border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0;
}
.eq {
  position: relative; text-align: center; margin: 14px 0; overflow-x: auto; white-space: nowrap;
  font: 1.15rem/1.6 "STIX Two Text", "Cambria Math", "Times New Roman", Georgia, serif;
}
.bar { text-decoration: overline; }
/* Contain KaTeX's absolutely positioned accessibility text inside scrolling regions. */
.tablewrap { position: relative; overflow-x: auto; margin: 22px 0 8px; }
table {
  border-collapse: collapse; font-size: 0.93rem; margin: 0 auto;
  border-top: 2px solid var(--text); border-bottom: 2px solid var(--text);
  font-variant-numeric: tabular-nums;
}
th, td { padding: 7px 22px; text-align: center; border-bottom: 1px solid var(--rule); white-space: nowrap; }
thead th { color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--text); }
tbody th { text-align: left; font-weight: 600; }
thead th:first-child { text-align: left; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
table.compact th, table.compact td { padding: 7px 10px; }
table.compact thead th { text-align: center; line-height: 1.3; }
table.compact thead th.grp { border-bottom: 1px solid var(--rule); }
table.compact thead th:first-child { text-align: left; }
tr.group th { color: var(--muted); font-size: 0.86rem; padding-top: 12px; }
td.crit { background: var(--badge-bg); }
.tnote { text-align: center; margin: 0 0 22px; }
.tablewrap + p:not(.tnote) { margin-top: 22px; }
@media (max-width: 620px) { th, td { padding: 6px 12px; } }
figure { margin: 20px 0; }
figure img {
  display: block; width: 100%; height: auto; background: #fff;
  border: 1px solid var(--rule); border-radius: 10px;
}
figure.pad img { padding: 14px; }
figure.narrow { max-width: 780px; margin-left: auto; margin-right: auto; }
figcaption { margin-top: 8px; color: var(--muted); font-size: 0.92rem; line-height: 1.5; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid2 figure { margin: 0; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }

footer {
  margin-top: 60px; padding-top: 14px; border-top: 1px solid var(--rule);
  color: var(--muted); font-size: 13.5px; display: flex; flex-wrap: wrap; gap: 4px 18px;
}
footer a { color: var(--muted); }
