@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:wght@400;600;800&display=swap');

/* ==========================
   Global Styles
========================== */
* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  width: 100%;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #1e1e1e;
  line-height: 1.7;
  background: #ffffff;
  letter-spacing: -0.01em;
}

/* Links */
a {
  text-decoration: none;
  color: inherit;
}

.button {
  display: inline-block;
  margin-top: 25px;
  padding: 12px 22px;
  background: #1D4ED8;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.3s;
}

.button:hover {
  background: #243b9b;
}

/* ==========================
   Navbar
========================== */
.nav-bar {
  position: sticky !important;
  top: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05) !important;
  border-bottom: 1px solid rgba(37, 99, 235, 0.1) !important;
  padding: 0.8rem 2rem !important;
  z-index: 1000;
  transition: all 0.3s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

body.dark .nav-bar {
  background: rgba(26, 26, 26, 0.85) !important;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3) !important;
  border-bottom-color: rgba(37, 99, 235, 0.2) !important;
}

.nav-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.nav-bar .nav-link {
  font-size: 1.1rem !important;
  font-weight: 600 !important;
  padding: 0.6rem 1.2rem !important;
  border-radius: 10px !important;
  transition: all 0.3s ease !important;
  position: relative;
  color: #333 !important;
  text-decoration: none;
  white-space: nowrap;
}

body.dark .nav-bar .nav-link { color: #e0e0e0 !important; }

.nav-bar .nav-link:hover {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(29, 78, 216, 0.1) 100%) !important;
  transform: translateY(-2px);
}

.nav-bar .nav-link.active {
  background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%) !important;
  color: white !important;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

body.dark .nav-bar .nav-link.active { box-shadow: 0 4px 15px rgba(37, 99, 235, 0.5); }

.nav-bar #theme-toggle {
  background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%) !important;
  border: none !important;
  width: 42px !important;
  height: 42px !important;
  border-radius: 50% !important;
  font-size: 1.3rem !important;
  cursor: pointer;
  transition: all 0.3s ease !important;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-bar #theme-toggle:hover {
  transform: rotate(180deg) scale(1.1);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

/* 3-zone navbar layout */
.nav-left,
.nav-center,
.nav-right {
  display: flex;
  align-items: center;
}

.nav-center {
  justify-content: center;
  flex: 1;
}

.nav-left,
.nav-right {
  flex: 0 0 auto;
  min-width: 220px;
}

.nav-right {
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Site title in navbar */
.site-title {
  display: flex;
  flex-direction: column;
  gap: 0.36rem;
  line-height: 1.1;
  text-align: left;
  white-space: nowrap;
}

.site-title-name {
  font-family: "Source Serif 4", ui-serif, Georgia, serif;
  font-weight: 800;
  font-size: 1.7rem;
  color: #1e1e1e;
}

.site-title-tagline {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  color: #555;
  opacity: 0.95;
}

body.dark .site-title-name { color: #ffffff; }
body.dark .site-title-tagline { color: rgba(255,255,255,0.80); }

/* Desktop dropdown */
.nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.nav-dropdown > .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.nav-dropdown > .nav-link::after {
  content: "▾";
  font-size: 1.15rem;
  line-height: 1;
  opacity: 0.9;
  transform: translateY(1px);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-dropdown:hover > .nav-link::after {
  transform: translateY(1px) rotate(180deg);
  opacity: 1;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 220px;
  padding: 0.55rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(37, 99, 235, 0.18);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.16);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
  z-index: 2000;
}

body.dark .dropdown-menu {
  background: rgba(26, 26, 26, 0.96);
  border-color: rgba(37, 99, 235, 0.28);
}

.nav-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-link {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem !important;
  border-radius: 12px !important;
  transform: none !important;
  white-space: nowrap;
}

.dropdown-menu .dropdown-link:hover {
  background: rgba(37, 99, 235, 0.10);
}

body.dark .dropdown-menu .dropdown-link:hover {
  background: rgba(160, 180, 255, 0.12);
}

/* Mobile Menu */
.mobile-menu-btn {
  display: none;
  background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
  border: none;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.mobile-menu-btn span {
  width: 22px;
  height: 2px;
  background: white;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.mobile-menu-btn.active span:nth-child(1) { transform: rotate(45deg) translate(6px, 6px); }
.mobile-menu-btn.active span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.active span:nth-child(3) { transform: rotate(-45deg) translate(6px, -6px); }

.mobile-nav-links {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
  flex-direction: column;
  padding: 1rem;
  gap: 0.5rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

body.dark .mobile-nav-links { background: rgba(26, 26, 26, 0.95); }
.mobile-nav-links .nav-link { width: 100%; text-align: center; padding: 0.8rem 1rem !important; }

.mobile-nav-links.active {
  display: flex;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Mobile: responsive navbar */
@media (max-width: 768px) {
  .nav-bar {
    padding: 1rem 1.5rem !important;
    justify-content: space-between;
    position: relative;
    padding-left: calc(1.5rem + 42px + 12px) !important;
  }

  .nav-links { display: none !important; }
  .nav-center { display: none !important; }
  .mobile-menu-btn { display: flex; }

  .nav-left,
  .nav-right {
    min-width: 0 !important;
    flex: 0 0 auto !important;
  }

  .nav-left {
    display: flex !important;
    align-items: center;
  }

  .nav-right {
    display: flex !important;
    margin-left: auto !important;
    justify-content: flex-end;
    gap: 0.75rem;
    align-items: center;
  }

  #mobileMenuBtn {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1002;
  }

  .site-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    width: max-content;
    max-width: 70%;
    pointer-events: none;
    z-index: 1001;
  }

  .site-title-name { font-size: 1.25rem; }
  .site-title-tagline { font-size: 0.9rem; }
}
/* ==========================
   Hero Section
========================== */
.hero {
  min-height: 100vh;
  background:
    linear-gradient(rgba(10,15,40,0.75), rgba(10,15,40,0.75)),
    url("assets/images/jwst-disk.jpg") center/cover no-repeat;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0px 30px;
}

.hero-name h1 {
  margin: 20px 0;
  font-size: 3.2rem;
  text-align: center;
}

.hero-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 50px;
  flex-wrap: wrap;
  max-width: 1000px;
  margin-top: 40px;
}

.hero-text {
  flex: 1;
  min-width: 250px;
}

.hero-text h2 {
  font-size: 2rem;
  margin-bottom: 10px;
}

.hero-text p {
  font-size: 1.2rem;
  line-height: 1.5;
}

.hero-photo {
  flex: 1;
  min-width: 250px;
  display: flex;
  justify-content: center;
}

.hero-photo img {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: 3px solid #fff;
  object-fit: cover;
  transition: transform 0.3s, box-shadow 0.3s;
}

.hero-photo img:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(0,0,0,0.5);
}

.subtitle {
  font-size: 1.2rem;
  opacity: 0.9;
  margin-top: 10px;
  text-align: center;
}

/* ==========================
   Sections
========================== */
.section {
  max-width: 1400px; /* wider for publications */
  margin: auto;
  padding: 60px 30px;
}

.section h2 {
  font-family: 'Source Serif 4', serif;
  font-weight: 600;
  font-size: 2rem;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

/* ==========================
   About
========================== */

.hero-image {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  max-height: 500px; /* ADD THIS - limits container height */
  display: flex; /* ADD THIS */
  align-items: center; /* ADD THIS */
  justify-content: center; /* ADD THIS */
}

.hero-image img {
  width: 100%;
  height: auto; /* ADD THIS - maintains aspect ratio */
  max-height: 500px; /* ADD THIS - limits height */
  object-fit: contain; /* CHANGE THIS - fits entire image without cropping */
  display: block;
  border-radius: 16px;
  transition: transform 0.3s ease;
}

/* ==========================
   Publications
========================== */
.pub-entry {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 30px;
  padding: 30px;
  margin-bottom: 25px;
  border-radius: 16px;
  align-items: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid rgba(0,0,0,0.04);
}

.pub-entry.alt1 {
  background-color: rgba(122,162,255,0.08);
}

.pub-entry.alt2 {
  background-color: rgba(26,42,108,0.08);
}

.pub-entry:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.pub-text h3 {
  font-family: 'Source Serif 4', serif;
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.pub-text p {
  margin: 8px 0;
  font-size: 0.95rem;
  opacity: 0.9;
  line-height: 1.5;
}

.ads-link {
  color: #1a73e8;
  text-decoration: underline;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.ads-link:hover {
  color: #0c47a1;
}

.pub-image img {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
}

.pub-image img:hover {
  transform: scale(1.03);
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);
}

/* ==========================
   Fullscreen Modal for Images
========================== */
.img-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 999;
}

.img-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.img-modal img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 12px;
}

/* ==========================
   Footer
========================== */
footer {
  text-align: center;
  padding: 30px;
  font-size: 0.9rem;
  color: #666;
}

/* Compact footer nav on mobile + desktop (matches cv.html) */
.home-footer .footer-nav {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 2rem;
}

/* ==========================
   Fancy Footer (match cv.html)
========================== */

/* Theme tokens for footer */
body {
  --footer-bg: #e8e9f3;
  --footer-border: rgba(37, 99, 235, 0.2);
  --footer-text: #555;
}

body.dark {
  --footer-bg: #0d0d0d;
  --footer-border: rgba(37, 99, 235, 0.3);
  --footer-text: #b0b0b0;
}

.home-footer {
  position: relative;
  padding: 3.5rem 2rem 2rem;
  background: var(--footer-bg);
  border-top: 2px solid var(--footer-border);
  overflow: hidden;
  width: 100%;
  margin-top: 3rem;
}

.footer-constellation {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 1;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.constellation-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  background: #2563EB;
  border-radius: 50%;
  box-shadow: 0 0 15px rgba(37, 99, 235, 0.8), 0 0 30px rgba(37, 99, 235, 0.4);
  animation: twinkle 3s ease-in-out infinite;
}

body.dark .constellation-dot {
  background: #93c5fd;
  box-shadow: 0 0 20px rgba(160, 180, 255, 0.9), 0 0 40px rgba(160, 180, 255, 0.5);
}

@keyframes twinkle {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.constellation-line {
  position: absolute;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.6), transparent);
  transform-origin: left center;
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.4);
}

body.dark .constellation-line {
  background: linear-gradient(90deg, transparent, rgba(160, 180, 255, 0.7), transparent);
  box-shadow: 0 0 10px rgba(160, 180, 255, 0.5);
}

.footer-container {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  z-index: 1;
  width: 100%;
  background: transparent;
  border: none;
}

.footer-name {
  font-size: 2.5rem;
  font-weight: 900;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-tagline {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--footer-text);
  margin-bottom: 2rem;
  max-width: 700px;
}

.footer-nav {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;              /* Option B: wrap */
  justify-content: center;
  background: transparent !important;
}

.footer-nav a {
  color: #333;
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
  background: transparent !important;
}

.footer-nav a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: #2563EB;
  transition: width 0.3s ease;
}

.footer-nav a:hover { color: #2563EB; }
.footer-nav a:hover::after { width: 100%; }

body.dark .footer-nav a { color: #e0e0e0; }
body.dark .footer-nav a:hover { color: #93c5fd; }
body.dark .footer-nav a::after { background: #93c5fd; }

.search-container {
  width: 100%;
  max-width: 500px;
  margin-bottom: 1.8rem;
}

.search-box {
  width: 100%;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  border: 2px solid rgba(37, 99, 235, 0.3);
  border-radius: 50px;
  background: white;
  color: #333;
  transition: all 0.3s ease;
  text-align: center;
}

.search-box:focus {
  outline: none;
  border-color: #2563EB;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.2);
}

body.dark .search-box {
  background: #1a1a1a;
  color: #e0e0e0;
  border-color: rgba(37, 99, 235, 0.4);
}

body.dark .search-box:focus { border-color: #93c5fd; }
.search-box::placeholder { color: #999; }

.footer-links {
  display: flex;
  gap: 1.2rem;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  background: white;
  color: #333;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  border: 2px solid rgba(37, 99, 235, 0.2);
}

.footer-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(37, 99, 235, 0.2);
  border-color: #2563EB;
  color: #2563EB;
}

body.dark .footer-link {
  background: #1a1a1a;
  color: #e0e0e0;
  border-color: rgba(37, 99, 235, 0.3);
}

body.dark .footer-link:hover {
  border-color: #93c5fd;
  color: #93c5fd;
}

.footer-link svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.contact-btn {
  background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%) !important;
  color: white !important;
  border: none !important;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.contact-btn:hover {
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
  color: white !important;
}

.footer-bottom {
  padding-top: 1.8rem;
  border-top: 1px solid rgba(37, 99, 235, 0.15);
  color: #888;
  font-size: 0.9rem;
}

body.dark .footer-bottom {
  border-top-color: rgba(37, 99, 235, 0.25);
  color: #999;
}

/* Mobile: keep Option B (wrap), just tighten spacing/font a bit */
@media (max-width: 768px) {
  .home-footer { padding: 3rem 1.5rem 2rem; }

  .footer-name { font-size: 2rem; }
  .footer-tagline { font-size: 1rem; }

  .footer-nav {
    flex-direction: row;  /* IMPORTANT: do NOT column-stack */
    gap: 0.9rem;
  }

  .footer-nav a { font-size: 0.95rem; }

  .footer-links {
    flex-direction: row;  /* keep wrapped row */
    gap: 0.9rem;
  }
}

/* Optional: slightly tighter on small screens so it fits in fewer lines */
@media (max-width: 768px) {
  .home-footer .footer-nav {
    gap: 0.9rem;
  }
  .home-footer .footer-nav a {
    font-size: 0.95rem;
  }
}

/* ==========================
   Dark Mode
========================== */
:root {
  --bg: #ffffff;
  --text: #1e1e1e;
  --nav: #0b0f2a;
  --accent: #1D4ED8;
}

body.dark {
  --bg: #0e1117;
  --text: #e6edf3;
  --nav: #010409;
  --accent: #60a5fa;
  --pub-alt1: rgba(26,42,54,0.5);
  --pub-alt2: rgba(36,50,80,0.5);
}

body {
  background: var(--bg);
  color: var(--text);
}

nav {
  background: var(--nav);
}

.button {
  background: var(--accent);
}

body.dark .pub-entry.alt1 {
  background-color: var(--pub-alt1);
}

body.dark .pub-entry.alt2 {
  background-color: var(--pub-alt2);
}

body.dark .ads-link {
  color: #60a5fa;
}

/* ==========================
   Responsive
========================== */
@media (max-width: 900px) {
  .pub-entry {
    grid-template-columns: 1fr;
  }
  .pub-image {
    text-align: center;
  }
}

@media (max-width: 768px) {
  .hero-content {
    flex-direction: column;
    text-align: center;
  }

  .hero-photo img {
    width: 150px;
    height: 150px;
  }

  .hero-text h2 {
    font-size: 1.8rem;
  }
}
/* ==========================
   Contact card background logos
========================== */
.contact-card {
  position: relative;
  display: flex;
  align-items: center;
  padding: 25px;
  border-radius: 16px;
  color: #1e1e1e;
  font-family: 'Inter', sans-serif;
  background-color: rgba(250, 250, 250, 0.95);
  background-repeat: no-repeat;
  background-position: top right;
  background-size: 60px 60px; /* adjust size as needed */
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.contact-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

/* ==========================
   Mobile: global safety rules
========================== */
@media (max-width: 768px) {
  body {
    max-width: 100vw;
    overflow-x: hidden;
  }

  img {
    max-width: 100%;
    height: auto;
  }

  * {
    overflow-wrap: anywhere;
  }

  /* Reduce the shared .section padding on mobile */
  .section {
    padding: 2rem 1rem;
  }
}

/* ==========================
   Mobile density for subpages
   body.subpage = all pages except index.html
========================== */
@media (max-width: 768px) {
  /* Main container */
  body.subpage main {
    padding: 1rem;
  }

  /* Content sections */
  body.subpage .content-section {
    margin: 1.5rem 0;
  }
  body.subpage .content-section h3 {
    font-size: 1.4rem;
  }

  /* About: hero grid */
  body.subpage .about-hero {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.5rem 1rem;
  }
  body.subpage .hero-text h2 { font-size: 2rem; }
  body.subpage .hero-subtitle { font-size: 1rem; }

  /* About: stats grid → 2 columns */
  body.subpage .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1.5rem 0;
  }
  body.subpage .stat-card { padding: 1rem 0.75rem; }
  body.subpage .stat-number { font-size: 1.8rem; }

  /* About: two-column */
  body.subpage .two-column {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin: 1.5rem 0;
  }

  /* About: timeline */
  body.subpage .timeline {
    padding-left: 1.5rem;
    margin: 1rem 0;
  }

  /* About: media and approach grids */
  body.subpage .media-grid,
  body.subpage .approach-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 1rem 0;
  }
  body.subpage .media-card { padding: 1rem; }
  body.subpage .approach-card { padding: 1rem; }

  /* Research: hero */
  body.subpage .research-hero {
    padding: 1.5rem 1rem;
    margin: 0 auto 1.5rem;
  }
  body.subpage .research-hero h2 { font-size: 2rem; }

  /* Research: accordions */
  body.subpage .accordion { margin: 1rem 0; }
  body.subpage .accordion-header {
    padding: 1rem 1.2rem;
    gap: 1rem;
  }
  body.subpage .accordion-header h3 { font-size: 1.3rem; }
  body.subpage .accordion-toggle { font-size: 1.1rem; }
  body.subpage .accordion-inner { padding: 1rem 1.2rem; }
  body.subpage .story-section { margin: 1rem 0; }
  body.subpage .story-image { margin: 0.75rem 0; }
  body.subpage .highlight-box {
    padding: 1rem;
    margin: 1rem 0;
  }

  /* Outreach: hero and sections */
  body.subpage .outreach-hero {
    padding: 1.5rem 1rem;
    margin: 0 auto 1.5rem;
  }
  body.subpage .outreach-hero h2 { font-size: 2rem; }
  body.subpage .outreach-section { margin: 1.5rem 0; }
  body.subpage .section-header h3 { font-size: 1.5rem; }

  /* Outreach: card grids */
  body.subpage .content-grid,
  body.subpage .content-grid-3col {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 1rem 0;
  }
  body.subpage .card-content { padding: 1rem; }
  body.subpage .card-image { height: 180px; }

  /* Publications: entries */
  body.subpage .pub-entry {
    grid-template-columns: 1fr;
    padding: 1rem;
    gap: 1rem;
    margin-bottom: 1rem;
  }
  body.subpage .year-divider { margin: 1.5rem 0 0.75rem; }
  body.subpage .section-divider {
    margin: 2rem 0 1.5rem;
    padding: 1.2rem;
  }

  /* Contact: grid and form */
  body.subpage .contact-hero h2 { font-size: 2rem; }
  body.subpage .contact-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 1.5rem 0;
  }
  body.subpage .contact-form-wrapper {
    padding: 1rem;
    margin: 1.5rem auto 0;
  }

  /* CV: hero */
  body.subpage .cv-hero h1 { font-size: 2rem; }

  /* Resources and proposals: headings */
  body.subpage .resources h2,
  body.subpage .proposals h2 { font-size: 2rem; }

  /* Filter controls */
  body.subpage .filter-controls {
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
  }
  body.subpage .filter-group { min-width: 100%; }

  /* Compact footer on subpages */
  body.subpage .home-footer {
    padding: 2rem 1rem 1.5rem;
  }
  body.subpage .footer-name { font-size: 1.6rem; }
  body.subpage .footer-tagline {
    font-size: 0.9rem;
    margin-bottom: 1rem;
  }
  body.subpage .search-container { margin-bottom: 1rem; }
  body.subpage .footer-links { gap: 0.6rem; }
  body.subpage .footer-link {
    padding: 0.55rem 0.9rem;
    font-size: 0.85rem;
  }
}

/* Extra-small screens */
@media (max-width: 480px) {
  body.subpage main { padding: 0.75rem; }
  body.subpage .stats-grid {
    gap: 0.75rem;
  }
  body.subpage .stat-card { padding: 0.75rem 0.5rem; }
  body.subpage .stat-number { font-size: 1.5rem; }
}

