/* ===== Reset & Base ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --color-bg: #ffffff;
  --color-text: #1a1a1a;
  --color-text-light: #555;
  --color-text-muted: #767676;
  --color-accent: #124191;
  --color-accent-light: #e8eef7;
  --color-border: #e0e0e0;
  --color-card-bg: #f8f9fa;
  --color-hero-bg: #0a1628;
  --color-footer-bg: #1a1a2e;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --container-max: 1200px;
  --copy-max-width: 720px;
  --section-padding: 80px 0;
}

/* Avoid animating browser history scroll restoration (Back/Forward). */
html {
  scroll-behavior: auto;
}

/* Keep smooth scroll for user-triggered in-page jumps when focused. */
html:focus-within {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  padding: 0.5rem 1rem;
  background: var(--color-accent);
  color: #fff;
  font-weight: 600;
  z-index: 9999;
  border-radius: 0 0 4px 0;
}

.skip-link:focus {
  top: 0;
}

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

/* Body copy: global `a` reset keeps nav/cards clean; restore link affordance in prose. */
.single-page .content a,
.list-page .content a,
.person-page-bio a,
.person-page-email a,
.person-page-website a,
.person-page-google-scholar a,
.group-detail-body a,
.dataset-detail-body a,
.event-detail-content a,
.project-detail-body a,
.project-detail-summary a,
.facility-description a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.single-page .content a:hover,
.list-page .content a:hover,
.person-page-bio a:hover,
.person-page-email a:hover,
.person-page-website a:hover,
.person-page-google-scholar a:hover,
.group-detail-body a:hover,
.dataset-detail-body a:hover,
.event-detail-content a:hover,
.project-detail-body a:hover,
.project-detail-summary a:hover,
.facility-description a:hover {
  color: var(--color-text);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

.section-title {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.section-intro {
  font-size: 1.05rem;
  color: var(--color-text-light);
  max-width: var(--copy-max-width);
  margin-bottom: 40px;
  line-height: 1.7;
}

/* ===== Header ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(10, 22, 40, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-logo {
  display: flex;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.site-logo--visible {
  opacity: 1;
  pointer-events: auto;
}

.logo-img {
  height: 32px;
  width: auto;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 1px;
  transition: transform 0.3s;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 32px;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  font-weight: 400;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: #fff;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  background: #1a2332;
  overflow: hidden;
}

#spectral-hero {
  position: relative;
  width: 100%;
  height: 100%;
  isolation: isolate;
}

#spectral-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

.hero-lab-logo-watermark {
  position: absolute;
  inset: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  /* Promote above WebGL canvas compositing in Chromium (translateZ(0) is not always enough). */
  transform: translate3d(0, 0, 0.1px);
}

/* Darken the spectrogram locally so the white SVG reads on bright terrain peaks. */
.hero-lab-logo-watermark::before {
  content: "";
  position: absolute;
  width: min(78vw, 640px);
  height: min(42vh, 320px);
  background: radial-gradient(
    ellipse at center,
    rgba(4, 10, 22, 0.88) 0%,
    rgba(4, 10, 22, 0.5) 38%,
    rgba(4, 10, 22, 0.12) 58%,
    transparent 72%
  );
  z-index: 0;
}

.hero-lab-logo-watermark-img {
  position: relative;
  z-index: 1;
  width: min(58vw, 520px);
  max-width: 88%;
  height: auto;
  opacity: 0.62;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.95))
    drop-shadow(0 0 24px rgba(0, 0, 0, 0.65))
    drop-shadow(0 6px 48px rgba(0, 0, 0, 0.5));
}

.spectral-player-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.hero-corner-left {
  position: absolute;
  bottom: 32px;
  left: auto;
  right: clamp(24px, 5vw, 64px);
  z-index: 22;
  width: max-content;
  pointer-events: auto;
}

.hero-info-btn {
  display: flex;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(0, 0, 0, 0.4);
  color: rgba(255, 255, 255, 0.88);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.hero-info-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

.hero-info-btn:focus-visible {
  outline: 2px solid rgba(135, 206, 235, 0.9);
  outline-offset: 2px;
}

.hero-info-btn[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.hero-info-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  box-sizing: border-box;
  width: min(320px, calc(100vw - 2 * clamp(24px, 5vw, 64px)));
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.hero-info-tagline {
  margin: 0 0 10px;
  font-size: 0.8rem;
  font-style: italic;
  color: rgba(255, 255, 255, 0.7);
}

.hero-info-panel .spectral-player-top {
  position: static;
  transform: none;
  width: 100%;
  align-items: stretch;
}

.hero-info-panel .hero-player {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  justify-content: flex-start;
}

.hero-logos-bottom {
  position: absolute;
  bottom: 32px;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 0 clamp(24px, 5vw, 64px);
  pointer-events: none;
}

.hero-cambridge-logo {
  height: clamp(24px, 3.5vw, 40px);
  width: auto;
  opacity: 1;
  filter: drop-shadow(0 2px 12px rgba(0,0,0,0.4));
}

.hero-player {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 48px;
  padding: 8px 20px 8px 8px;
  color: #fff;
  white-space: nowrap;
}

.hero-btn-ring {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  --ring-color: #87ceeb;
  background: conic-gradient(
    from -90deg,
    var(--ring-color) calc(var(--progress, 0) * 360deg),
    rgba(255, 255, 255, 0.15) calc(var(--progress, 0) * 360deg)
  );
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-play-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.hero-play-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.hero-play-btn svg {
  display: block;
}

.hero-track-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.hero-track-title {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-track-artist {
  font-size: 0.7rem;
  opacity: 0.6;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-time {
  font-size: 0.75rem;
  opacity: 0.5;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.hero-next-btn {
  flex-shrink: 0;
  border: none;
  background: none;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  transition: color 0.2s;
}

.hero-next-btn:hover {
  color: rgba(255, 255, 255, 0.85);
}

/* ===== Research Themes / Tabs ===== */
.research-themes {
  padding: var(--section-padding);
}

.research-header-bar {
  display: flex;
  align-items: flex-end;
  border-bottom: 1px solid var(--color-border);
}

.tab-bar {
  gap: 0;
  margin-bottom: 40px;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tab-bar-title {
  display: inline-flex;
  align-items: center;
  padding: 14px 16px 14px 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
  position: relative;
}

.tab-bar-title--accent {
  color: var(--color-text);
}

.tab-bar-title--accent::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  background: var(--color-accent);
}

.tab-bar::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 14px 24px;
  font-family: var(--font-family);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--color-text-light);
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  transition: color 0.2s;
}

.tab-btn::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-accent);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

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

.tab-btn.active {
  color: var(--color-text);
  font-weight: 500;
}

.tab-btn.active::after {
  transform: scaleX(1);
}

.tab-icon {
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.tab-btn:hover .tab-icon,
.tab-btn.active .tab-icon {
  opacity: 1;
}

/* Research Groups */
.research-group {
  margin-bottom: 64px;
}

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

.research-group--all {
  margin-bottom: 0;
}

.tab-bar-logo {
  display: flex;
  align-items: flex-end;
  padding-right: clamp(20px, 3vw, 40px);
  flex-shrink: 0;
  padding-bottom: 8px;
}

.tab-bar-logo img {
  height: clamp(36px, 4.5vw, 52px);
  width: auto;
}

.methods-block {
  margin-top: 24px;
}

.methods-bar {
  margin-bottom: 24px;
}

.methods-bar .tab-bar-title {
  padding: 14px 0;
}

.methods-intro {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--color-text-light);
  max-width: var(--copy-max-width);
  margin-bottom: 24px;
}

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

/* MLS colour variant */
.tabs--mls .tab-btn::after {
  background: #b72037;
}

.tab-panel {
  display: none;
  animation: fadeIn 0.35s ease;
}

.tab-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.theme-layout {
  display: flex;
  flex-direction: column;
  gap: 40px;
  align-items: stretch;
}

.theme-description p {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--color-text-light);
  max-width: var(--copy-max-width);
}

.theme-projects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.theme-group-link {
  display: inline-block;
  margin-top: 16px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: opacity 0.2s;
}

.theme-group-link:hover {
  opacity: 0.75;
}

.theme-group-link--mcc {
  color: #124191;
}

.theme-group-link--mls {
  color: #b72037;
}

.theme-group-link .arrow {
  display: inline-block;
  transition: transform 0.2s;
}

.theme-group-link:hover .arrow {
  transform: translateX(4px);
}

/* ===== Person group tags ===== */
.person-group-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  color: #fff;
  letter-spacing: 0.03em;
  margin-top: 4px;
  text-decoration: none;
}

.person-group-tag--mcc {
  background: #124191;
}

.person-group-tag--mls {
  background: #b72037;
}

/* ===== Group detail page ===== */
.group-detail-page .container {
  max-width: 860px;
  margin: 0 auto;
  padding: 80px 24px;
}

.group-detail-logo {
  text-align: center;
  margin-bottom: 32px;
}

.group-detail-logo img {
  margin-inline: auto;
  max-width: 320px;
  height: auto;
}

.group-detail-body {
  line-height: 1.8;
  color: var(--color-text-light);
  font-size: 1.05rem;
}

.group-detail-body p {
  margin-bottom: 16px;
}

.group-members {
  margin-top: 48px;
}

.group-members-heading {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 24px;
}

.group-detail-page .people-grid {
  grid-template-columns: repeat(4, 1fr);
  gap: 32px 24px;
}

@media (max-width: 640px) {
  .group-detail-page .people-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.group-detail-back {
  margin-top: 48px;
}

.group-detail-back a {
  color: var(--color-accent);
  text-decoration: none;
  font-size: 0.95rem;
}

.group-detail-back a:hover {
  text-decoration: underline;
}

.project-card {
  --project-card-thumb-width: 120px;
  --project-card-min-height: calc(var(--project-card-thumb-width) / 2);
  display: flex;
  align-items: stretch;
  min-height: var(--project-card-min-height);
  border-radius: 8px;
  overflow: hidden;
  background: var(--color-card-bg);
  transition: transform 0.2s, box-shadow 0.2s;
}

.project-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.project-card--stub {
  opacity: 0.82;
  cursor: default;
}

.project-card--stub:hover {
  transform: none;
  box-shadow: none;
}

.stub-label {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--color-text-muted);
}

.project-card-thumb {
  flex-shrink: 0;
  width: var(--project-card-thumb-width);
  aspect-ratio: 2 / 1;
  overflow: hidden;
  background: var(--color-border);
}

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

.project-card-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.project-card--no-thumb .project-card-text {
  padding-left: var(--project-card-thumb-width);
}

.project-title {
  display: block;
  padding: 12px 20px;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--color-text);
}

.project-title .arrow {
  display: inline-block;
  transition: transform 0.2s;
}

.project-card:hover .arrow {
  transform: translateX(4px);
}

/* ===== Research groups on homepage ===== */
.research-groups-home {
  padding: var(--section-padding);
  background: var(--color-card-bg);
}

.research-groups-home--embedded {
  margin-top: 48px;
  padding: 0;
  background: transparent;
}

.research-groups-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.research-group-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  padding: 22px 22px 26px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.research-group-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.research-group-card--stub:hover {
  transform: none;
  box-shadow: none;
}

.research-group-card-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  margin-bottom: 8px;
}

.research-group-card-logo img {
  height: clamp(64px, 7vw, 104px);
  width: auto;
}

.research-group-card-summary {
  color: var(--color-text-light);
  margin-bottom: 10px;
}

.research-group-card-leads {
  color: var(--color-text-light);
  font-size: 0.9rem;
  margin-bottom: 0;
}

@media (max-width: 860px) {
  .research-groups-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Events & Publications Cards ===== */
.latest-events,
.latest-publications {
  padding: var(--section-padding);
}

.latest-publications {
  background: var(--color-card-bg);
}

.events-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
  align-items: stretch;
}

.events-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.event-card-featured .card-image {
  aspect-ratio: 16 / 10;
}

.event-card-featured .card-body {
  padding: 24px;
}

.event-card-featured .card-title {
  font-size: 1.2rem;
}

.event-card.event-card-small {
  display: grid;
  grid-template-columns: 180px 1fr;
  min-height: 0;
  flex: 1;
}

.event-card.event-card-small .card-image {
  width: 100%;
  height: 100%;
  aspect-ratio: unset;
}

.event-card.event-card-small .card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.event-card.event-card-small .card-title {
  font-size: 0.95rem;
}

.event-card.event-card-small .card-summary {
  display: none;
}

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

.event-card {
  display: block;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  transition: transform 0.2s, box-shadow 0.2s;
}

.event-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.card-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--color-accent-light);
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
}

.card-body {
  padding: 20px;
}

.card-date {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 500;
  margin-top: 8px;
  line-height: 1.4;
}

.card-summary {
  font-size: 0.9rem;
  color: var(--color-text-light);
  margin-top: 8px;
  line-height: 1.5;
}

/* Publications cards */
.pub-card {
  display: block;
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  transition: transform 0.2s, box-shadow 0.2s;
}

.pub-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.pub-card--stub:hover {
  transform: none;
  box-shadow: none;
}

.pub-body {
  padding: 24px;
}

.pub-year {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pub-title {
  font-size: 1.05rem;
  font-weight: 500;
  margin-top: 8px;
  line-height: 1.4;
}

.pub-authors {
  font-size: 0.88rem;
  color: var(--color-text-light);
  margin-top: 8px;
  line-height: 1.5;
}

.pub-journal {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-top: 4px;
  font-style: italic;
}

/* ===== People Grid ===== */
.people-section {
  padding: var(--section-padding);
}

.people-category {
  margin-bottom: 48px;
}

.people-category:last-child {
  margin-bottom: 0;
}

.people-category-heading {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-light);
  margin-bottom: 20px;
  letter-spacing: 0.02em;
}

.past-members-list {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 2;
  column-gap: 40px;
}

.past-members-list li {
  padding: 6px 0;
  font-size: 0.95rem;
  color: var(--color-text);
}

.past-member-info {
  font-weight: 400;
  color: var(--color-text-light);
  font-size: 0.85rem;
}

.people-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px 32px;
}

.person-card {
  text-align: center;
  display: block;
  transition: transform 0.2s;
}

.person-card:hover {
  transform: translateY(-4px);
}

.person-card:hover .person-name {
  color: var(--color-accent);
}

.person-card--stub {
  cursor: default;
}

.person-card--stub:hover {
  transform: none;
}

.person-card--stub:hover .person-name {
  color: inherit;
}

.person-photo {
  width: 140px;
  height: 140px;
  margin: 0 auto 16px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--color-card-bg);
}

.person-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.person-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  background: var(--color-card-bg);
}

.person-name {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.person-role {
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

/* ===== Footer ===== */
.site-footer {
  background: var(--color-footer-bg);
  color: rgba(255, 255, 255, 0.8);
  padding: 48px 0 32px;
}

.footer-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

.footer-info {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 32px;
}

.footer-logos {
  display: flex;
  align-items: center;
  gap: 20px;
}

.footer-logo-cms {
  height: 48px;
  width: auto;
}

.footer-logo-cam {
  height: 24px;
  width: auto;
}

.footer-name {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 4px;
}

.footer-text p {
  font-size: 0.88rem;
  line-height: 1.6;
}

.footer-text a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-copy {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.4);
}

@media (max-width: 640px) {
  .footer-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
}

/* ===== View All Button ===== */
.section-view-all {
  text-align: center;
  margin-top: 40px;
}

.btn-view-all {
  display: inline-block;
  padding: 12px 32px;
  border: 2px solid var(--color-accent);
  border-radius: 6px;
  color: var(--color-accent);
  font-size: 0.95rem;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}

.btn-view-all:hover {
  background: var(--color-accent);
  color: #fff;
}

/* ===== Events List Page ===== */
.events-list-page,
.people-list-page {
  padding: 120px 0 80px;
}

.page-title {
  font-size: 2.2rem;
  font-weight: 600;
  margin-bottom: 40px;
  letter-spacing: -0.02em;
}

.events-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.event-list-item {
  display: flex;
  gap: 32px;
  padding: 24px 0;
  border-bottom: 1px solid var(--color-border);
  transition: background 0.15s;
  text-decoration: none;
}

.event-list-item:first-child {
  border-top: 1px solid var(--color-border);
}

.event-list-item:hover {
  background: var(--color-card-bg);
}

.event-list-date {
  flex-shrink: 0;
  width: 120px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding-top: 3px;
}

.event-list-title {
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 6px;
  line-height: 1.4;
}

.event-list-summary {
  font-size: 0.9rem;
  color: var(--color-text-light);
  line-height: 1.5;
}

/* ===== Event Detail Page ===== */
.event-detail-page {
  padding: 120px 0 80px;
}

.event-detail-page .container {
  max-width: 800px;
}

.event-detail-image {
  text-align: center;
  margin-bottom: 32px;
}

.event-detail-image img {
  max-width: 360px;
  max-height: 240px;
  object-fit: contain;
  border-radius: 8px;
}

.event-detail-header {
  margin-bottom: 32px;
}

.event-detail-date {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 12px;
}

.event-detail-header h1 {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.event-detail-content {
  max-width: 720px;
  line-height: 1.8;
  color: var(--color-text-light);
}

.event-detail-content p {
  margin-bottom: 16px;
}

/* ===== Publications List Page ===== */
.publications-list-page {
  padding-top: 100px;
}

.publications-list-page .page-title {
  max-width: var(--container-max);
  margin: 0 auto 0;
  padding: 0 24px 24px;
}

.fpub-cite a,
.fpub-desc a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(255, 255, 255, 0.65);
}

.fpub-cite a:hover,
.fpub-desc a:hover {
  text-decoration-color: #fff;
}

.pub-list-legend {
  max-width: var(--container-max);
  margin: 0 auto 40px;
  padding: 0 24px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.container-wide {
  width: 100%;
}

.pub-year-block {
  padding: 48px 0;
  background: #fff;
}

.pub-year-block-alt {
  background: #f0f1f3;
}

.pub-year-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

.pub-year-heading {
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 24px;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.pub-year-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.pub-year-item {
  line-height: 1.6;
}

.pub-item-authors {
  display: block;
  font-size: 0.9rem;
  color: var(--color-text-light);
  margin-bottom: 2px;
}

.pub-item-title {
  display: block;
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 2px;
}

a.pub-item-title {
  color: var(--color-accent);
  text-decoration: none;
}

a.pub-item-title:hover {
  text-decoration: underline;
}

.pub-item-journal {
  display: block;
  font-size: 0.88rem;
  font-style: italic;
  color: var(--color-text-muted);
}

@media (max-width: 640px) {
  .event-list-item {
    flex-direction: column;
    gap: 8px;
  }

  .event-list-date {
    width: auto;
  }
}

/* ===== Person Detail Page ===== */
.person-page {
  padding: 120px 0 80px;
}

.person-page-header {
  text-align: center;
  margin-bottom: 48px;
}

.person-page-photo {
  width: 180px;
  height: 180px;
  margin: 0 auto 24px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--color-card-bg);
}

.person-page-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.person-placeholder-large {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  background: var(--color-card-bg);
}

.person-page-name {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.person-page-role {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.person-page-positions {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}

.person-page-position {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.person-page-email,
.person-page-website,
.person-page-google-scholar {
  margin-bottom: 4px;
}

.person-page-bio {
  max-width: 720px;
  margin: 0 auto;
  line-height: 1.8;
  color: var(--color-text-light);
  font-size: 1rem;
}

.person-page-bio p {
  margin-bottom: 16px;
}

/* ===== Discover More Section ===== */
.discover-section {
  background: var(--color-accent);
  color: #fff;
  padding: 36px 0;
}

.discover-section .section-title {
  color: #fff;
}

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

.discover-card {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  overflow: hidden;
  transition: background 0.2s, transform 0.2s;
}

.discover-card:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
}

.discover-card-video {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
}

.discover-card-video iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.discover-card-title {
  padding: 10px 12px;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
}

@media (max-width: 768px) {
  .discover-section {
    padding: 32px 0;
  }

  .discover-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* ===== Duo Section (Facilities / Applicants Row) ===== */
.duo-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.trio-section {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
}

.duo-card-datasets {
  background: #2d3748;
  color: #fff;
}

.duo-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 48px;
  text-align: center;
  transition: background 0.3s, transform 0.2s;
  position: relative;
  overflow: hidden;
}

.duo-card-facilities {
  background: var(--color-hero-bg);
  color: #fff;
}

.duo-card-applicants {
  background: var(--color-accent);
  color: #fff;
}

.duo-card:hover {
  opacity: 0.92;
}

.duo-card-inner {
  max-width: 360px;
}

.duo-card-icon {
  margin-bottom: 20px;
  opacity: 0.8;
}

.duo-card-icon svg {
  stroke: currentColor;
}

.duo-card-title {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.duo-card-blurb {
  font-size: 0.95rem;
  opacity: 0.8;
  line-height: 1.6;
  margin-bottom: 20px;
}

.duo-card-link {
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0.9;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.duo-card-link .arrow {
  transition: transform 0.2s;
}

.duo-card:hover .duo-card-link .arrow {
  transform: translateX(4px);
}

/* ===== Project Detail Page ===== */
.project-detail-page {
  padding: 120px 0 80px;
}

.project-detail-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 48px;
  align-items: start;
}

.project-detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 100px;
}

.project-detail-sidebar > .back-link {
  padding: 0 12px;
}

.project-sidebar-group {
  display: flex;
  flex-direction: column;
}

.project-sidebar-details {
  border: none;
}

.project-sidebar-theme {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0;
  padding: 8px 12px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s, background 0.15s;
  border-radius: 4px;
}

.project-sidebar-theme::-webkit-details-marker {
  display: none;
}

.project-sidebar-theme::before {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 5px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform 0.2s;
  opacity: 0.6;
}

.project-sidebar-details[open] .project-sidebar-theme::before {
  transform: rotate(90deg);
}

.project-sidebar-theme:hover {
  color: var(--color-text);
  background: var(--color-card-bg);
}

.project-sidebar-list {
  list-style: none;
  margin: 4px 0 0;
  padding: 0 0 0 8px;
}

.project-sidebar-list li {
  margin: 0;
}

.project-sidebar-link {
  display: block;
  padding: 8px 12px;
  font-size: 0.95rem;
  color: var(--color-text-light);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  border-radius: 0;
}

.project-sidebar-link:hover {
  background: var(--color-card-bg);
  color: var(--color-text);
}

.project-sidebar-link.active {
  border-left-color: var(--color-accent);
  background: var(--color-accent-light);
  color: var(--color-text);
  font-weight: 500;
}

.project-detail-content {
  min-width: 0;
}

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.project-detail-title {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.project-header-meta,
.method-header-meta {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

.detail-header-thumb {
  width: clamp(180px, 28vw, 320px);
  max-height: 180px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--color-card-bg);
}

.detail-header-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.publication-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 28px;
}

.publication-title-meta {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

.publication-author-photos {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 180px;
  flex-shrink: 0;
}

.publication-author-photo {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.publication-author-photo:hover {
  transform: scale(1.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.publication-author-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.publication-author-photos--inline {
  justify-content: flex-start;
  max-width: none;
  margin-bottom: 8px;
}

.publication-author-photo--small {
  width: 30px;
  height: 30px;
}

.project-people-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 0;
}

.project-person-icon {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.project-person-icon:hover {
  transform: scale(1.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.project-person-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.project-person-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-card-bg);
  color: var(--color-text-muted);
}

.publication-author-photo--small .project-person-placeholder svg {
  width: 16px;
  height: 16px;
}

.project-detail-summary {
  font-size: 1rem;
  color: var(--color-text-light);
  line-height: 1.7;
  margin-bottom: 32px;
  background: var(--color-card-bg);
  padding: 20px 24px;
  border-radius: 8px;
  border-left: 3px solid var(--color-border);
}

/* markdownify emits <p>/<ul>; global * reset removes margins — restore prose rhythm */
.project-detail-summary p {
  margin-bottom: 16px;
}

.project-detail-summary p:last-child {
  margin-bottom: 0;
}

.project-detail-summary ul,
.project-detail-summary ol {
  margin: 0 0 16px 24px;
}

.project-detail-summary li {
  margin-bottom: 8px;
}

.project-detail-summary li:last-child {
  margin-bottom: 0;
}

.project-detail-body {
  line-height: 1.8;
  color: var(--color-text-light);
}

.project-detail-body p {
  margin-bottom: 16px;
}

.project-detail-body h2 {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 32px 0 12px;
}

.project-detail-body h3 {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--color-text);
  margin: 24px 0 8px;
}

.project-detail-body ul,
.project-detail-body ol {
  margin: 0 0 16px 24px;
}

.project-detail-body li {
  margin-bottom: 8px;
}

.project-detail-body img {
  max-width: 100%;
  border-radius: 8px;
  display: block;
  margin: 16px 0;
}

.project-detail-body video {
  max-width: 100%;
  border-radius: 8px;
  display: block;
  margin: 16px 0;
}

.project-publications {
  margin-top: 48px;
  border-top: 1px solid var(--color-border);
  padding-top: 32px;
}

.project-publications-heading {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 16px;
}

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

.project-publications-list li {
  margin-bottom: 16px;
}

.project-publications-list a,
.project-publications-list .project-publication-citation {
  display: block;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.project-publications-list a {
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.project-publications-list a:hover {
  background: var(--color-card-bg);
  border-color: var(--color-accent);
}

.project-publication-citation {
  line-height: 1.7;
  color: var(--color-text-light);
}

.project-pub-title {
  display: block;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.4;
  margin-bottom: 4px;
}

.project-pub-authors {
  display: block;
  font-size: 0.85rem;
  color: var(--color-text-light);
  line-height: 1.5;
}

.project-pub-journal {
  display: block;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  font-style: italic;
  margin-top: 2px;
}

.project-pub-doi {
  color: var(--color-accent);
  font-style: normal;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.project-pub-links-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.65rem 1rem;
  margin-top: 4px;
  font-size: 0.82rem;
}

.project-pub-doi-line {
  display: block;
  min-width: 0;
  word-break: break-word;
}

.project-pub-cite-wrap {
  position: relative;
  flex-shrink: 0;
}

.project-pub-cite-btn {
  font: inherit;
  font-size: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--color-text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.project-pub-cite-btn:hover,
.project-pub-cite-btn:focus-visible,
.project-pub-cite-btn[aria-expanded="true"] {
  color: var(--color-accent);
}

.project-pub-cite-panel {
  position: absolute;
  z-index: 20;
  left: 0;
  top: calc(100% + 6px);
  width: max-content;
  max-width: min(28rem, calc(100vw - 2rem));
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-bg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.project-pub-cite-panel .project-publication-citation {
  margin: 0;
  line-height: 1.7;
  color: var(--color-text-light);
  font-size: 0.9rem;
}

.project-pub-cite-panel .project-publication-citation a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.project-pub-cite-tabs-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.project-pub-cite-tabs .tab-bar {
  margin-bottom: 0;
  flex-wrap: nowrap;
}

.project-pub-cite-copy {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-bg);
  color: var(--color-text-muted);
  padding: 4px 8px;
  font-size: 0.72rem;
  line-height: 1;
  cursor: pointer;
}

.project-pub-cite-copy:hover,
.project-pub-cite-copy:focus-visible {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.project-pub-cite-copy.is-copied {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.project-pub-cite-copy.is-error {
  color: #b42318;
  border-color: #b42318;
}

.project-pub-cite-copy svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
  flex-shrink: 0;
}

.project-pub-cite-tabs .tab-btn {
  padding: 8px 10px;
  font-size: 0.78rem;
  font-weight: 500;
}

.project-pub-cite-tabs .tab-panel {
  animation: none;
}

.project-pub-cite-tabs .tab-panel .project-publication-citation {
  font-size: 0.82rem;
}

.project-pub-cite-bibtex {
  margin: 0;
  padding: 10px 12px;
  font-size: 0.72rem;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: 6px;
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.project-pub-cite-bibtex code {
  font-family: inherit;
  font-size: inherit;
}

.featured-pubs {
  margin-top: 40px;
}

.featured-pubs-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.featured-pub-card {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.featured-pub-image-wrap {
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.featured-pub-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-pub-body {
  padding: 16px;
}

.featured-pub-citation {
  line-height: 1.7;
  color: var(--color-text-light);
  margin-bottom: 10px;
}

.featured-pub-description {
  font-size: 0.92rem;
  color: var(--color-text-light);
  margin-bottom: 12px;
}

.featured-pub-link {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 500;
}

.featured-pub-link:hover {
  text-decoration: underline;
}

.back-link {
  color: var(--color-accent);
  font-size: 0.9rem;
  text-decoration: none;
  transition: color 0.2s;
}

.back-link:hover {
  text-decoration: underline;
}

.project-detail-back {
  margin-top: 48px;
}

.project-detail-back a {
  color: var(--color-accent);
  font-size: 0.9rem;
  text-decoration: none;
  transition: color 0.2s;
}

.project-detail-back a:hover {
  text-decoration: underline;
}

.detail-back-layout {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.detail-back-rail {
  position: sticky;
  top: 100px;
}

.page-back-top {
  margin-bottom: 24px;
}

@media (max-width: 900px) {
  .project-detail-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .project-detail-sidebar {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px;
  }

  .project-sidebar-group {
    min-width: 200px;
  }

  .detail-back-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .detail-back-rail {
    position: static;
  }

  .featured-pubs-grid {
    grid-template-columns: 1fr;
  }

  .publication-header {
    flex-direction: column;
    gap: 12px;
  }

  .publication-author-photos {
    justify-content: flex-start;
    max-width: none;
  }

  .detail-header {
    flex-direction: column;
    gap: 14px;
    margin-bottom: 18px;
  }

  .detail-header-thumb {
    width: min(100%, 340px);
    max-height: 220px;
  }
}

/* ===== Facilities Page ===== */
.facilities-page {
  padding: 120px 0 80px;
}

.facilities-content {
  max-width: 800px;
  line-height: 1.8;
  color: var(--color-text-light);
  font-size: 1rem;
}

.facilities-content h2 {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 48px 0 16px;
  letter-spacing: -0.02em;
}

.facilities-content h2:first-child {
  margin-top: 24px;
}

.facilities-content h3 {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--color-text);
  margin: 32px 0 12px;
}

.facilities-content p {
  margin-bottom: 16px;
}

.facilities-content img {
  width: 100%;
  border-radius: 8px;
  margin: 8px 0 24px;
}

/* ===== Applicants Page ===== */
.applicants-page {
  padding: 120px 0 80px;
}

.applicants-mailing-block {
  background: var(--color-accent-light);
  border-left: 4px solid var(--color-accent);
  padding: 20px 24px;
  margin-bottom: 40px;
  border-radius: 0 8px 8px 0;
}

.applicants-mailing-text {
  font-size: 1rem;
  color: var(--color-text);
  margin-bottom: 12px;
}

.applicants-mailing-btn {
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  transition: opacity 0.2s;
}

.applicants-mailing-btn:hover {
  opacity: 0.9;
}

.applicants-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 48px;
  align-items: start;
}

.applicants-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: sticky;
  top: 100px;
}

.applicants-nav-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  padding: 14px 20px;
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 400;
  color: var(--color-text-light);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  border-radius: 0;
}

.applicants-nav-btn:hover {
  background: var(--color-card-bg);
  color: var(--color-text);
}

.applicants-nav-btn.active {
  border-left-color: var(--color-accent);
  background: var(--color-accent-light);
  color: var(--color-text);
  font-weight: 500;
}

.applicants-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

.applicants-panel.active {
  display: block;
}

.applicants-panels {
  min-height: 400px;
  line-height: 1.8;
  color: var(--color-text-light);
}

.applicants-panels h2 {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 32px 0 12px;
}

.applicants-panels h3 {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--color-text);
  margin: 24px 0 8px;
}

.applicants-panels p {
  margin-bottom: 14px;
}

.applicants-panels ul,
.applicants-panels ol {
  margin: 0 0 14px 24px;
}

.applicants-panels li {
  margin-bottom: 6px;
}

.applicants-panels a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.applicants-panels a:hover {
  color: var(--color-text);
}

.applicants-panels strong {
  color: var(--color-text);
}

/* ===== Single Page ===== */
.single-page {
  padding: 120px 0 80px;
}

.single-page h1 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 24px;
}

.single-page .content {
  max-width: 720px;
  line-height: 1.8;
  color: var(--color-text-light);
}

/* ===== Datasets Page ===== */
.datasets-list-page {
  padding: 120px 0 80px;
}

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

.dataset-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
}

.dataset-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.dataset-card-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--color-card-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.dataset-card-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.dataset-card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.dataset-card-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 8px;
}

.dataset-card-summary {
  font-size: 0.9rem;
  color: var(--color-text-light);
  line-height: 1.5;
  flex: 1;
  margin-bottom: 16px;
}

.dataset-card-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-accent);
}

.dataset-card-link .arrow {
  transition: transform 0.2s;
}

.dataset-card:hover .dataset-card-link .arrow {
  transform: translateX(4px);
  display: inline-block;
}

/* Dataset Detail */
.dataset-detail-page {
  padding: 120px 0 80px;
}

.dataset-detail-page .container {
  max-width: 800px;
}

.dataset-detail-hero {
  max-width: 280px;
  margin-bottom: 32px;
}

.dataset-detail-hero img {
  width: 100%;
  border-radius: 8px;
}

.dataset-detail-title {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.dataset-detail-summary {
  font-size: 1.1rem;
  color: var(--color-text-light);
  line-height: 1.6;
  margin-bottom: 24px;
}

.dataset-repo-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-text);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  transition: opacity 0.2s;
  margin-bottom: 32px;
}

.dataset-repo-btn:hover {
  opacity: 0.85;
}

.dataset-publication {
  margin-bottom: 32px;
}

.dataset-publication h3 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.dataset-pub-link {
  display: block;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.dataset-pub-link:hover {
  background: var(--color-card-bg);
  border-color: var(--color-accent);
}

.dataset-detail-body {
  line-height: 1.8;
  color: var(--color-text-light);
}

.dataset-detail-body h2 {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 32px 0 12px;
}

.dataset-detail-body h3 {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--color-text);
  margin: 24px 0 8px;
}

.dataset-detail-body p {
  margin-bottom: 16px;
}

.dataset-detail-body ul,
.dataset-detail-body ol {
  margin: 0 0 16px 24px;
}

.dataset-detail-body li {
  margin-bottom: 8px;
}

.dataset-detail-body code {
  background: var(--color-card-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .datasets-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .theme-layout {
    gap: 32px;
  }

  .card-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .events-grid {
    grid-template-columns: 1fr;
  }

  .people-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 32px 24px;
  }

  .duo-section {
    grid-template-columns: 1fr;
  }

  .duo-card {
    padding: 60px 32px;
  }

  .applicants-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .applicants-sidebar {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0;
  }

  .applicants-nav-btn {
    border-left: none;
    border-bottom: 3px solid transparent;
    padding: 10px 16px;
    font-size: 0.9rem;
    white-space: nowrap;
  }

  .applicants-nav-btn.active {
    border-left-color: transparent;
    border-bottom-color: var(--color-accent);
  }

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

@media (max-width: 640px) {
  .datasets-grid,
  .theme-projects,
  .methods-projects {
    grid-template-columns: 1fr;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(10, 22, 40, 0.97);
    flex-direction: column;
    padding: 16px 24px;
    gap: 12px;
  }

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

  .people-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px 16px;
  }

  .person-photo {
    width: 100px;
    height: 100px;
  }

  .tab-btn {
    padding: 12px 16px;
    font-size: 0.85rem;
  }

  .tab-bar-title {
    padding: 12px 10px 12px 0;
    font-size: 0.75rem;
  }

  .event-card-small {
    flex-direction: column;
  }

  .event-card-small .card-image {
    width: 100%;
    min-width: unset;
    aspect-ratio: 16 / 10;
  }

  .event-card-small .card-summary {
    display: block;
  }

  .trio-section {
    grid-template-columns: 1fr;
  }

  :root {
    --section-padding: 48px 0;
  }
}

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