/* === Design tokens ================================================== */
:root {
  --ink: #10151B;
  --paper: #FFFFFF;
  --mist: #EFF6F3;
  --teal: #145C52;
  --teal-dark: #0E453D;
  --teal-bright: #2FBFA0;
  --coral: #E8623D;
  --coral-dark: #C74E2E;
  --slate: #5B6672;
  --border: #DCE6E3;

  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(16,21,27,.06), 0 8px 24px rgba(16,21,27,.06);
  --max-width: 1120px;
}

/* === Reset / base ===================================================== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--coral); }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 .5em;
  color: var(--ink);
}
h1 { font-size: clamp(2rem, 4vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
h3 { font-size: 1.25rem; font-weight: 500; color: var(--teal-dark); }
p { margin: 0 0 1em; }
.mono { font-family: var(--font-mono); }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: var(--paper); padding: .5em 1em; z-index: 100;
}
.skip-link:focus { left: 1em; top: 1em; }

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

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }
/* Longhand on purpose: .section and .container land on the same element on
   several pages (e.g. <section class="section container">). Two shorthand
   `padding` declarations at equal specificity don't merge per-side — the
   later rule wins outright — which was silently zeroing container's
   left/right padding on every page using that combo. */
.section { padding-top: 4rem; padding-bottom: 4rem; }
.section--alt { background: var(--mist); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 2.5rem; }
.eyebrow {
  font-family: var(--font-mono); font-size: .8rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--teal); display: block; margin-bottom: .5rem;
}

/* === Nav =============================================================== */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--ink); color: var(--paper);
}
.nav-inner {
  max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between; min-height: 64px;
}
.nav-brand {
  font-family: var(--font-body); font-weight: 600; color: var(--paper);
  font-size: .98rem; letter-spacing: .01em;
}
.nav-brand:hover { color: var(--mist); }
.nav-links { list-style: none; display: flex; gap: 1.75rem; margin: 0; padding: 0; }
.nav-links .nav-link { color: rgba(255,255,255,.82); font-size: .95rem; font-weight: 500; }
.nav-links .nav-link:hover,
.nav-links .nav-link.is-active { color: var(--paper); }
.nav-links .nav-link.is-active { border-bottom: 2px solid var(--coral); padding-bottom: 4px; }
.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 32px; height: 32px; background: none; border: 0; cursor: pointer; padding: 0;
}
.nav-toggle span { display: block; width: 100%; height: 2px; background: var(--paper); }

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute; top: 64px; left: 0; right: 0; background: var(--ink);
    flex-direction: column; gap: 0; max-height: 0; overflow: hidden;
    transition: max-height .25s ease;
  }
  .nav-links.is-open { max-height: 320px; }
  .nav-links li { border-top: 1px solid rgba(255,255,255,.12); }
  .nav-links .nav-link { display: block; padding: .9rem 1.5rem; }
  .nav-links .nav-link.is-active { border-bottom: 0; border-left: 3px solid var(--coral); }
}

/* === Buttons ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: .5em; min-height: 44px;
  font-family: var(--font-body); font-weight: 600; font-size: .95rem;
  padding: .7em 1.6em; border-radius: 999px; border: 2px solid var(--ink);
  background: transparent; color: var(--ink); cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}
.btn:hover { background: var(--ink); color: var(--paper); transform: translateY(-1px); }
.btn-primary { background: var(--teal); border-color: var(--teal); color: var(--paper); }
.btn-primary:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
.btn-icon {
  display: inline-flex; width: 44px; height: 44px; border-radius: 50%;
  border: 1.5px solid var(--border); align-items: center; justify-content: center;
  color: var(--ink); font-size: 1rem;
}
.btn-icon:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* === Dark hero: full-black, minimal-word landing statement ============= */
.dark-hero {
  position: relative; min-height: 94vh; display: flex; align-items: center;
  overflow: hidden; background: var(--ink); color: var(--paper);
}
.dark-hero-bg { position: absolute; inset: 0; z-index: 0; }
.dark-hero-bg img {
  width: 100%; height: 100%; object-fit: cover; object-position: 55% 45%;
  opacity: .38; filter: grayscale(.25) contrast(1.05); will-change: transform;
}
.dark-hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 60% at 32% 40%, rgba(16,21,27,.45), rgba(16,21,27,.95) 72%);
}
.dark-hero-inner { position: relative; z-index: 1; max-width: 880px; padding: 6rem 1.5rem; }
.dark-hero-eyebrow {
  font-family: var(--font-mono); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--teal-bright); display: block; margin-bottom: 1.5rem;
}
.dark-hero-title {
  font-family: var(--font-display); font-weight: 700; color: var(--paper);
  font-size: clamp(2.75rem, 7.5vw, 6rem); line-height: 1.04; letter-spacing: -.01em;
  margin: 0 0 1.75rem;
}
.dark-hero-title .accent { color: var(--coral); }
.dark-hero-terms {
  font-family: var(--font-mono); font-size: .95rem; letter-spacing: .04em;
  color: rgba(255,255,255,.62); margin: 0 0 2.25rem;
}
.dark-hero .btn-accent {
  background: var(--coral); border-color: var(--coral); color: var(--ink);
}
.dark-hero .btn-accent:hover { background: var(--coral-dark); border-color: var(--coral-dark); }
.dark-hero-scroll-cue {
  position: absolute; left: 50%; bottom: 2rem; z-index: 1; transform: translateX(-50%);
  color: rgba(255,255,255,.5); font-size: 1.3rem;
}
@media (prefers-reduced-motion: no-preference) {
  .dark-hero-scroll-cue { animation: scroll-cue 1.8s ease-in-out infinite; }
}
@keyframes scroll-cue {
  0%, 100% { transform: translate(-50%, 0); opacity: .5; }
  50% { transform: translate(-50%, 8px); opacity: .9; }
}
@media (max-width: 860px) {
  .dark-hero { min-height: 88vh; }
  .dark-hero-inner { padding: 5rem 1.5rem; text-align: center; }
}

.hero-actions { display: flex; gap: 1rem; margin-top: 1.5rem; flex-wrap: wrap; }
.dark-hero .hero-actions { justify-content: flex-start; }
@media (max-width: 860px) { .dark-hero .hero-actions { justify-content: center; } }

/* === Logo wall: image-led, minimal words ================================ */
.logo-wall { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 3rem 4rem; }
.logo-wall-item {
  display: flex; flex-direction: column; align-items: center; gap: .85rem;
  width: 170px; text-align: center; color: var(--ink);
}
.logo-wall-item img {
  max-height: 84px; width: auto; filter: grayscale(1) contrast(1.05); opacity: .82;
  transition: filter .2s ease, opacity .2s ease, transform .2s ease;
}
.logo-wall-item:hover img { filter: none; opacity: 1; transform: translateY(-3px); }
.logo-wall-item span { font-family: var(--font-mono); font-size: .82rem; color: var(--slate); }
.logo-wall-item:hover span { color: var(--teal); }
.logo-wall-item--icon { justify-content: center; }
.logo-wall-item--icon i {
  font-size: 3.25rem; height: 84px; display: flex; align-items: center; color: var(--ink);
  opacity: .82; transition: color .2s ease, opacity .2s ease, transform .2s ease;
}
.logo-wall-item--icon:hover i { opacity: 1; color: var(--teal); transform: translateY(-3px); }
/* Font Awesome's JS swaps <i> for <svg>, so style both. */
.logo-wall-item--more i,
.logo-wall-item--more svg {
  width: 84px; height: 84px; padding: 1.6rem; box-sizing: border-box; justify-content: center;
  font-size: 1.75rem; color: var(--teal); opacity: 1;
  border: 2px dashed var(--teal-bright); border-radius: 50%;
  transition: transform .2s ease, background .2s ease;
}
.logo-wall-item--more:hover svg { background: var(--mist); transform: translateY(-3px); }
.logo-wall-item--more span { color: var(--teal); }

/* === Stat band ============================================================ */
.stat-row { position: relative; display: flex; justify-content: center; gap: 3.5rem; flex-wrap: wrap; text-align: center; }
.stat-row::before {
  content: ""; position: absolute; top: 50%; left: 50%; width: 640px; height: 280px;
  transform: translate(-50%, -50%); pointer-events: none; z-index: 0;
  background: radial-gradient(ellipse at center, rgba(20, 92, 82, .1), transparent 70%);
}
.stat { position: relative; z-index: 1; }
.stat-num {
  display: block; font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.5rem, 6vw, 4rem); color: var(--teal); line-height: 1;
}
.stat-label {
  font-family: var(--font-mono); font-size: .8rem; text-transform: uppercase;
  letter-spacing: .06em; color: var(--slate);
}

/* === Scroll-reveal (home page only) ===================================== */
.reveal { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
  .reveal.is-visible { opacity: 1; transform: translateY(0); }
  .logo-wall-item.reveal:nth-child(2) { transition-delay: .08s; }
  .logo-wall-item.reveal:nth-child(3) { transition-delay: .16s; }
  .logo-wall-item.reveal:nth-child(4) { transition-delay: .24s; }
  .stat.reveal:nth-child(2) { transition-delay: .1s; }
  .stat.reveal:nth-child(3) { transition-delay: .2s; }
}

/* === Team photo strip: overlapping caption card ========================== */
.team-strip-inner { position: relative; }
.team-strip-img { width: 100%; border-radius: 20px; display: block; }
.team-strip-copy {
  position: absolute; left: 2rem; bottom: -1.75rem; max-width: 320px;
  background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem 1.75rem; box-shadow: var(--shadow);
}
.team-strip-copy .btn { margin-top: .5rem; }
@media (max-width: 700px) {
  .team-strip-copy { position: static; margin: 1.25rem 1rem 0; text-align: center; }
}

/* === Bootstrap .card polish (Team page) ================================== */
.card { border-color: var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-title { font-family: var(--font-display); }
.btn-outline-dark { border-color: var(--ink); color: var(--ink); }
.btn-outline-dark:hover { background: var(--ink); border-color: var(--ink); }

/* === Tags ================================================================ */
.tag-list { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0; }
.tag {
  font-family: var(--font-mono); font-size: .78rem; color: var(--teal-dark);
  background: var(--mist); border: 1px solid var(--border); border-radius: 999px;
  padding: .35em .9em;
}
a.tag { text-decoration: none; transition: background .15s ease, color .15s ease, border-color .15s ease; }
a.tag:hover { background: var(--teal); color: var(--paper); border-color: var(--teal); }
/* Area managers (teal, filled) vs. topic links (coral, filled) — two
   different colors so it's obvious at a glance which kind of link a badge
   is, distinct from plain (non-link, mist) specialty badges. */
.tag--area {
  display: inline-block; color: var(--paper); background: var(--coral); border-color: var(--coral);
}
a.tag--area:hover { background: var(--coral-dark); color: var(--paper); border-color: var(--coral-dark); }
.tag--topic {
  display: inline-block; color: var(--ink); background: var(--teal-bright); border-color: var(--teal-bright);
}
a.tag--topic:hover { background: var(--teal-dark); color: var(--paper); border-color: var(--teal-dark); }

/* === Role badges (Team) =================================================== */
.role-badge {
  display: inline-block; font-family: var(--font-mono); font-size: .72rem; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase; padding: .3em .85em; border-radius: 999px;
  margin-bottom: .5rem;
}
.role-badge--head { background: var(--ink); color: var(--paper); }
.role-badge--senior-scientist { background: var(--teal); color: var(--paper); }
.role-badge--scientist { background: var(--mist); color: var(--teal); border: 1px solid var(--teal); }
.role-badge--junior-scientist { background: var(--mist); color: var(--teal-dark); border: 1px solid var(--border); }
.role-badge--phd-student { background: var(--paper); color: var(--slate); border: 1px dashed var(--border); }
.role-badge--student { background: var(--paper); color: var(--slate); border: 1px dashed var(--border); }
.role-badge--visiting-researcher { background: var(--paper); color: var(--teal-dark); border: 1px solid var(--teal); }
.team-card-badges { justify-content: center; margin: .15rem 0 .3rem; }

.team-section { margin-top: 3rem; }
.team-section:first-child { margin-top: 0; }
.team-section-title {
  font-family: var(--font-mono); font-size: .85rem; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--teal); text-align: center; margin: 0 0 1.5rem;
}

/* === PI profile =========================================================== */
.pi-hero { display: grid; grid-template-columns: 220px 1fr; gap: 2.5rem; align-items: start; padding-top: 3.5rem; padding-bottom: 2.5rem; }
.pi-photo { width: 220px; height: 220px; border-radius: 50%; object-fit: cover; box-shadow: var(--shadow); }
.pi-role { color: var(--teal); font-weight: 600; margin-bottom: 1rem; }
.pi-bio { color: var(--slate); max-width: 46em; }
.pi-links { display: flex; gap: .75rem; margin: 1.5rem 0; }
.pi-contact { margin-top: 1rem; }
@media (max-width: 700px) {
  .pi-hero { grid-template-columns: 1fr; text-align: center; }
  .pi-photo { margin: 0 auto; }
  .pi-links { justify-content: center; }
}

/* === Publications ========================================================= */
.pub-controls {
  display: flex; gap: 1rem; flex-wrap: wrap; align-items: center;
  margin-bottom: 2.5rem; padding: 1.25rem; background: var(--mist); border-radius: var(--radius);
}
.pub-search, .pub-year-filter {
  font-family: var(--font-body); font-size: .95rem; padding: .6em .9em;
  border: 1px solid var(--border); border-radius: 8px; background: var(--paper);
}
.pub-search { flex: 1; min-width: 200px; }
.pub-count { color: var(--slate); font-size: .9rem; margin-left: auto; }
.pub-year-group { margin-bottom: 2.5rem; }
.pub-year-group h2 { font-family: var(--font-mono); font-weight: 500; color: var(--teal); }
.pub-entry { padding: 1.1rem 0; border-top: 1px solid var(--border); }
.pub-entry:first-of-type { border-top: 0; }
.pub-id { font-family: var(--font-mono); color: var(--slate); font-size: .85rem; }
.pub-authors { color: var(--ink); }
.pub-authors .pi-name { font-weight: 700; }
.pub-title { font-weight: 600; margin: .35em 0; }
.pub-meta { color: var(--slate); font-size: .9rem; }
.pub-doi { font-family: var(--font-mono); font-size: .85rem; }
.pub-empty { color: var(--slate); text-align: center; padding: 3rem 0; }

/* === Site footer ========================================================== */
.site-footer { border-top: 1px solid var(--border); margin-top: 3rem; background: var(--paper); }
.site-footer-grid {
  display: grid; grid-template-columns: 1.3fr 1fr auto; gap: 2.5rem; align-items: start;
  padding: 3rem 1.5rem 2rem;
}
.site-footer-brand { display: flex; align-items: center; gap: 1rem; }
.site-footer-logo { width: 48px; height: 48px; object-fit: contain; flex-shrink: 0; }
.site-footer-brand strong { font-family: var(--font-display); font-size: 1rem; display: block; }
.site-footer-brand p { color: var(--slate); font-size: .85rem; margin: .2rem 0 0; }
.site-footer-contact { font-style: normal; color: var(--slate); font-size: .85rem; line-height: 1.8; }
.site-footer-contact a { color: var(--slate); }
.site-footer-contact a:hover { color: var(--teal); }
.site-footer-social { display: flex; gap: .5rem; justify-content: flex-end; align-self: flex-start; }
.site-footer-social .btn-icon { width: 38px; height: 38px; font-size: .9rem; }
.site-footer-bottom { border-top: 1px solid var(--border); padding: 1rem 1.5rem; }
.site-footer-bottom .container { color: var(--slate); font-size: .8rem; text-align: center; }
@media (max-width: 760px) {
  .site-footer-grid { grid-template-columns: 1fr; text-align: center; padding: 2.5rem 1.5rem 1.5rem; }
  .site-footer-brand { flex-direction: column; }
  .site-footer-social { justify-content: center; }
}

/* === Molecule illustration grid (research pages) ========================= */
.mol-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1.5rem; margin: 2rem 0; }
.mol-card { text-align: center; }
.mol-card img { width: 100%; max-width: 180px; aspect-ratio: 1 / 1; object-fit: contain; margin: 0 auto 1rem; display: block; }
.mol-card h3 { font-size: 1rem; margin-bottom: .3rem; }
.mol-card p { color: var(--slate); font-size: .9rem; margin: 0; }
.mol-card-icon { font-size: 2.5rem; color: var(--teal); margin-bottom: 1rem; }

/* === Research line pages (multi-block layout) ============================ */
.section-head--wide { max-width: 820px; }
.section-head .lead { color: var(--slate); font-size: 1.1rem; line-height: 1.7; }
.line-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; margin: 0 0 2.5rem; }
.line-blocks { display: grid; gap: 1.75rem; max-width: 960px; margin: 0 auto; }
.line-block {
  display: grid; grid-template-columns: 240px 1fr; gap: 2rem;
  background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 2rem; scroll-margin-top: 5rem;
  border-left: 4px solid var(--teal-bright);
}
.line-block-head { display: flex; flex-direction: column; align-items: flex-start; gap: .4rem; }
.line-block-num { font-family: var(--font-mono); font-size: .8rem; color: var(--coral); letter-spacing: .08em; }
.line-block-head i { font-size: 1.75rem; color: var(--teal); }
.line-block-head h2 { font-size: 1.4rem; margin: 0; }
.line-block-img { width: 100%; border-radius: var(--radius); background: #F7F7F7; margin-bottom: .6rem; }
.line-block-body p { color: var(--slate); }
.line-block-body .tag-list { margin-top: 1.25rem; }
.line-back { text-align: center; margin: 2.5rem 0 0; }
@media (max-width: 720px) {
  .line-block { grid-template-columns: 1fr; gap: 1rem; padding: 1.5rem; }
  .line-block-head { flex-direction: row; align-items: center; flex-wrap: wrap; }
}

/* === Team grid ============================================================ */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.75rem; }
.team-card {
  display: flex; flex-direction: column; text-align: center; overflow: hidden;
  background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.team-card-photo { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; }
.team-card-body { display: flex; flex-direction: column; flex: 1; padding: 1.5rem; gap: .4rem; }
.team-card-body h3 { margin: 0; font-size: 1.1rem; }
.team-card-role { color: var(--slate); font-size: .88rem; font-style: italic; margin: 0; }
.team-card-email { font-family: var(--font-mono); font-size: .78rem; color: var(--slate); margin: .25rem 0 0; word-break: break-all; }
.team-card-links { display: flex; justify-content: center; gap: .5rem; margin-top: auto; padding-top: 1.25rem; }
.team-card-links .btn-icon { width: 38px; height: 38px; font-size: .9rem; }
.team-card-profile-link { margin-top: .6rem; font-family: var(--font-mono); font-size: .82rem; font-weight: 600; }

/* === Project list ========================================================== */
.project-list { display: grid; gap: 2rem; }
.project-card {
  display: grid; grid-template-columns: 240px 1fr; gap: 2rem; align-items: center;
  background: var(--paper); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 2rem;
}
.project-card-media {
  display: flex; align-items: center; justify-content: center; background: var(--mist);
  border-radius: 8px; padding: 1rem; height: 100%; min-height: 140px;
}
.project-card-media img { max-width: 100%; max-height: 130px; object-fit: contain; }
.project-card-media--icon i { font-size: 3.5rem; color: var(--ink); opacity: .82; }
.project-card h2 { margin: 0 0 .6rem; }
.project-card p { color: var(--slate); margin: 0 0 1.25rem; }
.project-card p a { text-decoration: underline; }
@media (max-width: 700px) {
  .project-card { grid-template-columns: 1fr; text-align: center; padding: 1.5rem; }
}
