/* HERO Lab
   Layout: a plain academic site in the manner of leading robotics labs. A short statement,
   then a full-bleed strip of lab photographs; image-led research tiles; plain lists for
   papers and news. White ground and black type, with University of Calgary red reserved
   for the top rule, the active page and small links. Single light theme by choice. */

:root {
  --bg: #FFFFFF;
  --ink: #15171A;
  --ink-2: #5C6168;
  --ink-3: #8A8F96;
  --line: #E3E5E8;
  --soft: #F4F5F6;
  --red: #D6001C;
  --red-ink: #B00017;
  --gold: #E2A812;
  --gold-deep: #B07D08;
  --gold-light: #FFE7A3;
  --gold-soft: #FBF4E2;
  --green: #0E8A55;
  --green-deep: #08663E;
  --green-soft: #E7F5EE;

  --font: "Libre Franklin", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --t-xs: 0.8125rem;
  --t-sm: 0.875rem;
  --t-md: 1rem;
  --t-lg: 1.1875rem;
  --t-xl: 1.625rem;
  --t-2xl: 2.125rem;
  --t-hero: clamp(2.375rem, 1.3rem + 3.6vw, 4rem);

  --maxw: 1240px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  border-top: 4px solid var(--red);
}

img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.15; letter-spacing: -0.012em; text-wrap: balance; color: var(--ink); }
p { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; }
figure { margin: 0; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--red-ink); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

.wrap {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-left: max(24px, env(safe-area-inset-left, 0px));
  padding-right: max(24px, env(safe-area-inset-right, 0px));
}
@media (max-width: 600px) {
  .wrap { padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px)); }
}

.skip { position: absolute; left: -9999px; top: 8px; background: var(--bg); padding: 8px 12px; z-index: 50; }
.skip:focus { left: max(12px, env(safe-area-inset-left, 0px)); }

/* ---------- Header ---------- */
.site-header { position: relative; border-bottom: 1px solid var(--line); background: var(--bg); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 76px; }
.brand { display: block; text-decoration: none; color: var(--ink); line-height: 1.15; }
.brand b { display: block; font-size: 1.375rem; font-weight: 700; letter-spacing: -0.01em; }
.brand span { display: block; font-size: var(--t-xs); color: var(--ink-2); margin-top: 2px; }
.brand:hover { color: var(--ink); }

.site-nav ul { list-style: none; display: flex; gap: 28px; }
.site-nav a { font-size: 0.9375rem; font-weight: 500; text-decoration: none; color: var(--ink); padding-block: 6px; }
.site-nav a:hover { color: var(--red-ink); }
.site-nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--red); }

.nav-toggle {
  display: none; font: inherit; font-size: var(--t-sm); font-weight: 600; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 3px; padding: 7px 14px; cursor: pointer;
}
@media (max-width: 880px) {
  .nav-toggle { display: inline-block; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%; z-index: 20;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px));
    padding-block: 6px 14px;
  }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav a { display: block; padding-block: 12px; font-size: var(--t-md); border-bottom: 1px solid var(--line); }
  .site-nav li:last-child a { border-bottom: 0; }
  .site-nav a[aria-current="page"] { box-shadow: none; color: var(--red-ink); }
}

/* ---------- Page scaffolding ---------- */
.block { padding-block: 72px; }
.block + .block { border-top: 1px solid var(--line); }
.block.tight { padding-block: 48px; }
.block-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.block-head h2 { font-size: var(--t-2xl); }
.more { font-size: var(--t-sm); font-weight: 600; color: var(--red-ink); text-decoration: none; }
.more:hover { text-decoration: underline; }
@media (max-width: 700px) { .block { padding-block: 52px; } .block-head h2 { font-size: var(--t-xl); } }

.page-title { padding-block: 64px 40px; }
.page-title h1 { font-size: clamp(2.25rem, 1.6rem + 2.4vw, 3.25rem); letter-spacing: -0.022em; }
.page-title p { margin-top: 16px; font-size: var(--t-lg); color: var(--ink-2); max-width: 42em; line-height: 1.55; }

.lede { font-size: var(--t-lg); line-height: 1.6; max-width: 40em; }
.muted { color: var(--ink-2); }
.small { font-size: var(--t-sm); }

/* ---------- Home hero ---------- */
.intro { padding-block: 72px 44px; }
.intro h1 { font-size: var(--t-hero); line-height: 1.04; letter-spacing: -0.03em; max-width: 17ch; }
.intro .sub { margin-top: 22px; font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem); line-height: 1.5; color: var(--ink-2); max-width: 36em; }
@media (max-width: 600px) { .intro { padding-block: 48px 32px; } }

.strip {
  display: grid;
  grid-template-columns: 1.1fr 1.33fr 0.78fr 1.33fr 1.5fr;
  gap: 6px;
  height: clamp(240px, 27vw, 400px);
}
.strip figure { position: relative; overflow: hidden; background: var(--soft); min-width: 0; }
.strip img { width: 100%; height: 100%; object-fit: cover; }
.strip figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 14px 10px;
  font-size: var(--t-xs); font-weight: 500; color: #FFFFFF;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0));
}
@media (max-width: 900px) {
  .strip {
    display: flex; height: 260px; overflow-x: auto; scroll-snap-type: x mandatory;
    padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px));
    scrollbar-width: none;
  }
  .strip::-webkit-scrollbar { display: none; }
  .strip figure { flex: 0 0 auto; width: 78%; max-width: 360px; scroll-snap-align: start; }
}

/* ---------- About + glance ---------- */
.about { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); }
.about p + p { margin-top: 1em; }
.glance { display: grid; gap: 18px; align-content: start; }
.glance div { padding-top: 14px; border-top: 1px solid var(--line); }
.glance dt { font-size: var(--t-xs); font-weight: 600; color: var(--ink-2); }
.glance dd { margin-top: 4px; font-size: var(--t-md); line-height: 1.5; }
@media (max-width: 860px) { .about { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Research tiles ---------- */
.areas { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; list-style: none; }
.area a { display: block; text-decoration: none; color: var(--ink); }
.area .im { aspect-ratio: 4 / 3; max-width: 100%; overflow: hidden; background: var(--soft); }
.area img { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms ease; }
.area a:hover img { transform: scale(1.03); }
.area h3 { margin-top: 16px; font-size: 1.1875rem; }
.area a:hover h3 { color: var(--red-ink); }
.area p { margin-top: 6px; font-size: 0.96875rem; color: var(--ink-2); line-height: 1.5; }
@media (max-width: 1000px) { .areas { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .areas { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Photo grids ---------- */
.photos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px 16px; list-style: none; }
.photos.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.photos .im { aspect-ratio: 4 / 3; max-width: 100%; overflow: hidden; background: var(--soft); }
.photos img { width: 100%; height: 100%; object-fit: cover; }
.photos figcaption, .photos .cap { margin-top: 8px; font-size: var(--t-sm); color: var(--ink-2); line-height: 1.4; }
@media (max-width: 900px) { .photos, .photos.three { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px) {
  .photos, .photos.three { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 10px; }
  .photos figcaption, .photos .cap { font-size: var(--t-xs); }
}

/* ---------- Two columns: papers + news ---------- */
.twocol { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 88px); }
.twocol h2 { font-size: var(--t-xl); margin-bottom: 8px; }
.twocol .more { display: inline-block; margin-top: 18px; }
@media (max-width: 860px) { .twocol { grid-template-columns: minmax(0, 1fr); } }

.pubs { list-style: none; }
.pubs li { padding-block: 16px; border-bottom: 1px solid var(--line); }
.pubs li:first-child { padding-top: 8px; }
.pubs .t { font-weight: 600; line-height: 1.4; }
.pubs .t a { text-decoration: none; }
.pubs .t a:hover { text-decoration: underline; }
.pubs .a { margin-top: 4px; font-size: var(--t-sm); color: var(--ink-2); }
.pubs .a strong { color: var(--ink); font-weight: 600; }
.pubs .v { font-size: var(--t-sm); color: var(--ink-2); }
.pubs .v em { color: var(--ink); }
.st { color: var(--red); font-weight: 700; }
/* Trophy and awards */
.trophy { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; margin-right: 0.4em; }
.trophy .tr-cup { fill: var(--gold); stroke: var(--gold-deep); stroke-width: 0.6; }
.trophy .tr-h { fill: none; stroke: var(--gold-deep); stroke-width: 1.5; stroke-linecap: round; }
.trophy .tr-shine { fill: none; stroke: var(--gold-light); stroke-width: 1.1; stroke-linecap: round; }
.trophy .tr-base { fill: var(--gold); stroke: var(--gold-deep); stroke-width: 0.5; }
.trophy .tr-plinth { fill: var(--gold-deep); }
.award {
  display: inline-flex; align-items: center; gap: 0; margin-top: 8px; padding: 4px 10px 4px 8px;
  font-size: var(--t-sm); font-weight: 700; color: var(--ink); line-height: 1.35;
  background: var(--gold-soft); border-radius: 3px;
}
.award .trophy { width: 1.3em; height: 1.3em; }
.news .h .trophy, .honors b .trophy { width: 1.25em; height: 1.25em; }

.awards { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.awards li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; padding: 22px 22px 22px 18px; background: var(--gold-soft); border-top: 3px solid var(--gold); }
.awards li > .trophy { width: 44px; height: 44px; margin: 0; }
.aw-name { font-weight: 700; font-size: 1.0625rem; line-height: 1.3; }
.aw-org { margin-top: 2px; font-size: var(--t-sm); color: var(--ink-2); }
.aw-who { margin-top: 10px; font-size: var(--t-sm); font-weight: 600; }
.aw-paper { display: block; margin-top: 4px; font-size: var(--t-sm); color: var(--ink-2); line-height: 1.4; }
.awards-more { list-style: none; margin-top: 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 32px; font-size: var(--t-sm); }
.awards-more li { display: flex; align-items: flex-start; }
.awards-more .trophy { margin-top: 0.1em; }
.awards-more b { font-weight: 600; }
@media (max-width: 900px) { .awards { grid-template-columns: minmax(0, 1fr); } .awards-more { grid-template-columns: minmax(0, 1fr); } }

/* Fabrication */
.fab { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: clamp(28px, 4vw, 56px); align-items: start; }
.fab-main .im { aspect-ratio: 16 / 9; max-width: 100%; overflow: hidden; background: var(--soft); }
.fab-main img, .fab-side img, .fab2 img { width: 100%; height: 100%; object-fit: cover; }
.fab-text h2 { font-size: var(--t-2xl); }
.fab-text .lede { margin-top: 14px; font-size: var(--t-md); }
.ticks { list-style: none; margin-top: 16px; display: grid; gap: 6px; font-size: var(--t-sm); }
.ticks li { padding-left: 18px; position: relative; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 8px; height: 8px; background: var(--red); }
.fab-side { margin-top: 20px; }
.fab-side .im { aspect-ratio: 16 / 9; max-width: 100%; overflow: hidden; background: var(--soft); }
.fab-side figcaption, .fab2 figcaption { margin-top: 8px; font-size: var(--t-sm); color: var(--ink-2); }
.fab-text .more { display: inline-block; margin-top: 16px; }
@media (max-width: 900px) { .fab { grid-template-columns: minmax(0, 1fr); } }

.fab2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.fab2 .im { aspect-ratio: 16 / 9; max-width: 100%; overflow: hidden; background: var(--soft); }
.steps { list-style: none; padding: 0; margin: 36px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; counter-reset: step; }
.steps li { padding: 18px 20px 0 0; border-top: 2px solid var(--ink); counter-increment: step; }
.steps li + li { padding-left: 20px; border-left: 1px solid var(--line); }
.steps h3 { font-size: var(--t-md); }
.steps h3::before { content: counter(step) "  "; color: var(--red); font-weight: 700; }
.steps p { margin-top: 6px; font-size: var(--t-sm); color: var(--ink-2); line-height: 1.5; }
@media (max-width: 900px) {
  .fab2 { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 24px; }
  .steps li + li { padding-left: 0; border-left: 0; }
  .steps li:nth-child(even) { padding-left: 20px; }
}
@media (max-width: 480px) { .steps { grid-template-columns: minmax(0, 1fr); } .steps li:nth-child(even) { padding-left: 0; } }

/* Equipment page */
.eq { display: grid; grid-template-columns: minmax(0, 17rem) minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); }
.eq-head h2 { font-size: var(--t-xl); }
.eq-head p { margin-top: 10px; font-size: var(--t-sm); color: var(--ink-2); line-height: 1.55; }
.eq-body { min-width: 0; }
.eq-photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.eq-photos .im { aspect-ratio: 4 / 3; max-width: 100%; overflow: hidden; background: var(--soft); }
.eq-photos img { width: 100%; height: 100%; object-fit: cover; }
.eq-photos figcaption { margin-top: 6px; font-size: var(--t-sm); color: var(--ink-2); }
.eq-list { list-style: none; }
.eq-list li { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.2fr) 6.5rem; gap: 4px 20px; padding-block: 12px; border-bottom: 1px solid var(--line); align-items: baseline; }
.eq-list li:first-child { border-top: 1px solid var(--line); }
.eq-list .n { font-weight: 600; line-height: 1.35; }
.eq-list .m { font-size: var(--t-sm); color: var(--ink-2); }
.eq-list .u { font-size: var(--t-sm); line-height: 1.45; }
.eq-list .l { text-align: right; font-size: var(--t-sm); }
.eq-list .l a { color: var(--red-ink); font-weight: 600; text-decoration: none; }
.eq-list .l a:hover { text-decoration: underline; }
@media (max-width: 900px) { .eq { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 620px) { .eq-list li { grid-template-columns: minmax(0, 1fr); } .eq-list .l { text-align: left; } .eq-photos { grid-template-columns: minmax(0, 1fr); } }

.news { list-style: none; }
.news li { display: grid; grid-template-columns: 4.75rem minmax(0, 1fr); gap: 12px; padding-block: 14px; border-bottom: 1px solid var(--line); }
.news li:first-child { padding-top: 8px; }
.news time { font-size: var(--t-sm); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.news .h { font-weight: 600; line-height: 1.4; }
.news .h .trophy, .news .h .grant { margin-right: 0.35em; }
.news .d { margin-top: 3px; font-size: var(--t-sm); color: var(--ink-2); line-height: 1.5; }
.news .d a { color: var(--ink); }

/* ---------- Sponsors ---------- */
.sponsors { display: flex; flex-wrap: wrap; align-items: center; gap: 28px 56px; list-style: none; }
.sponsors img { height: 44px; width: auto; filter: grayscale(1); opacity: 0.78; mix-blend-mode: multiply; }
.sponsors li:hover img { filter: none; opacity: 1; }
.sponsor-note { margin-top: 22px; font-size: var(--t-sm); color: var(--ink-2); max-width: 60em; }

/* ---------- Research page ---------- */
.ra { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.ra.flip > .ra-media { order: 2; }
.ra-media .im { aspect-ratio: 4 / 3; max-width: 100%; overflow: hidden; background: var(--soft); }
.ra-media img { width: 100%; height: 100%; object-fit: cover; }
.ra-media .cap { margin-top: 8px; font-size: var(--t-xs); color: var(--ink-3); }
.ra h2 { font-size: var(--t-2xl); }
.ra .desc { margin-top: 16px; }
.ra .desc p + p { margin-top: 0.9em; }
.ra h3 { margin-top: 28px; font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); }
.reflist { list-style: none; margin-top: 8px; display: grid; gap: 8px; font-size: var(--t-sm); line-height: 1.45; }
.reflist a { font-weight: 600; text-decoration: none; }
.reflist a:hover { text-decoration: underline; }
.reflist span { color: var(--ink-2); }
.fundline { margin-top: 8px; font-size: var(--t-sm); line-height: 1.5; }
.ra-photos { margin-top: 40px; }
@media (max-width: 900px) {
  .ra { grid-template-columns: minmax(0, 1fr); }
  .ra.flip > .ra-media { order: 0; }
  .ra h2 { font-size: var(--t-xl); }
}

.next { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; list-style: none; }
.next h3 { font-size: 1.1875rem; }
.next p { margin-top: 8px; font-size: 0.96875rem; color: var(--ink-2); line-height: 1.55; }
@media (max-width: 860px) { .next { grid-template-columns: minmax(0, 1fr); gap: 24px; } }

.equip { margin-top: 40px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 40px; }
.equip h3 { font-size: var(--t-md); }
.equip p { margin-top: 6px; font-size: var(--t-sm); color: var(--ink-2); line-height: 1.55; }
@media (max-width: 860px) { .equip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .equip { grid-template-columns: minmax(0, 1fr); } }

.rows { list-style: none; }
.rows li { display: grid; grid-template-columns: minmax(0, 1fr) 15rem; gap: 4px 24px; padding-block: 14px; border-bottom: 1px solid var(--line); }
.rows li:first-child { border-top: 1px solid var(--line); }
.rows .t { font-weight: 600; line-height: 1.4; }
.rows .s { margin-top: 2px; font-size: var(--t-sm); color: var(--ink-2); }
.rows .r { font-size: var(--t-sm); color: var(--ink-2); text-align: right; }
.rows .r b { display: block; color: var(--ink); font-weight: 600; }
.rows .r b.amt { font-size: 1.1875rem; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.rows .r span { display: block; margin-top: 2px; }
@media (max-width: 680px) { .rows li { grid-template-columns: minmax(0, 1fr); } .rows .r { text-align: left; } }

/* ---------- People ---------- */
.pi { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.pi-photo { aspect-ratio: 4 / 5; max-width: 100%; overflow: hidden; background: var(--soft); }
.pi-photo img { width: 100%; height: 100%; object-fit: cover; }
.pi h2 { font-size: var(--t-2xl); }
.pi .role { margin-top: 8px; color: var(--ink-2); line-height: 1.5; }
.pi .bio { margin-top: 20px; max-width: 40em; }
.pi .bio p + p { margin-top: 0.9em; }
.pi .contact { margin-top: 20px; font-size: var(--t-sm); line-height: 1.7; }
.copy { font: inherit; font-weight: 600; color: var(--red-ink); background: none; border: 0; padding: 0 0 0 10px; cursor: pointer; }
.cv { margin-top: 44px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.cv h3 { font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.cv ul { list-style: none; margin-top: 10px; display: grid; gap: 10px; font-size: var(--t-sm); line-height: 1.45; }
.cv li span { display: block; color: var(--ink-2); }
@media (max-width: 860px) { .pi { grid-template-columns: minmax(0, 1fr); } .pi-photo { max-width: 260px; } .cv { grid-template-columns: minmax(0, 1fr); } }

.groupshot { margin-top: 0; }
.groupshot .im { aspect-ratio: 21 / 9; max-width: 100%; overflow: hidden; background: var(--soft); }
.groupshot img { width: 100%; height: 100%; object-fit: cover; object-position: center 40%; }
.groupshot figcaption { margin-top: 8px; font-size: var(--t-sm); color: var(--ink-2); }

.team { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 32px 20px; list-style: none; }
.team .ph { aspect-ratio: 1 / 1; max-width: 100%; overflow: hidden; background: var(--soft); display: grid; place-items: center; }
.team .ph img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.team .ini { font-size: 2.25rem; font-weight: 600; color: var(--ink-3); letter-spacing: 0.02em; }
.team .nm { margin-top: 12px; font-weight: 600; line-height: 1.3; }
.team .pg { font-size: var(--t-sm); color: var(--ink-2); margin-top: 2px; }
.team .tp { font-size: var(--t-sm); margin-top: 6px; line-height: 1.45; }
.team .pd { font-size: var(--t-sm); font-weight: 600; color: var(--red-ink); margin-top: 4px; }
.subhead { font-size: var(--t-lg); margin: 48px 0 20px; }
.subhead:first-child { margin-top: 0; }

.compact { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 0 40px; }
.compact li { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 14px; align-items: center; padding-block: 12px; border-bottom: 1px solid var(--line); }
.compact .dot { width: 48px; height: 48px; border-radius: 50%; overflow: hidden; background: var(--soft); display: grid; place-items: center; font-size: var(--t-sm); font-weight: 600; color: var(--ink-3); }
.compact .dot img { width: 100%; height: 100%; object-fit: cover; }
.compact .nm { font-weight: 600; font-size: 0.96875rem; }
.compact .rl { font-size: var(--t-sm); color: var(--ink-2); line-height: 1.4; }

.honors { list-style: none; }
.honors li { display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: 4px 24px; padding-block: 12px; border-bottom: 1px solid var(--line); font-size: 0.96875rem; }
.honors li:first-child { border-top: 1px solid var(--line); }
.honors b { font-weight: 600; display: flex; align-items: flex-start; }
.honors b .trophy { margin-top: 0.05em; }
@media (max-width: 640px) { .honors li { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Publications page ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; padding-block: 8px 20px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.tabs button { font: inherit; font-size: 0.9375rem; font-weight: 500; color: var(--ink-2); background: none; border: 0; padding: 6px 0; cursor: pointer; }
.tabs button[aria-pressed="true"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--red); }
.tabs button .n { color: var(--ink-3); margin-left: 4px; font-variant-numeric: tabular-nums; }
.filters input[type="search"] { font: inherit; font-size: var(--t-md); flex: 1 1 220px; min-width: 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 3px; background: var(--bg); color: var(--ink); }
.filters label.chk { display: inline-flex; align-items: center; gap: 8px; font-size: var(--t-sm); }
.filters input[type="checkbox"] { accent-color: var(--red); width: 16px; height: 16px; }
.count { margin-top: 16px; font-size: var(--t-sm); color: var(--ink-3); }

.pgroup { margin-top: 40px; }
.pgroup > h2 { font-size: var(--t-xl); }
.pyear { margin-top: 28px; font-size: var(--t-sm); font-weight: 600; color: var(--ink-3); }
.plist { list-style: none; }
.plist li { display: grid; grid-template-columns: 3.2rem minmax(0, 1fr); gap: 12px; padding-block: 14px; border-bottom: 1px solid var(--line); }
.plist .id { font-size: var(--t-xs); color: var(--ink-3); padding-top: 3px; font-variant-numeric: tabular-nums; }
.plist .t { font-weight: 600; line-height: 1.4; }
.plist .a { margin-top: 3px; font-size: var(--t-sm); color: var(--ink-2); line-height: 1.5; }
.plist .a strong { color: var(--ink); font-weight: 600; }
.plist .v { font-size: var(--t-sm); color: var(--ink-2); }
.plist .v em { color: var(--ink); }
.plist .links { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: var(--t-sm); }
.plist .links a { color: var(--red-ink); font-weight: 600; text-decoration: none; }
.plist .links a:hover { text-decoration: underline; }
.plist .tag { font-size: var(--t-xs); font-weight: 600; color: var(--ink-3); }
.plist li:target { background: var(--soft); }

/* ---------- Teaching ---------- */
.courses { list-style: none; }
.courses li { display: grid; grid-template-columns: 11rem minmax(0, 1fr) 10rem; gap: 6px 24px; padding-block: 18px; border-bottom: 1px solid var(--line); }
.courses li:first-child { border-top: 1px solid var(--line); }
.courses .code { font-weight: 600; color: var(--red-ink); }
.courses .t { font-weight: 600; }
.courses .d { margin-top: 4px; font-size: 0.96875rem; color: var(--ink-2); line-height: 1.55; }
.courses .w { font-size: var(--t-sm); color: var(--ink-2); text-align: right; }
@media (max-width: 760px) { .courses li { grid-template-columns: minmax(0, 1fr); } .courses .w { text-align: left; } }
.inst { margin: 40px 0 12px; font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); }
.inst:first-child { margin-top: 0; }
blockquote.q { margin: 0; max-width: 46em; }
blockquote.q p { font-size: var(--t-xl); line-height: 1.4; letter-spacing: -0.01em; }
blockquote.q footer { margin-top: 14px; font-size: var(--t-sm); color: var(--ink-2); }

.talks { list-style: none; }
.talks li { display: grid; grid-template-columns: 6rem minmax(0, 1fr); gap: 12px; padding-block: 12px; border-bottom: 1px solid var(--line); }
.talks time { font-size: var(--t-sm); color: var(--ink-3); }
.talks .t { font-weight: 600; line-height: 1.4; }
.talks .w { font-size: var(--t-sm); color: var(--ink-2); }

/* ---------- Gallery ---------- */
.gal { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; list-style: none; }
.gal button { all: unset; display: block; width: 100%; cursor: zoom-in; }
.gal button:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.gal .im { aspect-ratio: 4 / 3; max-width: 100%; overflow: hidden; background: var(--soft); }
.gal img { width: 100%; height: 100%; object-fit: cover; transition: opacity 200ms ease; }
.gal button:hover img { opacity: 0.88; }
.gal .cap { margin-top: 6px; font-size: var(--t-sm); color: var(--ink-2); line-height: 1.35; }
.gal-sec + .gal-sec { margin-top: 56px; }
.gal-sec h2 { font-size: var(--t-xl); margin-bottom: 20px; }
@media (max-width: 900px) { .gal { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .gal { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.lightbox { border: 0; padding: 0; background: transparent; width: min(1100px, 94vw); max-width: 94vw; }
.lightbox::backdrop { background: rgba(10, 11, 13, 0.9); }
.lightbox img { width: 100%; max-height: 80vh; object-fit: contain; background: #000000; }
.lb-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 2px; color: #FFFFFF; }
.lb-cap { font-size: var(--t-sm); min-width: 0; }
.lb-btns { display: flex; gap: 8px; flex: none; }
.lb-btns button { font: inherit; font-size: var(--t-sm); font-weight: 600; color: #FFFFFF; background: transparent; border: 1px solid rgba(255, 255, 255, 0.4); border-radius: 3px; padding: 6px 12px; cursor: pointer; }
.lb-btns button:hover { border-color: #FFFFFF; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 24px; }
.foot { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); gap: 32px; padding-block: 48px 24px; font-size: var(--t-sm); line-height: 1.65; color: var(--ink-2); }
.foot b { display: block; color: var(--ink); font-size: var(--t-md); margin-bottom: 6px; }
.foot ul { list-style: none; }
.foot a { color: var(--ink-2); }
.foot a:hover { color: var(--red-ink); }
.foot-base { padding-block: 0 32px; font-size: var(--t-xs); color: var(--ink-3); }
@media (max-width: 760px) { .foot { grid-template-columns: minmax(0, 1fr); gap: 20px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Funding icon */
.grant { width: 1.2em; height: 1.2em; flex: none; vertical-align: -0.22em; margin-right: 0.4em; }
.grant .g-coin { fill: var(--green); }
.grant .g-ring { fill: none; stroke: #FFFFFF; stroke-opacity: 0.35; stroke-width: 0.8; }
.grant .g-sign { fill: none; stroke: #FFFFFF; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* News feed (news page) */
.feed { list-style: none; }
.feed li {
  display: grid; grid-template-columns: 4.5rem 2.5rem minmax(0, 1fr) 8.5rem; gap: 4px 12px; align-items: start;
  padding-block: 16px; border-bottom: 1px solid var(--line);
}
.feed li:first-child { border-top: 1px solid var(--line); }
.feed time { font-size: var(--t-sm); color: var(--ink-3); padding-top: 3px; font-variant-numeric: tabular-nums; }
.feed .ic { padding-top: 1px; }
.feed .ic svg { width: 30px; height: 30px; margin: 0; vertical-align: top; }
.feed .h { font-weight: 600; line-height: 1.4; }
.feed .d { margin-top: 4px; font-size: var(--t-sm); color: var(--ink-2); line-height: 1.55; }
.feed .d a { color: var(--ink); }
.feed .lg { display: flex; justify-content: flex-end; align-items: flex-start; padding-top: 2px; }
.feed .lg img { max-height: 46px; max-width: 136px; width: auto; height: auto; mix-blend-mode: multiply; }
.feed li.k-funding { background: linear-gradient(90deg, var(--green-soft), rgba(231, 245, 238, 0) 70%); }
.feed li.k-award { background: linear-gradient(90deg, var(--gold-soft), rgba(251, 244, 226, 0) 70%); }
.tag-fund { display: inline-block; margin-left: 8px; padding: 1px 8px; font-size: var(--t-xs); font-weight: 700; color: #FFFFFF; background: var(--green); border-radius: 2px; vertical-align: 0.1em; }
@media (max-width: 700px) {
  .feed li { grid-template-columns: 2.25rem minmax(0, 1fr); gap: 2px 12px; }
  .feed time { grid-column: 2; grid-row: 1; padding-top: 0; }
  .feed .ic { grid-column: 1; grid-row: 1 / span 3; }
  .feed .bd { grid-column: 2; }
  .feed .lg { grid-column: 2; justify-content: flex-start; margin-top: 8px; }
  .feed .lg:empty { display: none; }
  .feed .lg img { max-height: 38px; }
}

/* Partners logo wall */
.partners { list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.partners li {
  display: grid; place-items: center; min-height: 116px; padding: 18px 20px; text-align: center;
  background: var(--bg); border: 1px solid var(--line);
}
.partners li img { max-height: 54px; max-width: 100%; width: auto; height: auto; mix-blend-mode: multiply; }
.partners li.tall img { max-height: 66px; }
.partners li.sq img { max-height: 78px; }
.partners li.wide img { max-height: 40px; }
@media (max-width: 1100px) { .partners { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 900px) { .partners { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .partners { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .partners li { min-height: 92px; padding: 14px; }
  .partners li img { max-height: 42px; }
  .partners li.tall img { max-height: 52px; }
  .partners li.sq img { max-height: 62px; }
  .partners li.wide img { max-height: 30px; }
}
.partners li.noimg span { font-size: var(--t-sm); font-weight: 600; line-height: 1.35; color: var(--ink-2); }

@media (max-width: 600px) {
  .lede { font-size: 1.0625rem; }
  .ra .desc.lede { font-size: 1.0625rem; }
  .block-head { margin-bottom: 20px; }
}
.gal img[src*="gold-status"] { object-fit: contain; background: #FFFFFF; }

.gal.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 900px) { .gal.five { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .gal.five { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
