/* Mobile bottom navigation bar */
#mobile-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 58px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(17, 17, 17, 0.9);
  backdrop-filter: blur(6px);
  border-top: 1px solid rgba(255,255,255,0.12);
  display: none; /* hidden by default, shown in media query */
  z-index: 3000;
}

#mobile-nav .nav-items {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-around;
}

#mobile-nav a, #mobile-menu-toggle {
  --glow-color: rgb(217, 176, 255);
  color: var(--glow-color);
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 10px;
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
}

#mobile-nav a .icon,
#mobile-menu-toggle .icon {
  font-size: 18px;
}

#mobile-nav a.active {
  background: rgba(191, 123, 255, 0.14);
  box-shadow: 0 0 1em .25em rgba(217, 176, 255, 0.4);
}

/* Menu modal */
#mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  display: none;
  z-index: 2999;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-y: auto;
  padding-top: 80px;
}

#mobile-menu.active { display: flex; }

#mobile-menu-content {
  width: 90%;
  max-width: 320px;
  background: #1a1a1a;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid rgba(191, 123, 255, 0.2);
}

#mobile-menu-content h3 {
  color: #a58eff;
  font-size: 0.9rem;
  text-transform: uppercase;
  margin-top: 16px;
  margin-bottom: 10px;
  text-shadow: 0 0 10px #a58eff;
  text-align: center;
}

#mobile-menu-content h3:first-child { margin-top: 0; }

#mobile-menu-content a {
  display: block;
  color: rgb(217, 176, 255);
  text-decoration: none;
  padding: 10px 12px;
  margin-bottom: 6px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  transition: all 0.2s;
}

#mobile-menu-content a:hover {
  background: rgba(191, 123, 255, 0.15);
  box-shadow: 0 0 0.8em .2em rgba(217, 176, 255, 0.3);
}

#mobile-menu-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: rgb(217, 176, 255);
  font-size: 28px;
  cursor: pointer;
  z-index: 3001;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
}

/* ========== Optimisations Safari/macOS ========== */

#mobile-nav,
#mobile-menu-content {
  -webkit-overflow-scrolling: touch;
}

#mobile-nav a,
#mobile-menu-toggle,
#mobile-menu-close {
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#mobile-nav a:active,
#mobile-menu-toggle:active {
  -webkit-transform: scale(0.95);
  transform: scale(0.95);
