/* ============================================================
   PRIME Lab — stylesheet v2
   Palette inspired by the lab logo: deep blue + vibrant green,
   with an orange accent reserved for small highlights.
   Typography: Montserrat (Google Fonts).
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');

:root {
  /* Palette — derived from logo */
  --color-bg: #ffffff;
  --color-surface: #f6f9fc;
  --color-text: #141826;
  --color-muted: #5f6475;
  --color-border: #e3e7ef;

  --color-primary: #1E5FAA;        /* logo blue */
  --color-primary-dark: #164a85;
  --color-primary-soft: #e8f0fb;

  --color-accent: #3FAE63;         /* logo green */
  --color-accent-dark: #2f8d4d;

  --color-highlight: #F08C1F;      /* logo orange — used sparingly */

  /* Typography */
  --font-sans: "Montserrat", "Helvetica Neue", Arial, sans-serif;

  /* Layout */
  --max-width: 1200px;
  --gutter: 1.5rem;
  --radius: 16px;
  --transition: 180ms ease;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

/* Sticky-footer layout: body fills the viewport and main grows to push footer down */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}
/* The last section inside main absorbs any leftover vertical space
   so the footer sits flush at the bottom of the viewport on short pages. */
main > section:last-child {
  flex: 1 0 auto;
}
.site-footer {
  flex-shrink: 0;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-primary); text-decoration: none; transition: color var(--transition); }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--font-sans);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.5em;
  color: var(--color-text);
  letter-spacing: -0.01em;
}
/* Section headings in uppercase, à la the Asquith lab vibe */
h1, h2 {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
h1 { font-size: 3rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.25rem; }

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.section { padding: 5rem 0; }
.section--tight-bottom { padding-bottom: 2.5rem; }
.section--tight-top { padding-top: 2.5rem; }
.section--tight { padding: 3rem 0; }
.section--surface { background: var(--color-surface); }
.text-center { text-align: center; }
.text-primary { color: var(--color-primary); }

/* ---------- Header / Nav ---------- */
.site-header {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 16px rgba(16, 32, 72, 0.05);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 96px;
  gap: 2rem;
}
.site-title a {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}
.site-logo {
  height: 72px;
  width: 72px;
  object-fit: contain;
  display: block;
}
.site-title__text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  /* Constrain the lockup so the tagline wraps beneath the name
     instead of trailing past it */
  max-width: 14rem;
}
.site-title__name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.01em;
}
.site-title__affil {
  font-size: 0.6rem;
  color: var(--color-muted);
  font-weight: 600;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  line-height: 1.35;
}

.nav {
  display: flex;
  gap: 1.75rem;
  align-items: center;
}
.nav a {
  color: var(--color-text);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}
.nav a:hover,
.nav a.is-active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--color-text);
}

/* ---------- Hero ---------- */
.hero {
  padding: 4rem 0 3rem;
  text-align: center;
  position: relative;
}
.hero--banner {
  /* Dramatic full-bleed banner: dark navy gradient over the lab image so
     large white display type reads cleanly. Fills most of the first screen. */
  background-image:
    linear-gradient(165deg, rgba(8,18,40,0.82) 0%, rgba(13,28,60,0.72) 55%, rgba(20,40,82,0.78) 100%),
    url('../images/banner.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  min-height: 86vh;
  display: flex;
  align-items: center;
  padding: 7rem 0;
}
.hero__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-accent);
  margin-bottom: 1.5rem;
}
.hero__title {
  font-size: 3.25rem;
  color: var(--color-primary);
  max-width: 30ch;
  margin: 0 auto;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.005em;
}

/* Banner-variant overrides: white display type on the dark hero */
.hero--banner .hero__eyebrow { color: #7fe0a3; }
.hero--banner .hero__title {
  color: #ffffff;
  font-size: 4.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1.05;
  max-width: 16ch;
  text-shadow: 0 2px 30px rgba(0,0,0,0.35);
}

/* Tagline triad — e.g. "Understand. Predict. Engineer." */
.hero__tagline {
  margin: 1.75rem auto 0;
  color: rgba(255,255,255,0.92);
  font-size: 1.5rem;
  font-weight: 300;
  letter-spacing: 0.04em;
}
.hero__tagline strong {
  font-weight: 600;
  color: #fff;
}
/* Lead variant — used when the triad is the hero's primary heading */
.hero__tagline--lead {
  margin-top: 1rem;
  font-size: 3.5rem;
  line-height: 1.15;
  letter-spacing: 0.005em;
  text-shadow: 0 2px 30px rgba(0,0,0,0.35);
}
.hero__tagline--lead strong { font-weight: 700; }
.hero__actions {
  margin-top: 2.75rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}
.hero__lede {
  max-width: 60ch;
  color: var(--color-muted);
  font-size: 1.1rem;
  margin: 1.5rem auto 0;
}
.vision {
  max-width: 60ch;
  margin: 0 auto;
  color: var(--color-text);
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: -0.005em;
}
.bridge {
  text-align: center;
  color: var(--color-primary);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 2.5rem;
}

/* ---------- Accent band (mission strip) ---------- */
.accent-band {
  background: var(--color-primary);
  color: #fff;
  text-align: center;
  padding: 6rem 0;
}
.accent-band p {
  max-width: 58ch;
  margin: 0 auto;
  font-size: 1.5rem;
  line-height: 1.72;
  letter-spacing: 0.005em;
  color: #fff;
}
.accent-band .btn { margin-top: 2.5rem; }

/* ---------- Welcome / centred intro ---------- */
.welcome {
  max-width: 62ch;
  margin: 0 auto;
  text-align: center;
}
.welcome__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-accent);
  margin: 0 0 1rem;
}
.welcome h2 { color: var(--color-primary); }
.welcome p {
  color: var(--color-muted);
  font-size: 1.15rem;
  line-height: 1.75;
  margin: 1.25rem 0 0;
  /* Contained, justified body copy for a cleaner block edge.
     hyphens: none keeps whole words intact (no mid-word breaks). */
  text-align: justify;
  text-justify: inter-word;
  hyphens: none;
}

/* Shared justified treatment for the main body-copy blocks across pages */
.vision,
.area__body,
.area-hero__lede {
  text-align: justify;
  text-justify: inter-word;
  hyphens: none;
}

/* ---------- Image gallery strip ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 2.75rem;
}
.gallery__item {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: 0 6px 26px rgba(16, 32, 72, 0.10);
}
.gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 320ms ease;
}
.gallery__item:hover img { transform: scale(1.06); }
.gallery--4 { grid-template-columns: repeat(4, 1fr); }

/* Placeholder tiles (swap in real photos later) */
.gallery__item--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-primary-soft) 0%, #eef4fb 100%);
  border: 1px dashed #c5d4e8;
  box-shadow: none;
}
.gallery__item--placeholder span {
  color: var(--color-muted);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.05em;
}
.gallery__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.5rem 1.25rem 1rem;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 500;
  background: linear-gradient(180deg, rgba(8,18,40,0) 0%, rgba(8,18,40,0.78) 100%);
}

/* ---------- Cards / Grid ---------- */
.grid { display: grid; gap: 2rem; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--5 { grid-template-columns: repeat(5, 1fr); }

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: 4px solid var(--color-accent);
  border-radius: var(--radius);
  padding: 1.9rem;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 14px rgba(16, 32, 72, 0.05);
  transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 44px rgba(16, 32, 72, 0.14);
}
.card__title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
  color: var(--color-primary);
}
.card__meta {
  color: var(--color-muted);
  font-size: 0.95rem;
  line-height: 1.65;
}
.card__action {
  margin-top: auto;
  padding-top: 1.25rem;
}

/* ---------- Research area tiles ---------- */
.area {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}
.area__thumb {
  width: 220px;
  height: 220px;
  border-radius: 12px;
  background: var(--color-primary-soft);
  margin: 0 auto 1.75rem;
  object-fit: cover;
  display: block;
  border: 4px solid var(--color-primary-soft);
  transition: transform var(--transition), border-color var(--transition);
}
.area:hover .area__thumb {
  transform: scale(1.03);
  border-color: var(--color-accent);
}
/* Title — reserves space for up to 2 wrapped lines so all three tiles
   align their body text at the same vertical position. */
.area__title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-primary);
  line-height: 1.3;
  min-height: calc(1.25rem * 1.3 * 2);
  margin: 0 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.area__body {
  text-align: left;
  color: var(--color-text);
  font-size: 1rem;
  line-height: 1.7;
  margin: 0 0 1.75rem;
}
.area .btn {
  margin-top: auto;
  align-self: center;
}

/* ---------- Research page — stacked feature layout (Asquith-style) ---------- */
.page-title {
  text-align: center;
  font-size: 3rem;
  color: var(--color-primary);
  margin: 0;
}
/* Full-bleed header illustration that spans the whole page width.
   `contain` shows the whole illustration (no cropping); the white
   letterbox is invisible against the white page background. */
.research-banner-full {
  width: 100%;
  margin-bottom: 2.5rem;
}
.research-banner-full img {
  width: 100%;
  /* Spans the full page width; height scales with the viewport */
  height: clamp(240px, 34vw, 520px);
  object-fit: cover;
  object-position: center;
  display: block;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

/* Alternating image / text rows (Asquith-style) */
.research-rows {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  margin-top: 2rem;
}
.research-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.5rem;
  align-items: center;
  /* Subtle tinted panel to lift each area off the white page */
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2.75rem 3rem;
}
/* Every other row places the image on the right */
.research-row:nth-child(even) .research-row__media { order: 2; }
/* Figures sit ~30% smaller than the column, centred within it,
   with a uniform height so the rows line up tidily */
.research-row__img {
  width: 70%;
  height: 320px;
  object-fit: cover;
  object-position: center;
  margin: 0 auto;
  border-radius: var(--radius);
  display: block;
}
.research-row__title {
  /* Mixed-case (override the global uppercase h2) so the uppercase
     subtitle beneath provides the contrast, à la the Asquith layout. */
  text-transform: none;
  letter-spacing: -0.01em;
  color: var(--color-primary);
  font-size: 2rem;
  margin: 0 0 0.35rem;
}
.research-row__sub {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-accent);
  margin: 0 0 1.5rem;
}
.research-row__body {
  color: var(--color-muted);
  font-size: 1.12rem;
  line-height: 1.8;
  margin: 0 0 1.75rem;
  text-align: justify;
  text-justify: inter-word;
  hyphens: none;
}

/* ---------- Research area detail page: hero with figure + title ---------- */
.area-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3rem;
  align-items: center;
}
.area-hero__thumb {
  width: 320px;
  height: 320px;
  border-radius: 12px;
  object-fit: cover;
  border: 4px solid var(--color-primary-soft);
  display: block;
}
.area-hero__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-accent);
  margin: 0 0 0.75rem;
}
.area-hero__title {
  font-size: 2.5rem;
  color: var(--color-primary);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 1rem;
}
.area-hero__lede {
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--color-text);
  margin: 0;
}

/* ---------- Publications-related-to-area block ---------- */
.section--publications { background: var(--color-primary-soft); }
.pub-area-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: grid;
  gap: 0.65rem;
}
.pub-area-item {
  /* Tinted panel box, matching the research-page area panels */
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem 1.35rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.pub-area-item__citation {
  flex: 1 1 0;
  min-width: 260px;
  color: var(--color-text);
  line-height: 1.5;
}
.pub-area-item .btn {
  flex: 0 0 auto;
}
.pub-area-item__figure {
  flex: 0 0 auto;
  display: block;
  line-height: 0;
  border-radius: 10px;
  overflow: hidden;
  background: var(--color-primary-soft);
  border: 2px solid transparent;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.pub-area-item__figure img {
  display: block;
  width: auto;
  height: auto;
  max-width: 400px;
  max-height: 280px;
}
.pub-area-item__figure:hover {
  border-color: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 32, 72, 0.10);
}

/* ---------- People grid ---------- */
.person { text-align: center; }
.person__photo {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: var(--color-primary-soft);
  margin: 0 auto 0.75rem;
  object-fit: cover;
}
.person__name { font-weight: 600; }
.person__role { color: var(--color-muted); font-size: 0.9rem; }

/* ---------- People page (team cards, de Lázaro-style) ---------- */
.people-intro {
  max-width: 56ch;
  margin: 1.25rem auto 0;
  text-align: center;
  font-size: 1.3rem;
  line-height: 1.5;
  font-weight: 500;
  color: var(--color-text);
}
.people-group-photo {
  width: 100%;
  max-width: 780px;
  margin: 2.5rem auto 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  display: block;
}
.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}
.person-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: inherit;
  text-decoration: none;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.75rem 1.25rem;
  transition: transform var(--transition), box-shadow var(--transition);
}
.person-card:hover {
  color: inherit;
  text-decoration: none;
  transform: translateY(-4px);
  box-shadow: 0 14px 40px rgba(16, 32, 72, 0.13);
}
.person-card__photo {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: var(--color-primary-soft);
  margin: 0 auto 1rem;
  object-fit: cover;
  display: block;
  border: 4px solid #fff;
  box-shadow: 0 2px 12px rgba(16, 32, 72, 0.10);
}
.person-card__name {
  font-weight: 600;
  color: var(--color-primary);
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
}
.person-card__role {
  color: var(--color-text);
  font-size: 0.95rem;
  font-weight: 500;
}
.person-card__detail {
  color: var(--color-muted);
  font-size: 0.85rem;
  line-height: 1.5;
  margin-top: 0.5rem;
  text-align: left;
}
/* Keep the short CTA line centred */
.person-card--cta .person-card__detail { text-align: center; margin-top: 0.15rem; }
/* "Bio" pill button on a card — sits at the bottom, filling the empty space */
.person-card__bio {
  margin-top: auto;
  align-self: center;
  display: inline-block;
  padding: 0.45rem 1.3rem;
  border: 1.5px solid var(--color-primary);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.person-card__bio:hover {
  background: var(--color-primary);
  color: #fff;
  text-decoration: none;
}
/* Recruitment "this could be you" card */
.person-card--cta {
  justify-content: center;
  background: #fff;
  border-style: dashed;
  border-color: var(--color-primary);
}
.person-card--cta .person-card__plus {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 300;
  margin: 0 auto 1rem;
}
/* Full-width "join the team" CTA spanning the whole grid row */
.people-grid .person-card--cta {
  grid-column: 1 / -1;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  text-align: left;
  gap: 1.25rem;
  padding: 1.5rem 1.75rem;
}
.people-grid .person-card--cta .person-card__plus { margin: 0; }
.people-grid .person-card--cta .person-card__detail { margin-top: 0; }

/* Alumni avatars */
.alumni-list li { display: flex; align-items: flex-start; gap: 1rem; }
.alumni-photo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--color-primary-soft);
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(16, 32, 72, 0.08);
}

/* Publications — vertical timeline rail beside the list */
html { scroll-behavior: smooth; }
.pub-layout {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 3rem;
  align-items: start;
}
.pub-rail {
  position: sticky;
  top: 120px;
  align-self: start;
  display: flex;
  flex-direction: column;
  border-left: 2px solid var(--color-border);
  max-height: calc(100vh - 150px);
  overflow-y: auto;
}
.pub-rail a {
  position: relative;
  padding: 0.95rem 0 0.95rem 1.2rem;
  margin-left: -2px;
  border-left: 2px solid transparent;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-muted);
  text-decoration: none;
  line-height: 1.2;
  white-space: nowrap;
  transition: color var(--transition), border-color var(--transition);
}
.pub-rail a::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--color-border);
  transition: background var(--transition), border-color var(--transition);
}
.pub-rail a:hover { color: var(--color-primary); text-decoration: none; }
.pub-rail a.is-active { color: var(--color-primary); border-left-color: var(--color-primary); }
.pub-rail a.is-active::before { background: var(--color-primary); border-color: var(--color-primary); }
.pub-yeargroup { margin-bottom: 2.75rem; }
.pub-yeargroup:last-child { margin-bottom: 0; }
.pub-year { scroll-margin-top: 120px; margin-bottom: 1rem; }

@media (max-width: 820px) {
  .pub-layout { grid-template-columns: 1fr; gap: 1rem; }
  .pub-rail {
    position: sticky;
    top: 60px;
    z-index: 5;
    flex-direction: row;
    overflow-x: auto;
    border-left: none;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
    gap: 0.4rem;
    padding: 0.5rem 0;
    max-height: none;
  }
  .pub-rail a {
    margin-left: 0;
    border-left: none;
    border-bottom: 2px solid transparent;
    padding: 0.3rem 0.7rem;
    white-space: nowrap;
  }
  .pub-rail a::before { display: none; }
  .pub-rail a.is-active { border-left-color: transparent; border-bottom-color: var(--color-primary); }
}

/* Readable, contained body prose (used on bio / text pages) */
.prose { max-width: 74ch; margin-top: 1.25rem; }
.prose p {
  margin: 0 0 1.15rem;
  line-height: 1.8;
  color: var(--color-text);
  text-align: justify;
  text-justify: inter-word;
  hyphens: none;
}
.prose p:last-child { margin-bottom: 0; }

/* Alumni list */
.alumni-list {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  display: grid;
  gap: 1rem;
}
.alumni-list li {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}
.alumni-name {
  font-weight: 600;
  color: var(--color-primary);
  font-size: 1.05rem;
}
.alumni-role {
  color: var(--color-text);
  font-size: 0.95rem;
  margin-top: 0.15rem;
}
.alumni-info {
  color: var(--color-muted);
  font-size: 0.9rem;
  margin-top: 0.35rem;
  font-style: italic;
}

/* Contact / profile pill buttons on bio pages */
.bio-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.5rem;
}
.bio-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.05rem;
  border: 1.5px solid var(--color-border);
  border-radius: 999px;
  background: #fff;
  color: var(--color-primary);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition);
}
.bio-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.bio-link:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
}

/* Contact links row on bio pages */
.person-links {
  margin: 1.25rem 0 0;
  color: var(--color-muted);
  font-size: 0.95rem;
}
.person-links a { margin-right: 0.5rem; }
.person-links a + a { margin-left: 0.5rem; }

/* ---------- Publication list ---------- */
.pub-list { list-style: none; padding: 0; margin: 0; }
.pub-list li {
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--color-border);
}
.pub-list li:last-child { border-bottom: 0; }
.pub-title { font-weight: 600; }
.pub-authors { color: var(--color-muted); font-size: 0.95rem; }
.pub-venue { font-style: italic; color: var(--color-muted); font-size: 0.9rem; }

/* ---------- News list ---------- */
.news-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1rem;
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--color-border);
}
.news-item__date {
  color: var(--color-muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
}
.news-item:last-child { border-bottom: 0; }
/* Tinted panel boxes, matching the publications / research pages.
   `.pub-list .news-item` outranks the generic `.pub-list li` divider rule. */
.pub-list .news-item {
  padding: 1.35rem 1.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
}
.pub-list .news-item:last-child { margin-bottom: 0; }

/* ---------- Positions ---------- */
.position {
  padding: 1.75rem;
  background: var(--color-surface);
  border-radius: var(--radius);
  border-left: 4px solid var(--color-primary);
  margin-bottom: 1rem;
}

/* Open Positions — text panel over a background image (dark overlay
   keeps text legible; gracefully shows navy if the image is absent) */
.positions-banner {
  max-width: 900px;
  margin: 0 auto;
  padding: 3.75rem 3rem;
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.92);
  background-image:
    linear-gradient(160deg, rgba(8, 18, 40, 0.58) 0%, rgba(20, 40, 82, 0.52) 100%),
    url('../images/positions-bg.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.positions-banner p {
  font-size: 1.12rem;
  line-height: 1.8;
  margin: 0 0 1.25rem;
  max-width: 64ch;
}
.positions-banner__highlight {
  color: #7fe0a3;
  font-size: 1.5rem;
  font-weight: 600;
  font-style: italic;
  line-height: 1.4;
  margin: 2rem 0 2.25rem !important;
}

/* ---------- Funder grid ---------- */
.funder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 195px;
  padding: 0.5rem;
}
.funder img {
  max-height: 165px;
  max-width: 100%;
  width: auto;
  object-fit: contain;
  display: block;
  /* Hides the solid white background on JPG logos by blending with the
     section's light surface. PNGs with transparent backgrounds are unaffected. */
  mix-blend-mode: multiply;
  transition: transform var(--transition);
}
.funder:hover img { transform: scale(1.04); }
.funder__placeholder {
  height: 90px;
  width: 100%;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted);
  font-size: 0.85rem;
  background: var(--color-bg);
}
.funder__name {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--color-muted);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  border-radius: 999px;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 500;
  border: 0;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.btn:hover {
  background: var(--color-primary-dark);
  text-decoration: none;
  color: #fff;
  transform: translateY(-1px);
}
.btn--ghost {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}
.btn--ghost:hover { background: var(--color-primary); color: #fff; }

.btn--white-ghost {
  background: transparent;
  color: #fff;
  border: 2px solid #fff;
}
.btn--white-ghost:hover { background: #fff; color: var(--color-primary-dark); }

.btn--highlight {
  background: var(--color-highlight);
  color: #fff;
  font-weight: 600;
  padding: 0.85rem 2rem;
  box-shadow: 0 6px 20px rgba(240, 140, 31, 0.35);
}
.btn--highlight:hover {
  background: #d87715;
  color: #fff;
  box-shadow: 0 8px 24px rgba(240, 140, 31, 0.45);
}

.btn--lg {
  padding: 1.3rem 3.25rem;
  font-size: 1.15rem;
}

/* ---------- Footer (dark, minimal) ---------- */
.site-footer {
  border-top: 0;
  padding: 4rem 0 2.25rem;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.9rem;
  margin-top: 0;
  background: #0a1326;
}
.site-footer__inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
/* Rich footer layout (rendered by main.js) */
.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.footer-brand { display: flex; align-items: center; gap: 0.9rem; }
.footer-brand img {
  height: 60px;
  width: 60px;
  object-fit: contain;
  /* light chip guarantees the logo reads on the dark footer regardless of its own colours */
  background: #fff;
  border-radius: 12px;
  padding: 6px;
}
/* Mirror the header lockup: bold name + uppercase, tracked tagline
   that wraps beneath it (constrained width), adapted for the dark footer. */
.footer-brand > div { max-width: 14rem; line-height: 1.1; }
.footer-brand__name {
  color: #fff;
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.footer-brand__affil {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.6rem;
  font-weight: 600;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  line-height: 1.35;
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
}
.footer-nav a {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.95rem;
  font-weight: 500;
}
.footer-nav a:hover { color: #7fe0a3; text-decoration: none; }
.footer-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1.25rem;
}
.footer-social { display: flex; gap: 0.7rem; }
.footer-social a {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.85);
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.footer-social a:hover {
  background: #fff;
  color: var(--color-primary);
  border-color: #fff;
  text-decoration: none;
}
.footer-social svg { width: 18px; height: 18px; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 2rem;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
}
.footer-bottom a { color: rgba(255, 255, 255, 0.7); }
@media (max-width: 640px) {
  .footer-top { flex-direction: column; gap: 1.75rem; }
  .footer-right { align-items: flex-start; }
  .footer-bottom { flex-direction: column; text-align: left; }
}

/* ============================================================
   Responsive
   - 960px  → tablet / narrow laptop: switch to hamburger nav
              (7 nav items don't fit comfortably above this size)
   - 640px  → phone: tighten padding, collapse grids to 1 column,
              scale down hero/display text
   - 380px  → small phones: final typography trim
   ============================================================ */

/* ----- Tablet & narrow laptop ----- */
@media (max-width: 1100px) {
  h1, .hero__title { font-size: 2.2rem; }
  h2 { font-size: 1.6rem; }

  /* Shrink header so sticky nav doesn't dominate the viewport */
  .site-header__inner { min-height: 72px; }
  .site-logo { height: 52px; width: 52px; }
  .site-title__name { font-size: 1.05rem; }

  /* Hamburger nav from tablet width down */
  .nav-toggle { display: block; }
  .nav {
    display: none;
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--color-bg);
    border-radius: 0 0 20px 20px;
    padding: 1rem var(--gutter) 1.5rem;
    gap: 0.25rem;
    box-shadow: 0 16px 40px rgba(16, 32, 72, 0.12);
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 0.6rem 0.5rem; border-radius: 8px; }
  .nav a:hover { background: var(--color-primary-soft); text-decoration: none; }

  /* Grid collapses */
  .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--5 { grid-template-columns: repeat(3, 1fr); }
  .gallery--4 { grid-template-columns: repeat(2, 1fr); }

  /* Section padding */
  .section { padding: 3.5rem 0; }
  .section--tight-bottom { padding-bottom: 1.75rem; }
  .section--tight-top { padding-top: 1.75rem; }

  /* Heroes */
  .hero { padding: 3rem 0 2rem; }
  .hero--banner { min-height: 70vh; padding: 5rem 0; }
  .hero--banner .hero__title { font-size: 3rem; }
  .hero__tagline { font-size: 1.25rem; }
  .hero__tagline--lead { font-size: 2.5rem; }

  /* Accent band */
  .accent-band { padding: 3.5rem 0; }
  .accent-band p { font-size: 1.2rem; line-height: 1.6; }
  .accent-band .btn { margin-top: 2rem; }

  /* Buttons */
  .btn--lg { padding: 1rem 2.25rem; font-size: 1rem; }

  /* Research index page */
  .vision { font-size: 1.2rem; }
  .bridge { font-size: 1.2rem; margin-bottom: 1.75rem; }
  .area__thumb { width: 180px; height: 180px; }

  /* Research detail page — stack figure above text */
  .area-hero {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    text-align: center;
  }
  .area-hero__thumb {
    margin: 0 auto;
    width: 240px;
    height: 240px;
  }
  .area-hero__title { font-size: 1.9rem; }

  /* Research page — stack rows (image always above text) on small screens */
  .page-title { font-size: 2rem; }
  .research-rows { gap: 1.75rem; margin-top: 1rem; }
  .research-row { grid-template-columns: 1fr; gap: 1.5rem; padding: 1.75rem; }
  .research-row:nth-child(even) .research-row__media { order: 0; }
  .research-row__img { width: 85%; height: 240px; }
  .research-row__title { font-size: 1.5rem; }
  .research-row__sub { font-size: 0.82rem; letter-spacing: 0.14em; }
  .research-banner-full { margin-bottom: 1.5rem; }

  /* Publications list — stack citation above button */
  .pub-area-item {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.25rem 1.35rem;
  }
  .pub-area-item .btn { align-self: flex-start; }
  .pub-area-item__figure { width: 100%; }
  .pub-area-item__figure img { width: 100%; max-width: none; height: auto; max-height: 420px; }

  /* Funders */
  .funder { min-height: 140px; }
  .funder img { max-height: 110px; }
}

/* ----- Phone ----- */
@media (max-width: 640px) {
  :root { --gutter: 1.1rem; }

  h1, .hero__title { font-size: 2rem; }
  h2 { font-size: 1.4rem; }
  body { font-size: 15px; }

  /* Compact header */
  .site-header__inner { min-height: 60px; }
  .site-logo { height: 40px; width: 40px; }
  .site-title__name { font-size: 1rem; }
  .site-title__affil { display: none; }
  .site-title a { gap: 0.5rem; }
  .nav { top: 60px; border-radius: 0 0 20px 20px; }

  /* Grids → single column (funders remain 2-up for brand recognition) */
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .grid--5 { grid-template-columns: repeat(2, 1fr); }
  .gallery { grid-template-columns: 1fr; gap: 1rem; }
  .welcome p { font-size: 1.05rem; }

  /* Sections */
  .section { padding: 3rem 0; }
  .section--tight-bottom { padding-bottom: 1.5rem; }
  .section--tight-top { padding-top: 1.5rem; }

  /* Heroes — more spacious and bold on mobile */
  .hero { padding: 3rem 0 2rem; }
  .hero--banner { min-height: 78vh; padding: 5rem 0; }
  .hero--banner .hero__title { font-size: 2.4rem; }
  .hero__tagline { font-size: 1.1rem; margin-top: 1.25rem; }
  .hero__tagline--lead { font-size: 2rem; margin-top: 0.5rem; }
  .hero__actions { margin-top: 2rem; }
  .hero__eyebrow { font-size: 0.82rem; letter-spacing: 0.18em; margin-bottom: 1rem; }
  .hero__lede { font-size: 1rem; margin-top: 1.25rem; }

  /* Accent band */
  .accent-band { padding: 3.5rem 0; }
  .accent-band p { font-size: 1.1rem; line-height: 1.65; }
  .accent-band .btn { margin-top: 2rem; }

  /* Buttons */
  .btn { padding: 0.7rem 1.5rem; font-size: 0.9rem; }
  .btn--lg { padding: 0.9rem 2rem; font-size: 0.95rem; }

  /* Research index page */
  .vision { font-size: 1.1rem; line-height: 1.6; }
  .bridge { font-size: 1.1rem; margin-bottom: 1.5rem; }
  .area__thumb { width: 160px; height: 160px; }
  .area__title { font-size: 1.1rem; min-height: 0; }
  .area__body { font-size: 0.95rem; }

  /* Research detail page */
  .area-hero__thumb { width: 200px; height: 200px; }
  .area-hero__title { font-size: 1.65rem; }
  .area-hero__lede { font-size: 1rem; }

  /* Publications */
  .pub-area-item { padding: 1.1rem 1.2rem; gap: 1rem; }
  .pub-area-item__citation { font-size: 0.95rem; line-height: 1.55; }

  /* Funders */
  .funder { min-height: 100px; }
  .funder img { max-height: 80px; }

  /* News + footer */
  .news-item { grid-template-columns: 1fr; gap: 0.25rem; }
  .site-footer { padding: 2rem 0; font-size: 0.85rem; }
  .site-footer__inner { flex-direction: column; text-align: center; gap: 0.3rem; }

  /* People page */
  .people-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .people-intro { font-size: 1.1rem; }

  /* Open Positions banner */
  .positions-banner { padding: 2.25rem 1.5rem; }
  .positions-banner p { font-size: 1.02rem; }
  .positions-banner__highlight { font-size: 1.25rem; }
}

/* ----- Small phones ----- */
@media (max-width: 380px) {
  h1, .hero__title { font-size: 1.55rem; }
  .area-hero__title { font-size: 1.4rem; }
  .grid--5 { grid-template-columns: 1fr; }
  .btn--lg { padding: 0.75rem 1.5rem; }
}

/* ── Members nav link ──
   Use `.nav a.nav__members` so this beats the generic `.nav a`
   border-bottom rule that was otherwise clipping the box's bottom edge. */
.nav a.nav__members {
  font-weight: 600;
  color: var(--color-primary) !important;
  border: 1.5px solid var(--color-primary);
  border-radius: 6px;
  padding: 0.2em 0.75em !important;
  transition: background var(--transition), color var(--transition);
}
.nav a.nav__members::before {
  content: "";
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  margin-right: 0.4em;
  vertical-align: -0.08em;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%23000'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Crect%20x='4'%20y='10.5'%20width='16'%20height='10.5'%20rx='2'/%3E%3Cpath%20d='M7.5%2010.5V7a4.5%204.5%200%200%201%209%200v3.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%23000'%20stroke-width='2.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Crect%20x='4'%20y='10.5'%20width='16'%20height='10.5'%20rx='2'/%3E%3Cpath%20d='M7.5%2010.5V7a4.5%204.5%200%200%201%209%200v3.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.nav a.nav__members:hover {
  background: var(--color-primary);
  color: #fff !important;
  text-decoration: none;
}

/* ── Mobile touch targets & misc ── */
@media (max-width: 960px) {
  /* Nav items in open menu need decent tap height */
  .nav.is-open a { min-height: 44px; display: flex; align-items: center; padding: 0.4rem 0; }
  .nav__members  { padding: 0.4rem 0.75em !important; }
}

@media (max-width: 640px) {
  /* ELN/PI internal heroes — smaller than banner hero */
  .hero:not(.hero--banner) { padding: 2rem 0 1.25rem; }
  .hero:not(.hero--banner) .hero__title { font-size: 1.75rem; }

  /* Position tiles */
  .position { padding: 1.25rem 1.25rem; }
}
