/* ==========================================================================
   XRaD design system
   Fonts and Bootstrap defaults live in theme.scss; everything else is here.
   ========================================================================== */

:root {
  /* Colour */
  --brand: #26547c;          /* XRaD navy, from the logo */
  --brand-strong: #1a3d5c;
  --brand-soft: #eaf1f7;
  --accent: #0b7d77;         /* teal, echoing the Uniklinik mark */
  --accent-soft: #e3f3f1;
  --ink: #17222d;
  --ink-2: #3a4753;
  --muted: #5f6c78;
  --bg: #ffffff;
  --surface: #f5f7f9;
  --surface-2: #edf1f5;
  --line: #e2e7ec;
  --line-strong: #cbd4dc;
  --gold-ink: #7a5300;
  --gold-soft: #fbf1d9;

  /* Type */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Newsreader", "Iowan Old Style", Georgia, serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --fs-display: clamp(2.5rem, 1.6rem + 3.6vw, 4.5rem);
  --fs-h1: clamp(2.25rem, 1.7rem + 2.2vw, 3.5rem);
  --fs-h2: clamp(1.6rem, 1.3rem + 1.2vw, 2.25rem);
  --fs-h3: clamp(1.35rem, 1.2rem + 0.6vw, 1.7rem);
  --fs-lead: clamp(1.1rem, 1rem + 0.45vw, 1.3rem);
  --fs-body: 1.0625rem;
  --fs-small: 0.9375rem;
  --fs-meta: 0.75rem;

  /* Space */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --section-y: clamp(3rem, 2rem + 4vw, 6rem);
  --gutter: clamp(1rem, 0.5rem + 2.5vw, 2.5rem);

  /* Layout */
  --container: 76rem;
  --measure: 42rem;

  /* Shape and depth */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 18px;
  --shadow-1: 0 1px 2px rgba(15, 30, 45, 0.06), 0 1px 1px rgba(15, 30, 45, 0.04);
  --shadow-2: 0 18px 40px -22px rgba(15, 30, 45, 0.35), 0 2px 6px rgba(15, 30, 45, 0.05);

  /* Motion */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --fast: 160ms;
  --slow: 520ms;

  /* Faint scan-grid used behind headers */
  --grid-lines:
    linear-gradient(to right, rgba(38, 84, 124, 0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(38, 84, 124, 0.07) 1px, transparent 1px);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 6rem;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

h1, h2, h3, h4,
.h1, .h2, .h3 {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.015em;
  line-height: 1.15;
  font-optical-sizing: auto;
}

a {
  color: var(--brand);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
  transition: color var(--fast) var(--ease);
}

a:hover {
  color: var(--brand-strong);
}

::selection {
  background: rgba(38, 84, 124, 0.18);
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

img {
  max-width: 100%;
}

/* One centred container for every page */
#quarto-content.page-layout-full,
#quarto-content.page-columns {
  display: block;
}

#quarto-content main.content {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter) var(--section-y);
}

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */

#quarto-header {
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}

#quarto-header .navbar {
  background: transparent !important;
  padding: 0.7rem 0;
}

#quarto-header .navbar-container {
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

#quarto-header .navbar-brand {
  margin-right: var(--space-6);
  transition: opacity var(--fast) var(--ease);
}

#quarto-header .navbar-brand:hover {
  opacity: 0.8;
}

#quarto-header .navbar-logo {
  max-height: 38px !important;
  min-height: 28px !important;
  width: auto;
}

#quarto-header .navbar-nav .nav-link {
  position: relative;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink-2);
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  transition: color var(--fast) var(--ease), background-color var(--fast) var(--ease);
}

#quarto-header .navbar-nav .nav-link:hover,
#quarto-header .navbar-nav .nav-link:focus-visible {
  color: var(--ink);
  background: var(--surface);
}

#quarto-header .navbar-nav .nav-link.active {
  color: var(--brand);
}

/* Active page: a short brand-coloured rule under the label */
@media (min-width: 992px) {
  #quarto-header .navbar-nav .nav-link::after {
    content: "";
    position: absolute;
    left: 0.85rem;
    right: 0.85rem;
    bottom: -0.72rem;
    height: 2px;
    background: var(--brand);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--fast) var(--ease);
  }

  #quarto-header .navbar-nav .nav-link.active::after {
    transform: scaleX(1);
  }
}

#quarto-header .navbar-nav .nav-link .bi {
  font-size: 1.15rem;
}

#quarto-header .navbar-nav.ms-auto .nav-link {
  color: var(--ink-2);
}

/* Search */
#quarto-header #quarto-search .aa-Form {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  transition: border-color var(--fast) var(--ease), background-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}

#quarto-header #quarto-search .aa-Form:focus-within {
  background: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(38, 84, 124, 0.15);
}

#quarto-header #quarto-search .aa-Input {
  font-size: 0.9rem;
}

/* Mobile menu */
#quarto-header .navbar-toggler {
  border: 0;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
}

#quarto-header .navbar-toggler:focus {
  box-shadow: 0 0 0 2px var(--brand);
}

@media (max-width: 991.98px) {
  #quarto-header .navbar-collapse {
    padding: var(--space-3) 0 var(--space-2);
    border-top: 1px solid var(--line);
    margin-top: var(--space-3);
  }

  #quarto-header .navbar-nav .nav-link {
    font-size: 1.0625rem;
    padding: 0.7rem 0.5rem;
  }

  #quarto-header .navbar-nav .nav-link.active {
    background: var(--brand-soft);
  }
}

/* --------------------------------------------------------------------------
   Page header (every page except the homepage)
   -------------------------------------------------------------------------- */

#title-block-header {
  position: relative;
  margin: 0 calc(50% - 50vw) var(--space-7);
  padding: clamp(2.5rem, 1.5rem + 4vw, 5rem) calc(50vw - 50% ) clamp(2rem, 1.25rem + 2.5vw, 3.25rem);
  background-color: var(--surface);
  background-image: var(--grid-lines);
  background-size: 32px 32px;
  background-position: center top;
  border-bottom: 1px solid var(--line);
}

#title-block-header::after {
  /* fade the grid out towards the bottom edge */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(245, 247, 249, 0) 30%, var(--surface) 100%);
  pointer-events: none;
}

#title-block-header .quarto-title {
  position: relative;
  z-index: 1;
}

#title-block-header h1.title {
  font-size: var(--fs-h1);
  font-weight: 500;
  letter-spacing: -0.025em;
  margin: 0;
}

#title-block-header h1.title::before {
  content: "";
  display: block;
  width: 2.5rem;
  height: 3px;
  margin-bottom: var(--space-5);
  background: linear-gradient(90deg, var(--brand), var(--accent));
  border-radius: 2px;
}

#title-block-header .quarto-title-meta {
  display: none;
}

/* --------------------------------------------------------------------------
   Reveal on scroll (added by _includes/after-body.html)
   -------------------------------------------------------------------------- */

.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--slow) var(--ease), transform var(--slow) var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   Homepage
   -------------------------------------------------------------------------- */

.home-page #title-block-header {
  display: none;
}

.home-page #quarto-content main.content {
  padding-bottom: var(--section-y);
}

.home-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  grid-template-areas:
    "identity statement"
    "identity photo";
  column-gap: clamp(2rem, 1rem + 4vw, 5.5rem);
  row-gap: var(--space-6);
  align-items: start;
  margin: 0 calc(50% - 50vw);
  padding: clamp(3rem, 2rem + 4vw, 6.5rem) calc(50vw - 50% ) clamp(3rem, 2rem + 4vw, 6rem);
  background:
    radial-gradient(60rem 30rem at 85% -10%, rgba(11, 125, 119, 0.08), transparent 60%),
    radial-gradient(50rem 30rem at 0% 110%, rgba(38, 84, 124, 0.08), transparent 60%),
    var(--surface);
  border-bottom: 1px solid var(--line);
  isolation: isolate;
}

.home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: var(--grid-lines);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 30% 40%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 80% at 30% 40%, #000 30%, transparent 75%);
}

.hero-identity {
  grid-area: identity;
  display: flex;
  flex-direction: column;
  align-self: stretch;
}

.hero-logo {
  margin: 0 0 var(--space-6);
  line-height: 0;
}

.hero-logo img {
  display: block;
  width: 100%;
  max-width: 26rem;
  height: auto;
  mix-blend-mode: multiply;   /* lets the logo's white background melt into the page */
}

.hero-institution {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.hero-institution::before {
  content: "";
  width: 1.75rem;
  height: 1px;
  background: var(--ink-2);
}

.hero-affiliations {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-5) var(--space-6);
  margin-top: auto;
  padding-top: var(--space-6);
  border-top: 1px solid var(--line-strong);
}

.hero-institution {
  margin-bottom: var(--space-7);
}

.hero-affiliations p {
  display: contents;
}

.affiliation {
  display: block;
  height: 52px;
  background-repeat: no-repeat;
  background-position: left center;
  background-size: contain;
  mix-blend-mode: multiply;
  opacity: 0.9;
  border-radius: var(--radius-sm);
  transition: opacity var(--fast) var(--ease), transform var(--fast) var(--ease);
}

.affiliation:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.affiliation-clinic {
  width: 146px;
  background-image: url("files/images/Universitätsklinikum_Ulm_logo.svg");
}

.affiliation-university {
  width: 184px;
  background-image: url("files/images/Logo_uulm_Vorlage_100mm_schwarz.webp");
}

.hero-statement {
  grid-area: statement;
}

.hero-statement p {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1.05rem + 0.75vw, 1.6rem);
  line-height: 1.5;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.005em;
  margin: 0;
  max-width: 40em;
  hyphens: manual;
}

.hero-statement p + p {
  margin-top: 1em;
  font-size: clamp(1.05rem, 0.95rem + 0.4vw, 1.25rem);
  color: var(--ink-2);
}

.hero-tagline {
  font-weight: 500;
}

.hero-photo {
  grid-area: photo;
  position: relative;
}

.hero-photo p {
  margin: 0;
}

.hero-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 634 / 440;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
}

/* Offset frame behind the group photo */
.hero-photo::before {
  content: "";
  position: absolute;
  inset: 1.25rem 1.25rem -1.25rem -1.25rem;
  border: 1px solid rgba(38, 84, 124, 0.25);
  border-radius: var(--radius-lg);
  z-index: -1;
}

/* Quick links to the other pages */
.home-links {
  margin-top: var(--section-y);
}

.home-links p {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--line-strong);
  counter-reset: home-link;
}

.home-links a {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-6);
  min-height: 9rem;
  padding: var(--space-5) var(--space-5) var(--space-5) 0;
  color: var(--ink);
  text-decoration: none;
  counter-increment: home-link;
}

.home-links a + a {
  padding-left: var(--space-5);
  border-left: 1px solid var(--line);
}

.home-links a::before {
  content: counter(home-link, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  letter-spacing: 0.08em;
  color: var(--muted);
}

.home-links a::after {
  /* animated rule along the top edge */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -1px;
  height: 2px;
  background: var(--brand);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 260ms var(--ease);
}

.home-links a:hover::after,
.home-links a:focus-visible::after {
  transform: scaleX(1);
}

.home-link-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 1.1rem + 0.6vw, 1.65rem);
  letter-spacing: -0.015em;
  line-height: 1.15;
}

.home-link-label::after {
  content: "→";
  font-family: var(--font-sans);
  font-size: 1.1rem;
  color: var(--muted);
  transition: transform var(--fast) var(--ease), color var(--fast) var(--ease);
}

.home-links a:hover .home-link-label::after {
  transform: translateX(4px);
  color: var(--brand);
}

@media (max-width: 991.98px) {
  .home-hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "identity"
      "statement"
      "photo";
    row-gap: var(--space-7);
  }

  .hero-institution {
    margin-bottom: var(--space-6);
  }

  .hero-logo img {
    max-width: 20rem;
  }

  .home-links p {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 0;
  }

  .home-links a,
  .home-links a + a {
    min-height: 7rem;
    padding: var(--space-4) var(--space-4) var(--space-4) 0;
    border-left: 0;
    border-top: 1px solid var(--line-strong);
  }

  .home-links a:nth-child(even) {
    padding-left: var(--space-4);
    border-left: 1px solid var(--line);
  }
}

@media (max-width: 575.98px) {
  .hero-logo img {
    max-width: 15rem;
  }

  .hero-photo::before {
    inset: 0.75rem 0.75rem -0.75rem -0.5rem;
  }

  .affiliation {
    height: 42px;
  }

  .affiliation-clinic {
    width: 118px;
  }

  .affiliation-university {
    width: 148px;
  }

  .home-links p {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-links a,
  .home-links a + a,
  .home-links a:nth-child(even) {
    flex-direction: row;
    align-items: baseline;
    justify-content: flex-start;
    gap: var(--space-4);
    min-height: 0;
    padding: var(--space-4) 0;
    border-left: 0;
  }

  .home-link-label {
    flex: 1;
  }
}

/* --------------------------------------------------------------------------
   Shared bits: tags, lead paragraphs
   -------------------------------------------------------------------------- */

.research-intro {
  display: block;
  max-width: var(--measure);
  font-size: var(--fs-lead);
  line-height: 1.6;
  color: var(--ink-2);
  margin: 0 0 var(--space-8);
}

.badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.2;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  margin: 0 0.35rem 0.4rem 0;
  white-space: normal;
  text-align: left;
}

/* --------------------------------------------------------------------------
   Research
   -------------------------------------------------------------------------- */

.research-grid {
  counter-reset: project;
}

/* Figure and text side by side, alternating sides (stacked below 992px) */
.research-card {
  counter-increment: project;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: clamp(1.5rem, 1rem + 3vw, 4rem);
  align-items: center;
  padding: var(--space-7) 0;
  border-top: 1px solid var(--line);
}

.research-card:first-child {
  border-top: 0;
  padding-top: 0;
}

.research-card > p:first-child {
  grid-column: 1;
  grid-row: 1;
}

.research-card > section {
  grid-column: 2;
  grid-row: 1;
}

.research-card:nth-child(even) > p:first-child {
  grid-column: 2;
}

.research-card:nth-child(even) > section {
  grid-column: 1;
}

.research-card > section > * {
  margin: 0;
}

/* Figure panel */
.research-card > p:first-child {
  margin: 0;
  padding: clamp(0.75rem, 0.5rem + 1vw, 1.5rem);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
  transition: box-shadow 260ms var(--ease), border-color 260ms var(--ease);
}

.research-card > p:first-child:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-2);
}

.research-card img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: var(--radius-sm);
  cursor: zoom-in;
}

.research-card img.img-contain {
  width: auto;
  max-width: 100%;
  max-height: 360px;
}

/* Number + heading */
.research-card h3 {
  font-size: var(--fs-h3);
  line-height: 1.2;
  margin-bottom: var(--space-4);
}

.research-card h3::before {
  content: counter(project, decimal-leading-zero);
  display: block;
  margin-bottom: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.research-desc {
  display: block;
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink-2);
  max-width: var(--measure);
}

.research-card p:has(.research-desc) {
  margin-bottom: var(--space-4);
}

.research-card p:has(.badge) {
  margin-bottom: var(--space-2);
}

.research-responsible {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35em;
  font-size: var(--fs-small);
  color: var(--muted);
}

.research-responsible a {
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 100% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: color var(--fast) var(--ease), background-size var(--fast) var(--ease);
}

.research-responsible a:hover {
  color: var(--brand);
}

@media (max-width: 991.98px) {
  .research-card {
    grid-template-columns: minmax(0, 1fr);
    padding: var(--space-7) 0;
  }

  .research-card > p:first-child,
  .research-card > section,
  .research-card:nth-child(even) > p:first-child,
  .research-card:nth-child(even) > section {
    grid-column: 1;
    grid-row: auto;
  }

  .research-card > p:first-child {
    margin-bottom: var(--space-5);
  }

  .research-card img.img-contain {
    max-width: 30rem;
  }
}

@media (max-width: 575.98px) {
  .research-card > p:first-child {
    padding: var(--space-2);
    border-radius: var(--radius-md);
  }
}

/* --------------------------------------------------------------------------
   Team
   -------------------------------------------------------------------------- */

.team-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-7) clamp(1rem, 0.5rem + 1.5vw, 2rem);
}

.team-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.team-card p {
  margin: 0;
}

/* Portrait */
.team-card > p:first-child {
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  margin-bottom: var(--space-4);
  isolation: isolate;
}

.team-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 25%;
  filter: saturate(0.88);
  transition: transform 600ms var(--ease), filter 600ms var(--ease);
}

.team-card:hover img {
  transform: scale(1.035);
  filter: saturate(1);
}

.team-name {
  display: block;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.team-role {
  display: block;
  margin-top: 0.3rem;
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Contact icons */
.team-card > p:last-child {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: var(--space-4);
}

.team-card > p:last-child a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  font-size: 0.95rem;
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  transition: color var(--fast) var(--ease), background-color var(--fast) var(--ease), border-color var(--fast) var(--ease), transform var(--fast) var(--ease);
}

.team-card > p:last-child a:hover,
.team-card > p:last-child a:focus-visible {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
  transform: translateY(-1px);
}

/* Group leader: wide card across the top of the grid */
.team-lead {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  grid-template-rows: 1fr auto auto auto 1fr;
  column-gap: clamp(1.5rem, 1rem + 3vw, 3.5rem);
  align-items: start;
  padding: clamp(1.25rem, 1rem + 1.5vw, 2rem);
  margin-bottom: var(--space-4);
  background-color: var(--surface);
  background-image: var(--grid-lines);
  background-size: 28px 28px;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius-lg) + 6px);
}

.team-lead > p:first-child {
  grid-row: 1 / -1;
  margin: 0;
}

.team-lead img {
  aspect-ratio: 1 / 1;
}

.team-lead > p:not(:first-child) {
  grid-column: 2;
}

.team-lead > p:nth-child(2) {
  grid-row: 2;
}

.team-lead > p:nth-child(3) {
  grid-row: 3;
}

.team-lead > p:nth-child(4) {
  grid-row: 4;
}

.team-lead .team-name {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.team-lead .team-role {
  margin-top: var(--space-3);
  color: var(--accent);
}

.team-lead > p:last-child {
  margin-top: var(--space-5);
}

@media (max-width: 991.98px) {
  .team-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 767.98px) {
  .team-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-6) var(--space-4);
  }

  .team-name {
    font-size: 1rem;
  }

  .team-role {
    font-size: 0.875rem;
    letter-spacing: 0.06em;
  }

  .team-card > p:last-child a {
    width: 2.75rem;
    height: 2.75rem;
  }

  .team-card > p:last-child {
    gap: 0.25rem;
  }
}

@media (max-width: 575.98px) {
  .team-lead {
    grid-template-columns: minmax(0, 7rem) minmax(0, 1fr);
    column-gap: var(--space-4);
    padding: var(--space-4);
  }

  .team-lead > p:last-child {
    grid-column: 1 / -1;
    grid-row: 5;
    margin-top: var(--space-4);
  }

  .team-lead {
    grid-template-rows: 1fr auto auto 1fr auto;
  }

  .team-lead > p:first-child {
    grid-row: 1 / 5;
  }

  .team-lead > p:nth-child(2) {
    grid-row: 2;
  }

  .team-lead > p:nth-child(3) {
    grid-row: 3;
  }

  .team-lead .team-name {
    font-size: 1.5rem;
  }
}

/* --------------------------------------------------------------------------
   Publications
   -------------------------------------------------------------------------- */

.pub-note {
  display: block;
  font-size: var(--fs-small);
  color: var(--muted);
  margin-bottom: var(--space-4);
}

/* Leave room for the navbar and the sticky year index when jumping to a year */
html:has(.pub-years) {
  scroll-padding-top: 9rem;
}

/* Year index, filled in by _includes/after-body.html */
.pub-years {
  position: sticky;
  top: 4.25rem;
  z-index: 5;
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  margin: 0 calc(-1 * var(--space-2)) var(--space-7);
  padding: var(--space-3) var(--space-2);
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}

.pub-years::-webkit-scrollbar {
  display: none;
}

.pub-years:empty {
  display: none;
}

.pub-years a {
  flex: none;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-2);
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  transition: color var(--fast) var(--ease), background-color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}

.pub-years a:hover,
.pub-years a:focus-visible {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

/* Each year: sticky year label on the left, entries on the right */
main section.level2:has(> h2.pub-year) {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  column-gap: clamp(1.5rem, 1rem + 2vw, 3.5rem);
  margin-bottom: var(--space-8);
}

h2.pub-year {
  grid-column: 1;
  grid-row: 1 / span 400;
  align-self: start;
  position: sticky;
  top: 8.5rem;
  margin: 0;
  padding-top: var(--space-5);
  font-family: var(--font-display);
  font-size: clamp(2rem, 1.6rem + 1.5vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--brand);
  border: 0;
  font-variant-numeric: lining-nums;
}

h2.pub-year::after {
  content: "";
  display: block;
  width: 1.75rem;
  height: 2px;
  margin-top: var(--space-4);
  background: var(--accent);
}

h2.pub-year .anchorjs-link {
  display: none;
}

.pub-entry {
  grid-column: 2;
  position: relative;
  padding: var(--space-5) var(--space-5);
  margin: 0 calc(-1 * var(--space-5));
  border-radius: var(--radius-md);
  transition: background-color var(--fast) var(--ease);
}

.pub-entry + .pub-entry::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--space-5);
  right: var(--space-5);
  border-top: 1px solid var(--line);
}

.pub-entry:hover {
  background: var(--surface);
}

.pub-entry:hover::before,
.pub-entry:hover + .pub-entry::before {
  border-top-color: transparent;
}

.pub-entry p {
  margin: 0;
}

.pub-title {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 1.05rem + 0.35vw, 1.3rem);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-2);
  max-width: 54rem;
}

.pub-title a {
  color: var(--ink);
  text-decoration: none;
  background-image: linear-gradient(var(--brand), var(--brand));
  background-size: 0 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: color var(--fast) var(--ease), background-size 300ms var(--ease);
}

.pub-title a:hover {
  color: var(--brand);
  background-size: 100% 1px;
}

.pub-authors {
  display: block;
  font-size: var(--fs-small);
  line-height: 1.6;
  color: var(--muted);
  margin-bottom: var(--space-2);
  max-width: 60rem;
}

.pub-authors strong {
  color: var(--ink);
  font-weight: 600;
}

.pub-venue {
  display: block;
  font-size: var(--fs-small);
  font-style: italic;
  color: var(--ink-2);
  margin-bottom: var(--space-3);
}

/* "Oral" / "Early Accept" inside the venue line */
.pub-highlight {
  display: inline-block;
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  vertical-align: 0.1em;
}

/* Award badge */
.pub-award {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gold-ink);
  background: var(--gold-soft);
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  margin: 0 0.35rem var(--space-3) 0;
}

.pub-award .fa-trophy {
  color: #c08a12;
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pub-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  padding: 0.3rem 0.65rem;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: color var(--fast) var(--ease), background-color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}

.pub-links a::after {
  content: "↗";
  font-family: var(--font-sans);
  font-size: 0.8em;
  opacity: 0.6;
  transition: transform var(--fast) var(--ease), opacity var(--fast) var(--ease);
}

.pub-links a:hover,
.pub-links a:focus-visible {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.pub-links a:hover::after {
  opacity: 1;
  transform: translate(1px, -1px);
}

@media (max-width: 767.98px) {
  main section.level2:has(> h2.pub-year) {
    display: block;
    margin-bottom: var(--space-6);
  }

  h2.pub-year {
    position: static;
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: 0 0 var(--space-3);
    font-size: 2rem;
  }

  h2.pub-year::after {
    flex: 1;
    width: auto;
    height: 1px;
    margin: 0;
    background: var(--line-strong);
  }

  .pub-entry {
    padding: var(--space-4) var(--space-3);
    margin: 0 calc(-1 * var(--space-3));
  }

  .pub-entry + .pub-entry::before {
    left: var(--space-3);
    right: var(--space-3);
  }

  .pub-years {
    top: 3.75rem;
  }

  .pub-links a {
    padding: 0.5rem 0.75rem;
  }
}

/* --------------------------------------------------------------------------
   Open positions
   -------------------------------------------------------------------------- */

.position-panel {
  position: relative;
  max-width: 52rem;
  padding: clamp(1.75rem, 1rem + 3vw, 3.5rem);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius-lg) + 6px);
  box-shadow: var(--shadow-2);
  overflow: hidden;
}

.position-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}

.position-panel p {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.75rem);
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.position-panel a {
  font-weight: 500;
  overflow-wrap: anywhere;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

/* --------------------------------------------------------------------------
   Contact
   -------------------------------------------------------------------------- */

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(1.25rem, 1rem + 2vw, 2.5rem);
  align-items: stretch;
}

.contact-card {
  padding: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.contact-card h3 {
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 var(--space-5);
}

.contact-card h3 .anchorjs-link {
  display: none;
}

.contact-address {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 1.15rem + 0.6vw, 1.6rem);
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.contact-address p {
  margin: 0;
}

.contact-grid > p:has(iframe),
.contact-grid > iframe {
  margin: 0;
}

.contact-map {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 22rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line) !important;
  filter: grayscale(0.35) contrast(1.02);
  transition: filter 400ms var(--ease);
}

.contact-map:hover {
  filter: none;
}

@media (max-width: 767.98px) {
  .contact-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .contact-map {
    min-height: 18rem;
  }
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.nav-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  font-size: var(--fs-small);
  color: var(--muted);
  padding: var(--space-6) max(var(--gutter), calc((100% - var(--container)) / 2)) !important;
  min-height: 0;
}

.nav-footer a {
  color: var(--ink-2);
  text-decoration: none;
}

.nav-footer a:hover {
  color: var(--brand);
}

.nav-footer .bi {
  font-size: 1.1rem;
}

/* --------------------------------------------------------------------------
   404
   -------------------------------------------------------------------------- */

.not-found-page main.content > p {
  max-width: var(--measure);
  font-size: var(--fs-lead);
  color: var(--ink-2);
}
