/* --- Header and Navigation --- */
header {
  display: flex;
  justify-content: space-between; /* Space between logo and menu */
  align-items: center; /* Vertically center items */
  width: 100%;
  max-width: 1400px;
  padding: 1rem;
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
}

/* Hamburger menu */
.hamburger-menu {
  display: none; /* Default: hidden for desktop */
  position: relative;
  width: 30px;
  height: 24px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1001;
  padding-right: 1rem;
}

/* Hamburger menu bars */
.hamburger-menu .bar {
  position: absolute;
  width: 80%;
  height: 2px;
  background-color: var(--c-purple);
  border-radius: 2px;
  transition: all 0.3s ease-in-out;
}

.hamburger-menu .bar:nth-child(1) {
  top: 0;
}

.hamburger-menu .bar:nth-child(2) {
  top: 8px;
}

.hamburger-menu .bar:nth-child(3) {
  top: 16px;
}

/* Transform hamburger into cross */
.hamburger-menu.active .bar:nth-child(1) {
  transform: rotate(45deg);
  top: 10px;
}

.hamburger-menu.active .bar:nth-child(2) {
  opacity: 0; /* Hide middle bar */
}

.hamburger-menu.active .bar:nth-child(3) {
  transform: rotate(-45deg);
  top: 10px;
}

/* Desktop navigation */
.desktop-menu {
  display: flex;
  gap: 2rem;
}

/* Mobile menu */
.mobile-menu {
  display: none; /* Hidden by default */
  flex-direction: column;
  gap: 1rem;
  background-color: var(--c-purple-500);
  position: fixed; /* Make it fixed to cover the viewport */
  top: 0;
  left: 0;
  width: 100vw; /* Full width of the viewport */
  height: 100vh; /* Full height of the viewport */
  padding: 2rem; /* Add padding for spacing */
  z-index: 1000; /* Ensure it's on top of other elements */
  overflow-y: auto; /* Allow scrolling if the content overflows */
  text-align: center;
}

.mobile-menu.active {
  display: flex; /* Show the menu when active */
}

.mobile-menu a {
  font-size: 2rem;
  text-decoration: none;
  margin-bottom: 1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .desktop-menu {
    display: none; /* Hide desktop menu */
  }

  .hamburger-menu {
    display: block; /* Show hamburger menu */
    margin-left: auto; /* Push to the right */
  }
}
