/* Global navigation: fixed glass bar + mobile full-screen menu.
   Driven entirely by config/navigation.json (see js/components/navbar.js). */

.navbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: 64px;
  background: var(--color-surface);
  background: color-mix(in srgb, var(--color-surface) 62%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  border-bottom: 1px solid var(--color-border);
}

.navbar__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.navbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--color-text-primary);
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  white-space: nowrap;
}

.navbar__brand img {
  width: 28px;
  height: 28px;
}

.navbar__nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 36px);
}

.navbar__link {
  position: relative;
  padding: 8px 2px;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  transition: color 0.25s ease;
}

.navbar__link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 2px;
  height: 1px;
  background: var(--color-accent);
  transition: right 0.3s ease;
}

.navbar__link:hover,
.navbar__link.is-active {
  color: var(--color-text-primary);
}

.navbar__link:hover::after,
.navbar__link.is-active::after {
  right: 0;
}

.navbar__actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.navbar__icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  color: var(--color-text-secondary);
  transition: color 0.25s ease, background-color 0.25s ease;
}

.navbar__icon-btn:hover {
  color: var(--color-text-primary);
  background: color-mix(in srgb, var(--color-surface-muted) 72%, transparent);
}

.navbar__icon-btn svg {
  width: 20px;
  height: 20px;
}

.navbar__burger {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.navbar__burger span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.navbar__burger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(5.5px) rotate(45deg);
}

.navbar__burger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.navbar__burger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-5.5px) rotate(-45deg);
}

/* Mobile menu — rendered as a SIBLING of .navbar, not a child:
   backdrop-filter on the bar would otherwise become the containing block
   for its fixed position. */
.navbar__menu {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 4.5vh, 40px);
  background: var(--color-bg);
  background: color-mix(in srgb, var(--color-bg) 76%, transparent);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  backdrop-filter: blur(24px) saturate(140%);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0s linear 0.35s;
}

.navbar__menu.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.35s ease;
}

.navbar__menu-link {
  font-family: var(--font-heading);
  font-size: clamp(26px, 7vw, 38px);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  transition: color 0.25s ease;
}

.navbar__menu-link:hover,
.navbar__menu-link.is-active {
  color: var(--color-text-primary);
}

.navbar__menu-meta {
  position: absolute;
  bottom: clamp(28px, 6vh, 56px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  opacity: 0.7;
}

@media (max-width: 767px) {
  .navbar__nav {
    display: none;
  }

  .navbar__burger {
    display: inline-flex;
  }
}

@media (min-width: 768px) {
  .navbar__menu {
    display: none;
  }
}
