/* ============================================================
   nav.css — the shared site navigation.
   One component for every page (Figma node 292:1961 and its twins
   on the Home/About frames): brand 166px | centered pill menu |
   three 50px social buttons. Brand and socials are equal-width,
   so the menu is always exactly page-centered — identical
   geometry on every page, no jumping between them.
   Mobile (≤1023px): burger + collapsible panel.
   ============================================================ */

.nav {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 1356px;
  max-width: calc(100% - 32px);
  height: 82px;
  padding: 16px 32px;
}

.nav-bar,
.nav-panel {
  display: contents;
}

.brand {
  width: 166px;
  font-family: "VT323", monospace;
  font-size: 14px;
  letter-spacing: -0.056px;
  text-transform: uppercase;
  color: #fff;
  white-space: nowrap;
  text-decoration: none;
}

.nav-toggle {
  display: none;
  width: 46px;
  height: 46px;
  border-radius: 56px;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.burger,
.burger::before,
.burger::after {
  content: "";
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: #fff;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.burger {
  position: relative;
  /* Middle bar is shorter in the design (16px, inset 6px). */
  width: 16px;
  margin-left: 6px;
}
.burger::before {
  position: absolute;
  left: -6px;
  top: -8px;
  width: 22px;
}
.burger::after {
  position: absolute;
  left: -6px;
  top: 8px;
  width: 22px;
}
.nav.open .burger {
  background: transparent;
}
.nav.open .burger::before {
  transform: translateY(8px) rotate(45deg);
}
.nav.open .burger::after {
  transform: translateY(-8px) rotate(-45deg);
}

.menu {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px;
  border-radius: 56px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.menu-item {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 32px;
  border-radius: 32px;
  font-family: "VT323", monospace;
  font-size: 14px;
  letter-spacing: -0.056px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.menu-item:not(.active):hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.menu-item.active {
  background: #fff;
  color: #000;
}

.social {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sm-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 36px;
  border: 1px solid transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.sm-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
}

.sm-btn img {
  display: block;
}

/* ---------------- Mobile ---------------- */
@media (max-width: 1023px) {
  .nav {
    left: 0;
    top: 0;
    right: 0;
    width: auto;
    max-width: none;
    height: auto;
    transform: none;
    padding: 0;
    flex-direction: column;
    align-items: stretch;
    border-bottom-left-radius: 32px;
    border-bottom-right-radius: 32px;
    transition: background-color 0.25s ease;
  }
  .nav.open {
    background: rgba(0, 0, 0, 0.4);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
  }

  .nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
  }

  .brand {
    width: auto;
    font-size: 16px;
    letter-spacing: -0.064px;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-panel {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 24px;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    padding: 0 16px;
    transition: max-height 0.3s ease, opacity 0.25s ease, visibility 0.25s ease,
      padding 0.3s ease;
  }
  .nav.open .nav-panel {
    max-height: 340px;
    opacity: 1;
    visibility: visible;
    padding: 0 16px 24px;
  }

  .menu {
    flex-direction: column;
    align-items: stretch;
    border-radius: 16px;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .menu-item {
    justify-content: flex-start;
    padding: 0 16px;
    border-radius: 12px;
    font-size: 16px;
  }

  .social {
    justify-content: flex-start;
  }
}
