.header,
.navbar {
  transition: 0.3s ease;
}

.header.active .navbar {
  background-color: rgba(0, 0, 0, 0.8);
}

/* Mobile Navigation - Fullscreen centered */
.navbar {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background-color: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(20px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-20px);
  transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.4s ease;
}

@media (min-width: 1024px) {
  .navbar {
    position: relative;
    inset: auto;
    flex-direction: row;
    gap: 0;
    background-color: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border-radius: 9999px;
    padding: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    transition: transform 0.7s ease-in-out;
  }
}

.navOpen .navbar {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Mobile nav links - larger and centered */
.navbar a {
  padding: 1rem 2rem;
  font-size: 1.5rem;
  line-height: 1.2;
  position: relative;
  z-index: 20;
  display: block;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  transition: color 0.3s ease, transform 0.3s ease;
}

.navbar a:hover,
.navbar a.active {
  color: rgba(255, 255, 255, 1);
  transform: scale(1.05);
}

@media (min-width: 1024px) {
  .navbar a {
    padding: 0.75rem 22px;
    font-size: 1rem;
    line-height: 1;
    color: rgba(255, 255, 255, 1);
  }

  .navbar a:hover {
    transform: none;
  }
}

.navbar .indicator {
  position: absolute;
  height: 100%;
  width: 100%;
  left: 0;
  top: 0;
  display: none;
  opacity: 0;
  transform: scale(0.5);
  transition: 0.45s cubic-bezier(0.075, 0.82, 0.165, 1);
}

@media (min-width: 1024px) {
  .navbar .indicator {
    display: block;
  }
}

.navbar .indicator::before {
  content: "";
  border-radius: 9999px;
  height: calc(100% - 1rem);
  top: 0.5rem;
  width: 100%;
  position: absolute;
  left: 0;
  background-color: rgba(255, 255, 255, 0.1);
}

/* Mobile burger menu button */
.navToggler {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
  padding: 0.25rem;
  position: fixed;
  right: 1.5rem;
  top: 1.5rem;
  z-index: 50;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.navToggler:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

.navOpen .navToggler {
  background-color: rgba(255, 255, 255, 0.1);
}

@media (min-width: 1024px) {
  .navToggler {
    display: none;
  }
}

.navToggler svg {
  margin: auto;
  color: white;
}

.navToggler svg:last-child {
  display: none;
}

.navOpen .navToggler svg:first-child {
  display: none;
}

.navOpen .navToggler svg:last-child {
  display: block;
}

.navOverlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 20;
  transition: all 0.5s;
  opacity: 0;
  visibility: hidden;
}

.navOverlay.navOverlayVisible {
  opacity: 1;
  visibility: visible;
}

/* ------------------------------------- */
/* Centered The Navbar container */
/* ------------------------------------ */
.header .flex {
  justify-content: center;
}

/* Header hide/show transition */
.header {
  transition: transform 0.3s ease-in-out;
}

.header.invisible {
  transform: translateY(-100%) !important;
}

/* Indicator */

.navbar .indicator {
  position: absolute;
  height: 100%;
  width: 100%;
  left: 0;
  top: 0;
  display: none;
  opacity: 0;
  transform: scale(0.5);
  transition: 0.45s cubic-bezier(0.075, 0.82, 0.165, 1);
}

/* @media (min-width: 1024px) {
  display: block;
} */

.navbar .indicator::before {
  content: "";
  position: absolute;
  top: 0.5rem;
  left: 0;
  width: 100%;
  height: calc(100% - 1rem);
  border-radius: 9999px;
  background-color: rgba(255, 255, 255, 0.1);
}

.indicator {
  position: relative;
}

/* Navbar scroll hide/show is handled via JavaScript with inline !important styles
   to override Tailwind CDN. See script at bottom of generated-page.html */

/* Mobile logo hide on scroll */
.header .hideOnScroll {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.header .hideOnScroll.scrolled {
  opacity: 0 !important;
  transform: translateX(-2rem) !important;
  pointer-events: none !important;
}

/* Hide indicator on mobile */
@media (max-width: 1023px) {
  .navbar .indicator {
    display: none !important;
  }

  /* Hide theme toggle in mobile nav */
  .navbar #theme-toggle {
    margin-top: 1rem;
    width: 3rem;
    height: 3rem;
  }
}
