/* ---- base tokens ---------------------------------------------------- */

:root {
  --font-serif: 'Lora', Georgia, serif;
  --font-sans: 'Rubik', -apple-system, BlinkMacSystemFont, sans-serif;
  --max-width: 1180px;
}

/* Hue per accent identity (see tokens/colors.css for the accent-N-* color
   values themselves; readme.md documents this hue mapping). data-accent is
   set once per page load by js/theme.js. */
[data-accent="1"] { --hue: 260; --brand-light: var(--accent-1-light); --brand-dark: var(--accent-1-dark); --brand-strong-light: var(--accent-1-strong-light); --brand-strong-dark: var(--accent-1-strong-dark); }
[data-accent="2"] { --hue: 155; --brand-light: var(--accent-2-light); --brand-dark: var(--accent-2-dark); --brand-strong-light: var(--accent-2-strong-light); --brand-strong-dark: var(--accent-2-strong-dark); }
[data-accent="3"] { --hue: 40;  --brand-light: var(--accent-3-light); --brand-dark: var(--accent-3-dark); --brand-strong-light: var(--accent-3-strong-light); --brand-strong-dark: var(--accent-3-strong-dark); }
[data-accent="4"] { --hue: 300; --brand-light: var(--accent-4-light); --brand-dark: var(--accent-4-dark); --brand-strong-light: var(--accent-4-strong-light); --brand-strong-dark: var(--accent-4-strong-dark); }

/* Light-mode tokens (default). Grayscale-with-hue-tint values, hue supplied
   by whichever [data-accent] identity got picked this load. */
:root {
  --bg: oklch(98.5% 0.006 var(--hue));
  --bg-alt: oklch(96% 0.008 var(--hue));
  --bg-raise: oklch(100% 0 0);
  --fg: oklch(22% 0.018 var(--hue));
  --fg-muted: oklch(46% 0.018 var(--hue));
  --fg-faint: oklch(62% 0.014 var(--hue));
  --border: oklch(89% 0.01 var(--hue));

  /* role: inline text highlighting (lab-author names, keyword/tag highlighting) */
  --brand: var(--brand-light);
  /* role: buttons and emphasis elements */
  --brand-strong: var(--brand-strong-light);
}

/* Dark-mode tokens. data-theme is set once at load by js/theme.js (defaults
   to system preference) — not a bare prefers-color-scheme query, so a manual
   toggle can be added later without re-architecting this. */
[data-theme="dark"] {
  --bg: oklch(19% 0.014 var(--hue));
  --bg-alt: oklch(23% 0.016 var(--hue));
  --bg-raise: oklch(26% 0.018 var(--hue));
  --fg: oklch(94% 0.006 var(--hue));
  --fg-muted: oklch(68% 0.014 var(--hue));
  --fg-faint: oklch(50% 0.012 var(--hue));
  --border: oklch(34% 0.018 var(--hue));

  --brand: var(--brand-dark);
  --brand-strong: var(--brand-strong-dark);
}

/* ---- reset ------------------------------------------------------------ */

* { box-sizing: border-box; }
body { margin: 0; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
img { max-width: 100%; display: block; }
::selection { background: oklch(80% 0.08 260 / 0.4); }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  transition: background 0.2s ease, color 0.2s ease;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
}

/* ---- header / nav ------------------------------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in oklch, var(--bg) 93%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand__logo {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  flex-shrink: 0;
}

.wordmark {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--fg);
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
  row-gap: 8px;
}

.site-nav a {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-muted);
}

.site-nav a:hover { color: var(--fg); }

.site-nav a.is-active {
  color: var(--brand);
  font-weight: 600;
  border-bottom: 2px solid var(--brand);
}

/* ---- hero / about -------------------------------------------------- */

.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 56px 32px 48px;
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
  gap: 48px;
  align-items: center;
}

.hero__text { max-width: 360px; }

.hero__photo {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero__photo img { width: 100%; height: 100%; object-fit: contain; }

.hero__title {
  font-family: var(--font-serif);
  font-size: 40px;
  font-weight: 600;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}

.hero__affiliation {
  font-size: 13px;
  color: var(--fg-muted);
  margin: 0 0 10px;
  letter-spacing: 0.01em;
}

.hero__tagline {
  font-size: 14px;
  font-weight: 600;
  color: var(--brand);
  margin: 0 0 22px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.eyebrow {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero__para {
  font-size: 15px;
  line-height: 1.65;
  color: var(--fg-muted);
  margin: 10px 0 20px;
  text-wrap: pretty;
}

.underline-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
  border-bottom: 1px solid var(--fg);
}

/* ---- shared section layout ------------------------------------------ */

.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 32px;
}

.section__head { margin-bottom: 36px; }

.section__head-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 36px;
  flex-wrap: wrap;
  gap: 12px;
}

.section__title {
  font-family: var(--font-serif);
  font-size: 36px;
  font-weight: 600;
  margin: 8px 0 0;
}

.section__sub {
  font-size: 15px;
  color: var(--fg-muted);
  margin: 10px 0 0;
  max-width: 560px;
  line-height: 1.6;
}

.section__footer { margin-top: 28px; }

/* ---- research themes -------------------------------------------------- */

.themes-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.theme-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-raise);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 28px 24px 26px;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease;
}

.theme-card:hover { transform: translateY(-3px); }

.theme-card__bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--brand-strong);
}

.theme-card__number {
  font-family: var(--font-serif);
  font-size: 15px;
  color: var(--brand-strong);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.theme-card__title {
  font-family: var(--font-serif);
  font-size: 23px;
  font-weight: 600;
  margin: 4px 0 0;
}

.theme-card__blurb {
  font-size: 15px;
  color: var(--fg-muted);
  line-height: 1.55;
  margin: 0;
}

/* ---- research page (single-column theme write-ups) ---------------------- */

.research-list {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 64px;
}

.research-row {
  scroll-margin-top: 84px;
}

.research-row__number {
  display: block;
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--brand-strong);
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.research-row__title {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 600;
  margin: 0 0 16px;
}

.research-row__body p {
  font-size: 17px;
  line-height: 1.75;
  color: var(--fg-muted);
  margin: 0 0 20px;
}

.research-row__body p:last-child { margin-bottom: 0; }

.research-row__body h3 {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
  margin: 32px 0 10px;
}

.research-row__body em { font-style: italic; }

/* ---- news -------------------------------------------------------------- */

.news-row {
  grid-template-columns: 110px 1fr;
  gap: 20px;
  padding: 18px 0;
  border-top: 1px solid var(--border);
}

/* see the .tool-card note above -- same [hidden]-defeating trap */
.news-row:not([hidden]) { display: grid; }

.news-row__date {
  font-size: 13px;
  color: var(--fg-faint);
  font-weight: 600;
}

.news-row__text {
  font-size: 15px;
  color: var(--fg);
  margin: 0;
  line-height: 1.6;
}

.news-row__text a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.news-row__text a:hover { color: var(--brand-strong); }

.btn-outline {
  font-size: 14px;
  font-weight: 600;
  color: var(--brand-strong);
  background: none;
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 10px 20px;
  cursor: pointer;
}

/* ---- tools --------------------------------------------------------- */

.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.tool-card {
  flex-direction: column;
  gap: 10px;
  background: var(--bg-raise);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 22px;
  transition: border-color 0.15s ease;
}

/* author CSS always beats the UA stylesheet's [hidden] { display: none },
   regardless of source order -- an unconditional `display: flex` above
   would silently defeat the hidden attribute main.js relies on. */
.tool-card:not([hidden]) { display: flex; }

.tool-card:hover { border-color: var(--brand); }

.tool-card__name {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  color: var(--fg);
}

.tool-card__blurb {
  font-size: 14px;
  color: var(--fg-muted);
  line-height: 1.55;
  margin: 0;
  flex: 1;
}

.tool-card__link {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
}

/* ---- publications ---------------------------------------------------- */

.pub-count {
  font-size: 13px;
  color: var(--fg-faint);
}

.pub-year-group {
  grid-template-columns: 96px 1fr;
  gap: 24px;
  border-top: 1px solid var(--border);
  padding: 28px 0;
}

/* see the .tool-card note above -- same [hidden]-defeating trap */
.pub-year-group:not([hidden]) { display: grid; }

.pub-year-group__year {
  position: sticky;
  top: 84px;
  align-self: start;
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--fg-faint);
  font-style: italic;
}

.pub-year-group__entries {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.pub-entry { display: flex; flex-direction: column; gap: 6px; }

.pub-entry__title {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 500;
  color: var(--fg);
  margin: 0;
  line-height: 1.4;
}

.pub-entry__title a { border-bottom: 1px solid transparent; }
.pub-entry__title a:hover { border-bottom-color: var(--fg); }

.pub-entry__authors {
  margin: 0;
  font-size: 15px;
  color: var(--fg-muted);
}

.pub-entry__authors .is-lab-member {
  color: var(--brand);
}

.pub-entry__authors .author {
  font-weight: 400;
  color: var(--fg-muted);
}

.pub-entry__authors .author-ellipsis {
  color: var(--fg-faint);
}

.pub-entry__meta {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--fg-faint);
}

.pub-entry__journal {
  font-style: italic;
  color: var(--brand);
  font-weight: 600;
}

.pub-entry__doi {
  color: var(--fg-faint);
  font-weight: 400;
  width: fit-content;
}

/* ---- publications page (page head, filter bar) ------------------------- */

.page-head {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 56px 32px 8px;
}

.page-title {
  font-family: var(--font-serif);
  font-size: 48px;
  font-weight: 600;
  margin: 8px 0 14px;
  letter-spacing: -0.01em;
}

.page-sub {
  font-size: 16px;
  color: var(--fg-muted);
  line-height: 1.6;
  max-width: 620px;
  margin: 0;
}

.filter-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 32px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filter-bar {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

.search-input {
  font-family: var(--font-sans);
  font-size: 14px;
  padding: 10px 14px;
  border-radius: 2px;
  border: 1px solid var(--border);
  background: var(--bg-raise);
  color: var(--fg);
  min-width: 260px;
  outline: none;
}

.search-input:focus { border-color: var(--brand); }

.year-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.year-chip {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 2px;
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg-muted);
}

.year-chip.is-active {
  border-color: var(--brand);
  background: color-mix(in oklch, var(--brand) 12%, transparent);
  color: var(--brand);
}

.empty-state {
  font-size: 15px;
  color: var(--fg-muted);
  padding: 40px 0;
  border-top: 1px solid var(--border);
}

/* ---- team page ----------------------------------------------------------- */

.group-title {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 600;
  margin: 0 0 24px;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 32px 24px;
}

.team-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 8px;
}

.team-card__trigger {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 4px;
  text-align: left;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.team-card__photo {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  margin-bottom: 12px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-alt);
  transition: opacity 0.15s ease;
}

.team-card__trigger:hover .team-card__photo { opacity: 0.85; }

.team-card__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.team-card__initials {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 22px;
  font-weight: 600;
  color: var(--brand-strong);
  background: color-mix(in oklch, var(--brand) 14%, var(--bg-alt));
}

.team-card__name {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 600;
  margin: 0;
  color: var(--fg);
}

.team-card__role {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  margin: 0;
}

.alumni-section { border-top: 1px solid var(--border); }

.alumni-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px 32px;
}

.alumni-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.alumni-row__photo {
  display: block;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-alt);
}

.alumni-row__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.alumni-row__initials {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--brand-strong);
  background: color-mix(in oklch, var(--brand) 14%, var(--bg-alt));
}

.alumni-row__name {
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
  margin: 0 0 2px;
}

.alumni-row__caption {
  font-size: 13px;
  color: var(--fg-muted);
  margin: 0;
  line-height: 1.5;
}

.alumni-row__current-wrap {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
  margin-left: 4px;
}

.alumni-row__current-btn {
  width: 16px;
  height: 16px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: none;
  color: var(--fg-faint);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.alumni-row__current-btn:hover,
.alumni-row__current-btn:focus-visible {
  color: var(--brand);
}

.alumni-row__current-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 6px;
  background: var(--fg);
  color: var(--bg);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  padding: 6px 10px;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.alumni-row__current-btn:hover + .alumni-row__current-tooltip,
.alumni-row__current-btn:focus + .alumni-row__current-tooltip {
  opacity: 1;
}

.pets-section { border-top: 1px solid var(--border); }

.pets-group-title {
  font-style: italic;
  color: var(--brand);
  margin-bottom: 6px;
}

.pets-sub {
  font-size: 14px;
  color: var(--fg-muted);
  margin: 0 0 28px;
}

.pets-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-bottom: 36px;
}

.pet-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--bg-alt);
  border-radius: 18px;
  padding: 24px;
}

.pet-card__photo {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  margin-bottom: 14px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg);
}

.pet-card__photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pet-card__name {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  color: var(--fg);
}

.pet-card__owner {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  margin: 2px 0 8px;
}

.pet-card__blurb {
  font-size: 15px;
  color: var(--fg-muted);
  margin: 0;
  line-height: 1.55;
  font-style: italic;
}

.pet-card__memorial {
  font-size: 12px;
  color: var(--fg-faint);
  margin: 10px 0 0;
  font-style: italic;
}

.pet-alumni-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--fg-faint);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 14px;
}

.pet-alumni-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 24px;
}

.pet-alumni-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}

.pet-alumni-row__photo {
  display: block;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-alt);
  opacity: 0.85;
}

.pet-alumni-row__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pet-alumni-row__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-muted);
  margin: 0;
}

.pet-alumni-row__caption {
  font-size: 12px;
  color: var(--fg-faint);
  margin: 0;
}

.team-modal { position: fixed; inset: 0; z-index: 100; }
.team-modal:not([hidden]) { display: flex; align-items: center; justify-content: center; padding: 20px; }

.team-modal__overlay {
  position: absolute;
  inset: 0;
  background: color-mix(in oklch, black 45%, transparent);
}

[data-theme="dark"] .team-modal__overlay {
  background: color-mix(in oklch, black 60%, transparent);
}

.team-modal__card {
  position: relative;
  background: var(--bg-raise);
  border: 1px solid var(--border);
  border-radius: 2px;
  max-width: 420px;
  width: 100%;
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.team-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  color: var(--fg-faint);
  padding: 4px;
}

.team-modal__photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  background: color-mix(in oklch, var(--brand) 14%, var(--bg-alt));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 32px;
  font-weight: 600;
  color: var(--brand-strong);
}

/* A real photo shows in full (letterboxed, not cropped) instead of the
   circular thumbnail used elsewhere -- overrides the initials-fallback
   shape above. */
.team-modal__photo.has-photo {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  background: var(--bg-alt);
}

.team-modal__photo img { width: 100%; height: 100%; object-fit: cover; }

.team-modal__photo.has-photo img { object-fit: contain; }

.team-modal__name {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  margin: 0;
  color: var(--fg);
  text-align: center;
}

.team-modal__role {
  font-size: 14px;
  font-weight: 600;
  color: var(--brand);
  margin: 0;
  text-align: center;
}

.team-modal__social:empty { display: none; }

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.social-links__icon {
  width: 18px;
  height: 18px;
  color: var(--fg-muted);
}

.social-links__icon:hover { color: var(--brand); }

.social-links__icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.team-modal__bio {
  font-size: 14px;
  color: var(--fg-muted);
  margin: 0;
  text-align: center;
  line-height: 1.6;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

/* ---- gallery page ---------------------------------------------------- */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px 24px;
}

.photo-figure {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.photo-figure__img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--bg-alt);
  overflow: hidden;
}

.photo-figure__img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.photo-figure__caption {
  font-size: 13px;
  color: var(--fg-muted);
  margin: 0;
  line-height: 1.5;
}

.gallery-note {
  font-size: 13px;
  color: var(--fg-faint);
  margin: 28px 0 0;
  text-align: center;
}

.gallery-lightbox { position: fixed; inset: 0; z-index: 100; }
.gallery-lightbox:not([hidden]) { display: flex; align-items: center; justify-content: center; padding: 20px; }

.gallery-lightbox__overlay {
  position: absolute;
  inset: 0;
  background: color-mix(in oklch, black 65%, transparent);
}

.gallery-lightbox__card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 900px;
  width: 100%;
}

.gallery-lightbox__photo {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--bg-alt);
  overflow: hidden;
}

.gallery-lightbox__photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--bg-alt);
}

.gallery-lightbox__caption {
  font-size: 14px;
  color: var(--bg);
  margin: 0;
  text-align: center;
}

.gallery-lightbox__close {
  position: absolute;
  top: -44px;
  right: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: color-mix(in oklch, black 40%, transparent);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  color: var(--bg);
  padding: 0;
}

.gallery-lightbox__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: color-mix(in oklch, black 40%, transparent);
  color: var(--bg);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.gallery-lightbox__arrow--prev { left: -22px; }
.gallery-lightbox__arrow--next { right: -22px; }

/* ---- tools page ------------------------------------------------------ */

.tools-index {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 28px 32px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  border-bottom: 1px solid var(--border);
}

.tools-index__link {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-muted);
}

.tools-index__link:hover { color: var(--brand); }

.tool-list {
  display: flex;
  flex-direction: column;
}

.tool-row {
  display: flex;
  gap: 40px;
  padding: 40px 0;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 84px;
}

.tool-row__img {
  display: block;
  width: 340px;
  flex-shrink: 0;
  aspect-ratio: 4 / 3;
  background: var(--bg-alt);
  overflow: hidden;
}

.tool-row__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-lightbox { position: fixed; inset: 0; z-index: 100; }
.gallery-lightbox:not([hidden]) { display: flex; align-items: center; justify-content: center; padding: 20px; }

.gallery-lightbox__overlay {
  position: absolute;
  inset: 0;
  background: color-mix(in oklch, black 65%, transparent);
}

.gallery-lightbox__card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 900px;
  width: 100%;
}

.gallery-lightbox__photo {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--bg-alt);
  overflow: hidden;
}

.gallery-lightbox__photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--bg-alt);
}

.gallery-lightbox__caption {
  font-size: 14px;
  color: var(--bg);
  margin: 0;
  text-align: center;
}

.gallery-lightbox__close {
  position: absolute;
  top: -44px;
  right: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: color-mix(in oklch, black 40%, transparent);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  color: var(--bg);
  padding: 0;
}

.gallery-lightbox__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: color-mix(in oklch, black 40%, transparent);
  color: var(--bg);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.gallery-lightbox__arrow--prev { left: -22px; }
.gallery-lightbox__arrow--next { right: -22px; }

.tool-row__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.tool-row__name {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 600;
  color: var(--brand);
}

.tool-row__blurb {
  font-size: 15px;
  color: var(--fg-muted);
  line-height: 1.65;
  margin: 0;
  max-width: 640px;
}

.tool-row__description {
  font-size: 14px;
  color: var(--fg-faint);
  line-height: 1.65;
  margin: 0;
  max-width: 640px;
}

.tool-row__icons {
  display: flex;
  gap: 14px;
}

.tool-row__icon {
  color: var(--fg-muted);
  display: flex;
}

.tool-row__icon:hover { color: var(--brand); }

.archived-head {
  padding: 48px 0 8px;
}

/* ---- contact ------------------------------------------------------------ */
/* This section always shows an inverted palette relative to the page theme
   (dark block on a light page, light block on a dark page) -- swapping --fg
   and --bg reproduces that without a second token set. */

.contact {
  background: var(--fg);
  color: var(--bg);
  padding: 72px 0;
}

.contact__grid {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}

.contact__title {
  font-family: var(--font-serif);
  font-size: 34px;
  font-weight: 600;
  margin: 10px 0 16px;
}

.contact__text {
  font-size: 16px;
  line-height: 1.65;
  margin: 0 0 22px;
  max-width: 440px;
  opacity: 0.75;
}

.contact__email {
  font-size: 18px;
  font-weight: 700;
  display: inline-block;
  margin-bottom: 28px;
  border-bottom: 1px solid currentColor;
}

/* the page's own --brand-strong is tuned for the page's palette; the contact
   block's background is inverted, so it needs the *other* theme's strong
   variant to read correctly against it */
:root:not([data-theme="dark"]) .contact__email { color: var(--brand-strong-dark); }
[data-theme="dark"] .contact__email { color: var(--brand-strong-light); }

.contact__details { display: flex; flex-direction: column; gap: 4px; }

.contact__detail-line { font-size: 14px; margin: 0; opacity: 0.65; }

.contact__map {
  width: 100%;
  height: 320px;
  background: var(--bg-alt);
  overflow: hidden;
}

.contact__map picture,
.contact__map img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---- footer -------------------------------------------------------------- */

.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 28px 32px;
  font-size: 13px;
  color: var(--fg-faint);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---- responsive --------------------------------------------------------- */

@media (max-width: 979px) {
  .hero__grid { grid-template-columns: 1fr; gap: 28px; }
  .hero__text { max-width: 100%; order: 2; }
  .hero__photo { order: 1; height: 240px; }
  .themes-grid { grid-template-columns: repeat(2, 1fr); }
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
  .contact__grid { grid-template-columns: 1fr; gap: 28px; }
  .team-grid { grid-template-columns: repeat(3, 1fr); }
  .alumni-grid { grid-template-columns: repeat(2, 1fr); }
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .pets-grid { grid-template-columns: repeat(2, 1fr); }
  .pet-alumni-grid { grid-template-columns: repeat(2, 1fr); }

  /* Plenty of room for the tooltip at full width above this breakpoint --
     only medium/mobile viewports are narrow enough for a long nowrap
     current_position string to push past the edge of the screen. */
  .alumni-row__current-tooltip {
    white-space: normal;
    max-width: min(240px, calc(100vw - 32px));
  }
}

@media (max-width: 679px) {
  .site-header__inner { padding: 14px 20px; }
  .nav-toggle { display: flex; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 12px 20px 16px;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { font-size: 15px; padding: 8px 0; width: 100%; }
  .hero { padding: 40px 20px 36px; }
  .hero__title { font-size: 32px; }
  .section { padding: 36px 20px; }
  .section__head, .section__head-row { margin-bottom: 24px; }
  .section__title { font-size: 28px; }
  .themes-grid { grid-template-columns: 1fr; }
  .tools-grid { grid-template-columns: 1fr; }
  .pub-year-group { grid-template-columns: 1fr; gap: 10px; }
  .pub-year-group__year { position: static; }
  .news-row { grid-template-columns: 1fr; gap: 4px; }
  .contact { padding: 48px 0; }
  .contact__grid { padding: 0 20px; }
  .contact__title { font-size: 26px; }
  .page-head { padding: 36px 20px 8px; }
  .page-title { font-size: 34px; }
  .filter-wrap { padding: 24px 20px 0; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .search-input { min-width: auto; }
  .team-grid { grid-template-columns: repeat(2, 1fr); gap: 20px 14px; }
  .alumni-grid { grid-template-columns: 1fr; }
  .pets-grid { grid-template-columns: 1fr; }
  .pet-alumni-grid { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: 1fr; }
  .gallery-lightbox__arrow--prev { left: 4px; }
  .gallery-lightbox__arrow--next { right: 4px; }
  .gallery-lightbox__close { top: 4px; right: 4px; }
  .tools-index { padding: 20px 20px 16px; }
  .tool-list { gap: 32px; }
  .tool-row { flex-direction: column; gap: 16px; padding: 0 0 32px; }
  .tool-row__img { width: 100%; }
}
