:root {
  --text: #1f2933;
  --muted: #52616b;
  --blue: #0066cc;
  --blue-dark: #004a99;
  --orange: #d95f02;
  --purple: #7570b3;
  --bg: #f6f8fb;
  --card: #ffffff;
  --border: #e3e8ef;
  --shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 6px 18px rgba(15, 23, 42, 0.06);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.5rem 1rem 2.5rem 1rem;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(0, 102, 204, 0.10), transparent 34rem),
    radial-gradient(circle at top right, rgba(217, 95, 2, 0.10), transparent 28rem),
    var(--bg);
}

/* Home page full-width shell */
body.home-page {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
}

.page-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.5rem 1rem 0 1rem;
}

main.page-shell {
  padding-top: 0;
  padding-bottom: 0.75rem;
}

.footer-shell {
  padding-top: 0;
  padding-bottom: 2.5rem;
}


a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

header {
  display: block;
  padding: 1rem 0 1.15rem 0;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.brand {
  max-width: 900px;
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.45rem 0.75rem;
  margin-top: 1rem;
}

nav a {
  white-space: nowrap;
  padding: 0.42rem 0.65rem;
  border-radius: 999px;
  color: var(--blue-dark);
  font-weight: 650;
  font-size: 0.95rem;
}

nav a:hover,
nav a.active {
  background: rgba(0, 102, 204, 0.08);
  text-decoration: none;
}

nav a.active {
  color: var(--blue-dark);
  box-shadow: inset 0 0 0 1px rgba(0, 102, 204, 0.18);
}

.brand h1 {
  margin: 0 0 0.25rem 0;
  font-size: 2.05rem;
  font-weight: 820;
  letter-spacing: 0.2px;
}

.subtitle {
  margin: 0;
  font-size: 1.50rem;
  color: var(--orange);
  font-weight: 720;
}

.m2d2-letter {
  color: var(--purple);
  font-weight: 850;
}

.subtitle1 {
  margin: 0;
  font-size: 1.02rem;
  color: var(--blue);
  font-weight: 720;
}

.affiliation {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.brand-intro {
  max-width: 820px;
  margin: 0.65rem 0 0.35rem 0;
  color: var(--blue);
  font-size: 1.02rem;
  font-weight: 720;
  line-height: 1.55;
}


/* Full-width home animation strip */
.full-bleed-media {
  max-width: 1120px;
  width: calc(100% - 2rem);
  margin: 0 auto 1.75rem auto;
  display: grid;
  grid-template-columns: 0.980fr 0.988fr 0.667fr 1fr;
  gap: 0;
  overflow: hidden;
  background: #f8fafc;
  line-height: 0;
}

.media-tile {
  min-width: 0;
  overflow: hidden;
  background: #f8fafc;
}

.media-tile-1 { aspect-ratio: 588 / 600; }
.media-tile-2 { aspect-ratio: 497 / 503; }
.media-tile-3 { aspect-ratio: 256 / 384; }
.media-tile-4 { aspect-ratio: 523 / 523; }

.media-tile img,
.media-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


main { margin-top: 0; }

.hero {
  background: linear-gradient(135deg, rgba(255,255,255,0.96), rgba(255,255,255,0.88));
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 2rem;
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.hero-title {
  max-width: 960px;
  margin: 0;
  font-size: clamp(1.45rem, 2.4vw, 1.85rem);
  line-height: 1.18;
  letter-spacing: -0.018em;
  font-weight: 780;
}

.hero-title span { color: var(--blue-dark); }

.hero-subtitle {
  max-width: 900px;
  margin: 0.65rem 0 0 0;
  color: #9a3f00;
  font-size: clamp(1rem, 1.65vw, 1.22rem);
  line-height: 1.4;
  font-weight: 690;
}

.hero-subtitle span { color: var(--blue-dark); }

.hero-text {
  max-width: 900px;
  margin-top: 0.85rem;
  margin-bottom: 1.5rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-media-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1.25rem;
}

.hero-panel {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.hero-panel-media {
  aspect-ratio: 4 / 3;
  width: 100%;
  background:
    linear-gradient(135deg, rgba(0, 102, 204, 0.12), rgba(117, 112, 179, 0.12)),
    #eef3f9;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.75rem;
  color: var(--muted);
  font-weight: 750;
  letter-spacing: 0.01em;
}

.hero-panel-media img,
.hero-panel-media video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #f8fafc;
}

.hero-media-subtitle {
  margin: 0.85rem 0 0 0;
  color: var(--muted);
  font-size: 0.96rem;
  text-align: center;
}

.card,
.content-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.35rem 1.5rem;
  box-shadow: var(--shadow-soft);
  margin-bottom: 1.25rem;
}

h2,
h2.section-heading {
  margin: 0 0 1rem 0;
  font-size: 1.3rem;
  border-left: 4px solid var(--blue);
  padding-left: 0.65rem;
  font-weight: 800;
}

/* News */
.news-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--border);
}

.news-item {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 1rem;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--border);
}

.news-date {
  color: var(--purple);
  font-weight: 800;
  font-size: 0.95rem;
}

.news-title { font-weight: 800; }

.news-item p {
  margin: 0.25rem 0 0 0;
  color: var(--muted);
  font-size: 0.96rem;
}

/* People */
.people-card {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.2rem;
  align-items: baseline;
  color: var(--muted);
}
.people-card strong { color: var(--text); }

.member {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding: 1.1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.avatar {
  width: 140px;
  height: 140px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #f5f7fa;
  flex: 0 0 auto;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.member-info { flex: 1; min-width: 250px; }
.name-line { font-weight: 800; font-size: 1.08rem; margin-bottom: 0.25rem; }
.role-line { font-size: 0.95rem; color: var(--muted); margin-bottom: 0.5rem; }
.contact-line, .research-line, .bio-line { font-size: 0.95rem; margin-bottom: 0.4rem; }
.links a { margin-right: 0.75rem; white-space: nowrap; }
.links a::after { content: "↗"; font-size: 0.85em; margin-left: 0.2rem; color: #777; }
.alumni-list li { margin-bottom: 0.5rem; }

/* Publications */
.pubs {
  list-style: none;
  padding: 1.2rem 1.4rem;
  margin: 1rem 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
}

.pub {
  margin: 0;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}
.pub:last-child { border-bottom: 0; }
.pub-title { font-weight: 650; margin: 0; }
.pub-title a { color: var(--blue-dark); text-decoration: none; }
.pub-title a:hover { text-decoration: underline; }
.pub-meta { font-size: 0.95rem; color: var(--muted); }
.me { font-weight: 800; color: var(--text); }
.dot { color: #aaa; margin: 0 0.3rem; }

/* Research page */
.section-title {
  text-align: center;
  font-size: 1.55rem;
  font-weight: 820;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.section-sub {
  text-align: center;
  color: var(--muted);
  margin: 0 auto 1.5rem auto;
  max-width: 780px;
}

.overview,
.note {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.25rem 1.4rem;
  box-shadow: var(--shadow-soft);
  margin: 0 auto 1.5rem auto;
  max-width: 960px;
}
.overview p { margin-top: 0; }

.themes {
  display: block;
  margin-top: 1.5rem;
}

.theme {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.25rem;
  margin-bottom: 1.35rem;
  box-shadow: var(--shadow-soft);
}

.theme h3 {
  margin: 0 0 0.85rem 0;
  font-size: 1.25rem;
  color: var(--text);
}

.theme figure { margin: 0 0 1rem 0; }
.theme img {
  width: 100%;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  display: block;
  margin: 0.25rem auto 0.5rem auto;
}
.theme figcaption {
  font-size: 0.92rem;
  color: var(--muted);
  text-align: center;
}

.image-placeholder {
  min-height: 240px;
  border: 1px dashed rgba(0, 102, 204, 0.35);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(0, 102, 204, 0.08), rgba(217, 95, 2, 0.08)),
    #f8fafc;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
  margin-bottom: 0.5rem;
}
.image-placeholder strong { color: var(--text); margin-bottom: 0.25rem; }

.theme-text p { margin-top: 0; }
.keywords {
  margin-top: 0.7rem;
  color: var(--muted);
  font-size: 0.94rem;
}
.papers-block { margin-top: 0.85rem; }
.papers-title { font-weight: 800; margin-bottom: 0.25rem; }
.papers { margin-top: 0.25rem; padding-left: 1.1rem; }
.papers li { margin-bottom: 0.35rem; }

/* General content */
ul { padding-left: 1.25rem; }

footer {
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  padding: 1.25rem 0 0 0;
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 860px) {
  .hero {
    padding: 1.35rem;
  }

  .news-item {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }
}

@media (max-width: 900px) {
  .hero-media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  body { padding: 1rem 0.75rem 2rem 0.75rem; }
  .brand h1 { font-size: 1.8rem; }
  .hero-media-grid { grid-template-columns: 1fr; }
  .card, .content-card, .overview, .note, .theme, .pubs { padding: 1rem; }
  .member { padding: 0.9rem; }
}


/* Keep the home-page full-width strip from being constrained or stacked by other responsive rules */
@media (max-width: 900px) {
  .full-bleed-media {
    grid-template-columns: minmax(0, 0.980fr) minmax(0, 0.988fr) minmax(0, 0.667fr) minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  body.home-page {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 0;
  }

  .full-bleed-media {
    grid-template-columns: minmax(0, 0.980fr) minmax(0, 0.988fr) minmax(0, 0.667fr) minmax(0, 1fr);
  }

  .page-shell {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}
