:root {
  --bg-main: #b9cedf;
  --bg-accent: #9ebec9;
  --ink: #162331;
  --ink-soft: #2b4156;
  --line: rgba(22, 35, 49, 0.18);
  --white: #f8fbff;
  --link: #2d6fad;
  --hero-shadow: rgba(4, 18, 28, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, #bed3e1 0%, var(--bg-main) 35%, #b3c9db 100%);
  font-family: "Noto Serif SC", Georgia, serif;
  line-height: 1.55;
}

.home-page {
  font-family: "Roboto Serif", "Noto Serif SC", Georgia, serif;
}

.home-page .brand,
.home-page .nav-links a,
.home-page .intro-copy h1,
.home-page .content-section h2,
.home-page .pub-badge,
.home-page .motto {
  font-family: "Roboto Serif", "Noto Serif SC", Georgia, serif;
}

.wrap {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(6px);
  background: rgba(158, 190, 201, 0.88);
  border-bottom: 1px solid var(--line);
}

.nav-wrap {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  color: var(--ink);
  text-decoration: none;
  font-size: clamp(1.35rem, 2.2vw, 2.05rem);
  font-weight: 600;
  letter-spacing: 0.4px;
  font-family: "Playfair Display", "Noto Serif SC", serif;
}

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  color: var(--ink);
  font-size: 1.1rem;
  font-family: "Times New Roman", Georgia, "Noto Serif SC", serif;
  font-weight: 400;
  position: relative;
}

.nav-links a.active {
  font-weight: 600;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 2px;
  transform: scaleX(0);
  transform-origin: left;
  background: var(--ink);
  transition: transform 0.28s ease;
}

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

.hero {
  position: relative;
  min-height: clamp(360px, 58vh, 680px);
  background-image: url("assets/hero.jpg");
  background-size: cover;
  background-position: center 100%;
  background-attachment: fixed;
  isolation: isolate;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(9, 23, 36, 0.22) 0%, var(--hero-shadow) 100%);
  z-index: -1;
}

.page-hero {
  position: relative;
  min-height: clamp(260px, 42vh, 460px);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  isolation: isolate;
}

.page-hero-publications {
  background-image: url("assets/IMG_8885.jpg");
}

.page-hero-teaching {
  background-image: url("assets/IMG_8886.JPG");
}

.page-hero-gallery {
  background-image: url("assets/IMG_8642.JPG");
}

.gallery-page {
  background: linear-gradient(180deg, #bad0de 0%, #b3c8d8 44%, #a9c1d2 100%);
}

.gallery-page .brand,
.gallery-page .nav-links a {
  font-family: "Roboto Serif", "Noto Serif SC", Georgia, serif;
}

.gallery-page .gallery-intro h1,
.gallery-page .gallery-lead {
  font-family: "Times New Roman", Times, "Noto Serif SC", Georgia, serif;
}

.gallery-intro {
  position: relative;
  margin-top: 18px;
  padding: clamp(56px, 9vw, 110px) 0 clamp(54px, 8vw, 96px);
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 10% 20%, rgba(122, 168, 196, 0.3), transparent 38%),
    radial-gradient(circle at 82% 24%, rgba(185, 210, 226, 0.18), transparent 40%),
    linear-gradient(135deg, rgba(7, 18, 30, 0.92), rgba(14, 32, 50, 0.88));
}

.gallery-intro::before {
  content: "";
  position: absolute;
  inset: -30px;
  background-image: url("assets/hero.jpg");
  background-size: cover;
  background-position: center;
  opacity: 0.2;
  filter: blur(7px);
  transform: scale(1.08);
  z-index: -1;
}

.gallery-intro-wrap {
  max-width: 880px;
}

.gallery-kicker {
  margin: 0 0 24px;
  color: rgba(236, 245, 253, 0.9);
  letter-spacing: 0.7px;
  font-size: clamp(0.78rem, 1vw, 0.9rem);
  font-weight: 600;
}

.gallery-intro h1 {
  margin: 0;
  color: #f6fbff;
  font-size: clamp(1.6rem, 3.4vw, 2.9rem);
  line-height: 1.15;
  font-family: "Playfair Display", "Noto Serif SC", serif;
}

.gallery-intro h1 span {
  color: #89c4ef;
}

.gallery-lead {
  margin: 28px 0 0;
  max-width: 760px;
  color: rgba(236, 245, 253, 0.92);
  font-size: clamp(0.92rem, 1.15vw, 1.04rem);
}

.gallery-showcase {
  margin-top: 34px;
  border: 0;
  width: min(896px, 92vw);
  padding: 0 0 8px;
}

.gallery-polaroid-grid {
  column-count: 3;
  column-gap: 14px;
}

.gallery-card {
  margin: 0 0 14px;
  background: transparent;
  padding: 0;
  border: 0;
  box-shadow: none;
  break-inside: avoid;
}

.gallery-card img {
  width: 100%;
  display: block;
  height: auto;
  border: 0;
}

.intro-section {
  margin-top: 36px;
  display: grid;
  grid-template-columns: clamp(220px, 24vw, 250px) 1fr;
  gap: clamp(22px, 4vw, 56px);
  align-items: center;
}

.avatar-card {
  background: transparent;
  border: 0;
  padding: 0;
}

.avatar-column {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.avatar-card img {
  width: 100%;
  display: block;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 0;
  box-shadow: none;
}

.social-links {
  margin-top: 12px;
  display: flex;
  gap: 14px;
  justify-content: center;
}

.social-btn {
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.96);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  opacity: 0.9;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.social-btn svg {
  width: 28px;
  height: 28px;
}

.social-btn:hover {
  transform: translateY(-1px);
  opacity: 1;
}

.intro-copy h1 {
  margin: 0;
  color: var(--white);
  font-size: clamp(1.45rem, 2.2vw, 2.2rem);
  font-family: "Playfair Display", "Noto Serif SC", serif;
}

.subtitle {
  margin: 10px 0 22px;
  font-size: clamp(1.02rem, 1.8vw, 1.45rem);
  color: #e9f2fb;
  font-weight: 600;
}

.intro-copy p {
  font-size: clamp(0.97rem, 1.35vw, 1.12rem);
  margin: 0 0 16px;
}

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

.content-section {
  margin-top: 30px;
  padding: 34px;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
}

.content-section h2 {
  margin: 0 0 14px;
  font-size: clamp(1.5rem, 2.2vw, 1.95rem);
  font-family: "Playfair Display", "Noto Serif SC", serif;
}

.content-section ul {
  margin: 0;
  padding-left: 20px;
}

.content-section li {
  margin-bottom: 8px;
  font-size: 0.98rem;
}

.section-note {
  margin: 0;
  font-size: 0.98rem;
  color: rgba(22, 35, 49, 0.72);
}

.section-divider {
  margin: 18px 0 22px;
  border-top: 1px dashed var(--line);
}

.pub-card {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 14px;
  align-items: center;
}

.pub-card + .pub-card {
  margin-top: 28px;
}

.pub-figure-wrap {
  position: relative;
  width: clamp(190px, 24vw, 260px);
  justify-self: start;
}

.pub-figure-img {
  width: 100%;
  aspect-ratio: 16 / 10;
  min-height: 0;
  object-fit: cover;
  border: 1px solid var(--line);
  display: block;
  box-shadow: 0 8px 20px rgba(12, 25, 38, 0.12);
}

.pub-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  background: #2f638e;
  color: #eef7ff;
  font-family: "Playfair Display", "Noto Serif SC", serif;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  padding: 6px 10px;
}

.pub-figure {
  min-height: 240px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(120, 160, 184, 0.42) 0%, rgba(59, 91, 120, 0.5) 100%),
    repeating-linear-gradient(
      -35deg,
      rgba(232, 243, 252, 0.36) 0,
      rgba(232, 243, 252, 0.36) 12px,
      rgba(203, 223, 238, 0.2) 12px,
      rgba(203, 223, 238, 0.2) 24px
    );
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(12, 25, 38, 0.12);
}

.pub-figure span {
  color: rgba(255, 255, 255, 0.95);
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: 0.15px;
}

.pub-meta h3 {
  margin: 0 0 10px;
  font-size: 1.14rem;
  line-height: 1.3;
  color: #2d6fad;
  font-weight: 400;
}

.pub-authors {
  margin: 0 0 8px;
  font-size: 1rem;
  color: var(--ink);
  font-weight: 400;
}

.pub-authors strong {
  font-weight: 400;
}

.pub-venue {
  margin: 0 0 14px;
  font-size: 0.94rem;
  color: rgba(22, 35, 49, 0.82);
}

.pub-btn {
  display: inline-block;
  border: 1px solid rgba(22, 35, 49, 0.6);
  color: var(--ink);
  text-decoration: none;
  padding: 4px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  background: rgba(248, 251, 255, 0.58);
}

.pub-btn + .pub-btn {
  margin-left: 8px;
}

.pub-btn:hover {
  background: rgba(248, 251, 255, 0.9);
}

.visitor-map-card {
  margin-top: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.visitor-map-frame {
  margin-top: 0;
  width: min(328px, 100%);
  margin-left: auto;
  margin-right: auto;
  border: 0;
  min-height: 134px;
  overflow: hidden;
  background: transparent;
}

.visitor-map-frame iframe,
.visitor-map-frame canvas,
.visitor-map-frame img,
.visitor-map-frame > div {
  width: 100%;
  height: 134px;
  border: 0;
  display: block;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.gallery-grid img {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border: 1px solid var(--line);
}

.site-footer {
  margin-top: 44px;
  background: var(--bg-accent);
  border-top: 1px solid var(--line);
}

.footer-wrap {
  min-height: 170px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-wrap p {
  margin: 0 0 8px;
}

.copyright {
  opacity: 0.8;
}

.motto {
  font-family: "Playfair Display", "Noto Serif SC", serif;
  font-size: 1rem;
  line-height: 1.4;
  color: rgba(248, 251, 255, 0.94);
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

@media (max-width: 980px) {
  .nav-wrap {
    min-height: 70px;
    flex-direction: column;
    justify-content: center;
    padding: 10px 0 12px;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 18px;
  }

  .nav-links a {
    font-size: 1.08rem;
  }

  .hero {
    background-attachment: scroll;
    min-height: 320px;
  }

  .page-hero {
    background-attachment: scroll;
    min-height: 240px;
  }

  .intro-section {
    grid-template-columns: 1fr;
  }

  .avatar-card {
    width: min(340px, 100%);
    margin: 0 auto;
  }

  .intro-copy {
    text-align: center;
  }

  .content-section {
    padding: 24px 6px;
  }

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

  .gallery-polaroid-grid {
    column-count: 2;
    column-gap: 12px;
  }

  .pub-card {
    grid-template-columns: 1fr;
  }

  .pub-figure {
    min-height: 200px;
  }

  .pub-figure-img {
    aspect-ratio: 16 / 10;
    min-height: 0;
  }

  .pub-figure-wrap {
    width: min(260px, 100%);
  }

  .footer-wrap {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 20px 0;
    min-height: unset;
  }

  .visitor-map-frame,
  .visitor-map-frame iframe,
  .visitor-map-frame canvas,
  .visitor-map-frame img,
  .visitor-map-frame > div {
    min-height: 118px;
    height: 118px;
  }
}

@media (max-width: 640px) {
  .gallery-polaroid-grid {
    column-count: 1;
  }
}
