/* ============================================================
   FONT IMPORT
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

html {
  font-size: clamp(12px, 0.9vw, 22px);
  scroll-behavior: smooth;
  overscroll-behavior: none;
}

/* ===== Global Layout Container ===== */
.page-container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}


/* ============================================================
   GLOBAL FIX – Locks entire site to fixed scale
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #000;
  font-family: 'Inter', 'avenir next', -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overscroll-behavior: none;
}



/* ============================================================
   STICKY HEADER
   ============================================================ */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2000;
  padding: 20px 40px;
  background: rgba(0, 0, 0, 0.92);
  color: white;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
}


/* ============================================================
   NAVBAR (locked width)
   ============================================================ */
.navbar {
  display: flex;
  justify-content: space-between;
  height: 50px;
  padding: 0 40px;
}


/* ============================================================
   LOGO + LAB NAME
   ============================================================ */
.logo-container {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-shrink: 0;
  /* prevents resizing */
}

.lab-logo {
  height: 200px;
  object-fit: contain;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.lab-logo:hover {
  transform: scale(1.02);
}


/* ============================================================
   NAV LINKS (fixed spacing)
   ============================================================ */
nav {
  display: flex;
}

nav a {
  padding: 8px 14px;
  margin-left: 10px;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 1.1em;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.25s ease;
}

nav a:hover {
  color: rgb(204, 220, 253);
}

/* Active nav link */
nav a.active {
  color: white;
  border-bottom: 2px solid rgba(204, 220, 253, 0.8);
}



/* ============================================================
   FULL-SCREEN SLIDESHOW BACKGROUND
   ============================================================ */
.slideshow-background {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: -1;
}

.slideshow-background .slide {
  position: absolute;
  width: 100%;
  height: 120%;
}

.slideshow-background .slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
}

.slideshow-background img.active {
  opacity: 0.3;
}

body.loaded .slideshow-background img.active {
  opacity: 0.3;
}

/* ==============================
   PAGE TRANSITION STATES
================================ */

/* Initial state */
body {
  opacity: 0;
  transition: opacity 0.4s ease;
}

/* Page fully visible */
body.page-visible {
  opacity: 1;
}

/* Slideshow synced with page fade */
body.page-visible .slideshow-background img.active {
  opacity: 0.3;
}

/* ============================================================
   MAIN PAGE LAYOUT (fixed width)
   ============================================================ */
main {
  flex: 1;
  padding-top: 120px;
  padding-bottom: 60px;
}

/* Home page centered layout */
main:has(#about),
main:has(#contact) {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 110px - 80px);
  padding-top: 110px;
  padding-bottom: 40px;
}


/* ============================================================
   SECTIONS (continuous background)
   ============================================================ */
section {
  max-width: 1000px;
  margin: 0 auto;
  padding: 30px 40px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  line-height: 1.8;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(1px);
  scroll-margin-top: 160px;
}

/* About and Contact sections centered on their pages */
section#about,
section#contact {
  margin: 0 20px;
}

section h2 {
  color: rgb(255, 255, 255);
  font-size: 1.5em;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 20px;
}

section p {
  margin-bottom: 1em;
  font-size: 1.1em;
  text-align: justify;
}

section p:last-child {
  margin-bottom: 0;
}

section ul {
  list-style: none;
  padding: 0;
}

section ul li {
  padding: 5px 0;
  font-size: 1.2em;
}

/* Fix Contact text alignment */
#contact p {
  text-align: center;
}



/* ============================================================
   PEOPLE PAGE SECTIONS
   ============================================================ */
section#pi,
section#postdocs,
section#graduates,
section#lab-manager,
section#staff,
section#alumni,
section#undergraduate-researchers {
  padding: 24px 28px 40px 28px;
  border-radius: 0;
  border: none;
  box-shadow: none;
}

section#pi {
  border-radius: 12px 12px 0 0;
}

section#alumni {
  border-radius: 0 0 12px 12px;
}

.alumni-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.alumni-list li {
  font-size: 1rem;
  padding: 4px 0;
  color: #ddd;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.alumni-list li:last-child {
  border-bottom: none;
}

.alumni-name {
  display: block;
  color: rgb(255, 255, 255);
  font-weight: 500;
  font-size: 1rem;
}

.alumni-position {
  display: block;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.875rem;
  margin-bottom: 4px;
}

.name-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.name-grid li {
  font-size: 1rem;
  color: rgb(255, 255, 255);
  padding: 4px 0;
  list-style: none;
  margin-left: 1.2em;
}

@media screen and (max-width: 768px) {
  .name-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 480px) {
  .name-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   PERSON CARDS (fixed scale)
   ============================================================ */
.person-card {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  max-width: 1000px;
  padding: 28px;
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.person-card:hover {
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
  transform: translateY(-2px);
}

.person-card img {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.person-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.person-info h3 {
  color: rgb(255, 255, 255);
  margin: 0 0 10px;
  font-size: 1.15em;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.person-info .bio {
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.65;
  margin-top: 8px;
  font-size: 0.95em;
  overflow-wrap: break-word;
}


/* Contact Section */
.contact-section {
  text-align: center;
  margin-top: 60px;
}

.contact-content {
  font-size: 1.1em;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.contact-logo {
  width: 220px;
  opacity: 0.8;
}

.contact-link {
  display: inline-block;
  margin-top: 12px;
  margin-bottom: 12px;
  padding: 8px 20px;
  color: #4da3ff;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95em;
  border: 1px solid #4da3ff;
  border-radius: 6px;
  transition: all 0.25s ease;
}

.contact-link:hover {
  color: white;
  background: rgba(77, 163, 255, 0.2);
  border-color: #7bbcff;
}

/* ===== Projects Layout ===== */
.projects-left-modals {
  max-width: 1500px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Big clickable boxes */
.project-box-header {
  background: rgba(0, 0, 0, 0.6);
  padding: 22px 28px;
  border-radius: 12px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  gap: 24px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.3s ease;
  scroll-margin-top: 180px;
}

.project-box-header:hover {
  background: rgba(0, 0, 0, 0.75);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.12);
}

.project-title {
  color: white;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  margin: 0 0 10px 0;
}

.project-description {
  color: rgba(255, 255, 255, 0.75);
  font-size: 1.2 rem;
  line-height: 1.55;
  margin: 0;
}

.project-box-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  /* fills remaining space */
  min-width: 0;
}

@media (min-width: 768px) {
  .project-box-header:nth-child(even) {
    flex-direction: row-reverse;
  }
}

.project-box-image {
  width: 250px;
  height: 250px;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
  position: relative;
  z-index: 10;
  /* keeps it above the slideshow */
}

.project-box-image-female-reproduction {
  width: 250px;
  height: 200px;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
  position: relative;
  z-index: 10;
  /* keeps it above the slideshow */
}

.project-box-image-female-reproduction img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
  transition: transform 0.3s ease;
}

.project-box-image img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
  transition: transform 0.3s ease;
}

/* ------------------------------
   PUBLICATIONS SECTION
--------------------------------*/

.publications {
  max-width: 1000px;
  margin: 0 auto;
  padding-bottom: 20px;
}

.pub {
  margin-bottom: 24px;
  padding: 20px 24px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
}

.pub-year {
  font-size: 1.3rem;
  font-weight: 700;
  color: white;
  margin: 0 0 16px 0;
  display: inline-block;
}

.pub-entry,
.publication {
  margin-bottom: 0px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.pub-entry:last-child,
.publication:last-child {
  margin-bottom: 0;
  border-bottom: none;
}

.pub-title {
  font-size: 1rem;
  font-weight: 600;
  color: white;
  line-height: 1.5;
}

/* Removes standard link formatting from the titles */
.pub-title a {
  color: inherit;
  text-decoration: none;
  font-weight: inherit;
}

/* Optional: Subtle hover effect so users know it's clickable */
.pub-title a:hover {
  text-decoration: underline;
  color: rgba(255, 255, 255, 0.8);
}

.pub-authors {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
}


/* ============================================================
   SELECTION & SCROLLBAR
   ============================================================ */
::selection {
  background: rgba(255, 255, 255, 0.2);
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}


/* ============================================================
   FOOTER
   ============================================================ */
footer {
  margin-top: auto;
  font-size: .7rem;
  background: rgba(0, 0, 0, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 20px 20px;
  z-index: 1000;
  backdrop-filter: blur(8px);
}

/* main flex handled in main layout section */

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
}

.footer-section {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-section h4 {
  color: white;
  font-size: .85rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: 0.3px;
}

.footer-section p {
  color: rgba(255, 255, 255, 0.6);
  font-size: .8rem;
  line-height: 1;
  margin: 0;
}


/* ============================================================
   MOBILE RESPONSIVE STYLES
   ============================================================ */

/* Tablet and below */
@media screen and (max-width: 1024px) {
  html {
    font-size: 16px;
  }

  main {
    width: 95%;
    padding: 140px 15px 40px;
  }

  section {
    padding: 24px 28px;
  }

  .navbar {
    padding: 0 20px;
  }

  .person-card {
    gap: 20px;
    padding: 20px;
  }

  .person-card img {
    width: 150px;
    height: 150px;
  }

  .project-box-header {
    padding: 20px 24px;
    gap: 18px;
  }

  .project-box-image {
    width: 120px;
    height: 120px;
  }

  .footer-content {
    gap: 20px;
    padding: 0 20px;
  }
}

/* Mobile devices */
@media screen and (max-width: 768px) {
  html {
    font-size: 15px;
  }

  /* Header adjustments */
  header {
    padding: 12px 15px;
  }

  .navbar {
    flex-direction: column;
    height: auto;
    padding: 0;
    gap: 12px;
  }

  .logo-container {
    flex-direction: column;
    gap: 12px;
    width: 100%;
    align-items: center;
  }

  .lab-logo {
    height: 80px;
  }

  nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
  }

  nav a {
    padding: 6px 10px;
    margin-left: 0;
    font-size: 0.9em;
  }

  /* Main content */
  main {
    width: 100%;
    padding: 160px 10px 40px;
  }

  section {
    padding: 20px;
    margin: 0 5px;
    border-radius: 10px;
  }

  section h2 {
    font-size: 1.2em;
  }

  section p {
    text-align: left;
  }

  /* Person cards - stack vertically */
  .person-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    padding: 20px 16px;
  }

  .person-card img {
    width: 140px;
    height: 140px;
  }

  .person-info {
    text-align: center;
  }

  .person-info h3 {
    font-size: 1.1em;
  }

  .person-info .bio {
    text-align: left;
    font-size: 0.9em;
  }

  /* People page sections */
  section#pi,
  section#postdocs,
  section#graduates,
  section#lab-manager,
  section#staff,
  section#alumni {
    padding: 16px 20px;
  }

  /* Project boxes - stack vertically */
  .projects-left-modals {
    padding: 10px;
    gap: 20px;
  }

  .project-box-header {
    flex-direction: column;
    padding: 20px;
    gap: 16px;
    text-align: center;
  }

  .project-box-image {
    width: 100px;
    height: 100px;
  }

.project-box-image-female-reproduction {
    width: 100px;
    height: 80px;
  }

  .project-box-text {
    align-items: center;
  }

  .project-title {
    font-size: 1rem;
    text-align: center;
  }

  .project-description {
    font-size: 0.9rem;
    text-align: center;
  }

  /* Publications */
  .publications {
    padding-bottom: 30px;
  }

  .pub {
    padding: 16px 18px;
  }

  .pub-year {
    font-size: 1.1rem;
  }

  .pub-title {
    font-size: 0.95rem;
  }

  .pub-authors {
    font-size: 0.8rem;
  }

  /* Contact section */
  .contact-section {
    padding: 20px 15px;
  }

  .contact-content {
    font-size: 0.9em;
  }

  .contact-logo {
    width: 100px;
  }

  /* Footer */
  footer {
    padding: 15px 10px;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }

  .footer-section {
    flex-direction: column;
    gap: 4px;
  }

  .footer-section h4 {
    font-size: 0.95rem;
  }

  .footer-section p {
    font-size: 0.85rem;
  }

}

/* Small mobile devices */
@media screen and (max-width: 480px) {
  html {
    font-size: 14px;
  }

  header {
    padding: 10px 12px;
  }

  .lab-logo {
    height: 60px;
  }

  nav a {
    padding: 5px 8px;
    font-size: 0.85em;
  }

  main {
    padding: 150px 8px 40px;
  }

  section {
    padding: 16px 14px;
    border-radius: 8px;
  }

  .person-card {
    padding: 16px 12px;
  }

  .person-card img {
    width: 120px;
    height: 120px;
  }

  .person-info h3 {
    font-size: 1em;
  }

  .person-info .bio {
    font-size: 0.85em;
    line-height: 1.5;
  }

  .project-box-header {
    padding: 16px;
  }

  .project-box-image {
    width: 80px;
    height: 80px;
  }

  .modal-content {
    padding: 20px 16px;
  }

  .pub {
    padding: 14px 12px;
  }

  footer {
    padding: 12px 8px;
  }

  .alumni-list li {
    font-size: 0.9rem;
  }

}