/* ============================================================
   Vallurupalli Lab — stylesheet
   Palette drawn from Dana-Farber and Broad Institute branding:
   navy, blue, white, warm grays, with orange used sparingly.
   Type: Helvetica Neue — Light (300) for display, Regular (400)
   for body, Bold (700) for section headings and UI.
   Edit the :root block to re-theme the entire site.
   ============================================================ */

:root {
  /* --- Blues (Dana-Farber / Broad inspired) --- */
  --navy:        #002d5c;   /* deepest — footer, headings */
  --navy-2:      #003f7d;
  --blue:        #0b5ea8;   /* primary interactive blue */
  --blue-light:  #2e86d4;
  --blue-tint:   #eaf2fa;   /* pale wash for alternating sections */
  --blue-tint-2: #d7e6f5;

  /* --- Orange (used sparingly — accents, hover, emphasis) --- */
  --orange:      #e8762c;   /* the pop — rules, hovers, borders, graphics */
  --orange-deep: #b54e10;   /* darker cousin, used wherever orange is TEXT
                               (passes WCAG AA on white and on the blue tint) */
  --orange-tint: #fdf0e6;

  /* --- Neutrals --- */
  --white:       #ffffff;
  --paper:       #fafbfc;   /* page background */
  --gray-50:     #f4f6f8;
  --gray-100:    #e8ecf1;
  --gray-200:    #d5dce4;   /* borders */
  --gray-400:    #94a1b0;
  --gray-600:    #5b6875;   /* secondary text */
  --gray-800:    #2a3441;   /* body text */

  /* --- Semantic aliases (used throughout) --- */
  --bg:        var(--white);
  --bg-2:      var(--blue-tint);
  --surface:   var(--white);
  --surface-2: var(--gray-50);
  --line:      var(--gray-200);
  --text:      var(--gray-800);
  --heading:   var(--navy);
  --muted:     var(--gray-600);
  --dim:       var(--gray-400);
  --accent:    var(--blue);
  --accent-2:  var(--orange);

  /* --- Type --- */
  --font: "Helvetica Neue", Helvetica, Arial, "Liberation Sans", sans-serif;
  --w-light:   300;
  --w-regular: 400;
  --w-bold:    700;

  /* --- Layout --- */
  --max:  1180px;
  --pad:  clamp(1.25rem, 5vw, 3rem);
  --nav-h: 74px;
  --radius: 8px;
  --shadow-sm: 0 1px 2px rgba(0, 45, 92, .06);
  --shadow:    0 4px 20px rgba(0, 45, 92, .08);
  --shadow-lg: 0 18px 50px rgba(0, 45, 92, .14);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  font-weight: var(--w-regular);
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; transition: color .18s ease; }
a:hover { color: var(--orange-deep); }

/* Headings — Helvetica Neue Light for display, Bold for structure */
h1, h2, h3, h4 { font-family: var(--font); color: var(--heading); margin: 0 0 .6em; }
h1 {
  font-weight: var(--w-light);
  font-size: clamp(2.3rem, 5.6vw, 4rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
}
h2 {
  font-weight: var(--w-bold);
  font-size: clamp(1.6rem, 3.1vw, 2.3rem);
  line-height: 1.2;
  letter-spacing: -0.018em;
}
h3 {
  font-weight: var(--w-bold);
  font-size: clamp(1.05rem, 1.8vw, 1.22rem);
  line-height: 1.35;
  letter-spacing: -0.008em;
}
h4 { font-weight: var(--w-bold); }
p  { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }
strong, b { font-weight: var(--w-bold); }

/* Accessibility */
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 3px; }
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--navy); color: #fff; padding: .75rem 1.25rem; font-weight: var(--w-bold);
}
.skip-link:focus { left: 0; }

/* ---------- Layout helpers ---------- */
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--pad); }
.section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }
.section--alt { background: var(--bg-2); }
.narrow { max-width: 760px; }
.center { text-align: center; margin-inline: auto; }

.eyebrow {
  font-size: .74rem; font-weight: var(--w-bold);
  letter-spacing: .17em; text-transform: uppercase;
  color: var(--orange-deep);
  margin: 0 0 1rem;
  display: flex; align-items: center; gap: .7rem;
}
.eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--orange); flex: none; }
.center .eyebrow { justify-content: center; }

.lede {
  font-size: clamp(1.05rem, 1.7vw, 1.26rem);
  font-weight: var(--w-light);
  color: var(--gray-600);
  line-height: 1.6;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--font); font-weight: var(--w-bold); font-size: .92rem;
  letter-spacing: .005em;
  padding: .82rem 1.55rem; border-radius: 4px;
  border: 1.5px solid transparent; cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--navy); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--blue); color: #fff; box-shadow: var(--shadow); }
.btn--ghost { border-color: var(--gray-200); color: var(--navy); background: transparent; }
.btn--ghost:hover { border-color: var(--orange); color: var(--orange-deep); background: var(--orange-tint); }
.btn-row { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }

/* ---------- Navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center;
  background: rgba(255, 255, 255, .93);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav__inner {
  width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--pad);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
/* Wordmark: the surname carries the weight, "Lab" sits back.
   The <span> in the markup wraps "Lab", so these two rules are the
   only place the emphasis is decided. */
.nav__brand {
  font-size: 1.12rem; font-weight: var(--w-bold);
  color: var(--navy); letter-spacing: -.018em; white-space: nowrap;
  display: inline-flex; align-items: center; gap: var(--logo-gap, .42rem);
}
/* Logo sizing. The SVG viewBox is padded so the ring is centred in its own box,
   so tweak these two numbers rather than the artwork if it needs rebalancing. */
.brand__logo {
  display: block; flex: 0 0 auto;
  width: var(--logo-size, 38px); height: var(--logo-size, 38px);
  transform: translateY(var(--logo-nudge, -1px));  /* optical: sit on the wordmark's cap height, not the line box */
}
.brand__logo--footer { --logo-size: 36px; }
@media (max-width: 640px) {
  /* --logo-gap must be set on .nav__brand: that is the element whose `gap` reads it. */
  .nav__brand { --logo-gap: .38rem; }
  .brand__logo { --logo-size: 32px; }
}
.nav__brand .brand__text { font-weight: inherit; }
.nav__brand .brand__text span { font-weight: var(--w-light); letter-spacing: -.005em; }
.nav__brand:hover { color: var(--navy); }
.nav__links { display: flex; align-items: center; gap: .1rem; list-style: none; margin: 0; padding: 0; }
.nav__links a {
  display: block; padding: .5rem .68rem; border-radius: 4px;
  color: var(--gray-600); font-size: .875rem; font-weight: var(--w-regular);
}
.nav__links a:hover { color: var(--navy); background: var(--gray-50); }
.nav__links a[aria-current="page"] {
  color: var(--navy); font-weight: var(--w-bold);
  box-shadow: inset 0 -2px 0 var(--orange);
  border-radius: 0;
}
.nav__toggle {
  display: none; background: none; border: 1px solid var(--line);
  border-radius: 4px; padding: .5rem .7rem; cursor: pointer; color: var(--navy);
}
.nav__toggle svg { display: block; }

@media (max-width: 980px) {
  .nav__toggle { display: block; }
  .nav__links {
    position: fixed; inset: var(--nav-h) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--white); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    padding: .5rem var(--pad) 1.25rem;
    max-height: calc(100dvh - var(--nav-h)); overflow-y: auto;
    transform: translateY(-8px); opacity: 0; pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
  }
  .nav__links.is-open { transform: none; opacity: 1; pointer-events: auto; }
  .nav__links a { padding: .85rem .25rem; font-size: 1rem; border-bottom: 1px solid var(--gray-100); }
  .nav__links a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--orange); padding-left: .8rem; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background: var(--white);
  padding: clamp(4rem, 10vw, 8rem) 0 clamp(3.5rem, 8vw, 6rem);
  border-bottom: 1px solid var(--line);
}
/* Soft blue wash + faint grid — no image files needed */
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto -10%; height: 125%;
  background:
    radial-gradient(45% 55% at 82% 8%,  rgba(11, 94, 168, .13), transparent 66%),
    radial-gradient(38% 45% at 12% 4%,  rgba(46, 134, 212, .09), transparent 66%),
    radial-gradient(34% 42% at 95% 62%, rgba(232, 118, 44, .10), transparent 68%);
  pointer-events: none;
}
/* Even fine grid, one weight. Nudge --grid-line if you want it stronger. */
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .55;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 62px 62px;
  mask-image: radial-gradient(72% 62% at 62% 30%, #000 12%, transparent 76%);
  -webkit-mask-image: radial-gradient(72% 62% at 62% 30%, #000 12%, transparent 76%);
}
.hero .wrap { position: relative; z-index: 1; }
.hero h1 { max-width: 16ch; }
.hero .lede { max-width: 56ch; }
.hero--page { padding: clamp(2.75rem, 6vw, 4.5rem) 0 clamp(2.25rem, 5vw, 3.25rem); }
.hero--page h1 { max-width: 22ch; }

/* Emphasis word inside the hero headline */
.hl { color: var(--blue); font-weight: var(--w-regular); }

/* Hero grid line weight. The site launched at .07; this is a hair above it.
   .07 = original   ·   .095 = current   ·   .13 = clearly visible */
:root { --grid-line: rgba(0, 45, 92, .095); }

/* ---------- Stat strip ---------- */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; margin-top: 3rem;
  box-shadow: var(--shadow-sm);
}
.stat { background: var(--white); padding: 1.5rem 1.4rem; }
.stat__n {
  font-size: 2rem; font-weight: var(--w-light); color: var(--navy);
  line-height: 1; letter-spacing: -.03em;
}
.stat:nth-child(3) .stat__n { color: var(--orange-deep); }
.stat__l { font-size: .8rem; color: var(--muted); margin-top: .55rem; line-height: 1.45; }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 1.4rem; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(275px, 1fr)); }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.8rem 1.65rem;
  box-shadow: var(--shadow-sm);
  transition: border-color .22s ease, transform .22s ease, box-shadow .22s ease;
}
.card:hover { border-color: var(--blue-light); transform: translateY(-3px); box-shadow: var(--shadow); }
.card h3 { margin-bottom: .55rem; }
.card p { color: var(--muted); font-size: .95rem; }
.card__num {
  font-size: .72rem; font-weight: var(--w-bold);
  letter-spacing: .15em; text-transform: uppercase;
  color: var(--orange-deep); margin-bottom: .85rem;
}

/* A card that deserves more room than its neighbours.
   Spans the full grid width and gets an orange left edge for emphasis. */
.card--wide {
  grid-column: 1 / -1;
  border-left: 3px solid var(--orange);
}
.card--wide p:last-child { color: var(--gray-800); }
.card--wide strong { color: var(--navy); }

/* Research theme card with a colored spine */
.theme { position: relative; padding-left: 2.1rem; }
.theme::before {
  content: ""; position: absolute; left: 1.05rem; top: 1.8rem; bottom: 1.8rem;
  width: 3px; border-radius: 3px;
  background: linear-gradient(180deg, var(--blue), var(--blue-tint-2));
}
.theme:hover::before { background: linear-gradient(180deg, var(--orange), var(--orange-tint)); }

/* ---------- People grid (hover reveals bio) ---------- */
.people-grid {
  display: grid; gap: 1.35rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.person {
  position: relative; border-radius: var(--radius);
  background: var(--gray-50); border: 1px solid var(--line);
  aspect-ratio: 3 / 4;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  z-index: 0;
  transition: border-color .25s ease, transform .25s ease, box-shadow .25s ease;
}
/* the hovered card must sit above its neighbours so the popover is not clipped */
.person:hover, .person:focus-within, .person.is-open {
  border-color: var(--blue-light); transform: translateY(-3px); box-shadow: var(--shadow);
  z-index: 30;
}
.person__img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border-radius: calc(var(--radius) - 1px);
  object-fit: cover; object-position: center 22%;
  transition: transform .5s cubic-bezier(.2,.7,.3,1), filter .35s ease;
  filter: grayscale(.2) contrast(1.02);
}
.person:hover .person__img, .person.is-open .person__img { filter: none; }

/* Always-visible name bar — stays put now, the bio appears beside it */
.person__bar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 2.2rem 1.1rem 1rem;
  background: linear-gradient(transparent, rgba(0, 32, 64, .86) 58%);
  border-radius: 0 0 calc(var(--radius) - 1px) calc(var(--radius) - 1px);
}
.person__name { font-weight: var(--w-bold); font-size: 1rem; color: #fff; letter-spacing: -.005em; }
.person__role { font-size: .79rem; color: #ffcda5; margin-top: .18rem; font-weight: var(--w-regular); }

/* ============================================================
   BIO POPOVER

   Fixed width, height grows to fit the text — nothing is ever cut
   off and nothing scrolls. It lives inside .person, so moving the
   cursor from the photo onto the popover keeps the card hovered:
   no flicker, and the links stay clickable.

   DEFAULT: opens below the photo. Used by the team and alumni grids.
   ============================================================ */
.person__panel {
  position: absolute; z-index: 40;
  top: calc(100% + 8px); left: 50%;
  width: min(330px, 84vw);
  padding: 1.1rem 1.25rem 1.15rem;
  text-align: left;
  background: var(--white);
  border: 1px solid var(--blue-tint-2);
  border-top: 3px solid var(--orange);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translate(-50%, -6px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.person:hover .person__panel,
.person:focus-within .person__panel,
.person.is-open .person__panel {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translate(-50%, 0);
}
/* bridge the gap so the cursor can cross without dropping hover */
.person__panel::before {
  content: ""; position: absolute; left: 0; right: 0; top: -11px; height: 11px;
}

/* ---- PI card only: open to the SIDE, vertically centred ----
   The PI sits alone in a 520px row, so there is room beside it.
   main.js flips it to the left (.is-left) if the right would overflow. */
@media (min-width: 761px) {
  .people-grid--pi .person__panel {
    top: 50%; left: calc(100% + 10px);
    border-top: 1px solid var(--blue-tint-2);
    border-left: 3px solid var(--orange);
    transform: translate(-8px, -50%);
  }
  .people-grid--pi .person:hover .person__panel,
  .people-grid--pi .person:focus-within .person__panel,
  .people-grid--pi .person.is-open .person__panel { transform: translate(0, -50%); }
  .people-grid--pi .person__panel::before {
    top: 0; bottom: 0; left: -13px; right: auto; width: 13px; height: auto;
  }
  .people-grid--pi .person__panel.is-left {
    left: auto; right: calc(100% + 10px);
    border-left: 1px solid var(--blue-tint-2);
    border-right: 3px solid var(--orange);
    transform: translate(8px, -50%);
  }
  .people-grid--pi .person:hover .person__panel.is-left,
  .people-grid--pi .person:focus-within .person__panel.is-left,
  .people-grid--pi .person.is-open .person__panel.is-left { transform: translate(0, -50%); }
  .people-grid--pi .person__panel.is-left::before { left: auto; right: -13px; }
}

/* Narrow screens: no room beside anything, so everything stacks below */
@media (max-width: 760px) {
  .person__panel { width: 84vw; }
}
.person__panel h3 { font-size: 1rem; margin-bottom: .1rem; color: var(--navy); }
.person__panel .person__role { color: var(--orange-deep); margin-bottom: .75rem; font-weight: var(--w-bold); }
.person__panel p { font-size: .855rem; line-height: 1.55; color: var(--muted); margin-bottom: .65rem; }
.person__panel p:last-of-type { margin-bottom: 0; }
.person__panel strong { color: var(--navy); }
.person__links { display: flex; flex-wrap: wrap; gap: .9rem; font-size: .82rem; margin-top: .8rem; }
.person__links a { color: var(--blue); font-weight: var(--w-bold); }
.person__links a:hover { color: var(--orange-deep); }


/* Tap hint on touch devices */
.person__hint {
  position: absolute; top: .75rem; right: .75rem; z-index: 4;
  width: 27px; height: 27px; border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  display: none; align-items: center; justify-content: center;
  color: var(--navy); font-size: .85rem; font-weight: var(--w-bold);
  box-shadow: var(--shadow-sm);
}
body.is-touch .person__hint { display: flex; }

/* Alumni — same card treatment as the team, one step smaller so the
   current team still reads as the primary group on the page. */
.people-grid--alumni { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1.1rem; }
.people-grid--alumni .person__bar { padding: 1.9rem .95rem .85rem; }
.people-grid--alumni .person__name { font-size: .92rem; }
.people-grid--alumni .person__role { font-size: .74rem; }
.people-grid--alumni .person__panel { width: min(290px, 84vw); padding: 1rem 1.1rem 1.05rem; }
.people-grid--alumni .person__panel h3 { font-size: .93rem; }
.people-grid--alumni .person__panel p { font-size: .8rem; margin-bottom: .5rem; }

/* "Now: ..." line — where the alumnus went next */
.person__next {
  margin-top: .55rem; padding-top: .55rem;
  border-top: 1px solid var(--gray-100);
  color: var(--orange-deep) !important; font-weight: var(--w-bold);
}

/* ============================================================
   HORIZONTAL PHOTO REEL  (Lab Fun)

   Native horizontal scrolling with snap points, so trackpad, touch
   swipe, shift+wheel and keyboard arrows all work without any script.
   The arrow buttons are a convenience layer on top.
   ============================================================ */
.reel-wrap { position: relative; }

.reel {
  display: flex; gap: 1.1rem;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: .25rem .25rem 1rem;
  /* thin, on-palette scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--gray-200) transparent;
}
.reel::-webkit-scrollbar { height: 8px; }
.reel::-webkit-scrollbar-track { background: var(--gray-50); border-radius: 4px; }
.reel::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 4px; }
.reel::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* one slide: photo on top, caption printed underneath */
.reel .shot {
  flex: 0 0 clamp(255px, 40vw, 430px);
  scroll-snap-align: center;
  display: flex; flex-direction: column;
  height: auto; aspect-ratio: auto;
  background: transparent; border: 0; box-shadow: none;
  padding: 0;
}
.reel .shot img {
  width: 100%; height: auto; aspect-ratio: 4 / 3;
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: border-color .22s ease, box-shadow .22s ease, transform .22s ease;
}
.reel .shot:hover { transform: none; }
.reel .shot:hover img { border-color: var(--blue-light); box-shadow: var(--shadow); transform: translateY(-3px); }

/* caption always visible — this is the single place captions are edited */
.reel .shot__cap {
  position: static; transform: none; opacity: 1;
  background: none; color: var(--muted);
  font-size: .85rem; line-height: 1.5;
  padding: .8rem .15rem 0; text-align: left;
}
.reel .shot__zoom { top: .7rem; right: .7rem; }

/* arrows */
.reel-nav {
  position: absolute; top: calc(50% - 1.6rem); z-index: 5;
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .96);
  border: 1px solid var(--gray-200); color: var(--navy);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease, opacity .18s ease;
}
.reel-nav:hover { background: var(--navy); color: #fff; border-color: var(--navy); }
.reel-nav--prev { left: -14px; }
.reel-nav--next { right: -14px; }
.reel-nav[disabled] { opacity: 0; pointer-events: none; }

@media (max-width: 760px) {
  .reel .shot { flex-basis: 82vw; }
  .reel-nav { display: none; }   /* swipe is the natural gesture here */
}

/* ---------- Lab Fun / featured gallery ---------- */
.gallery {
  display: grid; gap: .95rem;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  grid-auto-rows: 210px;
}
.shot {
  position: relative; overflow: hidden; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--gray-50);
  cursor: zoom-in; padding: 0; margin: 0; display: block; width: 100%; height: 100%;
  box-shadow: var(--shadow-sm);
  transition: border-color .22s ease, transform .22s ease, box-shadow .22s ease;
}
.shot--wide { grid-column: span 2; }
.shot--tall { grid-row: span 2; }
@media (max-width: 640px) { .shot--wide { grid-column: span 1; } .shot--tall { grid-row: span 1; } }

.shot img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .55s cubic-bezier(.2,.7,.3,1), filter .3s ease;
}
.shot:hover { border-color: var(--blue-light); transform: translateY(-3px); box-shadow: var(--shadow); }
.shot:hover img { transform: scale(1.06); }

.shot__cap {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 2.2rem .9rem .8rem; text-align: left;
  background: linear-gradient(transparent, rgba(0, 32, 64, .9));
  font-size: .83rem; line-height: 1.45; color: #fff;
  transform: translateY(101%); opacity: 0;
  transition: transform .3s ease, opacity .3s ease;
}
.shot:hover .shot__cap, .shot:focus-visible .shot__cap { transform: none; opacity: 1; }

/* Cover variant — portrait tiles that show the whole image, never cropped.
   Use for journal covers, graphical abstracts, or figure panels. */
.gallery--covers {
  grid-auto-rows: auto;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1.25rem;
}
.gallery--covers .shot {
  aspect-ratio: 3 / 4;
  height: auto;
  background: var(--white);
}
.gallery--covers .shot img {
  object-fit: contain;          /* whole cover visible, whatever its ratio */
  padding: .4rem;
}
.gallery--covers .shot:hover img { transform: scale(1.03); }
.gallery--covers .shot__cap { font-size: .78rem; padding: 1.8rem .8rem .7rem; }

.shot__zoom {
  position: absolute; top: .65rem; right: .65rem; z-index: 3;
  width: 29px; height: 29px; border-radius: 50%;
  background: rgba(255, 255, 255, .95);
  display: grid; place-items: center; color: var(--navy);
  box-shadow: var(--shadow-sm);
  opacity: 0; transform: scale(.82); transition: opacity .25s ease, transform .25s ease;
}
.shot:hover .shot__zoom { opacity: 1; transform: none; }

/* Link variant — the cover is an <a> that opens the paper, not a lightbox
   trigger. Used on the Publications page. */
.shot--link { cursor: pointer; color: inherit; text-decoration: none; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0, 26, 52, .94);
  backdrop-filter: blur(8px);
  display: grid; grid-template-rows: 1fr auto;
  opacity: 0; pointer-events: none;
  transition: opacity .28s ease;
}
.lightbox.is-open { opacity: 1; pointer-events: auto; }
.lightbox__stage {
  position: relative; display: grid; place-items: center;
  padding: 3.5rem 4.5rem 1rem; min-height: 0;
}
.lightbox__img {
  max-width: 100%; max-height: 100%;
  width: auto; height: auto; object-fit: contain;
  border-radius: 6px; box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
  animation: lbIn .38s cubic-bezier(.2,.75,.25,1);
}
@keyframes lbIn { from { opacity: 0; transform: scale(.965); } to { opacity: 1; transform: none; } }

.lightbox__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  padding: 1rem clamp(1rem, 4vw, 3rem) clamp(1.25rem, 3vw, 2rem);
  max-width: 1000px; margin-inline: auto; width: 100%;
}
.lightbox__cap { font-size: .96rem; color: #e7eef6; line-height: 1.55; }
.lightbox__count { font-size: .8rem; font-weight: var(--w-bold); color: #7f9bb8; letter-spacing: .1em; white-space: nowrap; }

.lb-btn {
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .28);
  color: #fff; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}
.lb-btn:hover { background: var(--orange); border-color: var(--orange); color: #fff; transform: scale(1.06); }
.lightbox__close { position: absolute; top: 1.1rem; right: 1.1rem; z-index: 4; }
.lightbox__prev { position: absolute; left: clamp(.5rem, 2vw, 1.5rem); top: 50%; transform: translateY(-50%); z-index: 4; }
.lightbox__next { position: absolute; right: clamp(.5rem, 2vw, 1.5rem); top: 50%; transform: translateY(-50%); z-index: 4; }
.lightbox__prev:hover, .lightbox__next:hover { transform: translateY(-50%) scale(1.06); }
@media (max-width: 640px) { .lightbox__stage { padding: 3.5rem 1rem 1rem; } }

/* ---------- Publications ---------- */
.pub-filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2.25rem; }
.chip {
  font-family: var(--font); font-size: .8rem; font-weight: var(--w-bold);
  padding: .48rem 1rem; border-radius: 999px;
  background: var(--white); border: 1px solid var(--gray-200); color: var(--muted);
  cursor: pointer; transition: all .18s ease;
}
.chip:hover { border-color: var(--orange); color: var(--orange-deep); }
.chip.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }

.pubs { list-style: none; margin: 0; padding: 0; }
.pub {
  display: grid; grid-template-columns: 78px 1fr; gap: 1.4rem;
  padding: 1.5rem 0; border-bottom: 1px solid var(--gray-200);
}
.pub:first-child { border-top: 1px solid var(--gray-200); }
.pub__year { font-weight: var(--w-bold); font-size: 1rem; color: var(--blue); padding-top: .15rem; }
.pub__title { font-weight: var(--w-bold); color: var(--navy); margin-bottom: .35rem; line-height: 1.42; }
.pub__authors { font-size: .885rem; color: var(--muted); margin-bottom: .35rem; }
.pub__authors .me { color: var(--navy); font-weight: var(--w-bold); }
.pub__authors .mentee { color: var(--orange-deep); font-weight: var(--w-bold); }
.pub__meta { font-size: .85rem; color: var(--dim); display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; }
.pub__journal { font-style: italic; color: var(--muted); }
.tag {
  font-size: .67rem; font-weight: var(--w-bold); letter-spacing: .09em; text-transform: uppercase;
  padding: .22rem .5rem; border-radius: 3px;
  background: var(--blue-tint); color: var(--blue); border: 1px solid var(--blue-tint-2);
}
.tag--alt { background: var(--orange-tint); color: var(--orange-deep); border-color: #f6d5b8; }
@media (max-width: 600px) {
  .pub { grid-template-columns: 1fr; gap: .35rem; }
  .pub__year { font-size: .9rem; }
}

/* ---------- Funding ---------- */
.funders { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.funder {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.6rem; box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--blue);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.funder:hover { border-top-color: var(--orange); box-shadow: var(--shadow); transform: translateY(-2px); }
.funder__name { font-weight: var(--w-bold); font-size: 1rem; color: var(--navy); margin-bottom: .35rem; }
.funder__grant { font-size: .9rem; color: var(--muted); margin-bottom: .6rem; }
.funder__years { font-size: .78rem; font-weight: var(--w-bold); color: var(--orange-deep); letter-spacing: .06em; }

/* Logo variant — image on top, organisation name beneath.
   Logos are constrained by height so mixed aspect ratios still line up. */
.funder--logo {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 1rem; padding: 1.75rem 1.5rem;
  color: inherit;   /* cards are <a> elements — don't inherit the blue link colour */
}
.funder--logo img {
  max-height: 62px; width: auto; max-width: 100%;
  object-fit: contain;
  filter: grayscale(1); opacity: .78;
  transition: filter .25s ease, opacity .25s ease;
}
.funder--logo:hover img { filter: none; opacity: 1; }
.funder--logo .funder__name { margin-bottom: 0; font-size: .88rem; line-height: 1.4; }

/* ---------- Callout ---------- */
.callout {
  border: 1px solid var(--blue-tint-2); border-radius: var(--radius);
  background: linear-gradient(135deg, var(--blue-tint), #fff 55%, var(--orange-tint));
  padding: clamp(1.75rem, 4vw, 2.75rem);
  box-shadow: var(--shadow-sm);
}
.section--alt .callout { background: linear-gradient(135deg, #fff, #fff 55%, var(--orange-tint)); }
.checklist { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.checklist li { position: relative; padding-left: 1.85rem; margin-bottom: .75rem; color: var(--muted); }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: .6em;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--orange); box-shadow: 0 0 0 4px var(--orange-tint);
}

/* ---------- Contact ---------- */
.contact-grid { display: grid; gap: 2.25rem; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.contact-block h3 { font-size: 1rem; margin-bottom: .5rem; }
.contact-block p { color: var(--muted); font-size: .95rem; }
.map-embed {
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; aspect-ratio: 16/9; box-shadow: var(--shadow-sm);
}
.map-embed iframe { width: 100%; height: 100%; border: 0; display: block; }

/* Campus card: photo, address, then its own map */
.campus {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
  transition: border-color .22s ease, box-shadow .22s ease, transform .22s ease;
}
.campus:hover { border-color: var(--blue-light); box-shadow: var(--shadow); transform: translateY(-3px); }
.campus__photo {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover;
  border-bottom: 1px solid var(--line);
  filter: grayscale(.25); transition: filter .3s ease;
}
.campus:hover .campus__photo { filter: none; }
.campus__body { padding: 1.4rem 1.5rem 1.25rem; }
.campus__body h3 { margin-bottom: .5rem; }
.campus__body p { color: var(--muted); font-size: .94rem; margin-bottom: .8rem; }
.campus__body a {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .88rem; font-weight: var(--w-bold);
}
.campus .map-embed {
  border: 0; border-top: 1px solid var(--line);
  border-radius: 0; box-shadow: none;
  aspect-ratio: 16 / 8; margin-top: auto;
}

/* ---------- Footer ---------- */
.footer { background: var(--navy); color: #c3d4e6; padding: 3.5rem 0 2.25rem; }
.footer__grid { display: grid; gap: 2rem; grid-template-columns: 1.6fr 1fr 1fr; }
@media (max-width: 760px) { .footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 460px) { .footer__grid { grid-template-columns: 1fr; } }
.footer .nav__brand { color: #fff; }
.footer h4 {
  font-size: .72rem; font-weight: var(--w-bold); letter-spacing: .16em; text-transform: uppercase;
  color: #ffb27a; margin-bottom: 1rem;
}
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: .55rem; }
.footer a { color: #c3d4e6; font-size: .9rem; }
.footer a:hover { color: #fff; }
.footer__bottom {
  margin-top: 2.5rem; padding-top: 1.6rem; border-top: 1px solid rgba(255, 255, 255, .16);
  display: flex; flex-wrap: wrap; gap: .75rem 2rem; justify-content: space-between;
  font-size: .82rem; color: #93aac2;
}

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .55s ease, transform .55s ease; }
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Print ---------- */
@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  .nav, .footer, .lightbox, .hero::before, .hero::after { display: none; }
  a { color: #000; text-decoration: underline; }
}
