/* Reset any margins/padding that might offset the background */
html, body {
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Vanta.js Background Container - MUST cover entire viewport from top-left */
#vanta-bg {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: -1 !important;
  margin: 0 !important;
  padding: 0 !important;
  pointer-events: none;
}

/* Ensure the canvas inside vanta-bg also fills the container */
#vanta-bg canvas,
#vanta-bg .vanta-canvas {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Style the main content to sit above the background */
.quarto-container,
#quarto-content,
main.content {
  position: relative;
  z-index: 1;
}

/* Push content down below the fixed navbar */
#quarto-content {
  padding-top: 80px !important;
  padding-bottom: 20px !important;
  box-sizing: border-box;
}

/* Center content vertically ONLY on homepage (when profile-section exists) */
#quarto-content:has(.profile-section) {
  min-height: calc(100vh - 80px);
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Add a subtle glass effect to content for better readability */
#quarto-content > main,
main.content {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 12px;
  padding: 1.5rem 1.5rem 2rem 1.5rem;
  margin: 0.5rem 1rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Wider container for About page */
#quarto-content:has(.about-section) .page-columns {
  max-width: none !important;
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

main.content:has(.about-section) {
  max-width: 1200px !important;
  width: 90vw !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Style the navbar to be semi-transparent */
.navbar {
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

/* Remove any default margins from Quarto containers */
.page-columns,
.page-rows-contents {
  margin: 0 !important;
}

/* ============================================
   PROFILE SECTION STYLES
   ============================================ */

.profile-section {
  text-align: center;
  max-width: 750px;
  margin: 0 auto;
  padding: 0.5rem 1rem;
}

/* Circular profile photo */
.profile-photo {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(10, 22, 40, 0.2);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  margin-bottom: 1rem;
}

/* Name heading */
.profile-section h1 {
  font-size: 2.5rem;
  font-weight: 400;
  color: #333;
  margin-bottom: 1rem;
  margin-top: 0;
  letter-spacing: 0.5px;
}

/* Bio text */
.profile-section p {
  font-size: 1.25rem;
  line-height: 1.7;
  color: #555;
  text-align: center;
  margin-bottom: 0.5rem;
}

/* Style links in the profile section */
.profile-section a {
  color: #0a1628;
  text-decoration: none;
  border-bottom: 1px solid #0a1628;
  transition: opacity 0.2s ease;
}

.profile-section a:hover {
  opacity: 0.7;
}


/* ============================================
   ABOUT PAGE STYLES
   ============================================ */

/* Remove margin sidebar and extra column padding on About page */
#quarto-content:has(.about-section) #quarto-margin-sidebar {
  display: none !important;
}

#quarto-content:has(.about-section) .page-columns {
  grid-template-columns: 1fr !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.about-section {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  box-sizing: border-box;
}

.about-row {
  display: flex;
  align-items: flex-start;
  gap: 3rem;
  margin-bottom: 2.5rem;
}

.about-row.reverse {
  flex-direction: row-reverse;
}

.about-text {
  flex: 1;
  font-size: 1rem;
  line-height: 1.7;
  color: #444;
  text-align: justify;
}

.about-text p {
  margin: 0 0 1rem 0;
}

.about-text p:last-child {
  margin-top: -0.5rem;
}

.about-image {
  flex: 0 0 275px;
  margin-top: 2.5rem;
}

.about-image img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* Responsive: stack on smaller screens */
@media (max-width: 768px) {
  .about-row,
  .about-row.reverse {
    flex-direction: column;
  }
  
  .about-image {
    flex: 0 0 auto;
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
  }
}

/* ============================================
   RESEARCH PAGE STYLES
   ============================================ */

.research-section .about-image {
  flex: 0 0 320px;
  margin-top: 2.5rem;
}

/* ============================================
   PHD INTERESTS PAGE STYLES
   ============================================ */

/* Center content vertically on PhD interests page */
#quarto-content:has(.phd-section) {
  min-height: calc(100vh - 80px);
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

main.content:has(.phd-section) {
  max-width: 900px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding: 1rem 2rem !important;
}

.phd-section {
  max-width: 850px;
  margin: 0 auto;
}

.phd-section p {
  font-size: 1rem;
  line-height: 1.7;
  color: #444;
  text-align: justify;
  margin-bottom: 1rem;
}

/* ============================================
   FOOTER STYLES
   ============================================ */

/* Custom footer for homepage only */
.home-footer {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  z-index: 10 !important;
  padding: 0.75rem 1.5rem !important;
  margin: 0 !important;
  background: transparent !important;
  font-size: 1.1rem !important;
  color: #fff !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5) !important;
  white-space: nowrap !important;
}
