#navigation {
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 50;
  background: rgb(0, 0, 0);
  backdrop-filter: blur(5px);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

#navigation.scrolled {
  background: rgba(0, 0, 0, 0.95);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

/* Container for nav content */
.nav-container {
  width: 100%;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
  overflow: hidden;
  transition: all 0.3s ease;
}

/* logo styles */
.nav-logo {
  font-weight: 900;
  font-size: 1.8rem;
  color: white;
  background: none;
  border: none;
  cursor: pointer;
  letter-spacing: -1px;
  display: flex;
  align-items: center;
  transition: transform 0.3s ease;
}

.nav-logo:hover {
  transform: scale(1.05);
}

/*Desktop Nav Links*/
.desktop-nav {
  display: flex;
  gap: 2rem;
  align-items: center;
  margin-left: auto;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.desktop-nav.hidden {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}

.nav-link {
  background: none;
  border: none;
  color: white;
  text-transform: uppercase;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 1px;
  cursor: pointer;
  padding: 0.5rem 0;
  position: relative;
  transition: color 0.3s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  width: 0%;
  height: 2px;
  bottom: -2px;
  left: 0;
  background: linear-gradient(to right, #7c3aed, #ec4899);
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

.nav-link:hover {
  color: #ec4899;
}

/* Mobile Nav */
.mobile-nav {
  display: none;
  align-items: center;
  margin-left: auto;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 100;
}

/* Burger Menu */
.burger {
  width: 34px;
  height: 28px; /* slightly taller so X isn't clipped */
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
  background: none;
  border: none;
  cursor: pointer;
  padding: 3px 0; /* adds vertical breathing room */
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  z-index: 120; /* ensures it stays on top */
}

.burger span {
  display: block;
  height: 3px;
  width: 100%;
  background: white;
  border-radius: 3px;
  transition: transform 0.28s cubic-bezier(.2,.9,.3,1), opacity 0.2s ease;
  transform-origin: center;
  box-shadow: 0 1px 0 rgba(0,0,0,0.4);
}

/* morph to X */
.burger.open span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.burger.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0.2);
}

.burger.open span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}


/* Mobile fullscreen menu */
#mobileMenu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  height: 100vh;
  background: rgba(0,0,0,0.98);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  transition: right 0.38s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.01s linear 0.38s;
  visibility: hidden;
  z-index: 80;
}

#mobileMenu.open {
  right: 0;
  visibility: visible;
  transition-delay: 0s;
}

/* Mobile links animate only when menu open */
.mobile-link {
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  text-transform: uppercase;
  font-weight: 600;
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
}

/* when menu open, animate links in */
#mobileMenu.open .mobile-link {
  animation: fadeInUp 0.36s forwards;
}

#mobileMenu.open .mobile-link:nth-child(1) { animation-delay: 0.06s; }
#mobileMenu.open .mobile-link:nth-child(2) { animation-delay: 0.12s; }
#mobileMenu.open .mobile-link:nth-child(3) { animation-delay: 0.18s; }
#mobileMenu.open .mobile-link:nth-child(4) { animation-delay: 0.24s; }
#mobileMenu.open .mobile-link:nth-child(5) { animation-delay: 0.30s; }
#mobileMenu.open .mobile-link:nth-child(6) { animation-delay: 0.36s; }
#mobileMenu.open .mobile-link:nth-child(7) { animation-delay: 0.42s; }
#mobileMenu.open .mobile-link:nth-child(8) { animation-delay: 0.48s; }


.mobile-link:hover {
  color: #ec4899;
}

/* prevents page scroll when mobile menu open */
body.no-scroll {
  overflow: hidden;
  touch-action: none;
}

/* ensure burger sits above menu */
.mobile-nav { z-index: 300; }

/* guarantee mobile menu sits under burger but above page */
#mobileMenu { z-index: 200; }

/* animate social cards if placed inside menu with .social-card-mobile */
.social-card-mobile {
  opacity: 0;
  transform: translateY(12px);
}
#mobileMenu.open .social-card-mobile,
#mobileMenu.open .mobile-link {
  animation: fadeInUp 0.36s forwards;
}

/*Fade-in animation for mobile menu links and social cards*/
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Adjustments for smaller screens */
@media (max-width: 768px) {
  .desktop-nav {
    display: none !important;
  }
  .mobile-nav {
    display: flex !important;
  }
}
