:root {
  --navy:    #1e293b; /* Slate 800 (Primary text/dark elements) */
  --navy2:   #f1f5f9; /* Slate 100 (Secondary backgrounds) */
  --accent:  #055C9D; /* Academic Data Blue (Links, highlights) */
  --accent2: #0284c7; /* Sky 600 */
  --gold:    #8B0000; /* Deep Burgundy (replaces Gold for academic accent) */
  --gold2:   #b91c1c; /* Red 700 */
  --teal:    #0f766e; /* Teal 700 */
  --light:   #f8fafc; /* Slate 50 (Off-white backgrounds) */
  --white:   #ffffff;
  --text:    #334155; /* Slate 700 (Body text) */
  --muted:   #64748b; /* Slate 500 (Muted text) */
  --border:  #e2e8f0; /* Slate 200 (Clean borders) */
}

[data-theme="dark"] {
  --navy:    #f8fafc;
  --navy2:   #1e293b;
  --accent:  #38bdf8;
  --accent2: #0284c7;
  --gold:    #f87171;
  --gold2:   #b91c1c;
  --teal:    #2dd4bf;
  --light:   #0f172a;
  --white:   #1e293b;
  --text:    #e2e8f0;
  --muted:   #94a3b8;
  --border:  #334155;
  --glow:    rgba(56,189,248,0.15);
  --grad1:   linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  background: var(--white);
  font-size: 15px;
  line-height: 1.7;
  overflow-x: hidden;
}

/* ── ANIMATED CANVAS BACKGROUND ── */
#hero-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0.15;
}

/* ── NAV ── */
nav {
  position: sticky; top: 0; z-index: 500;
  background: var(--white);

  backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 5%;
  height: 60px;
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s;
}
nav.scrolled { box-shadow: 0 4px 20px rgba(0,0,0,0.06); }
.nav-logo {
  font-family: 'DM Serif Display', serif;
  font-size: 1.05rem;
  color: var(--navy); text-decoration: none;
  letter-spacing: 0.01em;
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-logo-text {
  display: flex; flex-direction: column; line-height: 1.2;
  min-width: 0; overflow: hidden;
}
.nav-logo-main {
  font-family: 'DM Serif Display', serif;
  font-size: 1.05rem; color: var(--navy);
  letter-spacing: 0.02em;
}
.nav-logo-sub {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.65rem; font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.04em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav-logo-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold); flex-shrink: 0;
  animation: pulse-dot 2.5s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.7; }
}
.nav-links { display: flex; gap: 0; list-style: none; }
.nav-links a {
  display: block;
  padding: 0 16px; height: 60px; line-height: 60px;
  text-decoration: none;
  font-size: 0.8rem; font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.05em; text-transform: uppercase;
  white-space: nowrap;
  position: relative;
  transition: color 0.2s;
}
.nav-links a::after {
  content: '';
  position: absolute; bottom: 0; left: 16px; right: 16px;
  height: 2px; background: var(--gold);
  transform: scaleX(0);
  transition: transform 0.2s ease;
}
.nav-links a:hover { color: var(--navy); }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-links a.active { color: var(--navy); }
.nav-links a.active::after { transform: scaleX(1); }

/* Mobile hamburger */
.nav-toggle {
  display: none;
  flex-direction: column; gap: 5px;
  cursor: pointer; padding: 8px;
  z-index: 501;
}
.nav-toggle span {
  width: 22px; height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  transform-origin: center;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── SCROLL PROGRESS ── */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--accent);
  z-index: 1000;
  width: 0%;
  transition: width 0.15s ease-out;
  box-shadow: 0 1px 4px rgba(56,189,248,0.4);
}

/* ── THEME TOGGLE SWITCH ── */
.theme-toggle-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0 16px;
  height: 60px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.theme-toggle-track {
  position: relative;
  width: 36px;
  height: 20px;
  background: var(--border);
  border-radius: 20px;
  transition: background 0.3s ease;
  flex-shrink: 0;
}
.theme-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--navy);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
[data-theme="dark"] .theme-toggle-track {
  background: var(--accent);
}
[data-theme="dark"] .theme-toggle-thumb {
  transform: translateX(16px);
  background: #0f172a;
}
.theme-toggle-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}


/* ── HERO ── */
.hero {
  position: relative;
  width: 100%; min-height: 100vh;
  display: flex; align-items: center;
  overflow: hidden;
  background: var(--light);
}
.hero-particles {
  position: absolute; inset: 0;
  overflow: hidden;
}
.hero-particles canvas {
  width: 100%; height: 100%;
}
.hero-gradient {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 50%, rgba(5,92,157,0.05) 0%, transparent 70%),
    radial-gradient(ellipse 50% 80% at 80% 20%, rgba(139,0,0,0.03) 0%, transparent 60%),
    linear-gradient(160deg, #f8fafc 0%, #f1f5f9 60%, #ffffff 100%);
}
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(0,0,0,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}
.hero-content {
  position: relative; z-index: 10;
  padding: 120px 6% 80px;
  max-width: 680px;
  width: 100%;
}
.hero-tag {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(139,0,0,0.05); /* Burgundy light */
  border: 1px solid rgba(139,0,0,0.15);
  color: var(--gold); font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 6px 16px; border-radius: 20px;
  margin-bottom: 24px;
  animation: fadeSlideUp 0.8s ease both;
}
.hero-tag::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold);
  animation: pulse-dot 2s infinite;
}
.hero h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  color: var(--navy);
  line-height: 1.15; margin-bottom: 20px;
  animation: fadeSlideUp 0.8s ease 0.15s both;
}
.hero h1 em {
  font-style: italic;
  background: linear-gradient(90deg, var(--accent), var(--teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: 1.05rem; color: var(--text);
  font-weight: 400; max-width: 580px;
  line-height: 1.8;
  animation: fadeSlideUp 0.8s ease 0.3s both;
}
.hero-stats {
  display: flex; gap: 40px; flex-wrap: wrap;
  margin-top: 52px;
  animation: fadeSlideUp 0.8s ease 0.45s both;
}

.hero-stat .num {
  font-family: 'DM Serif Display', serif;
  font-size: 2.2rem; color: var(--gold);
  line-height: 1;
  display: flex; align-items: baseline; gap: 3px;
}
.hero-stat .num sup { font-size: 1rem; }
.hero-stat .label { font-size: 0.72rem; color: var(--muted); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; margin-top: 4px; }
.hero-scroll {
  position: absolute; bottom: 36px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--muted); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  animation: fadeIn 1.5s ease 1s both;
  z-index: 10;
  cursor: pointer;
  text-decoration: none;
}
.hero-scroll-line {
  width: 1px; height: 48px;
  background: linear-gradient(to bottom, var(--muted), transparent);
  animation: scrollLine 2s ease-in-out infinite;
}
@keyframes scrollLine {
  0%, 100% { transform: scaleY(1) translateY(0); opacity: 0.7; }
  50% { transform: scaleY(0.6) translateY(10px); opacity: 0.3; }
}

/* ── MICROSCOPY VISUAL (hero right side) ── */
.desktop-only {
  position: absolute; right: 4%; top: 50%;
  transform: translateY(-50%);
  z-index: 5;
}
.research-visual {
  width: 420px; height: 420px;
  animation: floatOrb 8s ease-in-out infinite;
}
@keyframes floatOrb {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-16px); }
}

.micro-frame {
  position: relative; width: 100%; height: 100%;
  border-radius: 50%;
  overflow: hidden;
  box-shadow:
    0 0 0 2px rgba(26,111,212,0.3),
    0 0 0 6px rgba(13,27,53,0.8),
    0 0 40px rgba(26,111,212,0.25),
    0 0 80px rgba(13,148,136,0.15);
}
.micro-frame img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
/* Outer scanning ring */
.micro-ring {
  position: absolute; inset: -12px;
  border-radius: 50%;
  border: 1px solid rgba(26,111,212,0.25);
  animation: spinRing 20s linear infinite;
}
.micro-ring:nth-child(2) {
  inset: -28px;
  border-color: rgba(13,148,136,0.18);
  animation-duration: 35s;
  animation-direction: reverse;
}
/* Scan line sweep */
.micro-scan {
  position: absolute; inset: 0; border-radius: 50%;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    transparent 45%,
    rgba(26,111,212,0.12) 50%,
    transparent 55%,
    transparent 100%
  );
  animation: scanLine 4s ease-in-out infinite;
}
@keyframes scanLine {
  0%, 100% { transform: translateY(-60%) rotate(0deg); opacity: 0; }
  30% { opacity: 1; }
  50% { transform: translateY(60%) rotate(0deg); opacity: 0.6; }
  70% { opacity: 0; }
}
/* Label badge */
.micro-label {
  position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%);
  background: rgba(13,27,53,0.9);
  border: 1px solid rgba(26,111,212,0.3);
  backdrop-filter: blur(8px);
  color: rgba(255,255,255,0.7);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem; letter-spacing: 0.1em;
  padding: 5px 14px; border-radius: 20px;
  white-space: nowrap;
}
/* Dot nodes around the frame */
.micro-node {
  position: absolute; border-radius: 50%;
  background: var(--accent2);
  box-shadow: 0 0 10px rgba(14,165,233,0.6);
}
.micro-node:nth-child(5) { width: 10px; height: 10px; top: 8%; left: 50%; transform: translateX(-50%); }
.micro-node:nth-child(6) { width: 8px; height: 8px; bottom: 12%; right: 8%; background: var(--teal); box-shadow: 0 0 10px rgba(13,148,136,0.6); }
.micro-node:nth-child(7) { width: 7px; height: 7px; top: 22%; left: 5%; background: var(--gold); box-shadow: 0 0 10px rgba(212,146,26,0.6); }

@keyframes spinRing { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ── ANIMATIONS ── */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-out {
  opacity: 0 !important;
  transition: opacity 0.4s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeSlideLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ── PAGE WRAPPER ── */
.page { max-width: 1060px; margin: 0 auto; padding: 0 5%; position: relative; z-index: 1; }

/* ── SECTIONS ── */
.section { padding: 96px 0; border-bottom: 1px solid var(--border); }
.section:last-of-type { border-bottom: none; }

.section-eyebrow {
  font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 12px;
  display: flex; align-items: center; gap: 10px;
}
.section-eyebrow::before {
  content: '';
  width: 24px; height: 2px;
  background: var(--accent);
  border-radius: 2px;
}
.section-heading {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(1.6rem, 2.8vw, 2.2rem);
  font-weight: 400; color: var(--navy);
  margin-bottom: 20px; line-height: 1.2;
}
.section-body {
  font-size: 0.97rem; color: #4a5568;
  line-height: 1.85; max-width: 780px;
}
.section-body p + p { margin-top: 16px; }

/* ── QUOTE BAR ── */
.quote-bar {
  background: var(--light);
  padding: 56px 5%;
  text-align: center;
  position: relative; overflow: hidden;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.quote-bar::before {
  content: '"';
  position: absolute; top: -20px; left: 5%;
  font-family: 'DM Serif Display', serif;
  font-size: 12rem; color: rgba(0,0,0,0.03);
  line-height: 1; pointer-events: none;
}
.quote-bar blockquote {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  font-style: italic;
  color: var(--navy); max-width: 750px; margin: 0 auto;
  line-height: 1.65; position: relative; z-index: 1;
}
.quote-bar cite {
  display: block; margin-top: 16px;
  font-size: 0.78rem; font-style: normal;
  color: var(--gold); letter-spacing: 0.1em; text-transform: uppercase;
  font-weight: 600;
}

/* ── PI BLOCK ── */
.pi-block {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 52px; margin-top: 52px; align-items: start;
}
.pi-img-wrap {
  position: relative;
  width: 240px;
}
.pi-img-frame {
  width: 240px; height: 280px;
  background: var(--navy2);
  overflow: hidden; border-radius: 8px;
  position: relative;
  border: 1px solid var(--border);
}
.pi-img-frame::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 60%, rgba(30,41,59,0.3));
}
.pi-img-frame img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.pi-img-placeholder {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; color: var(--muted); font-size: 0.8rem; text-align: center;
}
.pi-img-placeholder .big { font-family: 'DM Serif Display', serif; font-size: 3.5rem; color: rgba(255,255,255,0.5); }
.pi-badge {
  position: absolute; bottom: -14px; left: 50%; transform: translateX(-50%);
  background: var(--gold); color: #fff;
  font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 5px 16px; border-radius: 20px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(212,146,26,0.4);
}
.pi-details { padding-top: 8px; }
.pi-details h3 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.6rem;
  color: var(--navy); margin-bottom: 4px;
}
.pi-pos {
  font-size: 0.78rem; font-weight: 600;
  color: var(--accent); text-transform: uppercase;
  letter-spacing: 0.08em; margin-bottom: 20px;
}
.pi-desc { font-size: 0.93rem; color: #4a5568; line-height: 1.85; margin-bottom: 16px; }
.pi-links { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.pi-link {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px;
  background: var(--navy); color: #fff;
  text-decoration: none; border-radius: 6px;
  font-size: 0.78rem; font-weight: 500;
  transition: all 0.2s;
}
.pi-link:hover { background: var(--accent); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(26,111,212,0.35); }
.pi-link.outline {
  background: transparent; color: var(--navy);
  border: 1px solid var(--border);
}
.pi-link.outline:hover { background: var(--light); border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* ── TIMELINE ── */
.timeline { margin-top: 24px; }
.tl-item {
  display: flex; gap: 20px; align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
  transition: background 0.2s;
}
.tl-item:last-child { border-bottom: none; }
.tl-year {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem; font-weight: 500;
  color: var(--accent); min-width: 96px;
  padding-top: 2px; white-space: nowrap;
}
.tl-desc { font-size: 0.88rem; color: #4a5568; line-height: 1.6; }

/* ── RESEARCH CARDS ── */
.research-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px; margin-top: 48px;
}
.rc {
  border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden;
  transition: all 0.3s cubic-bezier(0.2,0,0,1);
  background: var(--white);
  cursor: default;
}
.rc:hover {
  box-shadow: 0 16px 40px rgba(13,27,53,0.12);
  transform: translateY(-5px);
  border-color: rgba(26,111,212,0.3);
}
.rc-img {
  width: 100%; height: 140px;
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem;
  position: relative; overflow: hidden;
}
.rc-img::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.2));
}
.rc-img img { width: 100%; height: 100%; object-fit: cover; }
.rc-body { padding: 22px; }
.rc-body h3 {
  font-family: 'DM Serif Display', serif;
  font-size: 1rem;
  color: var(--navy); margin-bottom: 10px; line-height: 1.35;
}
.rc-body p { font-size: 0.84rem; color: var(--muted); line-height: 1.8; }
.rc-tag {
  display: inline-block;
  margin-top: 14px;
  font-size: 0.65rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent); border: 1px solid rgba(26,111,212,0.25);
  padding: 3px 10px; border-radius: 12px;
}

/* ── INTERACTIVE RESEARCH TABS ── */
.research-tabs {
  display: flex; gap: 0;
  border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden;
  margin-bottom: 36px; margin-top: 48px;
}
.rtab {
  flex: 1; padding: 12px 16px;
  font-size: 0.78rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  cursor: pointer; text-align: center;
  background: var(--white); color: var(--muted);
  border: none; border-right: 1px solid var(--border);
  transition: all 0.2s;
}
.rtab:last-child { border-right: none; }
.rtab:hover { background: var(--light); color: var(--navy); }
.rtab.active {
  background: var(--navy);
  color: #fff;
}

/* ── TEAM ── */
.team-label {
  font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--muted); margin: 52px 0 22px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.team-label::before { content: ''; width: 18px; height: 2px; background: var(--gold); border-radius: 2px; }
.team-label:first-of-type { margin-top: 48px; }

.pi-team-row { display: flex; gap: 40px; align-items: flex-start; }
.pi-team-photo {
  width: 160px; height: 190px; flex-shrink: 0;
  background: var(--navy2); border-radius: 8px;
  overflow: hidden; display: flex; align-items: center; justify-content: center;
  position: relative;
}
.pi-team-photo img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.pi-team-photo .init { font-family: 'DM Serif Display', serif; font-size: 2.5rem; color: rgba(255,255,255,0.6); }
.pi-team-info h3 { font-family: 'DM Serif Display', serif; font-size: 1.3rem; color: var(--navy); margin-bottom: 4px; }
.pi-team-info .role {
  font-size: 0.75rem; color: var(--accent); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 18px;
}

.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 20px;
}
.mc {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden;
  text-align: center;
  transition: all 0.3s ease;
}
.mc:hover {
  box-shadow: 0 10px 28px rgba(13,27,53,0.12);
  transform: translateY(-4px);
  border-color: rgba(26,111,212,0.25);
}
.mc-photo {
  width: 100%; height: 168px;
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
  border-bottom: 1px solid var(--border);
}
.mc-photo img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.mc-photo .init { font-family: 'DM Serif Display', serif; font-size: 2.2rem; color: var(--muted); opacity: 0.6; }
.mc-info { padding: 16px 12px 20px; }
.mc-name { font-family: 'DM Serif Display', serif; font-size: 0.97rem; color: var(--navy); margin-bottom: 3px; }
.mc-role { font-size: 0.68rem; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
.mc-fellowship {
  font-size: 0.74rem; color: var(--muted); margin-bottom: 10px;
  font-family: 'JetBrains Mono', monospace;
}
.mc-writeup {
  font-size: 0.76rem; color: #5a6a7e;
  line-height: 1.65; margin: 8px 0 6px;
  font-style: italic;
  padding: 8px 10px;
  border-top: 1px solid var(--border);
  position: relative;
  text-align: left;
}
.mc-writeup::before {
  content: '\201C';
  font-family: 'DM Serif Display', serif;
  font-size: 1.5rem; font-style: normal;
  color: rgba(26,111,212,0.25);
  line-height: 0; vertical-align: -0.4em;
  margin-right: 2px;
}
.mc-links { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.mc-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.7rem; font-weight: 500;
  color: var(--accent); text-decoration: none;
  padding: 4px 9px; border: 1px solid var(--border);
  border-radius: 4px;
  transition: all 0.15s;
}
.mc-link:hover { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ── PUBLICATIONS ── */
.pub-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
}
.pub-search-wrapper {
  max-width: 500px;
  width: 100%;
}
.pub-search-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 30px;
  background: var(--white);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  outline: none;
}
.pub-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56,189,248,0.2);
}
.pub-filters {
  display: flex; gap: 10px; flex-wrap: wrap;
}
.pub-filter {
  padding: 6px 16px;
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  border: 1px solid var(--border);
  border-radius: 20px; cursor: pointer;
  background: var(--white); color: var(--muted);
  transition: all 0.2s;
}
.pub-filter:hover { border-color: var(--accent); color: var(--accent); }
.pub-filter.active {
  background: var(--navy); color: #fff; border-color: var(--navy);
}

.pub-list { display: flex; flex-direction: column; gap: 16px; }
.pub {
  background: var(--white); border: 1px solid var(--border);
  border-radius: 10px; padding: 22px 26px;
  display: grid; grid-template-columns: 56px 1fr;
  gap: 20px; align-items: start;
  transition: all 0.25s ease;
  position: relative; overflow: hidden;
}
.pub::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, var(--accent), var(--teal));
  opacity: 0;
  transition: opacity 0.2s;
}
.pub:hover { box-shadow: 0 6px 24px rgba(13,27,53,0.08); transform: translateX(4px); }
.pub:hover::before { opacity: 1; }
.pub-yr {
  font-family: 'DM Serif Display', serif;
  font-size: 1.3rem; color: var(--gold); font-weight: 400;
  padding-top: 2px;
}
.pub-title {
  font-family: 'DM Serif Display', serif;
  font-size: 0.97rem; color: var(--navy); margin-bottom: 6px; line-height: 1.45;
}
.pub-authors { font-size: 0.8rem; color: var(--muted); margin-bottom: 5px; }
.pub-journal { font-size: 0.8rem; font-style: italic; color: var(--accent); }
.pub-pmid {
  font-size: 0.72rem; color: var(--muted); margin-left: 8px;
  font-family: 'JetBrains Mono', monospace;
}
.pub-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.tag {
  font-size: 0.63rem; font-weight: 600;
  padding: 3px 9px; border-radius: 12px;
  background: rgba(26,111,212,0.08);
  color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.05em;
  border: 1px solid rgba(26,111,212,0.18);
  cursor: pointer; transition: all 0.15s;
}
.tag:hover { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ── AWARDS ── */
.awards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px; margin-top: 48px;
}
.aw {
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  border-radius: 10px;
  padding: 22px 24px 22px 28px;
  position: relative; overflow: hidden;
  transition: all 0.3s ease;
}
.aw::before { display: none; }
.aw:hover {
  box-shadow: 0 8px 24px rgba(13,27,53,0.06);
  transform: translateY(-3px);
  border-color: var(--gold);
}
.aw-yr {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem; font-weight: 500; color: var(--gold);
  letter-spacing: 0.1em; margin-bottom: 7px;
}
.aw-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1rem; color: var(--navy);
  margin-bottom: 8px; line-height: 1.4;
}
.aw-desc { font-size: 0.82rem; color: var(--muted); line-height: 1.65; }
.aw-org  { font-size: 0.82rem; color: var(--muted); line-height: 1.65; margin-bottom: 4px; }

/* ── ALUMNI ── */
.alumni-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px; margin-top: 48px;
}
.alum {
  background: var(--light); border: 1px solid var(--border);
  border-radius: 10px; padding: 24px;
  display: flex; gap: 18px; align-items: flex-start;
  transition: all 0.3s ease;
}
.alum:hover {
  box-shadow: 0 8px 24px rgba(13,27,53,0.06);
  transform: translateY(-3px);
  border-color: var(--accent);
}
.alum-avatar {
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--border); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: 'DM Serif Display', serif; font-size: 1.2rem;
  color: var(--navy);
  overflow: hidden;
}
.alum-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.alum-name { font-family: 'DM Serif Display', serif; font-size: 1.02rem; color: var(--navy); margin-bottom: 3px; }
.alum-was { font-size: 0.73rem; color: var(--muted); margin-bottom: 5px; }
.alum-now { font-size: 0.83rem; color: var(--accent); font-weight: 500; margin-bottom: 10px; line-height: 1.5; }
.alum-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.7rem; font-weight: 500; color: var(--accent);
  text-decoration: none; padding: 4px 10px;
  border: 1px solid var(--border); border-radius: 4px;
  transition: all 0.15s;
}
.alum-link:hover { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ── CONTACT ── */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 52px; margin-top: 48px;
}
.contact-item { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 26px; }
.c-ic {
  width: 40px; height: 40px; border-radius: 8px;
  background: rgba(26,111,212,0.08);
  border: 1px solid rgba(26,111,212,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
}
.contact-item h4 { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--navy); margin-bottom: 4px; }
.contact-item p, .contact-item a { font-size: 0.9rem; color: var(--muted); line-height: 1.65; text-decoration: none; }
.contact-item a:hover { color: var(--accent); }
.map-wrap { border-radius: 10px; overflow: hidden; height: 300px; border: 1px solid var(--border); }
.map-wrap iframe { width: 100%; height: 100%; border: none; }

/* ── FOOTER ── */
footer {
  background: var(--light);
  color: var(--muted);
  padding: 40px 5%;
  font-size: 0.8rem;
  position: relative; z-index: 1;
  border-top: 1px solid var(--border);
}
.footer-inner {
  max-width: 1060px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 20px;
}
.footer-logo { font-family: 'DM Serif Display', serif; font-size: 1.1rem; color: var(--navy); }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); text-decoration: none; transition: color 0.2s; font-size: 0.78rem; }
.footer-links a:hover { color: var(--accent); }

/* ── COUNTER ANIMATION ── */
.count-animate { display: inline-block; }

/* ── BACK TO TOP ── */
.back-top {
  position: fixed; bottom: 32px; right: 32px;
  width: 44px; height: 44px;
  background: var(--navy); color: #fff;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  text-decoration: none; font-size: 1.2rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  opacity: 0; transform: translateY(16px);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 400;
}
.back-top.visible { opacity: 1; transform: translateY(0); }
.back-top:hover { 
  background: var(--accent); 
  transform: translateY(-5px) scale(1.05); 
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

/* ── NEWS & UPDATES ── */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px; margin-top: 48px;
}
.news-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
  transition: all 0.3s ease;
  display: flex; flex-direction: column;
}
.news-card:hover {
  box-shadow: 0 14px 40px rgba(13,27,53,0.06);
  transform: translateY(-5px);
  border-color: var(--accent);
}
.news-card-gallery {
  position: relative;
  width: 100%; height: 230px;
  overflow: hidden; background: var(--light);
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.news-card-gallery img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  transition: opacity 0.5s ease, transform 0.4s ease;
}
.news-card-gallery img.hidden { opacity: 0; pointer-events: none; }
.news-card-gallery img.active { opacity: 1; }
.news-card-gallery:hover img.active { transform: scale(1.04); }
.gallery-dots {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px; z-index: 5;
}
.gallery-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,0.5); cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  border: none; padding: 0;
}
.gallery-dot.active { background: #fff; transform: scale(1.3); }
.gallery-count {
  position: absolute; top: 10px; right: 10px;
  background: rgba(0,0,0,0.5); color: #fff;
  font-size: 0.65rem; font-weight: 600;
  padding: 3px 8px; border-radius: 10px;
  letter-spacing: 0.05em; z-index: 5;
}
.news-card-body {
  padding: 22px 22px 20px;
  flex: 1; display: flex; flex-direction: column;
}
.news-meta {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap; margin-bottom: 12px;
}
.news-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem; color: var(--muted);
}
.news-badge {
  font-size: 0.62rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 12px;
}
.news-badge.conference { background: rgba(13,148,136,0.1); color: var(--teal); border: 1px solid rgba(13,148,136,0.25); }
.news-badge.award { background: rgba(212,146,26,0.1); color: var(--gold); border: 1px solid rgba(212,146,26,0.25); }
.news-badge.publication { background: rgba(26,111,212,0.08); color: var(--accent); border: 1px solid rgba(26,111,212,0.2); }
.news-badge.lab { background: rgba(99,102,241,0.08); color: #6366f1; border: 1px solid rgba(99,102,241,0.2); }
.news-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.05rem; color: var(--navy);
  line-height: 1.4; margin-bottom: 10px;
}
.news-body {
  font-size: 0.85rem; color: var(--muted);
  line-height: 1.75; flex: 1;
}
.news-body strong { color: var(--text); font-weight: 600; }
.news-body a { color: var(--accent); text-decoration: none; }
.news-body a:hover { text-decoration: underline; }
.news-people {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 14px;
}
.news-person {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.72rem; font-weight: 500;
  color: var(--navy);
  background: var(--light); border: 1px solid var(--border);
  padding: 3px 10px; border-radius: 12px;
}
.news-thanks {
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 0.75rem; color: var(--muted);
  line-height: 1.6;
}
.news-thanks strong { color: var(--text); }

/* Lightbox */
.lightbox {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 999;
  align-items: center; justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 90vw; max-height: 90vh;
  border-radius: 8px;
  object-fit: contain;
}
.lightbox-close {
  position: absolute; top: 24px; right: 28px;
  color: #fff; font-size: 2rem; cursor: pointer;
  background: none; border: none;
  line-height: 1; opacity: 0.7;
  transition: opacity 0.2s;
}
.lightbox-close:hover { opacity: 1; }
.lightbox-prev, .lightbox-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  color: #fff; font-size: 2rem; cursor: pointer;
  background: rgba(255,255,255,0.1); border: none;
  width: 50px; height: 50px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.lightbox-prev:hover, .lightbox-next:hover { background: rgba(255,255,255,0.25); }
.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }

/* ── SCIENTIFIC SCHEMATICS ── */
.schematic-section {
  padding: 80px 0 20px;
  border-bottom: 1px solid var(--border);
}
.schematic-wrap {
  width: 100%;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  overflow: hidden;
  position: relative;
}
.schematic-wrap::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 50% 50%, rgba(5,92,157,0.03) 0%, transparent 70%),
    repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(0,0,0,0.02) 40px),
    repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(0,0,0,0.02) 40px);
  pointer-events: none;
}
.schematic-svg {
  width: 100%;
  height: auto;
  display: block;
}
/* Pulse animations on microglia rings */
.pulse-ring {
  animation: pulseRing 2.5s ease-in-out infinite;
  transform-origin: center;
}
.pulse-ring-slow {
  animation: pulseRing 4s ease-in-out infinite;
  transform-origin: center;
}
@keyframes pulseRing {
  0%, 100% { r: 62; opacity: 0.25; }
  50% { r: 70; opacity: 0.08; }
}
.sch-node {
  transition: opacity 0.3s;
}
.sch-arrow {
  animation: dashMove 3s linear infinite;
}
@keyframes dashMove {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: -24; }
}

.schematic-sub-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 20px;
}
.schematic-panel {
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 14px 14px;
  overflow: hidden;
}
.sp-label {
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.sp-svg {
  width: 100%; height: auto; display: block;
}

/* ── CORE RESEARCH AXIS SLIDESHOW (desktop only) ── */
@media (min-width: 901px) {
  .research-slider-wrapper {
    position: relative;
    margin-top: 20px;
  }
  /* The overflow box — MUST have explicit width so children can resolve 100% */
  .research-slider-overflow {
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid var(--border);
  }
  /* The sliding track — same width as the overflow box */
  .research-grid-slide {
    display: flex;
    width: 100%;
    transition: transform 0.55s cubic-bezier(0.4,0,0.2,1);
    will-change: transform;
  }
  /* Each slide is exactly the overflow-box width and never shrinks */
  .research-grid-slide .ca-slide {
    flex: 0 0 100%;
    width: 100%;
    box-sizing: border-box;
  }
  /* Make images fill the slide nicely */
  .research-grid-slide .ca-slide img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
  }
  /* Slide label */
  .research-grid-slide .ca-slide .sp-label {
    font-size: 0.82rem;
    margin-bottom: 16px;
  }
  /* Nav row */
  .rs-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
  }
  .rs-btn {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--white);
    border: 1px solid var(--border);
    color: var(--navy);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  }
  .rs-btn:hover {
    background: var(--navy);
    color: #fff;
    border-color: var(--navy);
    transform: scale(1.08);
  }
  .rs-dots {
    display: flex; gap: 8px; align-items: center;
  }
  .rs-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--border);
    border: none; padding: 0;
    cursor: pointer;
    transition: all 0.2s;
  }
  .rs-dot.active {
    background: var(--navy);
    transform: scale(1.35);
  }
  .rs-counter {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: var(--muted);
    letter-spacing: 0.06em;
    min-width: 48px;
    text-align: center;
  }
  /* On desktop: hide mobile grid (the schematic-sub-grid fallback) */
  .ca-mobile-grid { display: none !important; }
}
/* On mobile: hide slider UI; show the regular 3-col grid instead */
@media (max-width: 900px) {
  .rs-nav { display: none !important; }
  .research-slider-wrapper { display: none !important; }
  .ca-mobile-grid { display: grid !important; }
}

/* ── RESPONSIVE ── */
@media (max-width: 1100px) {
  .research-visual { width: 320px; height: 320px; }
}

@media (max-width: 900px) {
  .pi-block { grid-template-columns: 1fr; }
  .pi-img-wrap { width: 200px; }
  .pi-img-frame { width: 200px; height: 240px; }
  .research-grid { grid-template-columns: 1fr 1fr !important; }
  .contact-grid { grid-template-columns: 1fr; }
  .pi-team-row { flex-direction: column; }
  .desktop-only { display: none; }
  .hero-content { max-width: 100%; }
  .schematic-sub-grid { grid-template-columns: 1fr; }
  .awards-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  /* Nav */
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .nav-logo { gap: 7px; }
  .nav-logo-main { font-size: 0.9rem; }
  .nav-logo-sub { font-size: 0.55rem; display: block; }
  .nav-logo-dot { width: 6px; height: 6px; }

  /* Hero */
  .hero-content { padding: 90px 6% 60px !important; max-width: 100% !important; }
  .desktop-only { display: none !important; }

  /* Hero text */
  .hero h1 { font-size: clamp(1.9rem, 9vw, 2.8rem); }
  .hero-sub { font-size: 0.92rem; max-width: 100%; }
  .hero-stats { gap: 20px; flex-wrap: wrap; margin-top: 32px; }
  .hero-stat .num { font-size: 1.5rem; }
  .hero-stat .label { font-size: 0.65rem; }
  .hero-tag { font-size: 0.65rem; }

  /* Sections */
  .section { padding: 56px 0; }
  .section-heading { font-size: clamp(1.4rem, 6vw, 1.9rem); }

  /* Research */
  .research-grid { grid-template-columns: 1fr !important; }

  /* Team */
  .member-grid { grid-template-columns: 1fr 1fr; }

  /* Publications */
  .pub { grid-template-columns: 1fr; }
  .pub-yr-col { display: none; }

  /* Awards */
  .awards-grid { grid-template-columns: 1fr; }
  .aw { padding: 18px 18px 18px 22px; }
  .aw-title { font-size: 0.95rem; }

  /* Schematic */
  .schematic-sub-grid { grid-template-columns: 1fr; }
  .schematic-wrap { padding: 12px; }
}

/* Mobile nav open — bulletproof: hidden by default with zero physical presence */
.nav-mobile {
  display: none;
  visibility: hidden;
  height: 0;
  overflow: hidden;
  padding: 0;
  border: none;
  position: fixed; top: 60px; left: 0; right: 0;
  background: rgba(10,20,42,0.99);
  backdrop-filter: blur(16px);
  z-index: 490;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.nav-mobile.open {
  display: block;
  visibility: visible;
  height: auto;
  overflow: visible;
  padding: 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  opacity: 1;
  transform: translateY(0);
}
/* Force-hide nav-mobile on screens wider than mobile breakpoint */
@media (min-width: 641px) {
  .nav-mobile { display: none !important; visibility: hidden !important; height: 0 !important; overflow: hidden !important; }  
}
.nav-mobile a {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 6%;
  font-size: 0.88rem; font-weight: 600;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  letter-spacing: 0.04em; text-transform: uppercase;
  border-left: 3px solid transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.nav-mobile a:hover,
.nav-mobile a.active {
  color: #38bdf8;
  border-left-color: #f87171;
  background: rgba(255,255,255,0.05);
}
.nav-mobile-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 6% 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 4px;
}
.nav-mobile-brand {
  font-family: 'DM Serif Display', serif;
  font-size: 1rem; color: #fff;
}
.nav-mobile-sub {
  font-size: 0.62rem; color: rgba(255,255,255,0.35);
  letter-spacing: 0.04em;
  font-family: 'DM Sans', sans-serif;
}

/* ── TOOLTIP ── */
[data-tooltip] {
  position: relative;
}
[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%; transform: translateX(-50%);
  background: var(--navy);
  color: #fff;
  font-size: 0.72rem;
  padding: 5px 10px;
  border-radius: 5px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 100;
}

/* ── VACANCY POPUP ── */
.vacancy-overlay {
  position: fixed; inset: 0;
  background: rgba(10,18,38,0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.vacancy-overlay.vp-visible {
  opacity: 1;
  pointer-events: auto;
}
.vacancy-card {
  background: #fff;
  border-radius: 18px;
  max-width: 480px; width: 100%;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 30px 80px rgba(10,18,38,0.35),
    0 0 0 1px rgba(255,255,255,0.06);
  transform: translateY(28px) scale(0.97);
  transition: transform 0.38s cubic-bezier(0.22,1,0.36,1), opacity 0.35s ease;
  opacity: 0;
}
.vacancy-overlay.vp-visible .vacancy-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.vacancy-card-top {
  background: linear-gradient(135deg, #1e293b 0%, #0d2540 60%, #0f3460 100%);
  padding: 28px 28px 24px;
  position: relative;
  overflow: hidden;
}
.vacancy-card-top::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 10% 80%, rgba(5,92,157,0.35) 0%, transparent 65%),
    radial-gradient(ellipse 50% 80% at 90% 10%, rgba(139,0,0,0.2) 0%, transparent 60%);
  pointer-events: none;
}
.vacancy-badge {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(34,197,94,0.15);
  border: 1px solid rgba(34,197,94,0.35);
  color: #4ade80;
  font-size: 0.62rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  padding: 5px 13px; border-radius: 20px;
  margin-bottom: 16px;
  position: relative; z-index: 1;
}
.vacancy-badge::before {
  content: '';
  width: 7px; height: 7px; border-radius: 50%;
  background: #4ade80;
  animation: pulse-dot 2s ease-in-out infinite;
  flex-shrink: 0;
}
.vacancy-card-top h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.45rem; color: #fff;
  line-height: 1.25; margin-bottom: 8px;
  position: relative; z-index: 1;
}
.vacancy-card-top .vp-lab {
  font-size: 0.72rem; color: rgba(255,255,255,0.5);
  letter-spacing: 0.06em;
  position: relative; z-index: 1;
}
.vacancy-close {
  position: absolute; top: 14px; right: 16px;
  width: 30px; height: 30px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  color: rgba(255,255,255,0.7);
  font-size: 1.1rem; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  z-index: 2;
}
.vacancy-close:hover { background: rgba(255,255,255,0.2); color: #fff; }
.vacancy-card-body {
  padding: 22px 28px 26px;
}
.vp-desc {
  font-size: 0.9rem; color: #4a5568;
  line-height: 1.8; margin-bottom: 22px;
  max-height: 40vh; overflow-y: auto;
  padding-right: 12px;
}
.vp-desc::-webkit-scrollbar {
  width: 4px;
}
.vp-desc::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.03); 
  border-radius: 4px;
}
.vp-desc::-webkit-scrollbar-thumb {
  background: rgba(13,37,64,0.15); 
  border-radius: 4px;
}
.vp-desc::-webkit-scrollbar-thumb:hover {
  background: rgba(13,37,64,0.3); 
}
.vp-cta {
  display: inline-flex; align-items: center; gap: 9px;
  background: linear-gradient(135deg, #055C9D, #0284c7);
  color: #fff;
  text-decoration: none;
  padding: 13px 24px;
  border-radius: 10px;
  font-size: 0.88rem; font-weight: 600;
  letter-spacing: 0.02em;
  transition: all 0.2s;
  box-shadow: 0 6px 20px rgba(5,92,157,0.35);
  width: 100%;
  justify-content: center;
}
.vp-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(5,92,157,0.45);
  background: linear-gradient(135deg, #0284c7, #0369a1);
}
.vp-cta svg { width: 15px; height: 15px; flex-shrink: 0; }
.vp-dismiss {
  display: block; text-align: center;
  margin-top: 14px;
  font-size: 0.75rem; color: #94a3b8;
  cursor: pointer;
  transition: color 0.2s;
  background: none; border: none; width: 100%;
}
.vp-dismiss:hover { color: #64748b; }
@media (max-width: 520px) {
  .vacancy-card { border-radius: 14px; }
  .vacancy-card-top { padding: 22px 20px 18px; }
  .vacancy-card-body { padding: 18px 20px 22px; }
  .vacancy-card-top h2 { font-size: 1.2rem; }
}

/* ── SKELETON CSS ── */
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.skeleton-box {
  position: relative;
  overflow: hidden;
  background-color: #e2e8f0;
  border-radius: 4px;
}
.skeleton-box::after {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0; right: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%);
  animation: shimmer 1.5s infinite;
}

/* ══════════════════════════════════════════════════════
   DARK MODE OVERRIDES — fixes all hardcoded colors
   ══════════════════════════════════════════════════════ */

[data-theme="dark"] body {
  background: #0f172a;
}

/* Nav */
[data-theme="dark"] nav {
  background: rgba(15, 23, 42, 0.95);
  border-bottom-color: var(--border);
}

/* Hero gradient & grid — these had hardcoded light colors */
[data-theme="dark"] .hero-gradient {
  background:
    radial-gradient(ellipse 80% 60% at 20% 50%, rgba(56,189,248,0.06) 0%, transparent 70%),
    radial-gradient(ellipse 50% 80% at 80% 20%, rgba(248,113,113,0.04) 0%, transparent 60%),
    linear-gradient(160deg, #0f172a 0%, #1e293b 60%, #0f172a 100%);
}
[data-theme="dark"] .hero-grid {
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
}

/* Hero text — the subtitle inline style uses var(--navy) which is fine,
   but .hero-sub uses var(--text) which we've already fixed.
   The em gradient needs a brighter version for dark: */
[data-theme="dark"] .hero h1 em {
  background: linear-gradient(90deg, #38bdf8, #2dd4bf);
  -webkit-background-clip: text;
  background-clip: text;
}

/* All hardcoded #4a5568 text (section body, PI desc, timeline) */
[data-theme="dark"] .section-body,
[data-theme="dark"] .pi-desc,
[data-theme="dark"] .vp-desc,
[data-theme="dark"] .tl-desc,
[data-theme="dark"] .rc-body p,
[data-theme="dark"] .news-body,
[data-theme="dark"] .aw-desc,
[data-theme="dark"] .aw-org,
[data-theme="dark"] .contact-item p,
[data-theme="dark"] .contact-item a {
  color: var(--text);
}

/* Quote bar */
[data-theme="dark"] .quote-bar {
  background: var(--white);
}

/* Cards, pubs, and awards backgrounds */
[data-theme="dark"] .rc,
[data-theme="dark"] .mc,
[data-theme="dark"] .pub,
[data-theme="dark"] .aw,
[data-theme="dark"] .news-card {
  background: var(--white);
  border-color: var(--border);
}

/* PI image frame */
[data-theme="dark"] .pi-img-frame {
  background: #334155;
  border-color: var(--border);
}

/* Team member photo placeholder gradient */
[data-theme="dark"] .mc-photo {
  background: linear-gradient(135deg, #1e293b, #334155);
}

/* Publication filter pills */
[data-theme="dark"] .pub-filter {
  background: var(--white);
  color: var(--muted);
  border-color: var(--border);
}
[data-theme="dark"] .pub-filter.active {
  background: #f8fafc;
  color: #0f172a;
  border-color: #f8fafc;
}

/* Tags */
[data-theme="dark"] .tag {
  background: rgba(56,189,248,0.1);
  border-color: rgba(56,189,248,0.25);
}

/* Alumni cards */
[data-theme="dark"] .alum {
  background: var(--white);
  border-color: var(--border);
}
[data-theme="dark"] .alum-avatar {
  background: #334155;
}

/* Contact icon */
[data-theme="dark"] .c-ic {
  background: rgba(56,189,248,0.1);
  border-color: rgba(56,189,248,0.2);
}

/* Map border */
[data-theme="dark"] .map-wrap {
  border-color: var(--border);
}

/* Footer */
[data-theme="dark"] footer {
  background: #0f172a;
  border-top-color: var(--border);
}

/* Microscopy visual — make the ring borders visible */
[data-theme="dark"] .micro-frame {
  box-shadow:
    0 0 0 2px rgba(56,189,248,0.35),
    0 0 0 6px rgba(15,23,42,0.9),
    0 0 40px rgba(56,189,248,0.2),
    0 0 80px rgba(45,212,191,0.1);
}

/* Skeleton shimmer for dark mode */
[data-theme="dark"] .skeleton-box {
  background-color: #334155;
}
[data-theme="dark"] .skeleton-box::after {
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.08) 50%, transparent 100%);
}

/* Research tabs */
[data-theme="dark"] .rtab {
  background: var(--white);
  color: var(--muted);
}
[data-theme="dark"] .rtab.active {
  background: #f8fafc;
  color: #0f172a;
}

/* Schematic panels */
[data-theme="dark"] .schematic-panel {
  border-color: var(--border);
}

/* Vacancy popup */
[data-theme="dark"] .vacancy-card {
  background: #1e293b;
}
[data-theme="dark"] .vacancy-card-top {
  background: linear-gradient(135deg, #0f172a, #1e293b);
}

/* Mobile nav */
[data-theme="dark"] .nav-mobile {
  background: rgba(15, 23, 42, 0.98);
}

/* Lightbox */
[data-theme="dark"] .lightbox {
  background: rgba(0,0,0,0.92);
}

/* Links in PI section */
[data-theme="dark"] .pi-link {
  background: #f8fafc;
  color: #0f172a;
}
[data-theme="dark"] .pi-link:hover {
  background: var(--accent);
  color: #fff;
}
[data-theme="dark"] .pi-link.outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
[data-theme="dark"] .pi-link.outline:hover {
  background: var(--white);
  border-color: var(--accent);
  color: var(--accent);
}

/* Back to top */
[data-theme="dark"] .back-top {
  background: #f8fafc;
  color: #0f172a;
}