:root {
  --paper: #F7F4EF;
  --surface: #FFFFFF;
  --ink: #2F3A52; --head: #11203D;
  --muted: #5C6579;
  --line: #DCD6CC;
  --teal: #B31B1B;
  --teal-ink: #FFFFFF;
  --indigo: #46567A;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0F1729; --surface: #162038; --ink: #CBD3E3; --head: #F2F5FB; --muted: #94A0B8;
    --line: #26324D; --teal: #EE6B66; --teal-ink: #0F1729; --indigo: #8A9BC0;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0F1729; --surface: #162038; --ink: #CBD3E3; --head: #F2F5FB; --muted: #94A0B8;
  --line: #26324D; --teal: #EE6B66; --teal-ink: #0F1729; --indigo: #8A9BC0;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--serif); font-size: 1.0625rem; line-height: 1.62;
  text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: underline; text-decoration-color: var(--teal); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--teal); }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 2px; }
.wrap { width: min(1080px, 100% - 40px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--teal); color: var(--teal-ink); padding: 8px 14px; font-family: var(--sans); z-index: 50; }
.skip:focus { left: 8px; }

/* Header */
header.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 24px; min-height: 60px; }
.brand { font-family: var(--serif); font-weight: 600; font-size: 1.15rem; text-decoration: none; letter-spacing: -0.01em; white-space: nowrap; }
.brand:hover { color: var(--ink); }
nav.main { margin-left: auto; overflow-x: auto; scrollbar-width: none; }
nav.main::-webkit-scrollbar { display: none; }
nav.main ul { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; }
nav.main a {
  font-family: var(--sans); font-size: 0.875rem; font-weight: 500; color: var(--muted);
  text-decoration: none; white-space: nowrap; padding: 6px 0; display: block;
  border-bottom: 2px solid transparent;
}
nav.main a:hover { color: var(--ink); }
nav.main a[aria-current="true"] { color: var(--ink); border-bottom-color: var(--teal); }
.theme-btn {
  flex: none; width: 36px; height: 36px; display: grid; place-items: center;
  background: transparent; color: var(--ink); border: 1px solid var(--line); border-radius: 50%; cursor: pointer;
}
.theme-btn:hover { border-color: var(--teal); color: var(--teal); }

/* Hero */
.hero { padding: 72px 0 40px; }
.hero h1 {
  font-family: var(--serif); font-weight: 500; letter-spacing: -0.025em; line-height: 1;
  font-size: clamp(2.8rem, 7.2vw, 5.4rem); margin: 0 0 22px;
}
.lede { font-size: clamp(1.15rem, 2.2vw, 1.4rem); line-height: 1.5; max-width: 40em; margin: 0 0 28px; color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  font-family: var(--sans); font-weight: 500; font-size: 0.9375rem; text-decoration: none;
  padding: 10px 18px; border-radius: 6px; border: 1px solid var(--ink); color: var(--ink); background: transparent;
}
.btn:hover { color: var(--ink); border-color: var(--teal); background: color-mix(in srgb, var(--teal) 10%, transparent); }
.btn.primary { background: var(--teal); border-color: var(--teal); color: var(--teal-ink); }
.btn.primary:hover { color: var(--teal-ink); filter: brightness(1.08); background: var(--teal); }

.scope { margin: 48px 0 0; }
.scope-frame { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
#wave { display: block; width: 100%; height: 330px; touch-action: pan-y; cursor: crosshair; }
.scope figcaption { font-family: var(--sans); font-size: 0.8125rem; line-height: 1.5; color: var(--muted); margin-top: 12px; max-width: 62em; }

/* Sections */
.sec { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 48px; padding: 72px 0; border-top: 1px solid var(--line); }
.sec > h2 {
  font-family: var(--serif); font-weight: 600; font-size: 1.5rem; letter-spacing: -0.01em; line-height: 1.2;
  margin: 0; align-self: start; position: sticky; top: 92px;
}
.body { max-width: 46rem; min-width: 0; }
.body > :first-child { margin-top: 0; }
.body p { margin: 0 0 1em; }

/* About */
.about-top { display: grid; grid-template-columns: 148px 1fr; gap: 28px; align-items: start; margin-bottom: 8px; }
.portrait { width: 148px; aspect-ratio: 1; object-fit: cover; object-position: center 20%; border-radius: 50%; background: var(--line); border: 1px solid var(--line); }
dl.facts { margin: 28px 0 0; font-family: var(--sans); font-size: 0.9375rem; display: grid; grid-template-columns: 8.5em 1fr; gap: 10px 16px; padding-top: 22px; border-top: 1px solid var(--line); }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }
.sub { font-family: var(--sans); font-weight: 600; font-size: 0.9375rem; margin: 36px 0 12px; }
ul.interests { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 32px; font-size: 1rem; }
ul.interests li { break-inside: avoid; padding: 7px 0; border-bottom: 1px solid var(--line); }

/* Research rows */
.row { padding: 30px 0; border-top: 1px solid var(--line); }
.row:first-child { padding-top: 0; border-top: 0; }
.row h3 { font-family: var(--serif); font-weight: 600; font-size: 1.28rem; margin: 0 0 8px; letter-spacing: -0.005em; }
.row p { margin: 0 0 14px; }
.links { display: grid; grid-template-columns: 4.6em minmax(0, 1fr); gap: 0 12px; font-family: var(--sans); font-size: 0.875rem; margin-top: 8px; }
.links .lab { color: var(--muted); }
.links ul { display: flex; flex-wrap: wrap; gap: 4px 18px; list-style: none; margin: 0; padding: 0; }
.links li { display: inline; }

/* Foundation model */
.feature { border-left: 3px solid var(--teal); padding-left: 24px; }
.feature h3 { font-family: var(--serif); font-weight: 600; font-size: 1.28rem; margin: 0 0 10px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin: 22px 0; }
.cols h4 { font-family: var(--sans); font-size: 0.9375rem; font-weight: 600; margin: 0 0 8px; }
.cols ul { margin: 0; padding-left: 1.1em; font-size: 1rem; }
.cols li { margin-bottom: 6px; }

/* Education timeline */
.timeline { list-style: none; margin: 0; padding: 0 0 0 26px; border-left: 1px solid var(--line); }
.timeline li { position: relative; padding-bottom: 36px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -32px; top: 9px; width: 11px; height: 11px; border-radius: 50%; background: var(--paper); border: 2px solid var(--teal); }
.timeline .when { font-family: var(--sans); font-size: 0.8125rem; color: var(--muted); display: block; margin-bottom: 2px; }
.timeline h3 { font-size: 1.12rem; font-weight: 600; margin: 0 0 2px; }
.timeline .where { margin: 0 0 8px; color: var(--muted); }
.timeline ul { margin: 0; padding-left: 1.1em; font-size: 1rem; }
.timeline li li { padding: 0; margin-bottom: 3px; }
.timeline li li::before { display: none; }

/* Publications */
.tools { display: flex; flex-wrap: wrap; gap: 14px 16px; align-items: center; margin-bottom: 8px; font-family: var(--sans); }
.search {
  flex: 1 1 220px; min-width: 0; padding: 10px 14px; font: inherit; font-size: 0.9375rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
}
.search::placeholder { color: var(--muted); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button {
  font: inherit; font-size: 0.8125rem; font-weight: 500; padding: 7px 12px; border-radius: 999px; cursor: pointer;
  color: var(--ink); background: transparent; border: 1px solid var(--line);
}
.seg button:hover { border-color: var(--teal); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.count { font-family: var(--sans); font-size: 0.8125rem; color: var(--muted); margin: 10px 0 0; }
.pubs h3 { font-family: var(--sans); font-size: 0.9375rem; font-weight: 600; margin: 34px 0 6px; padding-bottom: 8px; border-bottom: 1px solid var(--ink); }
.pubs ol { list-style: none; margin: 0; padding: 0; }
.pubs li { padding: 16px 0; border-bottom: 1px solid var(--line); }
.pubs .ti { font-weight: 500; line-height: 1.4; display: block; }
.pubs .au { font-size: 0.9375rem; color: var(--muted); display: block; margin-top: 3px; }
.pubs .au strong { color: var(--ink); font-weight: 600; }
.pubs .ve { font-family: var(--sans); font-size: 0.8125rem; color: var(--muted); display: block; margin-top: 4px; }
.pubs .empty { padding: 28px 0; font-family: var(--sans); color: var(--muted); }

/* Collaborators */
.groups { display: grid; grid-template-columns: 1fr 1fr; gap: 36px 40px; }
.groups h3 { font-family: var(--sans); font-weight: 600; font-size: 0.9375rem; margin: 0 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.groups ul { list-style: none; margin: 0; padding: 0; font-size: 1rem; }
.groups li { padding: 5px 0; }
.groups .role { display: block; font-family: var(--sans); font-size: 0.8125rem; color: var(--muted); }
.groups .wide { grid-column: 1 / -1; }

/* Contact */
.mail { font-size: clamp(1.3rem, 3.2vw, 1.9rem); font-weight: 500; letter-spacing: -0.01em; word-break: break-word; }
.social { display: flex; flex-wrap: wrap; gap: 10px 22px; list-style: none; padding: 0; margin: 22px 0 0; font-family: var(--sans); font-size: 0.9375rem; }
footer.foot { border-top: 1px solid var(--line); padding: 28px 0 48px; font-family: var(--sans); font-size: 0.8125rem; color: var(--muted); }

@media (max-width: 860px) {
  .sec { grid-template-columns: 1fr; gap: 24px; padding: 52px 0; }
  .sec > h2 { position: static; }
  .top .wrap { flex-wrap: wrap; gap: 4px 16px; padding-block: 8px; }
  nav.main { order: 3; width: 100%; margin-left: 0; }
  .theme-btn { margin-left: auto; }
  .brand + .theme-btn { margin-left: auto; }
  .hero { padding-top: 44px; }
}
@media (max-width: 640px) {
  #wave { height: 290px; }
  .about-top { grid-template-columns: 1fr; }
  .portrait { width: 128px; }
  ul.interests { columns: 1; }
  .cols, .groups { grid-template-columns: 1fr; }
  dl.facts { grid-template-columns: 1fr; gap: 2px; }
  dl.facts dd { margin-bottom: 10px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media print {
  header.top, .scope, .tools, .theme-btn { display: none; }
  body { background: #fff; color: #000; }
  .sec { break-inside: avoid-page; }
}

/* Multi-page additions */
.sec.first { border-top: 0; padding-top: 56px; }
.sec > h1 { font-family: var(--serif); font-weight: 600; font-size: 1.9rem; letter-spacing: -0.015em; line-height: 1.15; margin: 0; align-self: start; position: sticky; top: 92px; }
nav.main a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--teal); }
.explore { list-style: none; margin: 0; padding: 0; }
.explore li { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.explore li:first-child { padding-top: 0; }
.explore a { font-weight: 600; }
footer.foot .wrap { display: flex; flex-wrap: wrap; gap: 10px 28px; justify-content: space-between; align-items: baseline; }
.foot p { margin: 0; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; margin: 0; padding: 0; }
@media (max-width: 860px) { .sec > h1 { position: static; } .sec.first { padding-top: 36px; } }
@media (max-width: 640px) { .explore li { grid-template-columns: 1fr; gap: 2px; } }

/* GitHub mark on Code labels */
.links .lab .gh { width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px; fill: currentColor; }

/* Framework gallery */
.gallery { padding: 64px 0 24px; border-top: 1px solid var(--line); }
.gallery > h2 { font-family: var(--serif); font-weight: 600; font-size: 1.5rem; letter-spacing: -0.01em; line-height: 1.2; margin: 0 0 6px; }
.gal-lede { margin: 0 0 22px; color: var(--muted); font-family: var(--sans); font-size: 0.9375rem; max-width: 46em; }
.track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.track::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; min-width: 0; margin: 0; scroll-snap-align: start; }
.fig { display: block; height: clamp(240px, 50vw, 500px); padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.fig img { display: block; width: 100%; height: 100%; object-fit: contain; }
.slide figcaption { padding: 18px 2px 0; }
.slide h3 { font-family: var(--serif); font-weight: 600; font-size: 1.2rem; margin: 0 0 4px; }
.slide p { margin: 0 0 10px; max-width: 52em; }
.gal-ctrl { display: flex; align-items: center; gap: 12px; margin-top: 22px; font-family: var(--sans); font-size: 0.8125rem; color: var(--muted); }
.nav-btn { flex: none; width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer; }
.nav-btn:hover { border-color: var(--teal); color: var(--teal); }
.dots { display: flex; flex: 1; flex-wrap: wrap; gap: 14px; justify-content: center; }
.dots button { position: relative; width: 10px; height: 10px; padding: 0; border-radius: 50%; border: 1px solid var(--muted); background: transparent; cursor: pointer; }
.dots button::after { content: ""; position: absolute; inset: -9px; }
.dots button[aria-current="true"] { background: var(--teal); border-color: var(--teal); }
.play { font: inherit; min-width: 4.8em; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; }
.play:hover { border-color: var(--teal); }
@media (max-width: 640px) { .gal-ctrl { flex-wrap: wrap; } .dots { order: 5; flex-basis: 100%; } .gallery { padding-top: 44px; } }

/* Map */
.map { margin-top: 28px; }
.map iframe { display: block; width: 100%; height: 320px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.map-cap { margin: 10px 0 0; font-family: var(--sans); font-size: 0.8125rem; color: var(--muted); }
@media (max-width: 640px) { .map iframe { height: 260px; } }
@media print { .map iframe { display: none; } }

/* Publication DOI and code chips */
.pubs .ext { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pubs .chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font-family: var(--sans); font-size: 0.8125rem; line-height: 1.3; text-decoration: none; overflow-wrap: anywhere; transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease; }
.pubs .chip .k { font-weight: 600; }
.pubs .chip .gh { width: 14px; height: 14px; flex: none; fill: currentColor; }
.pubs .chip-doi { border-color: color-mix(in srgb, var(--teal) 45%, var(--line)); }
.pubs .chip-doi .k { color: var(--teal); }
.pubs .chip-code { border-color: color-mix(in srgb, var(--indigo) 45%, var(--line)); }
.pubs .chip-code .k { color: var(--indigo); }
.pubs .chip:hover, .pubs .chip:focus-visible { transform: translateY(-1px); box-shadow: 0 3px 10px color-mix(in srgb, var(--ink) 16%, transparent); }
.pubs .chip-doi:hover, .pubs .chip-doi:focus-visible { background: var(--teal); border-color: var(--teal); color: var(--teal-ink); }
.pubs .chip-code:hover, .pubs .chip-code:focus-visible { background: var(--indigo); border-color: var(--indigo); color: var(--paper); }
.pubs .chip:hover .k, .pubs .chip:focus-visible .k { color: inherit; }
@media (prefers-reduced-motion: reduce) { .pubs .chip { transition: none; } .pubs .chip:hover, .pubs .chip:focus-visible { transform: none; } }

/* Publication thumbnails */
.pubs li.pub { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 22px; align-items: start; }
.pubs .thumb { display: block; width: 100%; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; position: relative; }
.pubs .thumb.real { background: #fff; padding: 6px; }

.pubs .thumb.real img { display: block; width: 100%; height: 100%; object-fit: contain; }
.pubs .thumb.tile { background: var(--surface); color: var(--muted); }
.pubs .thumb.tile svg { display: block; width: 66%; margin: 12% auto 0; }
.pubs .thumb.tile .tl { position: absolute; left: 10px; right: 10px; bottom: 9px; font-family: var(--sans); font-size: 0.6875rem; letter-spacing: 0.02em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pubs .thumb svg .gl { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pubs .thumb svg .faint { opacity: 0.4; }
.pubs .thumb svg .dash { stroke-dasharray: 4 4; }
.pubs .thumb svg .ga2 { fill: none; stroke: var(--teal); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pubs .thumb svg .ga { fill: var(--teal); stroke: none; }
.pubs .thumb svg .gd { fill: currentColor; opacity: 0.45; stroke: none; }
.pubs .thumb svg .gf { fill: var(--teal); opacity: 0.28; stroke: none; }
@media (max-width: 640px) { .pubs li.pub { grid-template-columns: 92px minmax(0, 1fr); gap: 14px; } .pubs .thumb.tile .tl { display: none; } .pubs .thumb.tile svg { width: 74%; margin-top: 13%; } }

/* Institute icons */
.inst { display: inline-block; flex: none; width: 1.3em; height: 1.3em; margin-right: 0.5em; vertical-align: -0.3em; fill: var(--teal); }

/* Abstract chip and expandable panel */
.pubs .chip-abs { cursor: pointer; border-color: color-mix(in srgb, var(--ink) 35%, var(--line)); }
.pubs .chip-abs .k { color: var(--ink); }
.pubs .chip-abs .cv { flex: none; transition: transform .2s ease; }
.pubs .chip-abs[aria-expanded="true"] .cv { transform: rotate(180deg); }
.pubs .chip-abs:hover, .pubs .chip-abs:focus-visible, .pubs .chip-abs[aria-expanded="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.pubs .chip-abs:hover .k, .pubs .chip-abs:focus-visible .k, .pubs .chip-abs[aria-expanded="true"] .k { color: inherit; }
.pubs .abs { display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows .28s ease, visibility 0s linear .28s; }
.pubs .abs.open { grid-template-rows: 1fr; visibility: visible; transition: grid-template-rows .28s ease, visibility 0s; }
.pubs .abs-in { overflow: hidden; min-height: 0; }
.pubs .abs-in p { margin: 12px 0 0; padding: 12px 14px; background: var(--surface); border-left: 3px solid var(--teal); border-radius: 0 8px 8px 0; font-size: 0.9375rem; line-height: 1.6; }
.pubs .abs-more { display: inline-block; margin-top: 8px; font-family: var(--sans); font-size: 0.8125rem; }
@media (prefers-reduced-motion: reduce) { .pubs .abs, .pubs .abs.open, .pubs .chip-abs .cv { transition: none; } }

/* Chips outside the publication list (thesis link) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chips .chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid color-mix(in srgb, var(--teal) 45%, var(--line)); border-radius: 999px; background: var(--surface); color: var(--ink); font-family: var(--sans); font-size: 0.8125rem; line-height: 1.3; text-decoration: none; transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease; }
.chips .chip .k { font-weight: 600; color: var(--teal); }
.chips .chip .ic { flex: none; }
.chips .chip:hover, .chips .chip:focus-visible { background: var(--teal); border-color: var(--teal); color: var(--teal-ink); transform: translateY(-1px); box-shadow: 0 3px 10px color-mix(in srgb, var(--ink) 16%, transparent); }
.chips .chip:hover .k, .chips .chip:focus-visible .k { color: inherit; }
@media (prefers-reduced-motion: reduce) { .chips .chip { transition: none; } .chips .chip:hover, .chips .chip:focus-visible { transform: none; } }

/* Home: name and bio, no section heading */
.hero { padding-bottom: 28px; }
.hero h1 { margin-bottom: 0; }
.bio { padding: 12px 0 64px; }
.bio-grid { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 36px; align-items: start; max-width: 58rem; }
.bio-grid .portrait { width: 100%; height: auto; aspect-ratio: 1; }
.bio-text p { margin: 0 0 1em; font-size: 1.125rem; line-height: 1.6; }
.bio-text p:last-child { margin-bottom: 0; }
@media (max-width: 700px) { .bio-grid { grid-template-columns: 1fr; gap: 20px; } .bio-grid .portrait { width: 128px; height: auto; } }

/* Featured publications on Home */
#featured .body { max-width: 52rem; }
#featured-list { list-style: none; margin: 0; padding: 0; }
#featured-list li.pub:first-child { padding-top: 0; }
.feat-more { margin: 20px 0 0; font-family: var(--sans); font-size: 0.9375rem; }

/* Research page: thrusts */
.thrust-nav { margin: 14px 0 0; padding-left: 1.6em; list-style: upper-roman; }
.thrust-nav li { padding: 3px 0; }
.thrust-title { font-family: var(--serif); font-weight: 600; font-size: 1.55rem; letter-spacing: -0.01em; line-height: 1.2; margin: 0 0 8px; }
.thrust-lede { margin: 0 0 4px; }
h4.subhead, h2.subhead { font-family: var(--sans); font-size: 0.9375rem; font-weight: 600; color: var(--head); margin: 30px 0 4px; padding-bottom: 8px; border-bottom: 1px solid var(--head); }
.item { padding: 16px 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item h5, .item h3 { font-family: var(--serif); font-weight: 700; font-size: 1.4rem; line-height: 1.2; letter-spacing: -0.012em; color: var(--head); margin: 0 0 8px; }
.item h3 { position: relative; }
.item p { margin: 0 0 8px; }
.item .chips { margin: 4px 0 8px; }

/* Foundation model: blog layout */
.sec > .side { position: sticky; top: 92px; align-self: start; }
.side h1 { font-family: var(--serif); font-weight: 600; font-size: 1.9rem; letter-spacing: -0.015em; line-height: 1.15; margin: 0 0 18px; }
.toc ol { list-style: none; margin: 0; padding: 0; font-family: var(--sans); font-size: 0.875rem; border-left: 1px solid var(--line); }
.toc li a { display: block; padding: 5px 0 5px 12px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; }
.toc li a:hover { color: var(--ink); }
.toc li a.on { color: var(--ink); border-left-color: var(--teal); }
.post { max-width: 46rem; }
.post .lead { font-size: 1.2rem; line-height: 1.55; margin: 0 0 12px; }
.post .byline { font-family: var(--sans); font-size: 0.8125rem; color: var(--muted); margin: 0 0 10px; }
.post h2 { font-family: var(--serif); font-weight: 600; font-size: 1.5rem; letter-spacing: -0.01em; line-height: 1.2; margin: 56px 0 12px; scroll-margin-top: 88px; }
.post ul { margin: 0 0 1em; padding-left: 1.2em; }
.post li { margin: 0 0 0.45em; }
.post .glance { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px 22px 8px; margin: 26px 0 8px; }
.post .glance h3 { font-family: var(--sans); font-size: 0.9375rem; font-weight: 600; margin: 0 0 10px; }
.post .eq { overflow-x: auto; margin: 6px 0 16px; }
.post .eq .katex-display { margin: 0.6em 0; }
.post-fig { margin: 24px 0 28px; }
.post-fig[hidden] { display: none; }
.post-fig .frame { display: block; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.post-fig .frame img { display: block; width: 100%; height: auto; }
.post-fig figcaption { font-family: var(--sans); font-size: 0.8125rem; line-height: 1.5; color: var(--muted); margin-top: 10px; }
.table-wrap { overflow-x: auto; margin: 16px 0 6px; }
table.data { border-collapse: collapse; width: 100%; font-family: var(--sans); font-size: 0.8125rem; }
table.data th, table.data td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data thead th { border-bottom: 1px solid var(--ink); font-weight: 600; }
table.data td.best { font-weight: 600; color: var(--teal); }
.table-note { font-family: var(--sans); font-size: 0.8125rem; color: var(--muted); margin: 6px 0 0; }
@media (max-width: 860px) {
  .sec > .side { position: static; }
  .toc ol { display: flex; flex-wrap: wrap; gap: 2px 16px; border-left: 0; }
  .toc li a { padding: 4px 0; margin: 0; border-left: 0; }
}

/* Research page: vertical thrust illustrations in the left column */
.side h2 { font-family: var(--serif); font-weight: 600; font-size: 1.5rem; letter-spacing: -0.01em; line-height: 1.2; margin: 0; }
.thrust-art { margin: 18px 0 0; }
.thrust-art svg { display: block; width: 100%; max-width: 200px; height: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.thrust-art text { fill: var(--muted); font-family: var(--sans); font-size: 12px; }
.thrust-art text.sm { font-size: 10.5px; }
.thrust-art text.it { font-style: italic; }
.thrust-art text.eqt { fill: var(--ink); font-family: var(--serif); font-style: italic; font-size: 13.5px; }

/* Thrust pages and the Research hub */
.crumb { font-family: var(--sans); font-size: 0.8125rem; color: var(--muted); margin: 0 0 14px; }
.crumb a { color: var(--muted); }
.thrust-page .item { scroll-margin-top: 88px; }
.plist { list-style: none; margin: 0; padding: 0; }
.plist li.pub:first-child { padding-top: 16px; }
.more-thrusts { margin-top: 40px; }
.topic-label { font-family: var(--sans); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--teal); margin: 22px 0 8px; }
.go { margin: 26px 0 0; }
.thrust-art a.art-link { display: block; }
.thrust-art a.art-link:hover svg, .thrust-art a.art-link:focus-visible svg { border-color: var(--teal); }
.thrust-title a { color: inherit; text-decoration: none; }
.thrust-title a:hover { text-decoration: underline; }

.body .topic-label { margin: 22px 0 0; }
.body .go { margin: 26px 0 0; }
.body .crumb { margin: 0 0 14px; }
.thrust-page .feat-more { margin: 20px 0 0; }

/* FlowMARL results */
.fig-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; margin: 12px 0 0; }
.fig-grid .post-fig { margin: 0; }
.item .post-fig { margin: 16px 0 0; }
.fig-grid .post-fig { margin: 0; }
@media (max-width: 640px) { .fig-grid { grid-template-columns: 1fr; } }

/* Mini write-up inside an item */
.item .mini-h { font-family: var(--serif); font-weight: 700; font-size: 1.2rem; letter-spacing: -0.005em; color: var(--head); margin: 30px 0 6px; }
.item .eq { overflow-x: auto; margin: 6px 0 14px; }
.item .eq .katex-display { margin: 0.5em 0; }
.item .post-fig.narrow { max-width: 340px; }

.item .mini-blog .post-fig { margin: 18px 0 20px; }
table.data.wrap-head th { white-space: normal; vertical-align: bottom; line-height: 1.3; padding-left: 6px; padding-right: 6px; }
table.data.wrap-head td { padding-left: 6px; padding-right: 6px; }
.item .mini-blog .table-wrap { margin: 14px 0 12px; }

/* Embedded video in an item */
.item .video { position: relative; aspect-ratio: 16 / 9; background: #000; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.item .video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.item .video-fig { margin-top: 16px; }

/* Home: carousel with an updates column */
.gal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 28px; align-items: stretch; }
.gal-main { min-width: 0; }
.gal-layout .fig { height: clamp(220px, 36vw, 380px); }
.updates { display: flex; flex-direction: column; min-height: 0; overflow: hidden; contain: size; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px 6px; }
.updates h3 { font-family: var(--sans); font-size: 0.9375rem; font-weight: 600; margin: 0 0 8px; }
.updates ul { list-style: none; margin: 0; padding: 0; flex: 1; min-height: 0; overflow-y: auto; }
.updates li { padding: 12px 0; border-top: 1px solid var(--line); }
.updates .u-date { display: block; font-family: var(--sans); font-size: 0.75rem; color: var(--muted); margin-bottom: 3px; }
.updates .u-text { display: block; font-size: 0.95rem; line-height: 1.45; }
@media (max-width: 860px) {
  .gal-layout { grid-template-columns: 1fr; gap: 22px; }
  .gal-layout .fig { height: clamp(240px, 50vw, 500px); }
  .updates { contain: none; overflow: visible; }
  .updates ul { overflow: visible; }
}

/* Teaching: a book icon in front of each course */
.timeline ul.courses { list-style: none; padding-left: 0; }
.timeline ul.courses > li { position: relative; padding-left: 28px; }
.timeline ul.courses > li::before { content: ""; display: block; border: 0; border-radius: 0; box-shadow: none; position: absolute; left: 0; top: 0.3em; width: 17px; height: 17px; background: var(--teal); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z'/%3E%3Cpath d='M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z'/%3E%3Cpath d='M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z'/%3E%3C/svg%3E") center / contain no-repeat; }

.item .post-fig + .chips { margin-top: 16px; }

/* Carnelian and navy: headings in navy, a marker bar on each main title */
.hero h1, .sec > h1, .sec > h2, .side h1, .gallery > h2, .brand { color: var(--head); }
.item h3::before { content: ""; position: absolute; left: -14px; top: 0.2em; bottom: 0.2em; width: 3px; border-radius: 2px; background: var(--teal); }

/* Publication titles: a quiet underline, carnelian on hover */
.pubs li.pub a:not([class]) { text-decoration-color: color-mix(in srgb, currentColor 28%, transparent); }
.pubs li.pub a:not([class]):hover { text-decoration-color: var(--teal); }
