:root {
  --bg: #0b1020;
  --panel: #121935;
  --panel-2: #172042;
  --text: #f4f7fb;
  --muted: #cad4e5;
  --line: rgba(255,255,255,0.12);
  --accent: #7cc7ff;
  --shadow: 0 14px 36px rgba(0,0,0,0.28);
  --radius: 18px;
  --max: 1120px;
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-width: 320px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.65;
  color: var(--text);
  background: linear-gradient(180deg, #0a0f1f 0%, #101935 100%);
}
a { color: var(--text); }
a:hover { color: #ffffff; }
img {
  max-width: 100%;
  display: block;
  height: auto;
}
.container {
  width: min(calc(100% - 2rem), var(--max));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(10, 15, 31, 0.72);
  border-bottom: 1px solid var(--line);
}
.topbar nav {
  display: flex;
  justify-content: center;
}
.topbar ul {
  margin: 0;
  padding: 0.9rem 0;
  list-style: none;
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  justify-content: center;
}
.topbar a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
}
.topbar a:hover { color: var(--text); }

.hero {
  padding: 3.5rem 0 2rem;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 2rem;
  align-items: center;
}
.hero-photo {
  justify-self: start;
}
.hero-photo img {
  width: 100%;
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.hero-copy {
  min-width: 0;
}
.hero-copy h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
}
.hero-copy h2 {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  font-weight: 600;
}
.hero-copy p {
  margin: 0 0 1rem;
  color: var(--muted);
}

.section {
  padding: 1.25rem 0 2.5rem;
}
.section h2 {
  margin: 0 0 1.2rem;
  font-size: clamp(1.5rem, 2.4vw, 1.75rem);
  letter-spacing: 0.01em;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}
.card {
  background: linear-gradient(135deg, rgba(24,35,74,0.96), rgba(53,92,153,0.88));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem;
  min-height: 180px;
  box-shadow: var(--shadow);
}
.card h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.15rem;
}
.card p {
  color: var(--muted);
  margin: 0.4rem 0;
}
.card ul {
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
  color: var(--muted);
}
.card a { text-underline-offset: 2px; }
.card.research { background: linear-gradient(135deg, rgba(33, 82, 181, 0.94), rgba(90, 183, 227, 0.86)); }
.card.teaching { background: linear-gradient(135deg, rgba(132, 59, 180, 0.94), rgba(232, 121, 122, 0.84)); }
.card.group { background: linear-gradient(135deg, rgba(61, 102, 173, 0.94), rgba(115, 175, 235, 0.84)); }
.card.cv { background: linear-gradient(135deg, rgba(36, 103, 194, 0.94), rgba(92, 166, 230, 0.84)); }
.card.outreach { background: linear-gradient(135deg, rgba(145, 72, 166, 0.94), rgba(233, 121, 175, 0.84)); }
.card.press { background: linear-gradient(135deg, rgba(195, 92, 50, 0.94), rgba(239, 171, 92, 0.84)); }

.highlight-grid,
.about-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}
.highlight,
.about-card {
  background: rgba(18, 25, 53, 0.88);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  min-width: 0;
}
.highlight p,
.about-card p {
  margin-top: 0;
  color: var(--muted);
}
.figure-stack {
  display: grid;
  gap: 0.85rem;
}
.figure-stack img { border-radius: 12px; }
.about-card img {
  border-radius: 14px;
  margin-top: 0.8rem;
}

.footer {
  padding: 1.5rem 0 2.5rem;
  color: var(--muted);
  text-align: center;
  font-size: 0.95rem;
}
.footer a { color: var(--muted); }

/* Large tablets and small laptops */
@media (max-width: 1024px) {
  .hero {
    padding-top: 2.75rem;
  }
  .hero-grid {
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    gap: 1.5rem;
  }
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* iPad portrait and similar tablets */
@media (max-width: 820px) {
  .container {
    width: min(calc(100% - 1.5rem), var(--max));
  }
  .topbar ul {
    gap: 0.9rem;
    padding: 0.8rem 0;
  }
  .hero-grid,
  .highlight-grid,
  .about-grid {
    grid-template-columns: 1fr;
  }
  .hero-photo {
    max-width: 340px;
    width: 100%;
    justify-self: center;
  }
  .hero-copy {
    text-align: left;
  }
}

/* Phones */
@media (max-width: 600px) {
  .container {
    width: min(calc(100% - 1rem), var(--max));
  }
  .topbar nav {
    justify-content: stretch;
  }
  .topbar ul {
    width: 100%;
    gap: 0.6rem 1rem;
    padding: 0.75rem 0;
  }
  .topbar li {
    flex: 1 1 40%;
    text-align: center;
  }
  .hero {
    padding-top: 1.5rem;
  }
  .hero-grid,
  .card-grid,
  .highlight-grid,
  .about-grid {
    grid-template-columns: 1fr;
  }
  .card,
  .highlight,
  .about-card {
    padding: 1rem;
  }
  .card {
    min-height: unset;
  }
  .hero-copy h1 {
    font-size: 2rem;
  }
}

/* Very narrow phones */
@media (max-width: 380px) {
  .topbar li {
    flex-basis: 100%;
  }
  .hero-copy h1 {
    font-size: 1.8rem;
  }
}


.original-format {
  padding-top: 0.75rem;
}
.original-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  align-items: start;
}
.original-row.three-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.original-col {
  min-width: 0;
}
.original-col p {
  margin-top: 0;
  color: var(--muted);
}
.image.small {
  display: block;
  margin-top: 0.85rem;
}
.image.small img {
  width: 100%;
  height: auto;
  border-radius: 12px;
}
#highlights.original-format .original-col,
#about.original-format .original-col {
  background: transparent;
  border: 0;
  padding: 0;
  box-shadow: none;
}
@media (max-width: 820px) {
  .original-row,
  .original-row.three-col {
    grid-template-columns: 1fr;
  }
}
