/* ===========================================================
   NAVBAR
   =========================================================== */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  /* Above everything including drawer */
  padding: var(--sp-4) 0 0;
  transition: padding var(--dur-fast) var(--ease-out);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
  padding: 0.6rem 0.6rem 0.6rem 1.1rem;
  border-radius: 999px;
  background: rgba(250, 249, 245, 0.72);
  border: 1px solid rgba(10, 23, 38, 0.07);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 12px 32px -16px rgba(10, 23, 38, 0.12);
  transition: all var(--dur-fast) var(--ease-out);
}

.nav.is-scrolled .nav__inner {
  background: rgba(250, 249, 245, 0.92);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 16px 40px -16px rgba(10, 23, 38, 0.18);
}

/* When drawer is open, switch pill to dark so it sits on the dark overlay */
.nav.drawer-open .nav__inner {
  background: rgba(10, 23, 38, 0.85);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

.nav.drawer-open .nav__brand-name {
  color: var(--bone-100);
}

.nav.drawer-open .nav__brand-tag {
  color: var(--text-on-dark-muted);
}

/* ---- Brand ---- */
.nav__brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.nav__brand img {
  height: 38px;
  width: 38px;
  object-fit: contain;
}

.nav__brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.nav__brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  transition: color var(--dur-fast) var(--ease-out);
}

.nav__brand-tag {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  transition: color var(--dur-fast) var(--ease-out);
}

/* ---- Desktop links ---- */
.nav__links {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  list-style: none;
}

.nav__links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
  padding: 0.4rem 0.1rem;
  transition: color var(--dur-fast) var(--ease-out);
}

.nav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0%;
  height: 1.5px;
  background: var(--gold-500);
  transition: width var(--dur-fast) var(--ease-out);
}

.nav__links a:hover {
  color: var(--text-primary);
}

.nav__links a:hover::after,
.nav__links a.is-active::after {
  width: 100%;
}

.nav__links a.is-active {
  color: var(--text-primary);
}

.nav__cta {
  flex-shrink: 0;
}

/* ---- Burger button — morphs into × when drawer is open ---- */
.nav__burger {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--ink-900);
  position: relative;
  z-index: 201;
  /* Always on top so it's always tappable */
  transition: background var(--dur-fast) var(--ease-out);
}

/* Three-bar icon — middle bar */
.nav__burger span {
  position: relative;
  width: 16px;
  height: 1.5px;
  background: var(--bone-100);
  display: block;
  transition: background var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
}

/* Top and bottom bars */
.nav__burger span::before,
.nav__burger span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 16px;
  height: 1.5px;
  background: var(--bone-100);
  transition: transform var(--dur-fast) var(--ease-out),
    top var(--dur-fast) var(--ease-out);
}

.nav__burger span::before {
  top: -5px;
}

.nav__burger span::after {
  top: 5px;
}

/* Morph to × when drawer open */
.nav.drawer-open .nav__burger span {
  background: transparent;
  /* hide middle bar */
}

.nav.drawer-open .nav__burger span::before {
  top: 0;
  transform: rotate(45deg);
}

.nav.drawer-open .nav__burger span::after {
  top: 0;
  transform: rotate(-45deg);
}

/* ---- Mobile drawer ---- */
.nav__drawer {
  position: fixed;
  /* Always cover the full viewport from the very top when open.
     Previously this used top: var(--notice-offset, 0px) to "start
     below" the notice bar, but since both .nav and the drawer are
     fixed-position (scroll-independent) while the notice bar itself
     is a normal in-flow element that scrolls away with the page,
     that offset became a stale gap: once the user scrolled down and
     then opened the menu, the drawer left a blank strip at the top
     equal to the (no-longer-visible) notice bar's height, showing
     the page background instead of the drawer. The drawer is a
     full-screen overlay — it should always start at 0, not try to
     "tuck under" UI that may not even be on screen anymore. */
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 199;
  /* Just below .nav (200) so pill stays on top */
  background: var(--ink-900);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  /* Top padding clears the floating nav pill itself, which can sit
     up to --notice-offset + its own height down from the top. */
  padding: calc(var(--sp-7) + 1.75rem + var(--notice-offset, 0px)) var(--container-pad) var(--sp-6);
  transform: translate3d(0, -120vh, 0);
  transition: transform var(--dur-med) var(--ease-in-out);
  /* Prevent the drawer itself from being a scroll container unless content overflows */
  overflow-y: auto;
  /* GPU layer: avoids the iOS rendering glitch */
  -webkit-overflow-scrolling: touch;
  will-change: transform;
  /* Prevent stray tap events while closed */
  pointer-events: none;
}

.nav__drawer.is-open {
  transform: translate3d(0, 0, 0);
  pointer-events: auto;
}

/* Decorative radial glow inside drawer */
.nav__drawer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 90% 10%,
      rgba(201, 154, 61, 0.12), transparent 55%);
  pointer-events: none;
}

.nav__drawer-links {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  list-style: none;
  position: relative;
  /* above ::before */
  z-index: 1;
}

.nav__drawer-links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 7vw, 2.75rem);
  color: var(--bone-100);
  font-weight: 600;
  transition: color var(--dur-fast) var(--ease-out),
    padding-left var(--dur-fast) var(--ease-out);
}

.nav__drawer-links a:hover {
  color: var(--gold-300);
  padding-left: 0.5rem;
}

/* Current page — matches the gold accent used for desktop .is-active */
.nav__drawer-links a.is-active {
  color: var(--gold-300);
}

.nav__drawer-links a.is-active::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold-300);
  flex-shrink: 0;
}

/* ---- Drawer footer with CTA ---- */
.nav__drawer-foot {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--border-hair-dark);
  margin-top: var(--sp-5);
  position: relative;
  z-index: 1;
}

.nav__drawer-cta {
  align-self: flex-start;
}

.nav__drawer-tagline {
  font-size: 0.8rem;
  color: var(--text-on-dark-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
  margin: 0;
}

/* ---- Keep the old close button hidden — burger IS the close button now ---- */
.nav__drawer-close {
  display: none;
}

/* ---- Breakpoints ---- */
@media (max-width: 980px) {
  .nav__links {
    display: none;
  }

  .nav__cta {
    display: none;
  }

  .nav__burger {
    display: flex;
  }
}

@media (max-width: 480px) {
  .nav {
    padding-top: var(--sp-3);
  }

  .nav__inner {
    padding: 0.5rem 0.5rem 0.5rem 0.9rem;
  }

  .nav__brand img {
    height: 32px;
    width: 32px;
  }

  .nav__brand-name {
    font-size: 0.92rem;
  }
}