/* ===== VARIABLES ===== */
:root {
  --accent: #0b5ed7;
  --accent-dark: #084298;
  --accent-light: #eaf3ff;
  --text: #243447;
  --text-soft: #5f6f81;
  --bg: #f7fbff;
  --white: #ffffff;
  --border: #dbe7f5;
  --footer: #16324f;
  --shadow: 0 10px 30px rgba(11, 94, 215, 0.08);
  --radius: 16px;
  --max-width: 1200px;
  --header-height: 86px;
}

/* ===== GLOBAL ===== */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 20px);
}

body {
  margin: 0;
  padding-top: 90px;
  font-family: "Roboto", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-dark);
}

img {
  max-width: 100%;
  display: block;
  border-radius: 14px;
}

.container {
  width: min(92%, var(--max-width));
  margin: 0 auto;
}

main {
  padding-top: 20px;
}

/* ===== HEADER ===== */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 9999;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 18px rgba(31, 45, 61, 0.08);
}

.header-inner {
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 8px 0;
}

/* ===== BRAND / LOGO ===== */
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text);
}

.brand:hover {
  color: var(--text);
}

.logo {
  width: 54px;
  height: 54px;

  display: grid;
  place-items: center;

  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);

  box-shadow:
    0 4px 14px rgba(31, 45, 61, 0.055),
    inset 0 1px 1px rgba(255, 255, 255, 0.25);

  border: none;
  border-radius: 14px;

  overflow: hidden;
  padding: 4px;
  flex: 0 0 auto;
}

.logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: none;
  border-radius: 8px;
}

.brand-text h1 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.2;
  color: var(--text);
}

.brand-text p {
  margin: 2px 0 0;
  color: var(--text-soft);
  font-size: 0.95rem;
}

/* ===== NAVIGATION ===== */
nav ul {
  display: flex;
  gap: 22px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
  align-items: center;
}

nav li {
  position: relative;
}

nav > ul > li > a {
  display: inline-block;
  color: var(--text);
  font-weight: 500;
  padding-bottom: 4px;
  border-bottom: 3px solid transparent;
  transition: 0.2s ease;
}

nav > ul > li > a:hover,
nav > ul > li > a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ===== DROPDOWN MENU ===== */
.dropdown-menu-toggle {
  position: relative;
}

.dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.dropdown-arrow {
  font-size: 0.8rem;
  transition: transform 0.2s ease;
}

.dropdown-menu-toggle:hover .dropdown-arrow,
.dropdown-menu-toggle.open .dropdown-arrow {
  transform: rotate(180deg);
}

.sub-menu {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 270px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 8px 0;
  margin: 0;
  list-style: none;
  z-index: 3000;
}

/* Invisible bridge for dropdown hover */
.sub-menu::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 0;
  width: 100%;
  height: 10px;
}

.sub-menu li {
  width: 100%;
}

.sub-menu a {
  display: block;
  padding: 10px 16px;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
}

.sub-menu a:hover {
  background: var(--accent-light);
  color: var(--accent-dark);
}

@media (min-width: 701px) {
  .dropdown-menu-toggle:hover .sub-menu {
    display: block;
  }
}

/* ===== HERO ===== */
.hero {
  padding: 72px 0 48px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 36px;
  align-items: center;
}

.eyebrow {
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.hero h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.1;
  margin: 0 0 12px;
  color: var(--accent-dark);
}

.hero h3 {
  margin: 0 0 20px;
  font-size: 1.2rem;
  color: var(--text-soft);
  font-weight: 500;
}

.hero p {
  font-size: 1.05rem;
  margin-bottom: 22px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-card {
  background: var(--white);
  padding: 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.hero-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: var(--white);
}

/* ===== HERO WITH LOGO BACKGROUND ===== */
.hero-logo-bg {
  min-height: 78vh;
  display: flex;
  align-items: center;
  position: relative;
  background:
    linear-gradient(
      rgba(247, 251, 255, 0.88),
      rgba(247, 251, 255, 0.88)
    ),
    url("../images/logo.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: min(70vw, 620px);
}

.hero-centered {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 70vh;
}

.hero-content {
  max-width: 850px;
  margin: 0 auto;
}

.hero-content h2 {
  font-size: clamp(2.4rem, 5vw, 4.5rem);
  line-height: 1.05;
  margin: 0 0 16px;
  color: var(--accent-dark);
}

.hero-content h3 {
  margin: 0 0 22px;
  color: var(--text-soft);
  font-size: 1.25rem;
  font-weight: 500;
}

.hero-content p {
  max-width: 760px;
  margin: 0 auto 26px;
  font-size: 1.08rem;
}

.hero-content .hero-actions {
  justify-content: center;
}

/* ===== BUTTONS ===== */
.btn,
.button {
  display: inline-block;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 600;
  transition: 0.2s ease;
  text-decoration: none;
}

.btn-primary,
.button {
  background: var(--accent);
  color: white;
}

.btn-primary:hover,
.button:hover {
  background: var(--accent-dark);
  color: white;
}

.btn-secondary {
  background: var(--accent-light);
  color: var(--accent-dark);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: #dbeeff;
  color: var(--accent-dark);
}

/* ===== SECTIONS ===== */
section {
  padding: 44px 0;
  scroll-margin-top: 110px;
}

.section-title {
  margin-bottom: 20px;
}

.section-title h2 {
  font-size: 2rem;
  margin: 0 0 10px;
  color: var(--accent-dark);
}

.section-title p {
  margin: 0;
  color: var(--text-soft);
  max-width: 850px;
}

/* ===== CARDS ===== */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

/* ===== RESEARCH PREVIEW ===== */
.research-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.research-card {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.research-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 0;
}

.research-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.research-content h3 {
  margin: 0;
  color: var(--accent-dark);
  font-size: 1.08rem;
}

.research-content p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.95rem;
}

/* ===== UPDATES ===== */
.updates-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

.update-card h3 {
  margin-top: 0;
  color: var(--accent-dark);
}

.update-card p {
  color: var(--text-soft);
}

/* ===== BUILD SECTION ===== */
.build-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.build-item {
  text-align: center;
  padding: 24px 18px;
}

.build-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent-dark);
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  font-weight: 700;
}

.build-item h3 {
  margin: 0;
  font-size: 1.05rem;
}

/* ===== CONTACT / MAP ===== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: stretch;
}

.map-container {
  min-height: 320px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--white);
  box-shadow: var(--shadow);
}

.map-container iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 400px;
  border: 0;
}

.explore-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ===== ADDRESS SLIDER ===== */
.address-slider {
  margin-top: 22px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--white);
  box-shadow: var(--shadow);
}

.slider-track {
  display: flex;
  width: 100%;
}

.slider-slide {
  min-width: 100%;
}

.slider-slide img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  border-radius: 0;
}

.slider-caption {
  padding: 10px 14px;
  font-size: 0.9rem;
  color: var(--text-soft);
  background: var(--accent-light);
  text-align: center;
  font-weight: 500;
}

/* ===== FOOTER ===== */
footer {
  margin-top: 40px;
  background: var(--footer);
  color: #eef5ff;
  padding: 28px 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  .research-preview-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .updates-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1024px) {
  .hero-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .build-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 700px) {
  body {
    padding-top: 220px;
  }

  main {
    padding-top: 20px;
  }

  .header-inner {
    min-height: auto;
    flex-direction: column;
    align-items: flex-start;
  }

  nav ul {
    gap: 14px;
    flex-direction: column;
    align-items: flex-start;
  }

  .sub-menu {
    position: static;
    min-width: 100%;
    margin-top: 8px;
    box-shadow: none;
    border-radius: 10px;
  }

  .sub-menu::before {
    display: none;
  }

  .dropdown-menu-toggle.open .sub-menu {
    display: block;
  }

  .research-preview-grid,
  .build-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 42px;
  }
}

/* =========================================================
   PAGE HERO
   For internal pages such as People, Team, Research, etc.
========================================================= */

.page-hero {
  padding: 72px 0 34px;
}

.page-hero-card {
  background: linear-gradient(135deg, var(--white), var(--accent-light));
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow);
  padding: clamp(28px, 5vw, 54px);
  display: grid;
  grid-template-columns: 1.4fr 0.6fr;
  gap: 30px;
  align-items: center;
}

.page-hero h2 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.1;
  margin: 0 0 12px;
  color: var(--accent-dark);
}

.page-hero p {
  margin: 0;
  color: var(--text-soft);
  font-size: 1.08rem;
  max-width: 760px;
}

.hero-mark {
  justify-self: end;
  width: min(220px, 100%);
  aspect-ratio: 1 / 1;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 28px;
  display: grid;
  place-items: center;
  padding: 22px;
  box-shadow: var(--shadow);
}

.hero-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}


/* =========================================================
   PEOPLE / TEAM SECTION
========================================================= */

.people-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.person-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 18px;
  align-items: start;
  min-height: 210px;
}

.avatar {
  width: 76px;
  height: 76px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--accent), #63a4ff);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.04em;
  box-shadow: var(--shadow);
}

.person-body h3 {
  margin: 0 0 6px;
  color: var(--accent-dark);
  font-size: 1.22rem;
}

.email,
.orcid {
  margin: 0 0 8px;
  color: var(--text-soft);
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.muted {
  color: #8a97a6;
}

.profile-links {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.icon-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--accent-light);
  border: 1px solid var(--border);
  color: var(--accent-dark);
  font-weight: 600;
  font-size: 0.88rem;
  transition: 0.2s ease;
}

.icon-link:hover {
  transform: translateY(-1px);
  background: #dceeff;
  color: var(--accent-dark);
}

.icon-link svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex: 0 0 auto;
}

.orcid-icon {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #a6ce39;
  color: white;
  display: inline-grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.67rem;
  line-height: 1;
}


/* =========================================================
   RESPONSIVE ADDITIONS FOR PAGE HERO AND PEOPLE
========================================================= */

@media (max-width: 1024px) {
  .page-hero-card {
    grid-template-columns: 1fr;
  }

  .hero-mark {
    justify-self: start;
    width: 160px;
  }

  .people-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .page-hero {
    padding-top: 42px;
  }

  .person-card {
    grid-template-columns: 1fr;
  }

  .avatar {
    width: 66px;
    height: 66px;
    border-radius: 18px;
  }
}

/* =========================================================
   OVERVIEW GRID
   For research overview / thematic cards
========================================================= */

.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}

.overview-card {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.overview-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 0;
}

.overview-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.overview-card h3 {
  margin: 0;
  color: var(--accent-dark);
  font-size: 1.1rem;
}

.overview-card p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.95rem;
}


/* =========================================================
   LAB SECTION
========================================================= */

.lab-section {
  padding-top: 56px;
}

.lab-card {
  padding: 0;
  overflow: hidden;
}

.lab-header {
  display: grid;
  grid-template-columns: 0.9fr 1.4fr;
  gap: 0;
  align-items: stretch;
  background: var(--white);
}

.lab-image img {
  height: 100%;
  width: 100%;
  min-height: 340px;
  object-fit: cover;
  border-radius: 0;
}

.lab-intro {
  padding: 32px;
}

.lab-intro h2 {
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  line-height: 1.15;
}

.pi {
  color: var(--accent);
  font-weight: 700;
  margin: 0 0 18px;
}

.lab-body {
  padding: 28px 32px 34px;
  border-top: 1px solid var(--border);
}


/* =========================================================
   DETAIL BLOCKS
========================================================= */

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.detail-block h3 {
  margin: 0 0 12px;
  color: var(--accent-dark);
  font-size: 1.1rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tag-list li {
  background: var(--accent-light);
  color: var(--accent-dark);
  border: 1px solid var(--border);
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
}

.method-list,
.line-list {
  padding-left: 18px;
  margin: 0;
}

.method-list li,
.line-list li {
  margin-bottom: 8px;
}

.note {
  color: var(--text-soft);
  font-style: italic;
  margin-bottom: 0;
}


/* =========================================================
   RESPONSIVE ADDITIONS FOR OVERVIEW AND LAB SECTIONS
========================================================= */

@media (max-width: 1100px) {
  .overview-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1024px) {
  .lab-header {
    grid-template-columns: 1fr;
  }

  .lab-image img {
    min-height: 260px;
  }
}

@media (max-width: 700px) {
  .overview-grid {
    grid-template-columns: 1fr;
  }

  .lab-intro,
  .lab-body {
    padding: 24px;
  }
}


.team-hero-bg {
  min-height: 1000px;
  display: flex;
  align-items: center;
  background-image: url("../images/front_page_photo_team.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.team-hero-bg .page-hero-card {
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  box-shadow: none;
  border: none;
  text-align: center;
}

.team-hero-bg .page-hero-content {
  max-width: 850px;
  padding: 36px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.40);
  backdrop-filter: blur(4px);
  box-shadow: var(--shadow);
}

.team-hero-bg h2 {
  margin: 0 0 16px;
  font-size: clamp(2.4rem, 5vw, 4.5rem);
  color: var(--accent-dark);
}

.team-hero-bg p {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text);
}

/* ===== GALLERY ===== */

.gallery-slider {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding: 10px 48px;
}

.gallery-track {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

.gallery-track::-webkit-scrollbar {
  display: none;
}

.gallery-track img {
  flex: 0 0 auto;
  width: 220px;
  height: 160px;
  object-fit: cover;
  border-radius: 0;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.gallery-track img:hover {
  transform: scale(1.04);
  opacity: 0.9;
}

.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: white;
  color: var(--accent-dark);
  box-shadow: var(--shadow);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.gallery-prev {
  left: 4px;
}

.gallery-next {
  right: 4px;
}

.gallery-arrow:hover {
  background: var(--accent-light);
}

.gallery-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}

.gallery-dots .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #cfcfcf;
  display: inline-block;
}

.gallery-dots .dot.active {
  background-color: #9b1c2e;
}

/* ===== LIGHTBOX ===== */

.lightbox {
  display: none;
  position: fixed;
  z-index: 10000;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 12px;
  background: white;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 34px;
  color: white;
  font-size: 3rem;
  font-weight: 300;
  cursor: pointer;
  z-index: 10001;
}

@media (max-width: 700px) {
  .gallery-slider {
    padding: 10px 38px;
  }

  .gallery-track img {
    width: 180px;
    height: 130px;
  }

  .lightbox {
    padding: 20px;
  }

  .lightbox img {
    max-width: 96vw;
    max-height: 80vh;
  }
}

.hero-video-card {
  --video-max-height: 720px; /* change this value */
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius);
  max-height: var(--video-max-height);
}

.hero-video {
  width: 100%;
  height: var(--video-max-height);
  max-height: var(--video-max-height);
  object-fit: cover;
  display: block;
  border-radius: var(--radius);
}

/* ===== SMARTPHONE VERSION ===== */
@media (max-width: 700px) {

  body {
    font-size: 16px;
  }

  .container {
    width: 92%;
  }

  section {
    padding: 32px 0;
  }

  h1, h2 {
    line-height: 1.15;
  }

  h2 {
    font-size: 2rem;
  }

  p {
    font-size: 1rem;
  }
}

@media (max-width: 700px) {

  .hero-grid,
  .research-preview-grid,
  .updates-expertise-grid,
  .people-grid,
  .contact-grid,
  .overview-grid,
  .detail-grid,
  .build-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 700px) {

  .hero,
  .hero-logo-bg {
    min-height: auto;
    padding: 80px 0 48px;
    background-size: 85vw;
  }

  .hero-centered {
    min-height: auto;
  }

  .hero-content {
    padding: 0 8px;
  }

  .hero-content h2 {
    font-size: 2.3rem;
  }

  .hero-content h3 {
    font-size: 1.05rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    text-align: center;
    width: 100%;
  }
}

@media (max-width: 700px) {

  .hero-video-card {
    --video-max-height: 240px;
  }

  .hero-video {
    height: var(--video-max-height);
    max-height: var(--video-max-height);
    object-fit: cover;
  }
}

@media (max-width: 700px) {

  .gallery-slider {
    padding: 10px 36px;
  }

  .gallery-track {
    gap: 16px;
  }

  .gallery-track img {
    width: 170px;
    height: 120px;
  }

  .gallery-arrow {
    width: 34px;
    height: 34px;
    font-size: 1.7rem;
  }

  .lightbox {
    padding: 16px;
  }

  .lightbox img {
    max-width: 96vw;
    max-height: 80vh;
  }

  .lightbox-close {
    top: 12px;
    right: 18px;
    font-size: 2.4rem;
  }
}

@media (max-width: 700px) {

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .map-container iframe {
    min-height: 300px;
  }

  .slider-slide img {
    height: 180px;
  }
}

@media (max-width: 700px) {

  .btn,
  .button {
    padding: 13px 18px;
    font-size: 1rem;
  }

  a,
  button {
    touch-action: manipulation;
  }
}

/* ===== SMARTPHONE VERSION ===== */
@media (max-width: 700px) {

  body {
    font-size: 16px;
  }

  .container {
    width: 92%;
  }

  section {
    padding: 32px 0;
  }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
  }

  .logo {
    width: 42px;
    height: 42px;
  }

  .brand-text h1 {
    font-size: 1rem;
  }

  .brand-text p {
    font-size: 0.85rem;
  }

  nav {
    width: 100%;
    border-radius: 16px;
  }

  nav ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .hero-grid,
  .research-preview-grid,
  .updates-expertise-grid,
  .people-grid,
  .contact-grid,
  .overview-grid,
  .detail-grid,
  .build-grid {
    grid-template-columns: 1fr !important;
  }

  .hero-content h2 {
    font-size: 2.3rem;
  }

  .hero-content h3 {
    font-size: 1.05rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    width: 100%;
    text-align: center;
  }

  .hero-video-card {
    --video-max-height: 240px;
  }

  .hero-video {
    height: var(--video-max-height);
    max-height: var(--video-max-height);
  }

  .gallery-slider {
    padding: 10px 36px;
  }

  .gallery-track img {
    width: 170px;
    height: 120px;
  }

  .map-container iframe {
    min-height: 300px;
  }
}

/* =========================================================
   FINAL SMARTPHONE OPTIMIZATION + COLLAPSED HEADER
   Add a hamburger button with class .menu-toggle in header.html
   and toggle class .open on nav.main-nav with JavaScript.
========================================================= */

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--white);
  cursor: pointer;
  padding: 9px;
  box-shadow: var(--shadow);
  flex: 0 0 auto;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  margin: 5px 0;
  background: var(--accent-dark);
  border-radius: 999px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.menu-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle.open span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 700px) {
  :root {
    --header-height: 68px;
  }

  html {
    scroll-padding-top: 88px;
  }

  body {
    padding-top: 72px !important;
    font-size: 16px;
    overflow-x: hidden;
  }

  main {
    padding-top: 0 !important;
  }

  .container {
    width: min(92%, 100%);
  }

  header {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .header-inner {
    min-height: var(--header-height) !important;
    display: flex;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between;
    gap: 10px !important;
    padding: 8px 0 !important;
    position: relative;
  }

  .brand {
    flex: 1 1 auto;
    min-width: 0;
    gap: 10px;
  }

  .logo {
    width: 42px !important;
    height: 42px !important;
    border-radius: 12px;
  }

  .brand-text {
    min-width: 0;
  }

  .brand-text h1 {
    font-size: 0.94rem !important;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 62vw;
  }

  .brand-text p {
    font-size: 0.78rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 62vw;
  }

  .menu-toggle {
    display: block;
  }

  header nav,
  header .main-nav {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    width: 100%;
    max-height: calc(100vh - 88px);
    overflow-y: auto;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 18px 44px rgba(31, 45, 61, 0.16);
    padding: 12px;
  }

  header nav.open,
  header .main-nav.open {
    display: block;
  }

  header nav ul,
  header .main-nav ul {
    display: flex;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 4px !important;
    width: 100%;
  }

  header nav li,
  header .main-nav li {
    width: 100%;
  }

  header nav > ul > li > a,
  header .main-nav > ul > li > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border-bottom: 0;
    border-radius: 12px;
    color: var(--text);
  }

  header nav > ul > li > a:hover,
  header nav > ul > li > a.active,
  header .main-nav > ul > li > a:hover,
  header .main-nav > ul > li > a.active {
    background: var(--accent-light);
    color: var(--accent-dark);
    border-bottom-color: transparent;
  }

  .sub-menu {
    position: static !important;
    display: none;
    min-width: 100% !important;
    width: 100%;
    margin: 4px 0 8px;
    padding: 6px;
    border-radius: 14px;
    box-shadow: none;
    background: #f8fbff;
  }

  .sub-menu::before {
    display: none;
  }

  .dropdown-menu-toggle.open .sub-menu {
    display: block;
  }

  .sub-menu a {
    white-space: normal;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.95rem;
  }

  section {
    padding: 34px 0 !important;
    scroll-margin-top: 92px;
  }

  .section-title {
    margin-bottom: 16px;
  }

  .section-title h2,
  .page-hero h2,
  .hero h2,
  .hero-content h2 {
    font-size: clamp(2rem, 9vw, 2.75rem) !important;
    line-height: 1.08;
  }

  .section-title p,
  .hero p,
  .hero-content p,
  .page-hero p {
    font-size: 1rem;
  }

  .hero,
  .hero-logo-bg {
    min-height: auto !important;
    padding: 54px 0 42px !important;
    background-size: min(88vw, 420px);
  }

  .hero-centered {
    min-height: auto !important;
  }

  .hero-grid,
  .research-preview-grid,
  .updates-grid,
  .updates-expertise-grid,
  .build-grid,
  .contact-grid,
  .people-grid,
  .overview-grid,
  .lab-header,
  .detail-grid,
  .page-hero-card {
    grid-template-columns: 1fr !important;
  }

  .hero-actions,
  .explore-links {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .hero-actions .btn,
  .explore-links .btn,
  .btn,
  .button {
    width: 100%;
    text-align: center;
    min-height: 44px;
    padding: 12px 16px;
  }

  .card,
  .research-content,
  .lab-intro,
  .lab-body {
    padding: 18px !important;
  }

  .research-card img,
  .overview-card img {
    aspect-ratio: 16 / 10;
  }

  .page-hero {
    padding: 34px 0 22px !important;
  }

  .page-hero-card {
    gap: 18px;
    padding: 24px !important;
  }

  .hero-mark {
    width: 120px;
    justify-self: start;
    padding: 14px;
    border-radius: 20px;
  }

  .person-card {
    grid-template-columns: 56px 1fr !important;
    min-height: auto;
    gap: 14px;
    padding: 18px;
  }

  .avatar {
    width: 56px !important;
    height: 56px !important;
    border-radius: 16px;
    font-size: 1rem;
  }

  .profile-links {
    gap: 7px;
  }

  .icon-link {
    padding: 8px 9px;
    font-size: 0.82rem;
  }

  .team-hero-bg {
    min-height: 520px !important;
    background-position: center top;
  }

  .team-hero-bg .page-hero-card {
    min-height: 420px;
  }

  .team-hero-bg .page-hero-content {
    padding: 22px;
    background: rgba(255, 255, 255, 0.72);
  }

  .gallery-slider {
    padding: 8px 34px !important;
  }

  .gallery-track {
    gap: 14px !important;
    scroll-snap-type: x mandatory;
  }

  .gallery-track img {
    width: 72vw !important;
    max-width: 260px;
    height: 170px !important;
    scroll-snap-align: center;
  }

  .gallery-arrow {
    width: 34px !important;
    height: 34px !important;
    font-size: 1.7rem !important;
  }

  .gallery-dots {
    margin-top: 14px;
  }

  .lightbox {
    padding: 14px !important;
  }

  .lightbox img {
    max-width: 96vw !important;
    max-height: 78vh !important;
  }

  .lightbox-close {
    top: 10px !important;
    right: 16px !important;
    font-size: 2.4rem !important;
  }

  .hero-video-card {
    --video-max-height: 240px !important;
  }

  .hero-video {
    height: var(--video-max-height) !important;
    max-height: var(--video-max-height) !important;
    object-fit: cover;
  }

  .map-container,
  .map-container iframe {
    min-height: 300px !important;
  }

  .slider-slide img {
    height: 180px !important;
  }

  .footer-inner {
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 420px) {
  .brand-text h1 {
    max-width: 54vw;
    font-size: 0.86rem !important;
  }

  .brand-text p {
    max-width: 54vw;
    font-size: 0.74rem !important;
  }

  .section-title h2,
  .page-hero h2,
  .hero h2,
  .hero-content h2 {
    font-size: 2rem !important;
  }

  .person-card {
    grid-template-columns: 1fr !important;
  }

  .profile-links .icon-link span:not(.orcid-icon) {
    display: none;
  }

  .gallery-track img {
    width: 76vw !important;
    height: 150px !important;
  }
}

.student-name-card {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 120px;
}

.student-name-card .person-body h3 {
  margin: 0 0 6px;
}

.student-course {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.4;
}

.student-name-card .avatar {
  flex: 0 0 auto;
}


/* ===== PUBLICATIONS PAGE ===== */

.publications-hero {
  padding-bottom: 24px;
}

.publications-hero-card {
  text-align: center;
  display: flex;
  justify-content: center;
}

.publications-hero-card .page-hero-content {
  max-width: 850px;
}

.publications-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
}

.publication-tools {
  flex: 0 0 min(360px, 100%);
}

#publication-search {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  color: var(--text);
  background: var(--white);
  box-shadow: var(--shadow);
  outline: none;
}

#publication-search:focus {
  border-color: var(--accent);
}

.publication-status {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  color: var(--text-soft);
}

.publication-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 24px 0 28px;
}

.summary-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  text-align: center;
}

.summary-item strong {
  display: block;
  color: var(--accent-dark);
  font-size: 1.7rem;
  line-height: 1.1;
}

.summary-item span {
  display: block;
  color: var(--text-soft);
  margin-top: 6px;
  font-size: 0.95rem;
}

.publication-year-section {
  padding: 20px 0 14px;
}

.publication-year {
  color: var(--accent-dark);
  font-size: 1.8rem;
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.publication-year-list {
  display: grid;
  gap: 16px;
}

.publication-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.publication-card h4 {
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-size: 1.12rem;
  line-height: 1.35;
}

.publication-authors {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 0.96rem;
}

.publication-details {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.95rem;
}

.publication-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.publication-meta span {
  display: inline-flex;
  align-items: center;
  background: var(--accent-light);
  color: var(--accent-dark);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.84rem;
  font-weight: 600;
}

.publication-links {
  margin-top: 14px;
  font-weight: 700;
}

.publication-links a {
  display: inline-block;
  color: var(--accent);
}

.publication-links a:hover {
  color: var(--accent-dark);
}

@media (max-width: 900px) {
  .publications-title-row {
    flex-direction: column;
    align-items: stretch;
  }

  .publication-summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .publication-card {
    padding: 18px;
  }

  .publication-card h4 {
    font-size: 1.02rem;
  }

  .publication-authors,
  .publication-details {
    font-size: 0.9rem;
  }
}
