

:root {
  --nav-height: 76px;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  /* Bar uses edition palette */
  --magnet-nav-cream: #faf3e0;
  --magnet-nav-ink: #2e1c0a;
  --magnet-nav-accent: #d59609;
}

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  padding: 0 56px;
  height: var(--nav-height);
  background: color-mix(in srgb, var(--magnet-nav-cream) 88%, transparent);
  backdrop-filter: blur(14px) saturate(1.08);
  -webkit-backdrop-filter: blur(14px) saturate(1.08);
  border-bottom: 1px solid rgba(46, 28, 10, 0.07);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.55) inset,
    0 6px 28px rgba(46, 28, 10, 0.07);
  z-index: 5000;
  transform: translateZ(0);
  -webkit-transform: translate3d(0, 0, 0);
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

nav::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(213, 150, 9, 0) 42%,
    rgba(213, 150, 9, 0.5) 50%,
    rgba(213, 150, 9, 0) 58%,
    transparent 100%
  );
  pointer-events: none;
  opacity: 0.85;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-right: auto;
  text-decoration: none;
  color: var(--magnet-nav-ink);
  transition: opacity 0.2s ease;
}

.nav-brand:hover {
  opacity: 0.88;
}

.nav-brand-logo {
  height: 42px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(46, 28, 10, 0.08));
}

.nav-brand-name {
  font-family: 'Times New Roman', Times, serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--magnet-nav-ink);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  gap: 8px 32px;
  list-style: none;
  align-items: center;
}

.nav-links a {
  position: relative;
  font-family: 'Times New Roman', Times, serif;
  font-weight: 400;
  font-size: 13px;
  color: var(--magnet-nav-ink);
  text-decoration: none;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 0;
  transition: color 0.22s ease;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--magnet-nav-accent);
  transform: translateX(-50%);
  transition: width 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-links a:hover {
  color: var(--magnet-nav-accent);
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-hamburger {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  margin-right: -10px;
  z-index: 150;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--magnet-nav-ink);
  transform-origin: center;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
}

.nav-hamburger.is-open span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.nav-hamburger.is-open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.nav-hamburger.is-open span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

body.nav-open {
  overflow: hidden;
}

@keyframes mg-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

@keyframes mg-pop-in {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes mg-wiggle {
  0%,
  100% {
    transform: rotate(0);
  }
  25% {
    transform: rotate(-2deg);
  }
  75% {
    transform: rotate(2deg);
  }
}

.nav-brand-logo {
  animation: mg-float 5.5s ease-in-out infinite;
  transition: transform 0.4s var(--ease-out-expo), filter 0.4s ease;
}

.nav-brand:hover .nav-brand-logo {
  animation-play-state: paused;
  transform: rotate(-6deg) scale(1.08);
  filter: drop-shadow(0 3px 6px rgba(46, 28, 10, 0.18));
}

.nav-brand-name {
  transition: letter-spacing 0.35s var(--ease-out-expo), color 0.25s ease;
}

.nav-brand:hover .nav-brand-name {
  letter-spacing: 0.11em;
  color: var(--magnet-nav-accent);
}

.nav-links li {
  animation: mg-pop-in 0.6s var(--ease-out-expo) both;
}

.nav-links li:nth-child(1) {
  animation-delay: 0.05s;
}

.nav-links li:nth-child(2) {
  animation-delay: 0.1s;
}

.nav-links li:nth-child(3) {
  animation-delay: 0.15s;
}

.nav-links li:nth-child(4) {
  animation-delay: 0.2s;
}

.nav-links li:nth-child(5) {
  animation-delay: 0.25s;
}

.nav-links li:nth-child(6) {
  animation-delay: 0.3s;
}

.nav-links a {
  transition: color 0.22s ease, transform 0.25s var(--ease-out-expo);
}

.nav-links a:hover {
  transform: translateY(-2px);
}

.nav-links a:active {
  transform: translateY(0) scale(0.96);
}

.nav-hamburger:hover span {
  animation: mg-wiggle 0.6s ease-in-out;
}

.nav-hamburger:active {
  transform: scale(0.92);
}

@media (max-width: 900px) {
  nav {
    padding: 0 24px;
  }

  .nav-hamburger {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    width: 100%;
    flex-direction: column;
    gap: 0;
    background: var(--magnet-nav-cream);
    padding: 16px 24px 32px;
    border-bottom: 1px solid rgba(46, 28, 10, 0.08);
    box-shadow: 0 18px 36px rgba(46, 28, 10, 0.12);
    z-index: 100;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links li {
    width: 100%;
    border-bottom: 1px solid rgba(46, 28, 10, 0.06);
  }

  .nav-links li:last-child {
    border-bottom: none;
  }

  .nav-links a {
    display: block;
    padding: 16px 0;
    font-size: 14px;
  }

  .nav-links a::after {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-brand-logo,
  .nav-links li {
    animation: none !important;
  }

  .nav-hamburger:hover span {
    animation: none !important;
  }
}
