/* ==========================================================================
   SNAIL Lab — stylesheet
   1. Tokens & palette     5. Cards, grids, sections
   2. Base elements        6. Page-specific blocks
   3. Layout helpers       7. Footer
   4. Header & navigation  8. Responsive & motion
   ========================================================================== */

/* 1. Tokens & palette ----------------------------------------------------- */

:root {
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --maxw: 1120px;
  --gutter: 24px;
  --radius: 14px;
  --radius-sm: 8px;
  --radius-pill: 999px;

  /* The pastel spectrum palette. Every pastel on the site comes from these
     five; the spectrum is them in order, looping back to mint. The palette
     has no dark tone, so text is a soft charcoal and links a deepened mint. */
  --mint: #86e3ce;
  --pistachio: #d0e6a6;
  --butter: #fedc92;
  --coral: #fb867c;
  --lilac: #cfabdb;
  --spectrum: linear-gradient(90deg, var(--mint) 0%, var(--pistachio) 20%, var(--butter) 40%, var(--coral) 60%, var(--lilac) 80%, var(--mint) 100%);

  --bg: #ffffff;
  --bg-alt: #fff8ee;
  --surface: #ffffff;
  --surface-2: #fbf7f2;
  --border: #eee6ee;
  --border-strong: #ddd2e0;
  --text: #2e2a35;
  --muted: #5f5a6b;
  --accent: #0f7c68;
  --accent-hover: #0a5f50;
  --accent-tint: #e3f8f2;
  --on-accent: #ffffff;
  --warm: #b5432f;
  --warm-tint: #ffe9e5;

  --shadow-sm: 0 1px 2px rgba(46, 42, 53, 0.05);
  --shadow-md: 0 8px 24px rgba(46, 42, 53, 0.08);
  --shadow-lg: 0 18px 48px rgba(46, 42, 53, 0.12);

  color-scheme: light;
}

/* 2. Base elements -------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 0.6em;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

h1 { font-size: clamp(2.1rem, 5vw, 3.35rem); }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.15rem); }
h3 { font-size: 1.18rem; }
h4 { font-size: 1rem; }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover { color: var(--accent-hover); }

img,
svg {
  max-width: 100%;
  display: block;
}

ul,
ol { margin: 0 0 1.1em; padding-left: 1.25em; }
li { margin-bottom: 0.4em; }

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.1em 0.4em;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--on-accent);
  padding: 10px 16px;
  z-index: 200;
  border-radius: 0 0 var(--radius-sm) 0;
}

.skip-link:focus {
  left: 0;
  color: var(--on-accent);
}

/* 3. Layout helpers ------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: clamp(3.5rem, 7vw, 5.5rem);
}

.section--alt { background: var(--bg-alt); }

.section--tight { padding-block: clamp(2.5rem, 5vw, 3.5rem); }

.section--cta { padding-block: clamp(2rem, 4vw, 3rem) clamp(3rem, 7vw, 5rem); }

.section-head {
  max-width: 720px;
  margin-bottom: 2.5rem;
}

.section-head--center {
  margin-inline: auto;
  text-align: center;
}

.section-head--sm { margin-bottom: 1.5rem; }

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.lead {
  font-size: 1.08rem;
  color: var(--muted);
  margin-bottom: 0;
}

.section-head h2 + .lead { margin-top: -0.2em; }

.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.stack > * + * { margin-top: 1rem; }

.text-muted { color: var(--muted); }
.center { text-align: center; }

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: center;
}

.split--top { align-items: start; }

/* A heading on the left beside wider content on the right. */
.split--aside { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }

.narrow { max-width: 820px; }

.framed {
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 1.5rem; }
.mt-3 { margin-top: 2rem; }

.actions--center { justify-content: center; }

.pub-count {
  font-size: 0.86rem;
  margin: -0.75rem 0 1.25rem;
}

/* Coral to lilac, through the blend between them. */
.cta-band {
  background: linear-gradient(110deg, var(--coral) 0%, #e598ad 45%, var(--lilac) 100%);
  color: #3a3442;
  border-radius: var(--radius);
  padding: clamp(2rem, 5vw, 3.25rem) clamp(1.25rem, 4vw, 3rem);
  text-align: center;
}

.cta-band h2 { color: var(--text); }

.cta-band p {
  max-width: 58ch;
  margin-inline: auto;
  color: #3a3442;
}

@media (max-width: 860px) {
  .split,
  .split--aside { grid-template-columns: minmax(0, 1fr); }
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.68rem 1.25rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn:hover { transform: translateY(-1px); }

.btn svg { width: 16px; height: 16px; }

.btn-primary {
  background: var(--coral);
  color: var(--text);
}

.btn-primary:hover {
  background: #fc978e;
  color: var(--text);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.6);
  border-color: color-mix(in srgb, var(--text) 22%, transparent);
  color: var(--text);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: color-mix(in srgb, var(--text) 40%, transparent);
  color: var(--text);
}

/* On the coral call-to-action band a coral button would vanish. */
.cta-band .btn-primary {
  background: var(--text);
  color: #ffffff;
}

.cta-band .btn-primary:hover {
  background: #45404f;
  color: #ffffff;
}

/* Tags */

.tag {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.22rem 0.6rem;
  border-radius: var(--radius-pill);
  background: #fff1cc;
  color: #7a5a00;
  border: 1px solid transparent;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.85rem;
}

.badge-award {
  background: var(--warm-tint);
  color: var(--warm);
  border-color: color-mix(in srgb, var(--warm) 30%, transparent);
}

/* 4. Header & navigation -------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
}

/* The spectrum rule along the bottom of the header. */
.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  background: var(--spectrum);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}

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

.brand-mark {
  width: 34px;
  height: 34px;
  color: var(--accent);
  flex-shrink: 0;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-size: 1.02rem; }

.brand-sub {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: block;
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.93rem;
  font-weight: 550;
  color: var(--muted);
}

.nav-links a:hover {
  color: var(--text);
  background: var(--surface-2);
}

.nav-links a[aria-current="page"] {
  color: var(--accent);
  background: var(--accent-tint);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.icon-btn svg { width: 19px; height: 19px; }

.nav-toggle { display: none; }

/* 5. Cards, grids, sections ----------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.card--link:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.card h3 { margin-bottom: 0.5rem; }
.card p { color: var(--muted); font-size: 0.95rem; }

.card-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--accent-tint);
  color: var(--accent);
  margin-bottom: 1.1rem;
}

.card-icon svg { width: 23px; height: 23px; }

/* Research directions step through the palette in order, both as cards on the
   home page and as sections on the research page. */
#research-cards > :nth-child(4n + 1),
#research-blocks > :nth-child(4n + 1) { --hue: var(--mint); }
#research-cards > :nth-child(4n + 2),
#research-blocks > :nth-child(4n + 2) { --hue: var(--pistachio); }
#research-cards > :nth-child(4n + 3),
#research-blocks > :nth-child(4n + 3) { --hue: var(--butter); }
#research-cards > :nth-child(4n + 4),
#research-blocks > :nth-child(4n + 4) { --hue: var(--coral); }

#research-cards .card-icon,
#research-blocks .card-icon {
  background: var(--hue);
  color: var(--text);
}

#research-cards .card { box-shadow: inset 0 4px 0 var(--hue); }
#research-cards .card--link:hover { box-shadow: inset 0 4px 0 var(--hue), var(--shadow-md); }

/* Project cards */

.project-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.project-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.project-media {
  aspect-ratio: 16 / 9;
  max-width: 100%;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-body {
  padding: 1.35rem 1.4rem 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* A project card is just its name and links under the image. */
.project-body h3 { margin-bottom: 0; }

.project-body .link-row { margin-top: 0.6rem; }

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 1rem;
  font-size: 0.87rem;
  font-weight: 600;
}

.link-row a { display: inline-flex; align-items: center; gap: 0.3rem; }
.link-row svg { width: 14px; height: 14px; }

/* 6. Page-specific blocks ------------------------------------------------- */

/* Hero: a pastel wash with one glow per palette colour, and white rings */

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(560px 400px at 6% 8%, color-mix(in srgb, var(--mint) 85%, transparent), transparent 70%),
    radial-gradient(540px 380px at 46% -12%, color-mix(in srgb, var(--butter) 75%, transparent), transparent 70%),
    radial-gradient(560px 400px at 96% 16%, color-mix(in srgb, var(--coral) 55%, transparent), transparent 70%),
    radial-gradient(640px 420px at 84% 112%, color-mix(in srgb, var(--lilac) 85%, transparent), transparent 70%),
    radial-gradient(580px 380px at 18% 118%, color-mix(in srgb, var(--pistachio) 90%, transparent), transparent 70%);
  background-color: #fff9f2;
  color: #3f3a48;
  isolation: isolate;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("../img/hero-waves.svg");
  background-repeat: no-repeat;
  background-position: right -60px top -40px;
  background-size: 720px 720px;
  pointer-events: none;
  z-index: -1;
}

.hero-inner {
  padding-block: clamp(4rem, 11vw, 7.5rem);
  max-width: 760px;
}

.hero h1 { color: var(--text); margin-bottom: 0.45em; }

.hero .hero-eyebrow {
  color: var(--text);
  border: 1px solid color-mix(in srgb, var(--text) 16%, transparent);
  border-radius: var(--radius-pill);
  padding: 0.3rem 0.85rem;
  background: rgba(255, 255, 255, 0.6);
}

.hero-lead {
  font-family: var(--font-serif);
  font-size: clamp(1.05rem, 2.1vw, 1.3rem);
  line-height: 1.6;
  color: #3f3a48;
  max-width: 62ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.hero-meta {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid color-mix(in srgb, var(--text) 14%, transparent);
  font-size: 0.9rem;
  color: #4f4a5a;
}

/* Pull quote / mission */

.pull-quote {
  font-family: var(--font-serif);
  font-size: clamp(1.15rem, 2.4vw, 1.5rem);
  line-height: 1.55;
  color: var(--text);
  border-left: 3px solid;
  border-image: linear-gradient(180deg, var(--mint), var(--butter) 50%, var(--coral)) 1;
  padding-left: 1.4rem;
  margin: 0;
}

/* Research areas (research.html) */

.research-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  padding-block: clamp(2.5rem, 5vw, 3.5rem);
  border-top: 1px solid var(--border);
  align-items: start;
}

.research-block:first-of-type { border-top: 0; padding-top: 0; }

.research-block .card-icon { margin-bottom: 1rem; }

.research-block h2 { font-size: clamp(1.4rem, 2.6vw, 1.8rem); }

/* Project cards under each research direction, across the full width */
.research-projects { grid-column: 1 / -1; }

.research-projects-title {
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1rem;
}

.thread-list { list-style: none; padding: 0; margin: 1.25rem 0 0; }

.thread-list li {
  position: relative;
  padding-left: 1.5rem;
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 0.7rem;
}

.thread-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

/* News */

.news-list { list-style: none; margin: 0; padding: 0; }

.news-item {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 1.5rem;
  padding: 1.4rem 0;
  border-top: 1px solid var(--border);
  margin: 0;
}

.news-item:first-child { border-top: 0; }

.news-date {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  padding-top: 0.15rem;
}

.news-item h3 {
  font-size: 1.02rem;
  margin-bottom: 0.3rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.news-item p {
  color: var(--muted);
  font-size: 0.94rem;
  margin-bottom: 0;
}

.news-item .tag { text-transform: capitalize; }

/* Publications */

.pub-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  padding: 1rem 1.15rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.search-field {
  position: relative;
  flex: 1 1 260px;
  min-width: 0;
}

.search-field svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
}

.search-field input {
  width: 100%;
  padding: 0.6rem 0.9rem 0.6rem 2.3rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
}

.search-field input::placeholder { color: var(--muted); }

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip:hover { color: var(--text); border-color: var(--accent); }

.chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.year-head {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
  margin: 2.25rem 0 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.year-head:first-of-type { margin-top: 0; }

.pub {
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border);
}

.pub-title {
  font-size: 1.01rem;
  font-weight: 650;
  line-height: 1.4;
  margin-bottom: 0.3rem;
  color: var(--text);
}

.pub-authors {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.pub-authors strong { color: var(--text); font-weight: 650; }

.pub-venue {
  font-size: 0.88rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.pub-venue em { color: var(--text); font-style: normal; font-weight: 600; }

.empty-state {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--muted);
}

.error-page {
  text-align: center;
  padding-block: clamp(4rem, 12vw, 8rem);
}

.error-page .lead {
  margin-inline: auto;
  max-width: 52ch;
}

/* People */

.people-group { margin-bottom: 3rem; }

.group-title {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.75rem;
}

.person {
  position: relative;
  text-align: center;
}

.person-photo {
  width: 132px;
  height: 132px;
  max-width: 100%;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.person h3 { font-size: 1.02rem; margin-bottom: 0.15rem; }

.person-role {
  font-size: 0.86rem;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

/* Optional extra line under the role, e.g. a co-advisor. */
.person-note {
  font-size: 0.8rem;
  font-style: italic;
  color: var(--muted);
  margin: -0.35rem 0 0.6rem;
}

.person-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.6rem;
}

.person-links a {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--muted);
}

.person-links a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.person-links svg { width: 15px; height: 15px; }

/* Every card's "Read bio" button has an ::after covering the whole card, so
   the photo and name open the pop-up too; the link icons sit above it. */

.person .person-links { position: relative; z-index: 1; }

.person-bio-btn {
  display: inline-block;
  margin: 0.1rem 0 0.15rem;
  padding: 0.26rem 0.8rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--accent-tint);
  color: var(--accent);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 650;
  line-height: 1.4;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.person-bio-btn::after {
  content: "";
  position: absolute;
  inset: 0;
}

.person .person-photo {
  outline: 3px solid transparent;
  outline-offset: 3px;
  transition: transform 0.18s ease, outline-color 0.18s ease;
}

.person:hover .person-photo {
  transform: translateY(-3px);
  outline-color: var(--hue);
}

.person:hover .person-bio-btn {
  background: var(--accent);
  color: var(--on-accent);
}

/* The hover ring steps through the palette from card to card. */
.people-group .person:nth-child(5n + 1) { --hue: var(--mint); }
.people-group .person:nth-child(5n + 2) { --hue: var(--pistachio); }
.people-group .person:nth-child(5n + 3) { --hue: var(--butter); }
.people-group .person:nth-child(5n + 4) { --hue: var(--coral); }
.people-group .person:nth-child(5n + 5) { --hue: var(--lilac); }

/* Bio pop-up */

html:has(.person-dialog) { scrollbar-gutter: stable; }
html:has(.person-dialog[open]) { overflow: hidden; }

.person-dialog {
  width: min(640px, calc(100% - 2rem));
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  overscroll-behavior: contain;
}

.person-dialog[open] { animation: dialog-in 0.2s ease-out; }

.person-dialog::backdrop {
  background: rgba(46, 42, 53, 0.45);
  backdrop-filter: blur(3px);
}

.person-dialog[open]::backdrop { animation: fade-in 0.2s ease-out; }

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
}

@keyframes fade-in {
  from { opacity: 0; }
}

.person-dialog-body {
  position: relative;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 1.75rem;
  align-items: start;
  padding: 2.25rem 2.25rem 2rem;
}

.person-dialog-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
}

/* The photo sits in a ring of the full spectrum, separated by a white gap. */
.person-dialog .person-photo {
  width: 150px;
  height: 150px;
  margin: 0;
  padding: 4px;
  border: 3px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    conic-gradient(var(--mint), var(--pistachio), var(--butter), var(--coral), var(--lilac), var(--mint)) border-box;
}

.person-dialog h2 {
  font-size: 1.45rem;
  margin: 0.35rem 2.25rem 0.2rem 0;
}

/* The name is focused only to start screen readers there; it is not a control. */
.person-dialog h2:focus { outline: none; }

.person-bio {
  margin: 1rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.97rem;
  line-height: 1.7;
}

.person-dialog .person-links {
  justify-content: flex-start;
  margin-top: 1.15rem;
}

/* PI card is wider and horizontal */

.pi-card {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
  text-align: left;
}

.pi-card .person-photo {
  width: 180px;
  height: 180px;
  margin: 0;
  border-radius: var(--radius);
}

.pi-card .person-links { justify-content: flex-start; }

.pi-card h3 { font-size: 1.4rem; }

.pi-card p { color: var(--muted); font-size: 0.96rem; }

/* Alumni */

.alumni-list { list-style: none; padding: 0; margin: 0; }

.alumni-list li {
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.8rem;
}

.alumni-list .alumni-next { color: var(--muted); }

/* Join page */

.callout {
  --hue: var(--mint);
  background: color-mix(in srgb, var(--hue) 22%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--hue) 70%, transparent);
  border-radius: var(--radius);
  padding: 1.5rem 1.65rem;
}

.grid > .callout:nth-child(4n + 2) { --hue: var(--butter); }
.grid > .callout:nth-child(4n + 3) { --hue: var(--coral); }
.grid > .callout:nth-child(4n + 4) { --hue: var(--lilac); }

.callout h3 { margin-bottom: 0.4rem; }

.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0;
}

.faq-item h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.faq-item p { color: var(--muted); font-size: 0.96rem; }

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

/* Sponsors */

.sponsor-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  justify-content: center;
}

.sponsor {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 150px;
  padding: 0.9rem 1.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.92rem;
  text-align: center;
}

.sponsor:hover { color: var(--accent); border-color: var(--accent); }

.sponsor img { max-height: 40px; width: auto; }

/* Page header (inner pages): a lighter version of the hero wash */

.page-head {
  padding-block: clamp(2.75rem, 6vw, 4rem) clamp(1.5rem, 3vw, 2rem);
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(420px 260px at -4% -30%, color-mix(in srgb, var(--mint) 60%, transparent), transparent 70%),
    radial-gradient(440px 240px at 50% -60%, color-mix(in srgb, var(--butter) 55%, transparent), transparent 70%),
    radial-gradient(480px 300px at 100% 0%, color-mix(in srgb, var(--coral) 35%, transparent), transparent 70%),
    radial-gradient(500px 260px at 86% 140%, color-mix(in srgb, var(--lilac) 55%, transparent), transparent 70%),
    radial-gradient(460px 240px at 30% 150%, color-mix(in srgb, var(--pistachio) 60%, transparent), transparent 70%);
  background-color: #fff9f2;
}

.page-head h1 { margin-bottom: 0.3em; }

.page-head .lead { max-width: 68ch; }

/* 7. Footer --------------------------------------------------------------- */

.site-footer {
  background: #2a2732;
  color: #d3cedb;
  padding-block: 3.5rem 2rem;
  margin-top: auto;
  border-top: 4px solid;
  border-image: var(--spectrum) 1;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
  gap: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.site-footer h4 {
  color: #fff;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.site-footer a { color: #d3cedb; }
.site-footer a:hover { color: var(--butter); }

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.9rem;
}

.footer-brand .brand-mark { color: var(--mint); }

.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 0.5rem; font-size: 0.93rem; }

.footer-address { font-size: 0.93rem; font-style: normal; line-height: 1.75; }

.footer-social {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.15rem;
}

.footer-social a {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-social a:hover {
  border-color: var(--mint);
  background: color-mix(in srgb, var(--mint) 14%, transparent);
}

.footer-social svg { width: 16px; height: 16px; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  padding-top: 1.5rem;
  font-size: 0.85rem;
  color: #a9a3b4;
}

/* 8. Responsive & motion -------------------------------------------------- */

@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .research-block { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .pi-card { grid-template-columns: 140px minmax(0, 1fr); gap: 1.5rem; }
  .pi-card .person-photo { width: 140px; height: 140px; }
}

@media (max-width: 760px) {
  :root { --gutter: 18px; }

  .nav-toggle { display: inline-grid; }

  .nav-links {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem var(--gutter) 1rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
  }

  .nav-links.is-open { display: flex; }

  .nav-links a {
    padding: 0.8rem 0.6rem;
    font-size: 1rem;
    border-radius: var(--radius-sm);
  }

  .news-item { grid-template-columns: minmax(0, 1fr); gap: 0.35rem; }
  .pub-controls { flex-direction: column; align-items: stretch; }
}

@media (max-width: 560px) {
  .grid-4,
  .grid-3,
  .grid-2 { grid-template-columns: minmax(0, 1fr); }

  .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 2rem; }

  .pi-card {
    grid-template-columns: minmax(0, 1fr);
    text-align: center;
  }

  .pi-card .person-photo { margin: 0 auto; }
  .pi-card .person-links { justify-content: center; }
  .brand-sub { display: none; }

  .person-dialog-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
    padding: 2.25rem 1.35rem 1.6rem;
    text-align: center;
  }

  .person-dialog .person-photo { width: 124px; height: 124px; margin: 0 auto; }
  .person-dialog h2 { margin-inline: 0; }
  .person-bio { text-align: left; }
  .person-dialog .person-links { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
