/* ================================================================
   NMorais Lab — styles.css
   Design system + all component styles
   Generated with Claude Sonnet 4.6 (Anthropic)
   ================================================================ */

/* ----------------------------------------------------------------
   DESIGN TOKENS
   Edit colour values here to retheme the entire site at once.
   ---------------------------------------------------------------- */
:root {
  --navy:        #0D1B2A;   /* primary dark — headings, nav bg   */
  --navy-mid:    #162438;   /* card / footer backgrounds         */
  --teal:        #087c72;   /* accent — WCAG AA on white (4.7:1) */
  --teal-light:  #14B8A6;   /* hover states + dark-bg teal       */
  --teal-on-dark: #14B8A6; /* teal on dark sections — passes AA */
  --slate:       #5f6e85;   /* secondary text — WCAG AA on fog   */
  --fog:         #F0F4F8;   /* alternate section backgrounds     */
  --white:       #FFFFFF;
  --border:      #E2E8F0;
  --radius:      12px;
  --shadow:      0 4px 24px rgba(13,27,42,.08);
  --shadow-lg:   0 8px 40px rgba(13,27,42,.14);
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
  --max-w: 1140px;
  --transition: 0.22s ease;
}

/* ----------------------------------------------------------------
   RESET & BASE
   ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-body);
  background: var(--white);
  color: var(--navy);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--teal); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--teal-light); }

h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.2; }

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section-label {
  display: block;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: .75rem;
  text-align: center;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: var(--navy);
  margin-bottom: 1rem;
  text-align: center;
}

/* Keep about section text left-aligned */
#about .section-label,
#about .section-title {
  text-align: left;
}

.section-intro {
  font-size: 1.05rem;
  color: var(--slate);
  max-width: 620px;
  margin: 0 auto 3rem;
  text-align: center;
}

#about .section-intro { text-align: left; }

section { padding: 5.5rem 0; }
#news { padding-bottom: 1.5rem; }

/* ----------------------------------------------------------------
   BUTTONS
   ---------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .8rem 1.7rem;
  border-radius: 8px;
  font-size: .95rem;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--teal);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--teal-light);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(13,148,136,.4);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 1.5px solid rgba(255,255,255,.3);
}
.btn-outline:hover {
  border-color: var(--teal);
  color: var(--teal);
  background: rgba(13,148,136,.08);
}

/* ----------------------------------------------------------------
   NAVIGATION
   ---------------------------------------------------------------- */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(13, 27, 42, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.07);
  transition: box-shadow var(--transition);
}
nav.scrolled { box-shadow: 0 2px 20px rgba(0,0,0,.35); }

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  height: 42px;
  flex-shrink: 0;
}

.nav-logo img {
  height: 38px;
  width: auto;
  border-radius: 0;
  object-fit: contain;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: .25rem;
  list-style: none;
}

.nav-links a {
  color: rgba(255,255,255,.75);
  font-size: .9rem;
  font-weight: 400;
  padding: .45rem .85rem;
  border-radius: 6px;
  letter-spacing: .01em;
  transition: background var(--transition), color var(--transition);
}
.nav-links a:hover {
  color: var(--white);
  background: rgba(255,255,255,.1);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: .5rem;
  border: none;
  background: transparent;
}
.nav-toggle span {
  display: block;
  width: 24px; height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.nav-drawer {
  display: none;
  flex-direction: column;
  gap: .25rem;
  padding: .75rem 1.5rem 1rem;
  background: var(--navy-mid);
  border-top: 1px solid rgba(255,255,255,.06);
}
.nav-drawer a {
  color: rgba(255,255,255,.8);
  font-size: .95rem;
  padding: .6rem .5rem;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.nav-drawer.open { display: flex; }

/* ----------------------------------------------------------------
   HERO
   ---------------------------------------------------------------- */
#hero {
  min-height: 100vh;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 7rem 0 5rem;
  position: relative;
  overflow: hidden;
}
#hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(13,148,136,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(13,148,136,.07) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}
#hero::after {
  content: '';
  position: absolute;
  top: -10%; right: -5%;
  width: 55vw; height: 55vw;
  max-width: 700px; max-height: 700px;
  background: radial-gradient(circle, rgba(13,148,136,.18) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner { position: relative; z-index: 1; max-width: 780px; }

.hero-logo-block {
  margin-bottom: 2.5rem;
}
.hero-logo-block img {
  height: auto;
  max-height: 200px;
  width: auto;
  max-width: 620px;
  object-fit: contain;
  filter: drop-shadow(0 0 20px rgba(13,148,136,.25));
  /* Logo is white on transparent — displays correctly on dark hero bg */
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255,255,255,.65);
  margin-bottom: 1.25rem;
}
.hero-kicker::before {
  content: '';
  display: block;
  width: 28px; height: 2px;
  background: rgba(255,255,255,.4);
}

.hero-lab-name {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: var(--teal);
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero-title {
  position: relative;
  font-size: clamp(2.8rem, 6vw, 4.8rem);
  color: var(--white);
  margin-bottom: 1.5rem;
  font-weight: 900;
  line-height: 1.1;
}
.hero-title span { color: var(--teal); }

/* Typewriter animation layers.
   .hero-title span { color:teal } has specificity 0-1-1, so we need
   0-2-0 here to keep the wrapper spans white while inner <span>s stay teal. */
.hero-title .hero-title-ghost {
  display: block;          /* sets the h1 height so layout never shifts */
  color: var(--white);
  opacity: 0.18;
  pointer-events: none;
  user-select: none;
}
.hero-title-ghost-teal { color: var(--teal); }

.hero-title .hero-title-typed {
  position: absolute;
  top: 0; left: 0;
  display: block;
  color: var(--white);     /* text defaults to white; inner <span> gets teal via .hero-title span */
}
/* Blinking cursor - permanent after typing completes */
.hero-title-typed.typing::after {
  content: '|';
  color: rgba(255,255,255,.55);
  animation: hero-caret-blink .7s step-end infinite;
}
@keyframes hero-caret-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.hero-desc {
  font-size: 1.15rem;
  color: rgba(255,255,255,.65);
  max-width: 580px;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.hero-affiliations {
  position: relative; z-index: 1;
  margin-top: 5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.2rem;
}
.hero-affiliations span {
  font-size: .78rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
  margin-right: .3rem;
}
.affil-badge {
  display: inline-block;
  padding: .35rem .8rem;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 20px;
  font-size: .78rem;
  color: rgba(255,255,255,.55);
  font-weight: 400;
  transition: border-color var(--transition), color var(--transition);
  text-decoration: none;
}
.affil-badge:hover { border-color: var(--teal); color: var(--teal); }

/* ----------------------------------------------------------------
   ABOUT
   ---------------------------------------------------------------- */
#about .about-stack {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  max-width: 820px;
  margin: 0 auto;
}

.lab-photo-wrap {
  width: 100%;
  height: 420px;           /* controls how tall the photo strip appears  */
  border-radius: var(--radius);
  overflow: hidden;
}

.lab-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;        /* crops to fill — no stretching             */
  object-position: center;  /* centre the crop; change to "top" if needed */
  display: block;
}

@media (max-width: 640px) {
  .lab-photo-wrap { height: 260px; }
}

.about-text { display: flex; flex-direction: column; gap: 1rem; }
.about-text p { color: #374151; font-size: 1rem; line-height: 1.8; }

.mission-pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}
.pillar {
  background: var(--fog);
  border-radius: var(--radius);
  padding: 1.25rem;
  border-top: 3px solid var(--teal);
}
.pillar h4 {
  font-family: var(--font-body);
  font-size: .88rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: .35rem;
}
.pillar p { font-size: .82rem; color: var(--slate); line-height: 1.5; }

/* Graphical abstract override — shows the full image (no crop) */
.lab-photo-abstract {
  height: auto !important;          /* override the fixed 420px from .lab-photo-wrap  */
  overflow: visible !important;     /* override overflow:hidden from .lab-photo-wrap  */
  background: var(--white);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
}
.lab-photo-abstract img {
  object-fit: contain !important;   /* show the whole diagram, no cropping            */
  height: auto !important;
  max-height: 500px;
  width: 100%;
}
@media (max-width: 640px) {
  .lab-photo-abstract img { max-height: 280px; }
}

/* ----------------------------------------------------------------
   TEAM
   ---------------------------------------------------------------- */
#team { background: var(--fog); }

/* PI — full-width card */
.pi-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin-bottom: 2.5rem;
  display: grid;
  grid-template-columns: 320px 1fr;
  /* default align-items: stretch — photo column grows to match bio height */
}

.pi-photo {
  background: linear-gradient(160deg, #e0eeec 0%, #b2d8d2 100%);
  overflow: hidden;
  min-height: 380px;
  /* stretches to match .pi-info height via grid align-items: stretch */
}
.pi-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;  /* keep face in frame on tall portraits */
  display: block;
}
.pi-photo-placeholder {
  width: 100px; height: 100px;
  background: var(--teal);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--white);
}

.pi-info {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: .9rem;
}

.pi-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--teal);
  background: rgba(13,148,136,.08);
  border: 1px solid rgba(13,148,136,.2);
  padding: .3rem .75rem;
  border-radius: 20px;
  width: fit-content;
}

.pi-name {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--navy);
  line-height: 1.15;
}

.pi-interests {
  font-size: .9rem;
  color: var(--slate);
  line-height: 1.7;
}
.pi-interests strong { color: var(--navy); font-weight: 500; }

.pi-email {
  font-size: .88rem;
  color: var(--teal);
  display: flex;
  align-items: center;
  gap: .4rem;
}
.pi-email a { color: var(--teal); }
.pi-email a:hover { color: var(--teal-light); }

.social-links { display: flex; gap: .5rem; flex-wrap: wrap; }
.social-link {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .75rem;
  font-weight: 500;
  color: var(--slate);
  padding: .3rem .65rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
  text-decoration: none;
}
.social-link:hover {
  border-color: var(--teal);
  color: var(--teal);
  background: rgba(13,148,136,.04);
}

/* Team grid — regular members */
.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media (max-width: 860px) {
  .team-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .team-grid {
    grid-template-columns: 1fr;
  }
}

.member-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}
.member-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.member-photo {
  width: 100%;
  aspect-ratio: 5/4;           /* consistent crop: slightly taller than 4/3 */
  background: linear-gradient(135deg, #e8f4f2 0%, #cce5e1 100%);
  overflow: hidden;
  flex-shrink: 0;
}
.member-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;  /* keep face in frame */
  display: block;
}
.member-photo-placeholder {
  width: 64px; height: 64px;
  background: var(--teal);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--white);
}

.member-info { padding: 1.25rem 1.4rem 1.4rem; }

.member-role-badge {
  display: inline-block;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: .45rem;
}

.member-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: .55rem;
  line-height: 1.25;
}

.member-interests {
  font-size: .82rem;
  color: var(--slate);
  line-height: 1.55;
  margin-bottom: .85rem;
}
.member-interests strong { color: var(--navy); font-weight: 500; }

.member-email {
  font-size: .82rem;
  color: var(--teal);
  display: flex;
  align-items: center;
  gap: .35rem;
  margin-bottom: .8rem;
  word-break: break-all;
}
.member-email a { color: var(--teal); }
.member-email svg { flex-shrink: 0; }

/* ----------------------------------------------------------------
   SOFTWARE
   ---------------------------------------------------------------- */
.software-section-divider {
  font-family: var(--font-body);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--slate);
  margin: 2.5rem 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.software-section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.software-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.tool-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  position: relative;
  overflow: hidden;
}
.tool-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: var(--teal);
  opacity: 0;
  transition: opacity var(--transition);
}
.tool-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  border-color: transparent;
}
.tool-card:hover::before { opacity: 1; }
.tool-card.software-only { border-style: dashed; }
.tool-card.software-only::before { background: #65707e; }

.tool-name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--navy);
}

.tool-desc {
  font-size: .88rem;
  color: var(--slate);
  line-height: 1.6;
  flex: 1;
}

.tool-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .28rem .65rem;
  border-radius: 20px;
  width: fit-content;
}
.tool-badge.webapp  { background: #D1FAE5; color: #065F46; }
.tool-badge.pkg     { background: #EFF6FF; color: #1E40AF; }
.tool-badge.dev     { background: #F1F5F9; color: #475569; }

.tool-badges { display: flex; flex-wrap: wrap; gap: .4rem; }

.tool-links { display: flex; flex-direction: column; gap: .5rem; margin-top: .25rem; }
.tool-link-row { display: flex; flex-wrap: wrap; gap: .45rem; }

.tool-link {
  font-size: .75rem;
  font-weight: 500;
  color: var(--slate);
  padding: .28rem .65rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  text-decoration: none;
  transition: all var(--transition);
}
.tool-link:hover {
  background: var(--teal);
  color: var(--white);
  border-color: var(--teal);
}
.tool-link.launch {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
  align-self: flex-start; /* prevent full-column stretch */
}
.tool-link.launch:hover { background: var(--teal); border-color: var(--teal); }

/* ----------------------------------------------------------------
   OUTREACH & SCIENCE COMMUNICATION
   ---------------------------------------------------------------- */
#outreach { background: var(--white); }

.outreach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.75rem;
  margin-top: 3rem;
}

.outreach-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition);
}
.outreach-card--live:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.outreach-card--soon {
  opacity: .88;
}
.outreach-card--soon:hover {
  opacity: 1;
}

/* Coloured header band */
.outreach-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem 1rem;
}
.outreach-header--live {
  background: linear-gradient(135deg, var(--navy) 0%, #1a3a5c 100%);
}
.outreach-header--soon {
  background: linear-gradient(135deg, #1e2d3d 0%, #263445 100%);
}

/* Clickable header (live cards) */
a.outreach-header--link {
  text-decoration: none;
  cursor: pointer;
  transition: filter var(--transition);
}
a.outreach-header--link:hover {
  filter: brightness(1.15);
}
a.outreach-header--link:hover .outreach-status-pill {
  transform: scale(1.06);
  box-shadow: 0 0 0 3px rgba(13,148,136,.35);
}

.outreach-card-emoji {
  font-size: 2.4rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.3));
}

.outreach-status-pill {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .3rem .8rem;
  border-radius: 20px;
  transition: transform var(--transition), box-shadow var(--transition);
}
.outreach-pill--live {
  background: var(--teal);
  color: var(--white);
}
.outreach-pill--soon {
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.55);
  border: 1px solid rgba(255,255,255,.18);
}

/* Card body */
.outreach-card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  flex: 1;
}

.outreach-card-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--navy);
  line-height: 1.2;
}

.outreach-card-subtitle {
  font-size: .82rem;
  color: var(--teal);
  font-weight: 600;
  letter-spacing: .02em;
}

.outreach-card-desc {
  font-size: .9rem;
  color: #374151;
  line-height: 1.75;
  flex: 1;
}

/* Science connection box */
.outreach-concept-box {
  background: var(--fog);
  border-left: 3px solid var(--teal);
  border-radius: 0 8px 8px 0;
  padding: .8rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.outreach-concept-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--teal);
}
.outreach-concept-box p {
  font-size: .82rem;
  color: var(--slate);
  line-height: 1.6;
}

/* Tags */
.outreach-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .1rem;
}
.outreach-tag {
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .25rem .65rem;
  border-radius: 20px;
  background: var(--fog);
  color: var(--slate);
  border: 1px solid var(--border);
}

/* License credit line inside outreach cards */
.outreach-license {
  margin-top: .85rem;
  font-size: .7rem;
  color: var(--slate);
  opacity: .7;
}
.outreach-license a {
  color: var(--teal);
  text-decoration: none;
  font-weight: 600;
}
.outreach-license a:hover { text-decoration: underline; }

/* Footer row */
.outreach-card-footer {
  margin-top: .5rem;
  display: flex;
  align-items: center;
}
.outreach-play-btn {
  font-size: .88rem;
  padding: .6rem 1.5rem;
}
.outreach-coming-soon-pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .8rem;
  font-weight: 600;
  color: var(--slate);
  background: var(--fog);
  padding: .45rem 1rem;
  border-radius: 20px;
  border: 1.5px dashed var(--border);
}

/* ----------------------------------------------------------------
   PUBLICATIONS — timeline layout
   ---------------------------------------------------------------- */
#publications { background: var(--fog); }

/* Vertical track */
.pub-timeline {
  position: relative;
  margin-top: 2.5rem;
  padding-left: 2.25rem;
}
.pub-timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: linear-gradient(
    to bottom,
    var(--teal) 0%,
    rgba(13,148,136,.15) 100%
  );
}

/* Year group */
.pub-year-group {
  margin-bottom: 2.75rem;
}
.pub-year-group:last-child { margin-bottom: 0; }

/* Year label row with dot on the track */
.pub-year-header {
  display: flex;
  align-items: center;
  gap: .85rem;
  margin-bottom: .9rem;
  position: relative;
}
.pub-year-dot {
  position: absolute;
  left: calc(-2.25rem + 1px);   /* centres 14px dot on the 2px line at left:7px */
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 3px rgba(13,148,136,.2), 0 0 0 6px rgba(13,148,136,.07);
  flex-shrink: 0;
}
.pub-year-label {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--teal);
  line-height: 1;
}

/* Papers under each year */
.pub-year-papers {
  display: flex;
  flex-direction: column;
}
.pub-paper {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border);
}
.pub-year-papers .pub-paper:first-child {
  border-top: 1px solid var(--border);
}

.pub-title { font-size: .98rem; font-weight: 500; color: var(--navy); line-height: 1.45; }
.pub-title a { color: var(--navy); }
.pub-title a:hover { color: var(--teal); }

.pub-authors { font-size: .82rem; color: var(--slate); font-style: italic; }
.pub-journal  { font-size: .82rem; color: #475569; font-weight: 500; }

.pub-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .35rem; }
.pub-tag {
  font-size: .7rem; font-weight: 500;
  background: #EFF6FF; color: #1D4ED8;
  padding: .15rem .55rem; border-radius: 10px;
}

/* ----------------------------------------------------------------
   NEWS
   ---------------------------------------------------------------- */

/* ── Social feed widget container ── */
.news-widget-wrap {
  max-width: 820px;
}

/* Placeholder shown until real widget is pasted in */
.news-placeholder-box {
  background: var(--white);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
  color: var(--slate);
}
.news-placeholder-box p { font-size: .88rem; line-height: 1.7; max-width: 380px; }
.news-placeholder-box code {
  background: var(--fog);
  padding: .2rem .5rem;
  border-radius: 4px;
  font-size: .78rem;
  color: var(--navy);
}

.news-social-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: .5rem;
}
.news-social-btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .65rem 1.25rem;
  border-radius: 8px;
  font-size: .88rem;
  font-weight: 500;
  text-decoration: none;
  border: 1.5px solid var(--border);
  color: var(--navy);
  transition: all var(--transition);
}
.news-social-btn:hover {
  border-color: var(--teal);
  color: var(--teal);
  background: rgba(13,148,136,.05);
}

/* ----------------------------------------------------------------
   TEAM GROUP PHOTO
   ---------------------------------------------------------------- */
.team-group-photo {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow);
}
.team-group-photo img {
  width: 100%;
  height: 420px;
  object-fit: cover;
  object-position: center;
  display: block;
}
@media (max-width: 640px) {
  .team-group-photo img { height: 240px; }
}

/* ----------------------------------------------------------------
   FUNDING
   ---------------------------------------------------------------- */
#funding {
  background: var(--white);
  padding: 4rem 0;
}

.funding-logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 3rem 4rem;
  margin-top: 2.5rem;
}

.funding-logo-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .65rem;
  text-decoration: none;
  cursor: pointer;
  transition: opacity var(--transition);
}
a.funding-logo-link:hover { opacity: .7; }

.funding-logo-static { cursor: default; }

.funding-logo-link img {
  height: 56px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  mix-blend-mode: multiply; /* removes white backgrounds on white section */
}

/* BIOMICS has a black background baked in — wrap it in a dark chip */
.funding-logo-dark-chip {
  background: var(--navy);
  border-radius: 8px;
  padding: .5rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.funding-logo-dark-chip img {
  height: 44px;
  width: auto;
  max-width: 160px;
}

.funding-logo-link span {
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--slate);
  text-align: center;
}

/* ----------------------------------------------------------------
   FOOTER
   ---------------------------------------------------------------- */
footer {
  background: var(--navy-mid);
  padding: 3.5rem 0 2rem;
  color: rgba(255,255,255,.55);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-col h4 {
  font-family: var(--font-body);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
  margin-bottom: 1rem;
}
.footer-col p { font-size: .88rem; line-height: 1.8; }

.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.footer-col ul a {
  font-size: .88rem;
  color: rgba(255,255,255,.55);
  transition: color var(--transition);
}
.footer-col ul a:hover { color: var(--teal); }

.footer-logo img {
  height: 36px;
  width: auto;
  object-fit: contain;
  opacity: .85;
  margin-bottom: 1rem;
  /* logo-icon.png is white on transparent — visible on dark footer */
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,.07);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: .8rem;
}

/* ----------------------------------------------------------------
   MEMBER CARD — bio, flag, extended social
   ---------------------------------------------------------------- */
.member-name-row {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin-bottom: .55rem;
}
.member-flag {
  font-size: 1.1rem;
  line-height: 1;
}
.member-bio {
  font-size: .82rem;
  color: var(--slate);
  line-height: 1.6;
  margin-bottom: .75rem;
  font-style: italic;
}

/* Fun fact line — appears on member cards and PI card */
.member-fun-fact {
  font-size: .76rem;
  color: #65707e;        /* lighter than --slate, so it reads as a footnote */
  line-height: 1.5;
  margin-top: .2rem;
  font-style: italic;
}
.member-fun-fact::before {
  content: '💡 ';
  font-style: normal;
}

/* ----------------------------------------------------------------
   ALUMNI SECTION
   ---------------------------------------------------------------- */
#alumni { background: var(--white); }

/* ── Group photo slideshow ──────────────────────────────────────── */
/* All group photos are 960×300 (ratio 16:5) — cover fills perfectly */
.alumni-slideshow {
  position: relative;
  width: 100%;
  margin: 0 0 2.5rem;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 5;
  box-shadow: 0 4px 24px rgba(0,0,0,.15);
}

.alumni-slides-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.alumni-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
}
.alumni-slide.active { opacity: 1; pointer-events: auto; }

.alumni-slideshow-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.55));
  color: rgba(255,255,255,.85);
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .06em;
  padding: 1.5rem 1rem .6rem;
  text-align: center;
  pointer-events: none;
}

.alumni-slide-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.18);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 2.4rem;
  height: 2.4rem;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
  z-index: 2;
}
.alumni-slide-arrow:hover { background: rgba(255,255,255,.35); }
.alumni-slide-prev { left: .75rem; }
.alumni-slide-next { right: .75rem; }

.alumni-slide-dots {
  position: absolute;
  bottom: .45rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: .35rem;
  z-index: 2;
}
.alumni-slide-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,.35);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background .2s, transform .2s;
}
.alumni-slide-dot.active { background: #fff; transform: scale(1.3); }

/* ── Year timeline ───────────────────────────────────────────────── */
.alumni-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: .5rem;
}

.alumni-year-group {
  display: grid;
  grid-template-columns: 3.5rem 1fr 200px;
  gap: 0 .5rem;
  align-items: start;
}

.alumni-year-label {
  font-size: .78rem;
  font-weight: 800;
  color: var(--teal);
  letter-spacing: .03em;
  padding-top: .2rem;
  text-align: right;
  flex-shrink: 0;
}

.alumni-year-people {
  list-style: none;
  margin: 0; padding: 0;
  border-left: 2px solid var(--border);
  padding-left: 1.25rem;
  padding-bottom: 1.6rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  align-self: stretch;
}

.alumni-year-group:last-child .alumni-year-people {
  border-left-color: transparent;
  padding-bottom: 0;
}

.alumni-entry {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .3rem .45rem;
  position: relative;
  cursor: default;
  transition: opacity .2s ease;
}

/* Dot on the timeline line */
.alumni-entry:first-child::before {
  content: '';
  position: absolute;
  left: -1.6rem;
  top: .45rem;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid var(--teal);
}

/* Dim inactive entries when a sibling is hovered */
.alumni-year-group.is-hovering .alumni-entry { opacity: .35; }
.alumni-year-group.is-hovering .alumni-entry.is-active { opacity: 1; }

.alumni-entry-name {
  font-size: .88rem;
  font-weight: 600;
  color: var(--navy);
}

.alumni-entry-years {
  font-size: .78rem;
  color: var(--slate);
  font-weight: 400;
}
.alumni-entry-years::before { content: '· '; }

.alumni-entry-at {
  font-size: .82rem;
  color: var(--slate);
}
.alumni-entry-at::before { content: '→ '; color: var(--teal); }

/* Photo cluster */
.alumni-year-photos {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  align-content: flex-start;
  padding-top: .1rem;
}

.alumni-year-photo {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  transition: opacity .2s ease, filter .2s ease, transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

/* Dim all photos when hovering, highlight active */
.alumni-year-group.is-hovering .alumni-year-photo {
  opacity: .2;
  filter: blur(1.5px);
}
.alumni-year-group.is-hovering .alumni-year-photo.is-active {
  opacity: 1;
  filter: none;
  transform: scale(1.12);
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(13,148,136,.2);
}

/* ── Role badges ────────────────────────────────────────────────── */
.alumni-role-badge {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .04em;
  padding: .16em .55em;
  border-radius: 99px;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.badge-postdoc  { background: #ccfbf1; color: #0f766e; }
.badge-phd      { background: #dbeafe; color: #1e40af; }
.badge-visiting { background: #ede9fe; color: #6d28d9; }
.badge-msc      { background: #fef3c7; color: #92400e; }
.badge-trainee  { background: #fce7f3; color: #9d174d; }

@media (max-width: 700px) {
  .alumni-year-group {
    grid-template-columns: 2.75rem 1fr;
    grid-template-rows: auto auto;
  }
  .alumni-year-photos {
    display: flex;
    grid-column: 2;
    grid-row: 2;
    padding-top: .6rem;
    padding-bottom: .4rem;
  }
  .alumni-entry-name { font-size: .82rem; }
}

/* ----------------------------------------------------------------
   BLUESKY FEED — 3-column compact grid
   ---------------------------------------------------------------- */
.bsky-feed-wrap {
  width: 100%;
}

.bsky-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
  align-items: start;
}

.bsky-card {
  background: var(--fog);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  transition: background var(--transition);
}
.bsky-card:hover { background: #e4eaf0; }

.bsky-card-date {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--teal);
}
.bsky-card-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--teal);
  flex-shrink: 0;
}

.bsky-text {
  font-size: .88rem;
  line-height: 1.6;
  color: var(--navy);
  margin: 0;
  flex: 1;
}

.bsky-link {
  font-size: .75rem;
  font-weight: 600;
  color: var(--teal);
  text-decoration: none;
  align-self: flex-start;
  margin-top: .15rem;
}
.bsky-link:hover { color: var(--teal-light); }

.bsky-loading, .bsky-error {
  text-align: center;
  color: var(--slate);
  padding: 3rem 1rem;
  font-size: .95rem;
  grid-column: 1 / -1;
}

.bsky-footer {
  text-align: center;
  margin-top: 1.25rem;
}
.bsky-follow-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: #0085FF;
  color: white;
  padding: .55rem 1.3rem;
  border-radius: 2rem;
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity var(--transition);
}
.bsky-follow-btn:hover { opacity: .85; color: white; }

@media (max-width: 700px) {
  .bsky-grid { grid-template-columns: 1fr; }
}

/* ----------------------------------------------------------------
   MAP / LOCATION SECTION
   ---------------------------------------------------------------- */
#location {
  background: var(--navy);
  padding: 5rem 0;
}
#location .section-label { color: rgba(255,255,255,.45); text-align: center; }
#location .section-title { color: var(--white); text-align: center; }

.location-inner {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 3rem;
  align-items: start;
  margin-top: 2.5rem;
}

.location-address {
  color: rgba(255,255,255,.65);
  font-size: .95rem;
  line-height: 1.9;
}
.location-address strong {
  display: block;
  color: var(--teal);
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: .5rem;
}
.location-address h3 {
  color: var(--white);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: .75rem;
  font-family: var(--font-body);
}
.location-address a { color: var(--teal); }
.location-address a:hover { color: var(--teal-light); }

.map-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,.4);
  height: 360px;
}
.map-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

@media (max-width: 860px) {
  .location-inner { grid-template-columns: 1fr; }
  .map-wrap { height: 280px; }
}

/* ----------------------------------------------------------------
   SCROLL ANIMATIONS
   ---------------------------------------------------------------- */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .55s ease, transform .55s ease;
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ----------------------------------------------------------------
   RESPONSIVE
   ---------------------------------------------------------------- */
@media (max-width: 900px) {
  .pi-card { grid-template-columns: 1fr; }
  .pi-photo { min-height: 280px; aspect-ratio: 16/9; position: static; }
  .mission-pillars { grid-template-columns: 1fr 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1024px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
}

@media (max-width: 640px) {
  section { padding: 4rem 0; }
  .mission-pillars { grid-template-columns: 1fr; }
  .pub-item { grid-template-columns: 44px 1fr; gap: 0 1rem; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .pi-photo { min-height: 220px; }
}

/* ----------------------------------------------------------------
   DEPRECATED tool badge
   ---------------------------------------------------------------- */
.tool-badge.deprecated { background: #FEF3C7; color: #92400E; }
.tool-card.deprecated-card { opacity: .85; border-style: dashed; border-color: #F59E0B; }
.tool-card.deprecated-card::before { background: #F59E0B; }

/* ----------------------------------------------------------------
   SOFTWARE FILTER BAR
   ---------------------------------------------------------------- */
.software-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 2rem;
}

.software-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .4rem 1rem;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--slate);
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-body);
}
.software-filter-btn:hover {
  border-color: var(--teal);
  color: var(--teal);
  background: rgba(13,148,136,.04);
}
.software-filter-btn.active {
  background: var(--teal);
  border-color: var(--teal);
  color: var(--white);
}

.tool-group { transition: opacity .2s ease; }
.tool-group.hidden { display: none; }

/* ----------------------------------------------------------------
   PUBLICATIONS FILTER BAR
   ---------------------------------------------------------------- */
.pub-filter-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 2rem;
}

.pub-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .4rem 1rem;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--slate);
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-body);
}
.pub-filter-btn:hover {
  border-color: var(--teal);
  color: var(--teal);
  background: rgba(13,148,136,.04);
}
.pub-filter-btn.active {
  background: var(--teal);
  border-color: var(--teal);
  color: var(--white);
}

/* Keyword search bar */
.pub-search-wrap {
  margin-bottom: 1.25rem;
  position: relative;
  max-width: 380px;
}
.pub-keyword-input {
  width: 100%;
  padding: .45rem 1rem .45rem 2.4rem;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: .85rem;
  color: var(--navy);
  background: var(--white);
  outline: none;
  transition: border-color var(--transition);
}
.pub-keyword-input:focus { border-color: var(--teal); }
.pub-keyword-input::placeholder { color: var(--slate); opacity: .7; }
.pub-search-icon {
  position: absolute;
  left: .85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--slate);
  pointer-events: none;
}


/* ----------------------------------------------------------------
   RESEARCH SECTION
   ---------------------------------------------------------------- */
#research { background: var(--white); }

.research-intro-grid {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 3rem;
  align-items: start;
  margin-bottom: 3.5rem;
}
@media (max-width: 900px) {
  .research-intro-grid { grid-template-columns: 1fr; }
}

.research-intro-text p {
  color: #374151;
  font-size: 1rem;
  line-height: 1.85;
  margin-bottom: 1rem;
}
.research-intro-text p:last-child { margin-bottom: 0; }

.research-video-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  aspect-ratio: 16/9;
  width: 100%;
}
.research-video-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* ----------------------------------------------------------------
   RESEARCH — filter bar, card grid, pub panels
   ---------------------------------------------------------------- */

/* Filter bar — mirrors software-filter-bar */
.research-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 2rem;
}
.research-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem 1rem;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--slate);
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-body);
}
.research-filter-btn:hover { border-color: var(--navy); color: var(--navy); }
.research-filter-btn.active { background: var(--navy); border-color: var(--navy); color: var(--white); }
.research-filter-btn.active .rfilter-dot { opacity: .7; }

/* Theme colour dots in filter buttons */
.rfilter-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.rfilter-dot.cancer          { background: #fca5a5; }
.rfilter-dot.neuro           { background: #c4b5fd; }
.rfilter-dot.bioinformatics  { background: #5eead4; }
.rfilter-dot.biostatistics   { background: #fcd34d; }
.rfilter-dot.evolutionary    { background: #86efac; }
.rfilter-dot.external   { background: #7dd3fc; }

/* Keyword search */
.research-keyword-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 320px;
  margin-bottom: 2rem;
}
.research-keyword-search-icon {
  position: absolute;
  left: .75rem;
  color: var(--muted);
  pointer-events: none;
  flex-shrink: 0;
}
.research-keyword-search {
  width: 100%;
  padding: .5rem .9rem .5rem 2.25rem;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--navy);
  font-size: .84rem;
  font-family: var(--font-body);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  -webkit-appearance: none;
}
.research-keyword-search::placeholder { color: var(--muted); }
.research-keyword-search:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(8,124,114,.1);
}
.research-keyword-search::-webkit-search-cancel-button { cursor: pointer; }

/* Project card grid */
.research-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1.1rem;
  margin-bottom: 2.5rem;
}
@media (max-width: 600px) { .research-card-grid { grid-template-columns: 1fr; } }

.research-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition), transform var(--transition);
}
.research-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

/* Coloured top stripe — background set by JS (supports gradients for multi-theme) */
.research-card-stripe { height: 4px; flex-shrink: 0; }

.research-card-body {
  padding: 1rem 1.15rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  flex: 1;
}

/* Theme pill badges — wrap in .research-theme-pills for multi-theme cards */
.research-theme-pills {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  flex-shrink: 0;
}
.research-theme-pill {
  display: inline-flex;
  align-items: center;
  gap: .3em;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: .2em .65em;
  border-radius: 99px;
  width: fit-content;
  flex-shrink: 0;
}
.research-theme-pill.cancer         { background: #fff1f2; color: #c71640; } /* darkened for 4.5:1 on pill-bg */
.research-theme-pill.neuro          { background: #f5f3ff; color: #6d31cc; } /* was passing; darkened for consistency */
.research-theme-pill.bioinformatics { background: #f0fdfa; color: #087c72; } /* uses new --teal, passes 4.5:1 */
.research-theme-pill.biostatistics  { background: #fffbeb; color: #92400e; } /* amber-800 ~7.5:1 on pill-bg, WCAG AA */
.research-theme-pill.evolutionary   { background: #f0fdf4; color: #166534; } /* green-800 ~7:1 on pill-bg, WCAG AA */
.research-theme-pill.external  { background: #f0f9ff; color: #0369a1; } /* sky-700 ~5.7:1 on pill-bg, WCAG AA */

.research-card-title {
  font-size: .9rem;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.4;
}
.research-card-title a { color: inherit; text-decoration: none; }
.research-card-title a:hover { color: var(--teal); }

/* Keywords */
.research-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
}
.research-keyword {
  font-size: .67rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: .18rem .55rem;
  border-radius: 10px;
  background: transparent;
  border: 1px solid rgba(100,116,139,.35);
  color: var(--slate);
}

.research-card-people {
  font-size: .76rem;
  color: var(--slate);
  line-height: 1.6;
  margin-top: auto;
  padding-top: .5rem;
  border-top: 1px solid var(--border);
}
.research-card-people strong { color: var(--navy); font-weight: 500; }
.research-card-people a { color: var(--teal); text-decoration: none; }
.research-card-people a:hover { text-decoration: underline; }

/* Cards are clickable */
.research-card {
  cursor: pointer;
  transition: box-shadow .2s ease, transform .2s ease,
              border-color .2s ease, background .2s ease;
}
.research-card:hover {
  box-shadow: 0 12px 40px rgba(0,0,0,.14);
  transform: translateY(-5px);
}
/* ~= matches the theme word anywhere in a space-separated list */
.research-card[data-theme~="cancer"]:hover {
  border-color: #fca5a5;
  background: #fff8f8;
}
.research-card[data-theme~="neuro"]:hover {
  border-color: #c4b5fd;
  background: #faf8ff;
}
.research-card[data-theme~="bioinformatics"]:hover {
  border-color: #5eead4;
  background: #f5fffd;
}
.research-card[data-theme~="biostatistics"]:hover {
  border-color: #fcd34d;
  background: #fffef5;
}
.research-card[data-theme~="evolutionary"]:hover {
  border-color: #86efac;
  background: #f7fff9;
}
.research-card[data-theme~="external"]:hover {
  border-color: #7dd3fc;
  background: #f5faff;
}
/* Stripe grows on hover */
.research-card:hover .research-card-stripe { height: 6px; }

.research-card-toggle {
  display: flex;
  align-items: center;
  gap: .35rem;
  margin-top: .6rem;
  padding-top: .6rem;
  border-top: 1px solid var(--border);
  font-size: .78rem;
  font-weight: 600;
  color: var(--teal);
  letter-spacing: .01em;
  transition: color .15s ease, gap .15s ease;
  user-select: none;
}
.research-card:hover .research-card-toggle {
  color: var(--navy);
  gap: .5rem;
}
.research-card-chevron {
  flex-shrink: 0;
  transition: transform .2s ease;
}
.research-card-detail { display: none; }
.research-card-preprint {
  display: flex;
  align-items: center;
  gap: .3rem;
  margin-top: .85rem;
  width: fit-content;
}
.research-card-preprint a {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .28rem .7rem;
  background: var(--fog);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: .73rem;
  font-weight: 600;
  color: var(--slate);
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.research-card-preprint a:hover {
  background: #e2e8f0;
  border-color: var(--slate);
  color: var(--navy);
  text-decoration: none;
}

/* ── Research project modal ──────────────────────────────────────── */
.research-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .5);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.research-modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}
.research-modal {
  background: var(--white);
  border-radius: var(--radius);
  width: 100%;
  max-width: 580px;
  max-height: 82vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 24px 64px rgba(0,0,0,.22);
  transform: translateY(14px) scale(.98);
  transition: transform .25s ease;
}
.research-modal-overlay.is-open .research-modal {
  transform: translateY(0) scale(1);
}

.research-modal-close {
  position: sticky;
  top: .75rem;
  float: right;
  margin: .75rem .75rem 0 0;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--fog);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: var(--slate);
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
  z-index: 1;
}
.research-modal-close:hover { background: var(--border); color: var(--navy); }

.research-modal-content {
  padding: 1.25rem 1.5rem 1.5rem;
  clear: both;
}

.research-modal-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.4;
  margin: .6rem 0 1rem;
}
.research-modal-title em { font-style: italic; }

.research-modal-desc {
  font-size: .88rem;
  color: var(--slate);
  line-height: 1.7;
  margin: 0 0 1.1rem;
}
.research-modal-desc sup { font-size: .65em; vertical-align: super; }
.research-modal-desc em { font-style: italic; }

.research-modal-pubs-label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--slate);
  margin: 0 0 .6rem;
}

.research-modal-pub-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.research-modal-pub-list li {
  font-size: .8rem;
  color: var(--slate);
  line-height: 1.55;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}
.research-modal-pub-list li:last-child { border-bottom: none; padding-bottom: 0; }
.research-modal-pub-list a { color: var(--teal); text-decoration: none; }
.research-modal-pub-list a:hover { text-decoration: underline; }

/* ----------------------------------------------------------------
   RESEARCH PUB PANELS (finished-work accordions by theme)
   ---------------------------------------------------------------- */
.research-pub-panels-wrap {
  margin-top: 3rem;
}
.research-pub-panels-heading {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 1.2rem;
  letter-spacing: .01em;
}
.research-pub-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: .6rem;
  overflow: hidden;
  background: var(--white);
}
.research-pub-panel-summary {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: 1rem 1.25rem;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  font-size: .9rem;
  color: var(--navy);
  background: var(--fog);
  user-select: none;
  transition: background .18s;
}
.research-pub-panel-summary::-webkit-details-marker { display: none; }
.research-pub-panel-summary:hover { background: var(--border); }
.research-pub-panel-summary.cancer         { border-left: 4px solid #fca5a5; }
.research-pub-panel-summary.neuro          { border-left: 4px solid #c4b5fd; }
.research-pub-panel-summary.bioinformatics { border-left: 4px solid #5eead4; }
.research-pub-panel-summary.biostatistics  { border-left: 4px solid #fcd34d; }
.research-pub-panel-summary.evolutionary   { border-left: 4px solid #86efac; }
.research-pub-panel-summary.external  { border-left: 4px solid #7dd3fc; }
.research-pub-panel-chevron {
  margin-left: auto;
  flex-shrink: 0;
  transition: transform .22s;
}
details[open] .research-pub-panel-chevron { transform: rotate(180deg); }
.research-pub-panel-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.research-pub-panel-list li {
  padding: .7rem 1.25rem;
  font-size: .85rem;
  line-height: 1.6;
  color: var(--body);
  border-bottom: 1px solid var(--border);
}
.research-pub-panel-list li:last-child { border-bottom: none; }
.research-pub-panel-list a { color: var(--teal); text-decoration: none; }
.research-pub-panel-list a:hover { text-decoration: underline; }
.research-pub-panel-list em { font-style: italic; }

/* ----------------------------------------------------------------
   NUNO STANDALONE PAGE
   ---------------------------------------------------------------- */
.nuno-page-body { background: var(--white); }

.nuno-hero {
  background: var(--navy);
  padding: 8rem 0 4rem;
  position: relative;
  overflow: hidden;
}
.nuno-hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(13,148,136,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(13,148,136,.07) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}
.nuno-hero-inner {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 3rem;
  align-items: center;
}
@media (max-width: 760px) {
  .nuno-hero-inner { grid-template-columns: 1fr; text-align: center; }
  .nuno-hero-photo { margin: 0 auto; }
}
.nuno-hero-photo {
  width: 220px;
  height: 280px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 3px solid rgba(13,148,136,.4);
}
.nuno-hero-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center top;
}
.nuno-hero-name {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--white);
  font-weight: 900;
  margin-bottom: .5rem;
}
.nuno-hero-title {
  font-size: 1rem;
  color: var(--teal);
  font-weight: 500;
  margin-bottom: 1.25rem;
  letter-spacing: .02em;
}
.nuno-hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1.25rem;
}
.nuno-cv-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem 1rem;
  border-radius: 8px;
  font-size: .82rem;
  font-weight: 500;
  color: var(--white);
  background: var(--teal);
  text-decoration: none;
  transition: background var(--transition);
}
.nuno-cv-btn:hover { background: var(--teal-light); color: var(--white); }
.nuno-cv-btn.outline {
  background: transparent;
  border: 1.5px solid rgba(255,255,255,.3);
  color: rgba(255,255,255,.75);
}
.nuno-cv-btn.outline:hover { border-color: var(--teal); color: var(--teal); background: transparent; }

/* Nuno page section layout */
.nuno-content {
  padding: 4rem 0;
  background: var(--white);
}
.nuno-section-label {
  display: block;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: .5rem;
}
.nuno-section-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--navy);
  margin-bottom: 1.5rem;
  padding-bottom: .75rem;
  border-bottom: 2px solid var(--border);
}

.nuno-bg-text p {
  color: #374151;
  font-size: 1rem;
  line-height: 1.85;
  margin-bottom: 1rem;
}

/* Press section */
.press-group { margin-bottom: 2rem; }
.press-group-title {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: .5rem;
}
.press-items {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.press-items li {
  font-size: .88rem;
  color: var(--slate);
  padding-left: 1rem;
  position: relative;
  line-height: 1.6;
}
.press-items li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--teal);
}
.press-items li a { color: var(--navy); }
.press-items li a:hover { color: var(--teal); }

/* Nuno publications — using same pub-timeline but lighter */
.nuno-pub-year { margin-bottom: 1.5rem; }
.nuno-pub-year-label {
  font-family: var(--font-body);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: .5rem;
  padding: .25rem 0;
  border-bottom: 1px solid var(--border);
}
.nuno-pub-entry {
  font-size: .9rem;
  color: var(--slate);
  line-height: 1.7;
  padding: .65rem 0;
  border-bottom: 1px solid rgba(226,232,240,.6);
}
.nuno-pub-entry a { color: var(--navy); font-weight: 500; }
.nuno-pub-entry a:hover { color: var(--teal); }
.nuno-pub-entry em { color: #475569; }
.nuno-pub-entry .pub-note {
  font-size: .78rem;
  color: var(--teal);
  margin-top: .25rem;
  display: block;
}
.nuno-star { color: var(--teal); font-weight: 700; margin-right: .3rem; }

/* Nuno page tab navigation */
.nuno-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 2.5rem;
  overflow-x: auto;
}
.nuno-tab-btn {
  padding: .75rem 1.5rem;
  font-size: .88rem;
  font-weight: 500;
  color: var(--slate);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  font-family: var(--font-body);
  transition: color var(--transition), border-color var(--transition);
  white-space: nowrap;
}
.nuno-tab-btn:hover { color: var(--teal); }
.nuno-tab-btn.active { color: var(--teal); border-bottom-color: var(--teal); }

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

/* ── BIOMICS news block ──────────────────────────────────────────── */
.biomics-news-block {
  background: linear-gradient(135deg, #0D1B2A 0%, #1a3a5c 100%);
  border-radius: var(--radius);
  padding: 2rem 2rem 2.25rem;
  margin-bottom: 3rem;
  color: var(--white);
}
.biomics-news-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: .75rem;
}
.biomics-news-logo {
  height: 2.8rem;
  width: auto;
  display: block;
  margin-bottom: .75rem;
  /* invert the dark logo so it appears white on the dark section background */
  filter: brightness(0) invert(1);
}
.biomics-news-label {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--teal-on-dark); /* lighter teal — WCAG AA on dark bg */
}
.biomics-news-more {
  font-size: .82rem;
  font-weight: 600;
  color: rgba(255,255,255,.6);
  text-decoration: none;
  transition: color var(--transition);
}
.biomics-news-more:hover { color: var(--white); }
.biomics-news-desc {
  font-size: .9rem;
  color: rgba(255,255,255,.72);
  line-height: 1.65;
  max-width: 640px;
  margin: 0 0 1.5rem;
}
.biomics-news-desc a { color: var(--teal-on-dark); text-decoration: none; } /* lighter teal on dark bg */
.biomics-news-desc a:hover { text-decoration: underline; }
.biomics-video-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
@media (max-width: 700px) {
  .biomics-video-grid { grid-template-columns: 1fr; }
}
.biomics-video-card {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.biomics-video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
}
.biomics-video-thumb-wrap {
  cursor: pointer;
  overflow: hidden;
  background: #000;
}
.biomics-video-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .25s ease, opacity .25s ease;
}
.biomics-video-thumb-wrap:hover .biomics-video-thumb,
.biomics-video-thumb-wrap:focus-visible .biomics-video-thumb {
  transform: scale(1.04);
  opacity: .85;
}
.biomics-video-play-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: transform .2s ease;
}
.biomics-video-thumb-wrap:hover .biomics-video-play-btn,
.biomics-video-thumb-wrap:focus-visible .biomics-video-play-btn {
  transform: scale(1.12);
}
.biomics-video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}
.biomics-video-info {
  padding: 1rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.biomics-video-tag {
  display: block;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: .5rem;
}
.biomics-video-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
  line-height: 1.4;
  margin-bottom: .4rem;
}
.biomics-video-desc {
  font-size: .82rem;
  color: rgba(255,255,255,.55);
  line-height: 1.5;
  margin-bottom: .5rem;
}
.biomics-video-date {
  font-size: .75rem;
  color: rgba(255,255,255,.35);
}
.biomics-video-card--soon {
  opacity: .65;
  border-style: dashed;
}
.biomics-video-soon-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.04);
}
/* ── BIOMICS news card grid ── */
.biomics-news-feed {
  border-top: 1px solid rgba(255,255,255,.12);
  padding-top: 1.25rem;
}
.biomics-news-feed-label {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: rgba(255,255,255,.45);
  margin-bottom: .9rem;
}
/* Horizontal scrolling card row */
.biomics-news-items {
  display: flex;
  gap: .85rem;
  overflow-x: auto;
  padding-bottom: .5rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.15) transparent;
}
.biomics-news-items::-webkit-scrollbar { height: 4px; }
.biomics-news-items::-webkit-scrollbar-track { background: transparent; }
.biomics-news-items::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 2px; }

/* Individual card */
.biomics-news-card {
  flex: 0 0 200px;
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  transition: background .18s, transform .18s, border-color .18s;
}
.biomics-news-card:hover {
  background: rgba(255,255,255,.13);
  border-color: rgba(255,255,255,.22);
  transform: translateY(-3px);
}
/* Photo area */
.biomics-nc-img-wrap {
  width: 100%;
  height: 110px;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(255,255,255,.06);
}
.biomics-nc-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.biomics-nc-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20,184,166,.12);
}
/* Card body */
.biomics-nc-body {
  padding: .65rem .75rem .75rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  flex: 1;
}
.biomics-nc-title {
  font-size: .78rem;
  font-weight: 500;
  color: rgba(255,255,255,.88);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.biomics-nc-date {
  font-size: .68rem;
  color: rgba(255,255,255,.4);
}
.biomics-nc-read {
  font-size: .7rem;
  color: var(--teal-on-dark);
  margin-top: auto;
  padding-top: .4rem;
}
/* "See all news" card */
.biomics-nc-seemore .biomics-nc-img-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20,184,166,.1);
}
.biomics-nc-seemore-body {
  justify-content: center;
  align-items: center;
  text-align: center;
}
.biomics-nc-seemore .biomics-nc-title {
  font-weight: 600;
  color: rgba(255,255,255,.75);
  -webkit-line-clamp: 2;
}
.biomics-nc-seemore .biomics-nc-read {
  color: var(--teal-on-dark);
  font-size: .75rem;
}
.biomics-news-loading {
  font-size: .82rem;
  color: rgba(255,255,255,.35);
  padding: .5rem 0;
}
@media (max-width: 600px) {
  .biomics-news-card { flex: 0 0 165px; }
  .biomics-nc-img-wrap { height: 90px; }
}

.biomics-action-btns {
  display: flex;
  gap: .85rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  align-items: center;
}
/* Prominent YouTube CTA inside BIOMICS block */
.biomics-yt-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: #FF0000;
  color: #fff !important;
  border: none !important;
  padding: .6rem 1.35rem;
  border-radius: 2rem;
  font-size: .85rem;
  font-weight: 700;
  text-decoration: none;
  transition: opacity var(--transition);
}
.biomics-yt-btn:hover { opacity: .85; }

/* ── News subsection headings ────────────────────────────────────── */
.news-subsection-header {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--slate);
  margin: 2.5rem 0 1rem;
}

/* ── Lab News section wrapper ────────────────────────────────────── */
.lab-news-wrap {
  background: var(--fog);
  border-radius: 14px;
  padding: 2rem 2rem 1.5rem;
  margin-bottom: 0;
}

/* Visual separator between lab news and Bluesky */
.news-section-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border), transparent);
  margin: 2.5rem 0;
}

/* "See all news" link */
.lab-news-see-all {
  text-align: center;
  margin-top: 1.25rem;
}
.lab-news-see-all-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: var(--navy);
  color: var(--white) !important;
  padding: .6rem 1.5rem;
  border-radius: 2rem;
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity var(--transition);
}
.lab-news-see-all-btn:hover { opacity: .82; }

/* ── Lab News horizontal card list ───────────────────────────────── */
.lab-news-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 0;
}

.lab-news-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: row;
  cursor: pointer;
  transition: box-shadow var(--transition), transform var(--transition);
  outline: none;
  min-height: 160px;
}
.lab-news-card:hover,
.lab-news-card:focus-visible {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

/* Image column — fixed width, uniform height */
.lab-news-card-img {
  flex: 0 0 260px;
  width: 260px;
  height: 180px;
  overflow: hidden;
  flex-shrink: 0;
}
.lab-news-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease;
}
.lab-news-card:hover .lab-news-card-img img {
  transform: scale(1.04);
}

/* Content column */
.lab-news-card-body {
  padding: 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  flex: 1;
}

.lab-news-date {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--teal);
}

.lab-news-card-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--navy);
  margin: 0;
}

.lab-news-card-summary {
  font-size: .92rem;
  line-height: 1.65;
  color: var(--slate);
  margin: 0;
  flex: 1;
}

.lab-news-read-more {
  font-size: .78rem;
  font-weight: 600;
  color: var(--teal);
  margin-top: .5rem;
  display: inline-block;
  transition: color var(--transition);
}
.lab-news-card:hover .lab-news-read-more { color: var(--teal-light); }

@media (max-width: 640px) {
  .lab-news-card { flex-direction: column; min-height: 0; }
  .lab-news-card-img { flex: none; width: 100%; height: 200px; }
  .lab-news-card-body { padding: 1.25rem 1.4rem; }
}

/* ── Lab News Modal ──────────────────────────────────────────────── */
.lab-news-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.lab-news-modal.open {
  display: flex;
}

.lab-news-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 20, 40, .65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.lab-news-modal-box {
  position: relative;
  background: var(--white);
  border-radius: 14px;
  max-width: 680px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 2.5rem 2.5rem 2rem;
  box-shadow: 0 24px 64px rgba(0,0,0,.28);
  animation: modal-in .22s ease;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
@media (max-width: 560px) {
  .lab-news-modal-box { padding: 2rem 1.4rem 1.5rem; border-radius: 10px; }
}

.lab-news-modal-close {
  position: absolute;
  top: 1rem;
  right: 1.1rem;
  width: 32px; height: 32px;
  border: none;
  background: var(--fog);
  border-radius: 50%;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  color: var(--slate);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.lab-news-modal-close:hover { background: var(--border); color: var(--navy); }

.lab-news-modal-meta {
  margin-bottom: .6rem;
}
.lab-news-modal-date {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--teal);
}

.lab-news-modal-title {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--navy);
  margin: 0 0 1.25rem;
}
@media (max-width: 560px) {
  .lab-news-modal-title { font-size: 1.25rem; }
}

.lab-news-modal-img-wrap {
  margin-bottom: 1.25rem;
}
.lab-news-modal-img-wrap img {
  width: 100%;
  border-radius: 8px;
  display: block;
  max-height: none;
  object-fit: contain;
  cursor: zoom-in;
}

/* Multi-image gallery in modal */
.news-modal-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .5rem;
  border-radius: 8px;
  overflow: hidden;
}
.news-modal-gallery img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  border-radius: 4px;
  cursor: zoom-in;
  transition: opacity .2s;
}
.news-modal-gallery img:hover { opacity: .85; }

/* ── Photo lightbox ──────────────────────────────────────────── */
.photo-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(0,0,0,.92);
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
.photo-lightbox.open { display: flex; }
.photo-lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 8px 48px rgba(0,0,0,.6);
  cursor: default;
}
.photo-lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: rgba(255,255,255,.8);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: .25rem .5rem;
  transition: color .2s;
}
.photo-lightbox-close:hover { color: #fff; }

.lab-news-modal-body {
  font-size: .95rem;
  line-height: 1.75;
  color: var(--navy);
}
.lab-news-modal-body p { margin: 0 0 1rem; }
.lab-news-modal-body ul,
.lab-news-modal-body ol { padding-left: 1.5rem; margin: 0 0 1rem; }
.lab-news-modal-body li { margin-bottom: .35rem; }
.lab-news-modal-body a { color: var(--teal); text-decoration: none; }
.lab-news-modal-body a:hover { text-decoration: underline; }
.lab-news-modal-body strong { font-weight: 600; }
