/* Site menu (hamburger). One source for every page with <nav data-nav>; behaviour in /nav.js. */
.nav {
  position: fixed;
  top: max(0.9rem, calc(env(safe-area-inset-top) + 0.55rem));
  left: max(0.9rem, calc(env(safe-area-inset-left) + 0.55rem));
  z-index: 30;
}

.nav-btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 2.45rem;
  height: 2.45rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 0.58rem 0.52rem;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0.72rem;
  background: transparent;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 10px 28px rgba(0, 0, 0, 0.28);
  cursor: pointer;
}

.nav-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(22px) saturate(1.55);
  -webkit-backdrop-filter: blur(22px) saturate(1.55);
  pointer-events: none;
}

.nav-btn span {
  display: block;
  width: 100%;
  height: 1.5px;
  flex: 0 0 1.5px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.82);
  transform-origin: center;
  transition: transform 0.22s ease, opacity 0.18s ease;
}

.nav.is-open .nav-btn span:nth-of-type(1) { transform: translateY(6.5px) rotate(45deg); }
.nav.is-open .nav-btn span:nth-of-type(2) {
  opacity: 0;
  visibility: hidden;
  transform: scaleX(0);
}
.nav.is-open .nav-btn span:nth-of-type(3) { transform: translateY(-6.5px) rotate(-45deg); }

.nav-list {
  position: relative;
  isolation: isolate;
  margin: 0.45rem 0 0;
  padding: 0.32rem;
  list-style: none;
  min-width: 10.6rem;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0.85rem;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 14px 32px rgba(0, 0, 0, 0.34);
}

.nav-list::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: rgba(8, 8, 14, 0.72);
  backdrop-filter: blur(22px) saturate(1.55);
  -webkit-backdrop-filter: blur(22px) saturate(1.55);
  pointer-events: none;
}

.nav-list a {
  display: block;
  padding: 0.55rem 0.72rem;
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  border-radius: 0.58rem;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
}

.nav-list a:hover {
  color: rgba(255, 255, 255, 0.96);
  background: rgba(255, 255, 255, 0.08);
}

.nav-btn:focus-visible,
.nav-list a:focus-visible {
  outline: 2px solid rgba(190, 220, 255, 0.7);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .nav-btn span { transition: none; }
}
