:root {
  --bg: #f2f2f3;
  --surface: #ffffff;
  --text: #1c1c1e;
  --muted: #48484a;
  --hint: #8e8e93;
  --border: rgba(0, 0, 0, 0.07);
  --border-strong: rgba(0, 0, 0, 0.14);
  --accent: #0066cc;
  --accent-hover: #0052a3;
  --accent-light: rgba(0, 102, 204, 0.06);
  --radius: 6px;
  --radius-lg: 10px;
  --nav-bg: #ffffff;
  --dropdown-bg: #1c1c1e;
  --dropdown-text: #f2f2f3;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Cascadia Code', Consolas, monospace;
  --grid: 1fr;
  --content-max: 1000px;
  --nav-h: 64px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121213;
    --surface: #1c1c1e;
    --text: #f2f2f3;
    --muted: #98989d;
    --hint: #636366;
    --border: rgba(255, 255, 255, 0.07);
    --border-strong: rgba(255, 255, 255, 0.14);
    --accent: #2997ff;
    --accent-hover: #40a9ff;
    --accent-light: rgba(41, 151, 255, 0.08);
    --nav-bg: #121213;
    --dropdown-bg: #2c2c2e;
    --dropdown-text: #f2f2f3;
  }
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html, body {
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
}

p { text-align: justify; }

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

a {
  color: inherit;
}

.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

/* ── Navigation (Swiss: exact, structural, integrated) ── */
.main-nav {
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 0 1.5rem;
  height: var(--nav-h);
}

.nav-container {
  max-width: var(--content-max);
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.nav-logo img {
  height: 36px;
  width: auto;
  transition: opacity 0.15s;
}

.nav-logo:hover img {
  opacity: 0.75;
}

.mobile-menu-toggle {
  display: none;
}

.nav-links {
  display: flex;
  list-style: none;
  height: 100%;
  gap: 0;
}

.nav-links > li {
  height: 100%;
  position: relative;
}

.nav-links > li > a {
  display: flex;
  align-items: center;
  padding: 0 1rem;
  height: 100%;
  font-family: var(--font-sans);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.15s;
  position: relative;
  white-space: nowrap;
}

.nav-links > li > a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 1rem;
  right: 1rem;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.2s ease;
}

.nav-links > li > a:hover,
.nav-links > li > a.active-category {
  color: var(--text);
}

.nav-links > li > a.active-category::after,
.nav-links > li:hover > a::after {
  transform: scaleX(1);
}

/* Dropdown (Swiss: flat, exact) */
.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--dropdown-bg);
  min-width: 220px;
  opacity: 0;
  visibility: visible;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 1001;
}

.nav-links > li:hover .dropdown {
  opacity: 1;
  pointer-events: auto;
}

.dropdown-content a {
  display: block;
  padding: 0.7rem 1.25rem;
  color: var(--dropdown-text);
  text-decoration: none;
  font-size: 13px;
  transition: background 0.12s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.dropdown-content a:last-child {
  border-bottom: none;
}

.dropdown-content a:hover {
  background: rgba(255, 255, 255, 0.07);
}

/* ── Hero (Swiss poster-field) ── */
.hero {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 3rem;
  align-items: start;
  padding-top: 3rem;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 1.25rem;
  letter-spacing: -0.03em;
  max-width: 12ch;
}

.hero .subtitle {
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hint);
  margin-bottom: 1rem;
  font-weight: 500;
}

.hero .bio {
  font-size: 15px;
  color: var(--muted);
  max-width: 60ch;
  margin-bottom: 1.5rem;
  line-height: 1.8;
  text-align: justify;
}

.affil {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.affil svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: var(--hint);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cta-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 1.75rem;
}

.cta-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 7px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--muted);
  transition: background 0.12s, color 0.12s;
  font-weight: 500;
}

.cta-links a:hover {
  background: var(--surface);
  color: var(--text);
}

/* ── Carousel ── */
.carousel-container {
  width: 100%;
  aspect-ratio: 4 / 3;
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.carousel {
  width: 100%;
  height: 100%;
  position: relative;
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.4s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--hint);
  background: var(--surface);
}

.carousel-slide.active {
  opacity: 1;
  z-index: 1;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.25);
  color: white;
  border: none;
  padding: 6px 10px;
  cursor: pointer;
  z-index: 10;
  border-radius: 3px;
  font-size: 14px;
  transition: background 0.12s;
}

.carousel-btn:hover {
  background: rgba(0, 0, 0, 0.45);
}

.carousel-btn.prev { left: 8px; }
.carousel-btn.next { right: 8px; }

.carousel-dots {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  text-align: center;
  z-index: 10;
}

.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 3px;
  background: rgba(200, 200, 200, 0.5);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.15s;
}

.dot.active {
  background: rgba(200, 200, 200, 0.9);
}

/* ── Sections (Swiss: rule-led, paced) ── */
section {
  margin-top: 5rem;
  scroll-margin-top: calc(var(--nav-h) + 2rem);
}

.section-heading {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--hint);
  margin-bottom: 2rem;
  padding-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-heading::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── News ── */
.blog-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 1.5rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}

.blog-item:last-of-type {
  border-bottom: none;
}

.blog-item.has-image {
  grid-template-columns: 80px 1fr 260px;
}

.blog-date {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--hint);
  padding-top: 2px;
}

.blog-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.blog-excerpt {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  text-align: justify;
}

.blog-image {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

/* ── Home page news ── */
#news-container .blog-item {
  align-items: center;
}

#news-container .blog-item.has-image {
  grid-template-columns: 80px 1fr auto;
}

#news-container .blog-image {
  max-width: 100px;
  align-self: center;
}

#news-container .blog-excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Publications (Swiss: structured list, not cards) ── */
#publications-list,
#selected-pubs-container {
  counter-reset: pub-counter;
}

.pub {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 1rem;
  align-items: start;
  counter-increment: pub-counter;
}

.pub > div {
  grid-column: 2;
}

.pub:last-of-type {
  border-bottom: none;
}

.pub::before {
  content: "[" counter(pub-counter) "]";
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  color: var(--hint);
  padding-top: 3px;
  text-align: right;
}

.pub[data-num]::before {
  content: "[" attr(data-num) "]";
}

.pub-year {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 6px;
  color: var(--hint);
  margin-right: 8px;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

.pub-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 0.3rem;
  line-height: 1.4;
}

.pub-authors {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 0.2rem;
  line-height: 1.6;
  text-align: justify;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.pub-journal {
  font-size: 13px;
  color: var(--hint);
  text-align: justify;
}

.pub-journal em {
  font-style: normal;
  color: var(--text);
}

.pub-links {
  display: flex;
  gap: 8px;
  margin-top: 0.7rem;
}

.pub-link {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--muted);
  transition: background 0.1s, color 0.1s;
}

.pub-link:hover {
  background: var(--surface);
  color: var(--text);
}

.all-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  margin-top: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: color 0.12s;
}

.all-link:hover {
  color: var(--text);
}

/* ── Research Topics (Swiss: paced, open composition) ── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: border-color 0.15s;
}

.project-card:hover {
  border-color: var(--border-strong);
}

.project-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.project-card p {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.6;
}

/* Full research topic page */
.research-topic {
  margin-bottom: 5rem;
  scroll-margin-top: calc(var(--nav-h) + 2rem);
}

.research-topic h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.topic-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--hint);
  font-size: 13px;
  overflow: hidden;
}

.topic-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.topic-description {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.8;
  text-align: justify;
}

.topic-description p {
  margin-bottom: 1rem;
}

/* ── PI Profile (Swiss split) ── */
.pi-profile-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 3rem;
  align-items: start;
}

.pi-image {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}

.pi-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pi-cv h2 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 700;
  margin-bottom: 0.3rem;
  letter-spacing: -0.03em;
}

.pi-cv .subtitle {
  font-size: 11.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--hint);
  margin-bottom: 1.5rem;
}

.pi-cv h3 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.pi-cv p {
  color: var(--text);
  margin-bottom: 1.25rem;
  line-height: 1.8;
  font-size: 14.5px;
}

.pi-cv h4 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.pi-cv ul {
  color: var(--muted);
  margin-bottom: 1.25rem;
  padding-left: 1rem;
  line-height: 1.8;
  font-size: 14px;
}

.pi-cv li {
  margin-bottom: 0.2rem;
}

/* ── Group (Swiss grid) ── */
.group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1.25rem;
}

.member-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s;
}

.member-card:hover {
  border-color: var(--border-strong);
}

a.member-card {
  text-decoration: none !important;
  color: inherit !important;
  display: block;
}

a.member-card:visited,
a.member-card:link,
a.member-card:hover,
a.member-card:active {
  text-decoration: none !important;
  color: inherit !important;
}

a.member-card .member-name,
a.member-card .member-role {
  color: inherit;
}

.member-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.02em;
  object-fit: cover;
}

.member-name {
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.member-role {
  font-size: 11.5px;
  color: var(--hint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.member-details {
  display: none;
}

/* ── Modal (Swiss: clean, structural) ── */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-content {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  padding: 2rem;
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--hint);
  line-height: 1;
  padding: 2px;
}

.modal-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.modal-avatar {
  width: 200px;
  height: 250px;
  border-radius: 0;
  margin: 0 auto 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  font-weight: 700;
  overflow: hidden;
}
.modal-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-name {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.modal-role {
  font-size: 12px;
  color: var(--hint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.modal-section {
  margin-bottom: 1.25rem;
}

.modal-section-title {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--hint);
  margin-bottom: 0.4rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--border);
}

.modal-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  text-align: justify;
}

/* ── Contact ── */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.contact-intro {
  margin-bottom: 1.5rem;
  font-size: 15px;
  color: var(--muted);
  max-width: 55ch;
  line-height: 1.7;
  text-align: justify;
}

.contact-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.contact-email {
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.12s;
}

.contact-email:hover {
  color: var(--accent-hover);
}

.contact-detail {
  margin-top: 0.75rem;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}

.address-label {
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.address-body {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 0.75rem;
  font-size: 14px;
  color: var(--muted);
}

.contact-row svg {
  width: 16px;
  height: 16px;
  stroke: var(--hint);
  fill: none;
  stroke-width: 1.5;
}

/* ── Institutions strip ── */
.institutions {
  display: flex;
  justify-content: center;
  gap: 3rem;
  align-items: center;
  padding: 3rem 0 1rem;
  border-top: 1px solid var(--border);
  margin-top: 4rem;
  flex-wrap: wrap;
}

.institutions img {
  height: 80px;
  width: auto;
}

/* ── Footer (Swiss: minimal, structured) ── */
footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--hint);
  flex-wrap: wrap;
  gap: 1rem;
}

/* ── Positions / Theses ── */
.position-card {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s;
  margin-bottom: 1rem;
}

.position-card:hover {
  border-color: var(--accent);
}

.position-card-body {
  flex: 1;
  min-width: 0;
}

.position-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 0.3rem;
  margin-top: 0.5rem;
}

.position-card p {
  font-size: 13.5px;
  color: var(--muted);
}

.position-date {
  font-size: 12px;
  color: var(--hint);
  margin-bottom: 0.4rem;
  font-weight: 500;
}

.position-preview {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.6;
  text-align: justify;
}

.position-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.65rem;
  border-radius: 100px;
  margin-bottom: 0.5rem;
}

.position-thumb {
  width: 160px;
  height: 120px;
  object-fit: cover;
  border-radius: var(--radius);
  flex-shrink: 0;
}

.modal-image {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: var(--radius);
  margin-top: 0.5rem;
}

.modal-attachment-btn {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.5rem 1.2rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  transition: opacity 0.2s;
}

.modal-attachment-btn:hover {
  opacity: 0.85;
}

.thesis-item {
  margin-bottom: 2.5rem;
}

.thesis-item h3 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.thesis-entry {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  background: var(--surface);
}

.thesis-entry strong {
  font-size: 14px;
}

.thesis-entry span,
.thesis-entry a {
  font-size: 13px;
  color: var(--muted);
}

.thesis-entry a {
  color: var(--accent);
  text-decoration: none;
}

.thesis-entry a:hover {
  text-decoration: underline;
}

/* ── Funding grid ── */
.funding-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
}

.funding-card {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  transition: border-color 0.15s;
}

.funding-card:hover {
  border-color: var(--border-strong);
}

.funding-card img {
  height: 60px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

/* ── Scroll reveals (Swiss: restrained, exact) ── */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.05s; }
.reveal-delay-2 { transition-delay: 0.1s; }
.reveal-delay-3 { transition-delay: 0.15s; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding-top: 1.5rem;
  }

  .hero h1 {
    max-width: 100%;
  }

  .pi-profile-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .main-nav {
    height: 56px;
    padding: 0 1rem;
  }

  .main-nav::before {
    content: '';
    position: fixed;
    top: 56px; left: 0;
    width: 100%;
    height: calc(100vh - 56px);
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1400;
  }

  .main-nav.menu-open::before {
    opacity: 1;
    pointer-events: auto;
  }

  .nav-container {
    height: 100%;
    padding: 0;
  }

  .nav-logo img {
    height: 30px;
  }

  .nav-links {
    position: fixed;
    top: 56px;
    right: 0;
    width: 100%;
    height: calc(100vh - 56px);
    background: var(--nav-bg);
    flex-direction: column;
    padding: 1rem 0;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 1500;
    gap: 0;
  }

  .main-nav.menu-open .nav-links {
    transform: translateX(0);
  }

  .mobile-menu-toggle {
    order: 2;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 22px;
    height: 16px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 2000;
  }

  .mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text);
    border-radius: 1px;
    transition: all 0.3s;
  }

  .main-nav.menu-open .mobile-menu-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .main-nav.menu-open .mobile-menu-toggle span:nth-child(2) {
    opacity: 0;
  }

  .main-nav.menu-open .mobile-menu-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .nav-links > li {
    width: 100%;
    height: auto;
    border-bottom: 1px solid var(--border);
  }

  .nav-links > li > a {
    padding: 1rem 1.5rem;
    font-size: 13px;
    justify-content: flex-start;
    width: 100%;
    touch-action: manipulation;
    height: auto;
  }

  .nav-links > li > a::after {
    display: none;
  }

  .dropdown {
    display: none;
    position: static;
    width: 100%;
    background: var(--bg);
    padding-left: 0;
    box-shadow: none;
    border-top: 1px solid var(--border);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .dropdown.dropdown-open {
    display: block;
    animation: dropdownIn 0.2s ease-out;
  }

  .dropdown-closing {
    display: block;
    animation: dropdownOut 0.15s ease-in forwards;
  }

  @keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
  }

  @keyframes dropdownOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-6px); }
  }

  .dropdown-content a {
    padding: 0.85rem 1.25rem;
    font-size: 13px;
    border-bottom: none;
    display: block;
    touch-action: manipulation;
    color: var(--muted);
  }

  section {
    margin-top: 3rem;
  }

  .section-heading {
    font-size: 11.5px;
    margin-bottom: 1.25rem;
  }

  .position-card {
    flex-direction: column;
  }

  .position-thumb {
    width: 100%;
    height: auto;
    max-height: 180px;
  }

  .pub {
    grid-template-columns: 28px 1fr;
    gap: 0.75rem;
  }

  .pub-title {
    font-size: 14px;
  }

  .group-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
  }

  .institutions {
    gap: 2rem;
    padding: 2rem 0;
  }

  .institutions img {
    height: 50px;
  }

  footer {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.75rem;
  }

  .research-topic h2 {
    font-size: 1.35rem;
  }

  .pi-cv h2 {
    font-size: 1.35rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .group-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .publications-list {
    gap: 1rem;
  }
}
