/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  color: #333;
  font-family: Arial, sans-serif;
  line-height: 1.5;
  background: #fff;
}

a {
  color: inherit;
}

button {
  font: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid #facc15;
  outline-offset: 3px;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.container--narrow {
  max-width: 860px;
}

/* Header */
.site-header {
  position: fixed;
  z-index: 20;
  top: 0;
  right: 0;
  left: 0;
  color: #fff;
  background: rgba(15, 23, 42, 0.82);
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  backdrop-filter: blur(10px);
}

.site-header__inner {
  max-width: 1200px;
  height: 56px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.site-nav a,
.mobile-menu a {
  color: #e2e8f0;
  text-decoration: none;
}

.site-nav a:hover,
.mobile-menu a:hover {
  color: #fff;
}

.nav-toggle {
  display: none;
  border: 0;
  color: #e2e8f0;
  background: transparent;
  font-size: 1.25rem;
  cursor: pointer;
}

.mobile-menu {
  display: none;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.94);
}

.mobile-menu--open {
  display: block;
}

.mobile-menu__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.site-main {
  padding-top: 56px;
}

/* Hero */
.hero {
  position: relative;
  min-height: calc(100vh - 56px);
  overflow: hidden;
  background: url("/assets/bg.jpeg") center/cover no-repeat;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.68), rgba(0, 0, 0, 0.54)),
    rgba(0, 0, 0, 0.58);
}

.hero-content {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 56px);
  padding: 4rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-align: center;
}

.hero-title {
  font-size: clamp(3rem, 7vw, 5.5rem);
  line-height: 1;
  letter-spacing: 0.06em;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.55);
}

.hero-owner {
  margin-top: 0.75rem;
  font-size: 1.15rem;
}

.hero-subtitle {
  margin-top: 0.75rem;
  font-size: clamp(1.4rem, 3vw, 2.25rem);
  font-weight: 400;
}

.hero-desc {
  max-width: 640px;
  margin-top: 1rem;
  color: #fff;
  font-size: 1.15rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.hero-actions {
  margin-top: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 1rem;
  border-radius: 4px;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.button--primary {
  color: #fff;
  background: #0066cc;
}

.button--primary:hover {
  background: #004a99;
}

.button--secondary {
  color: #fff;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.55);
}

.button--secondary:hover {
  background: rgba(15, 23, 42, 0.9);
}

#scrollDownArrow {
  position: absolute;
  z-index: 3;
  bottom: 20px;
  left: 50%;
  color: #fff;
  background: transparent;
  border: 0;
  font-size: 2rem;
  text-decoration: none;
  opacity: 0.8;
  transform: translateX(-50%);
  transition: opacity 0.2s ease;
  cursor: pointer;
}

#scrollDownArrow:hover {
  opacity: 1;
}

/* Page Headers */
.page-hero {
  color: #fff;
  background: #0f172a;
  padding: 3.5rem 0;
}

.page-hero h1 {
  font-size: 2rem;
  line-height: 1.2;
}

.page-hero p {
  max-width: 720px;
  margin-top: 0.5rem;
  color: #cbd5e1;
}

.page-section {
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
}

.content-block {
  margin-top: 2.5rem;
}

.content-block h2,
.prose h2 {
  margin-bottom: 0.75rem;
  font-size: 1.35rem;
  line-height: 1.25;
}

.prose {
  max-width: 760px;
  color: #475569;
}

.prose p + p {
  margin-top: 1rem;
}

.prose a,
.site-footer a {
  color: #0066cc;
  text-decoration: none;
}

.prose a:hover,
.site-footer a:hover {
  text-decoration: underline;
}

/* About portrait and CV */
.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(200px, 26vw, 280px);
  align-items: start;
  gap: clamp(2rem, 4vw, 3.5rem);
}

.about-profile { min-width: 0; }

.about-portrait {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border: 1px solid #dce3df;
  border-radius: 6px;
}

.about-cv {
  width: 100%;
  min-height: 44px;
  margin-top: 1rem;
  background: #285d51;
}

.about-cv:hover { background: #194338; }

@media (max-width: 700px) {
  .about-layout { grid-template-columns: 1fr; gap: 2rem; }
  .about-profile { width: min(100%, 360px); }
}

/* Theme Gallery */
.theme-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.theme-card {
  display: block;
  width: 100%;
  font: inherit;
  color: inherit;
  background-color: #f2f2f2;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.theme-card:hover {
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.theme-card__title {
  display: block;
  font-size: 1.17rem;
  font-weight: 700;
}

.theme-card p {
  margin-top: 0.4rem;
  color: #475569;
}

.theme-card--active {
  border: 2px solid #0066cc;
  background-color: #e6f2ff;
}

/* Project Type Filters */
.type-filter {
  margin: 0 0 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.type-filter__label {
  display: block;
  margin-bottom: 0.6rem;
  color: #475569;
  font-size: 0.9rem;
  font-weight: 700;
}

.type-filter__controls {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.25rem;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
}

.type-filter__button {
  padding: 0.45rem 0.8rem;
  color: #334155;
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 700;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.type-filter__button:hover,
.type-filter__button--active {
  color: #fff;
  background: #0066cc;
}

/* Tag Filters */
.tag-filter {
  margin: 1.5rem 0 2rem;
  padding: 1rem 0;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
}

.tag-filter__label {
  display: block;
  margin-bottom: 0.6rem;
  color: #475569;
  font-size: 0.9rem;
  font-weight: 700;
}

.tag-filter__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-filter__button {
  padding: 0.3rem 0.7rem;
  color: #334155;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.tag-filter__button:hover,
.tag-filter__button--active {
  color: #fff;
  background: #0066cc;
  border-color: #0066cc;
}

/* Project Cards */
.project-panel {
  margin: 2rem 0;
}

.project-panel h2 {
  margin-bottom: 1rem;
  font-size: 1.8rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 1rem;
}

.project-card {
  padding: 1.5rem;
  background-color: #f9f9f9;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  text-align: left;
  transition: box-shadow 0.2s ease;
}

.project-card:hover {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.project-card[hidden] {
  display: none;
}

.project-card img {
  width: 100%;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.project-card h3 {
  margin-bottom: 0.5rem;
}

.project-card p {
  margin-bottom: 0.5rem;
}

.project-type {
  display: inline-flex;
  width: fit-content;
  margin: 0 0 0.65rem;
  padding: 0.18rem 0.55rem;
  color: #0f5132;
  background: #d1e7dd;
  border: 1px solid #a3cfbb;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.4;
}

.project-theme {
  color: #64748b;
  font-size: 0.92rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.85rem 0 0;
  padding: 0;
  list-style: none;
}

.tag-list li {
  padding: 0.18rem 0.55rem;
  color: #334155;
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  font-size: 0.78rem;
  line-height: 1.4;
  white-space: nowrap;
}

.tag-list--modal {
  margin-top: 1rem;
}

.empty-filter-message {
  padding: 1rem;
  color: #475569;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
}

.links {
  flex-wrap: wrap;
  margin-top: 1rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.links a {
  color: #0066cc;
  font-size: 1rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  transition: color 0.2s ease;
}

.links a:hover {
  color: #004a99;
}

.learn-more {
  margin-left: auto;
  padding: 0.25rem 0.75rem;
  color: #fff;
  background-color: #0066cc;
  border: none;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.learn-more:hover {
  background-color: #004a99;
}

/* Feature Lists */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
  list-style: none;
}

.feature-card {
  padding: 1rem;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
}

.publication-list {
  list-style: none;
}

.publication-list li + li {
  margin-top: 1rem;
}

.publication-list span {
  color: #64748b;
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  inset: 0;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.6);
  padding: 1rem;
}

.modal-content {
  position: relative;
  width: 90%;
  max-width: 640px;
  max-height: calc(100vh - 2rem);
  overflow: auto;
  padding: 1.5rem;
  background: #fff;
  border-radius: 4px;
  text-align: left;
}

.modal-content img {
  width: 100%;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-meta {
  margin-top: 1rem;
}

.modal-list {
  margin-top: 1rem;
  padding-left: 1.25rem;
}

.modal-list li + li {
  margin-top: 0.5rem;
}

/* About Band */
.about-section {
  padding: 3rem 0;
  background: #f8f8f8 url("/assets/topo-lines.png") center/cover no-repeat;
}

.about-section p {
  max-width: 920px;
  margin-top: 0.75rem;
  color: #475569;
}

/* Footer */
.site-footer {
  margin-top: 4rem;
  color: #666;
  background-color: #fafafa;
  border-top: 1px solid #ddd;
}

.site-footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  text-align: center;
}

.site-footer__copyright {
  color: #334155;
  font-weight: 700;
}

.site-footer__tagline {
  color: #64748b;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.4rem 0.7rem;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.social-links a:hover {
  color: #fff;
  background: #0066cc;
  border-color: #0066cc;
  text-decoration: none;
}

@media (max-width: 700px) {
  .site-nav {
    display: none;
  }

  .nav-toggle {
    display: block;
  }

  .site-footer__inner {
    text-align: center;
  }
}

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

.project-card img,
.modal-content img {
  height: auto;
}

.project-image-credit {
  font-size: 0.75rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

/* Curated academic homepage */
.home-container {
  width: min(1120px, 100%);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
}
.research-intro { padding-block: clamp(3rem, 7vw, 5.5rem); background: #f4f6f3; border-bottom: 1px solid #dce3df; }
.research-intro-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  align-items: start;
  gap: clamp(2rem, 4vw, 3.5rem);
}
.research-intro-copy,
.research-profile { min-width: 0; }
.research-profile {
  display: grid;
  /* Center the photo itself, leaving the contact links in the lower space. */
  grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr);
  align-self: stretch;
}
.research-portrait {
  grid-row: 2;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 6px;
  border: 1px solid #dce3df;
}
.research-contact {
  grid-row: 3;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid #cdd9d1;
  scroll-margin-top: 80px;
}
.research-contact h2 { color: #172f2d; font-size: 1.2rem; line-height: 1.3; }
.research-contact a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #285d51;
}
.research-profile-links {
  display: flex;
  flex-wrap: wrap;
  column-gap: 1rem;
  list-style: none;
  font-size: 0.9rem;
}
@media (max-width: 900px) {
  .research-intro-layout { grid-template-columns: 1fr; gap: 2rem; }
  .research-profile { display: block; width: min(100%, 360px); }
}
.academic-home .hero-title { color: #172f2d; font-size: clamp(2.3rem, 5vw, 3.65rem); line-height: 1.12; letter-spacing: -0.035em; text-shadow: none; }
.research-position { margin-top: 0.85rem; color: #365f58; font-size: 1.05rem; font-weight: 600; }
.research-lead { max-width: 790px; margin-top: 1.8rem; color: #263e3c; font-size: clamp(1.3rem, 2.3vw, 1.65rem); line-height: 1.5; }
.research-agenda { max-width: 770px; margin-top: 1rem; color: #465b56; font-size: 1.05rem; }
.research-location { margin-top: 1.35rem; color: #53635f; font-size: 0.95rem; }
.research-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem; margin-top: 1.8rem; }
.research-actions a[download] { min-height: 44px; }
.academic-home a { text-underline-offset: 0.2em; }
.academic-home .button--primary { background: #285d51; }
.academic-home .button--primary:hover { background: #194338; }
.home-section { padding-block: 3.5rem; scroll-margin-top: 70px; }
.home-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; }
.section-label { color: #527268; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.35rem; }
.home-section h2 { color: #172f2d; font-size: clamp(1.65rem, 3vw, 2rem); line-height: 1.2; }
.home-section-heading > a { color: #285d51; font-size: 0.95rem; flex-shrink: 0; }
.featured-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.75rem; }
.featured-contribution { min-width: 0; display: flex; flex-direction: column; }
.featured-visual img { width: 100%; height: 205px; object-fit: contain; background: #f4f6f3; border: 1px solid #e3e8e5; }
.featured-visual .project-image-credit { color: #58635f; font-size: 0.68rem; margin-top: 0.5rem; line-height: 1.45; }
.featured-copy { padding-top: 1.25rem; flex: 1; display: flex; flex-direction: column; align-items: start; }
.featured-role { color: #527268; font-size: 0.8rem; margin-bottom: 0.5rem; }
.featured-copy h3 { color: #172f2d; font-size: 1.2rem; line-height: 1.35; margin-bottom: 0.8rem; }
.featured-copy > p:not(.featured-role) { color: #485852; font-size: 0.95rem; line-height: 1.65; margin-bottom: 1.15rem; }
.featured-link { color: #285d51; font-weight: 600; font-size: 0.9rem; margin-top: auto; }
.collection-note { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid #e0e6e2; max-width: 850px; color: #58635f; font-size: 0.95rem; }
.home-publications { background: #f7f8f6; border-top: 1px solid #e0e6e2; }
.selected-publications { list-style: none; }
.selected-publications li { display: grid; grid-template-columns: 125px 1fr; gap: 1.5rem; padding-block: 1.5rem; border-top: 1px solid #dce3df; }
.publication-year { color: #527268; font-size: 0.9rem; }
.selected-publications h3 { color: #203c36; font-size: 1.1rem; font-weight: 600; line-height: 1.5; }
.selected-authors { margin-top: 0.6rem; font-size: 0.85rem; color: #5a6661; }
.selected-venue { margin-top: 0.3rem; color: #475d53; font-size: 0.9rem; font-style: italic; }
.nav-toggle { min-width: 44px; min-height: 44px; }
@media (max-width: 760px) {
  .featured-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .featured-visual img { height: auto; max-height: 300px; }
  .home-section { padding-block: 2.5rem; }
  .home-section-heading { align-items: start; flex-direction: column; }
  .selected-publications li { grid-template-columns: 1fr; gap: 0.5rem; }
  .research-actions { gap: 1rem; }
}

/* Give the research evidence space to be read, without cropping its panels. */
.research-agenda { max-width: 800px; line-height: 1.75; }
.featured-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem; }
.featured-visual { margin: 0; }
.featured-visual .project-image-credit { font-size: 0.75rem; }
.featured-contribution--spotlight {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: center;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid #dce3df;
}
.featured-contribution--spotlight .featured-visual img { height: auto; max-height: none; }
.featured-contribution--spotlight .featured-copy { padding-top: 0; }
.featured-contribution--spotlight h3 { font-size: clamp(1.4rem, 2.5vw, 1.85rem); }
.featured-contribution--spotlight .featured-copy > p:not(.featured-role) { font-size: 1.05rem; }
.featured-visual figcaption { margin-top: 0.9rem; color: #485852; font-size: 0.9rem; line-height: 1.65; }
.featured-visual figcaption a { white-space: nowrap; color: #285d51; }
@media (max-width: 760px) {
  .featured-grid { grid-template-columns: 1fr; }
  .featured-contribution--spotlight { grid-template-columns: 1fr; gap: 1.25rem; }
}
