:root {
  --bg: #f7fafc;
  --panel: #ffffff;
  --panel-2: #eef6fb;
  --text: #162033;
  --muted: #55657d;
  --accent: #1769aa;
  --accent-2: #2b8f75;
  --border: rgba(22, 32, 51, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
  line-height: 1.65;
}

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

a:hover {
  text-decoration: underline;
}

.container {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}

.brand {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--muted);
}

.hero {
  min-height: 72vh;
  display: flex;
  align-items: center;
  padding: 3rem 0 0;
}

.hero-home {
  padding-bottom: 4rem;
}

.hero-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 500px);
  align-items: center;
}

.hero-home .hero-image {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: end;
  row-gap: 1rem;
  margin: 0;
  justify-self: end;
  width: 100%;
}

.figure-gallery {
  position: relative;
  width: min(100%, 500px);
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 0.5rem;
  background: #000000;
  box-shadow: 0 25px 70px rgba(45, 65, 90, 0.18);
}

.home-gif {
  display: block;
  height: 100%;
  width: 100%;
  object-fit: contain;
}

.gallery-control {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  color: #ffffff;
  background: rgba(22, 32, 51, 0.48);
  cursor: pointer;
  font-size: 1.7rem;
  line-height: 1;
  transform: translateY(-50%);
}

.gallery-control:hover,
.gallery-control:focus-visible {
  background: rgba(22, 32, 51, 0.72);
}

.gallery-control.previous {
  left: 0.75rem;
}

.gallery-control.next {
  right: 0.75rem;
}

.gallery-control[hidden] {
  display: none;
}

.figure-caption {
  width: min(100%, 500px);
  padding: 0 0.5rem;
  text-align: center;
}

.figure-caption-title {
  margin: 0;
  font-weight: 600;
  color: var(--text);
}

.figure-source {
  margin: 0.45rem 0 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.eyebrow,
.section-tag {
  display: inline-block;
  margin-bottom: 0.6rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(23, 105, 170, 0.1);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.1;
  margin: 0 0 1rem;
}

.lead {
  font-size: 1.06rem;
  color: var(--muted);
  max-width: 700px;
}

.lead-welcome {
  display: block;
  color: var(--text);
  font-weight: 700;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 1.3rem 0;
}

.recruitment-note {
  max-width: 34rem;
  margin: 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.08);
  color: var(--text);
  font-size: 0.98rem;
  line-height: 1.45;
}

.button {
  display: inline-block;
  padding: 0.8rem 1.1rem;
  border-radius: 999px;
  font-weight: 600;
}

.button.primary {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #ffffff;
}

.button.secondary {
  border: 1px solid var(--border);
  color: var(--text);
}

.hero-highlights {
  margin: 1.2rem 0 0;
  padding-left: 1rem;
  color: var(--muted);
}

.hero-card,
.card,
.publication-card,
.feature-card,
.contact-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 1.2rem;
  padding: 1.25rem;
  box-shadow: 0 18px 40px rgba(45, 65, 90, 0.1);
}

.hero-card ul {
  padding-left: 1rem;
  color: var(--muted);
}

.section {
  padding: 3rem 0;
}

.section.alt {
  background: var(--panel-2);
}

.research-themes {
  padding-top: 2.5rem;
}

.research-theme-grid {
  display: grid;
  gap: 1.8rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.research-theme-card {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  padding-bottom: 1rem;
  border-bottom: 1px solid #cfd8e3;
  color: var(--text);
}

.research-theme-card:hover {
  text-decoration: none;
}

.research-theme-card:hover h3,
.research-theme-card:focus-visible h3 {
  color: var(--accent);
}

.research-theme-figure {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 2.5;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.9rem;
  overflow: hidden;
}

.research-theme-figure.large {
  aspect-ratio: 16 / 9;
}

.research-theme-figure img {
  display: block;
  width: 90%;
  height: 90%;
  object-fit: contain;
}

.land-extremes-figure img {
  width: 96%;
  height: 96%;
}

.theme-card-gallery {
  position: relative;
}

.theme-card-gallery .theme-card-gallery-image {
  object-fit: contain;
}

.theme-card-gallery-label {
  position: absolute;
  left: 0;
  bottom: 0;
  max-width: 82%;
  padding: 0.45rem 0.65rem;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.62);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.25;
  pointer-events: none;
}

.theme-card-gallery .gallery-control {
  width: 2rem;
  height: 2rem;
  font-size: 1.45rem;
}

.theme-detail-gallery {
  position: relative;
}

.research-theme-card h3 {
  margin: 0.8rem 0 0.4rem;
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1.15;
}

.research-theme-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.theme-link {
  align-self: flex-start;
  margin-top: 1rem;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
}

.detail-container {
  max-width: 820px;
}

.back-link {
  display: inline-block;
  margin-bottom: 0.7rem;
  border-bottom: 1px solid currentColor;
  font-size: 0.9rem;
  font-weight: 600;
}

.research-detail h1 {
  margin: 0 0 1rem;
  color: var(--accent);
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.05;
}

.research-detail p {
  color: var(--muted);
}

.theme-detail-figure {
  margin: 2rem 0;
}

.theme-figure-gallery {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--panel);
}

.theme-gallery-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.theme-detail-figure figcaption {
  margin-top: 0.55rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.theme-subsections {
  display: grid;
  gap: 0.8rem;
  margin: 2rem 0;
}

.theme-subsection {
  border-top: 1px solid #cfd8e3;
  border-bottom: 1px solid #cfd8e3;
}

.theme-subsection + .theme-subsection {
  border-top: 0;
}

.theme-subsection summary {
  cursor: pointer;
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.3;
  padding: 1rem 0;
}

.theme-subsection summary::marker {
  color: var(--accent);
}

.theme-subsection p {
  margin: 0;
  padding: 0 0 1rem;
}

.subsection-figure {
  display: grid;
  place-items: center;
  position: relative;
  margin: 0 0 1rem;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--panel);
  overflow: hidden;
}

.subsection-figure img {
  display: block;
  width: 90%;
  height: 90%;
  object-fit: contain;
}

.subsection-figure figcaption {
  position: absolute;
  left: 0;
  bottom: 0;
  max-width: 88%;
  padding: 0.5rem 0.7rem;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.62);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.25;
}

.subsection-gallery .gallery-control {
  width: 2rem;
  height: 2rem;
  font-size: 1.45rem;
}

.subsection-note {
  color: var(--muted);
  font-size: 0.9rem;
  font-style: italic;
  text-align: right;
}

.equation-block {
  display: grid;
  gap: 0.45rem;
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--accent);
  background: #f4f8fb;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.02rem;
}

.equation-block p {
  margin: 0;
  padding: 0;
}

.equation-block span {
  display: inline-block;
}

.overline {
  text-decoration: overline;
}

.related-publications {
  margin-top: 2rem;
}

.related-publications h2 {
  margin: 0 0 1rem;
  color: var(--accent);
  font-size: 1.7rem;
}

.related-publication {
  padding: 1rem 0;
  border-top: 1px solid #cfd8e3;
}

.related-publication:last-child {
  border-bottom: 1px solid #cfd8e3;
}

.related-publication h3 {
  margin: 0 0 0.45rem;
  color: var(--text);
  font-size: 1.08rem;
  line-height: 1.25;
}

.related-publication .publication-meta {
  margin-top: 0;
}

.selected-publications {
  padding-top: 1rem;
}

.teaching-page h2 {
  margin-top: 0;
  color: var(--accent);
  font-size: clamp(2rem, 4vw, 3rem);
}

.teaching-block {
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border);
}

.teaching-block h3 {
  margin: 0 0 0.8rem;
  color: var(--text);
  font-size: 1.45rem;
}

.course-list {
  display: grid;
  gap: 0;
}

.course-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid #d5dde7;
}

.course-item:first-child {
  border-top: 0;
}

.course-item h4 {
  margin: 0 0 0.3rem;
  color: var(--text);
  font-size: 1.08rem;
}

.course-term {
  font-size: 0.9rem;
  font-weight: 600;
}

.course-item p {
  margin: 0;
  color: var(--muted);
}

.course-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.65rem;
  flex: 0 0 auto;
}

.course-item.course-feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  align-items: start;
  gap: 2rem;
}

.course-feature h4 {
  color: #000000;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.4;
}

.course-feature .course-catalog {
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.course-feature .course-term {
  margin-top: 0.6rem;
  color: var(--accent);
}

.course-feature .course-schedule {
  margin-top: 0.35rem;
  font-size: 0.95rem;
}

.course-feature .course-description {
  margin-top: 1rem;
  color: var(--text);
}

.course-feature .course-background {
  margin-top: 0.9rem;
  font-size: 0.95rem;
}

.course-flyer {
  width: 100%;
  max-width: 320px;
  margin: 0;
}

.course-flyer > a {
  display: block;
}

.course-flyer img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 0.4rem;
}

.course-flyer figcaption {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  text-align: center;
}

.group-page h2 {
  margin-top: 0;
  color: var(--accent);
  font-size: clamp(2rem, 4vw, 3rem);
}

.group-category {
  margin-top: 2rem;
  border-top: 1px solid var(--border);
  padding-top: 1.35rem;
}

.group-category h3 {
  margin: 0 0 1rem;
  color: var(--text);
  font-size: 1.4rem;
}

.person-profile {
  display: grid;
  grid-template-columns: 13rem 1fr;
  gap: 1.35rem;
  align-items: start;
  padding: 1.2rem 0;
}

.person-photo-frame {
  width: 100%;
  aspect-ratio: 1 / 1.08;
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  background: #ffffff;
  overflow: hidden;
}

.person-photo-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 30% 25%;
}

.person-photo-placeholder {
  background: #ffffff;
}

.person-photo-placeholder img {
  box-sizing: border-box;
  padding: 0.65rem;
  object-fit: contain;
  object-position: center;
  opacity: 0.10;
}

.student-photo-frame img {
  object-position: 50% 25%;
}

.student-photo-frame .ryan-portrait {
  object-position: 60% 50%;
}

.person-bio h4 {
  margin: 0 0 0.25rem;
  color: var(--text);
  font-size: 1.35rem;
}

.person-role {
  margin: 0 0 0.9rem;
  color: var(--text);
  font-weight: 700;
}

.person-bio p {
  margin: 0 0 0.75rem;
  color: var(--text);
  line-height: 1.55;
}

.person-section {
  margin-top: 1.2rem;
}

.person-section h5 {
  margin: 0 0 0.55rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 1.05rem;
}

.person-section ul {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text);
  line-height: 1.55;
}

.profile-link {
  display: inline-block;
  margin-top: 0.8rem;
  color: var(--accent);
  font-weight: 700;
}

.group-placeholder {
  margin: 0;
  color: var(--muted);
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}

.section-heading h2 {
  margin: 0;
  color: var(--accent);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.1;
}

.view-all-link,
.publication-read-link {
  border-bottom: 1px solid currentColor;
  color: var(--accent);
  font-weight: 600;
}

.selected-publication-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.selected-publication {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  padding-top: 0.8rem;
  border-top: 3px solid var(--accent);
}

.publication-figure-frame {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 2.5;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  font-size: 0.88rem;
  overflow: hidden;
}

.publication-figure-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.publication-meta {
  margin: 1rem 0 0.7rem;
  color: var(--accent);
  font-weight: 600;
}

.selected-publication h3 {
  margin: 0;
  color: var(--text);
  font-size: 1.2rem;
  line-height: 1.22;
}

.selected-publication h3 sub {
  line-height: 0;
}

.publication-read-link {
  align-self: flex-start;
  margin-top: auto;
  padding-top: 1.5rem;
}

.news-section {
  padding-top: 1rem;
}

.news-list {
  border-top: 0;
}

.news-item {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr) 7.5rem;
  gap: 1.5rem;
  align-items: center;
  padding: 1.25rem 0;
  border-bottom: 0;
}

.news-item + .news-item {
  border-top: 1px solid #b7c2d0;
}

.home-news-section .news-item:nth-of-type(n + 6) {
  display: none;
}

.news-item time {
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.news-item p {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.45;
}

.news-source-link {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
  justify-self: end;
  text-align: right;
  white-space: nowrap;
}

.two-column {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1.1fr 1fr;
}

.grid.three-up {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.publication-list {
  display: grid;
  gap: 1rem;
}

.publication-year-list {
  display: grid;
  gap: 2rem;
}

.publication-year {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.publication-year h3 {
  margin: 0 0 1rem;
  color: var(--accent);
  font-size: 1.65rem;
}

.publication-entry {
  padding: 0.95rem 0;
  border-top: 1px solid #d5dde7;
}

.publication-entry:first-of-type {
  border-top: 0;
}

.publication-entry p {
  margin: 0 0 0.35rem;
}

.publication-authors,
.publication-venue {
  color: var(--muted);
}

.publication-title {
  color: var(--text);
  font-weight: 700;
}

.publication-entry a {
  display: inline-block;
  margin-right: 0.75rem;
  margin-top: 0.25rem;
  color: var(--accent);
  font-weight: 700;
}

.publication-card h3,
.card h3,
.feature-card h3 {
  margin-top: 0;
  margin-bottom: 0.45rem;
}

.publication-card p,
.card li,
.feature-card p,
.contact-card li {
  color: var(--muted);
}

.card-list {
  display: grid;
  gap: 1rem;
}

.site-footer {
  padding: 2rem 0 3rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

@media (max-width: 900px) {
  .hero-grid,
  .two-column,
  .grid.three-up {
    grid-template-columns: 1fr;
  }

  .research-theme-grid {
    grid-template-columns: 1fr;
  }

  .course-item.course-feature {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .person-profile {
    grid-template-columns: 1fr;
  }

  .person-photo-frame {
    max-width: 14rem;
  }

  .selected-publication-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .nav {
    flex-direction: column;
    gap: 0.7rem;
  }

  .hero {
    padding-top: 3rem;
  }

  .teaching-page .course-item:not(.course-feature) {
    flex-direction: column;
    align-items: stretch;
  }

  .teaching-page .course-actions {
    justify-content: flex-start;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .selected-publication-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .news-item {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .news-source-link {
    justify-self: start;
    text-align: left;
  }
}
