/* ============================================================
   LUNA CUSTOM HOMES — Navigation & Mobile Menu
   ============================================================ */

/* ── Nav ─────────────────────────────────────────────────── */
nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 9000;
  padding: 15px 0;
  transition: padding .4s var(--ease), background .4s var(--ease), border-color .4s var(--ease);
  border-bottom: 1px solid transparent;
}
nav .luna-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}
nav.pinned {
  padding: 15px 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(32px) saturate(180%) brightness(0.85);
  -webkit-backdrop-filter: blur(32px) saturate(180%) brightness(0.85);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.05), 0 4px 24px rgba(0,0,0,0.4);
}
.nav-logo img {
  width: 100px; height: auto;
  filter: brightness(0) invert(1);
  transition: opacity .3s;
}
.nav-logo:hover img { opacity: 0.75; }
.nav-links {
  display: flex;
  gap: 2.75rem;
  margin-left: auto;
}
.nav-links a {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  position: relative;
  padding-bottom: 3px;
  transition: opacity .3s;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 1px;
  background: var(--gold);
  transition: width .35s var(--ease);
}
.nav-links a:hover::after { width: 100%; }
.nav-links a:hover { opacity: 1; }
.nav-links a.active { color: var(--gold); }
.nav-links a.active::after { width: 100%; background: var(--gold); }

/* ── Header CTA Button ───────────────────────────────────── */
.nav-btn {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  font-style: italic;
  line-height: 1;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  color: var(--dark);
  background: var(--white);
  height: 48px;
  padding: 12px 18px;
  border-radius: 200px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  transition: color .4s var(--ease);
  white-space: nowrap;
}
.nav-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--dark);
  border-radius: 200px;
  transform: translateX(-101%);
  transition: transform .4s var(--ease);
  z-index: 0;
}
.nav-btn:hover { color: var(--white); }
.nav-btn:hover::before { transform: translateX(0); }
.nav-btn span { position: relative; z-index: 1; }

/* hamburger – hidden on desktop */
.nav-hamburger { display: none; }

/* ── Mobile Menu Overlay ─────────────────────────────────── */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(12, 12, 12, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .4s var(--ease), visibility .4s var(--ease);
}
.mobile-menu.open {
  opacity: 1;
  visibility: visible;
}
.mobile-close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: none;
  border: none;
  color: var(--white);
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  padding: 8px;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
  z-index: 1;
}
.mobile-close:hover { opacity: 0.6; transform: rotate(90deg); }
.mobile-menu a {
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1.2;
  font-weight: 500;
  font-style: italic;
  letter-spacing: 0.02em;
  color: var(--white);
  text-decoration: none;
  padding: 10px 0;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .35s var(--ease), transform .35s var(--ease), color .25s;
}
.mobile-menu.open a {
  opacity: 1;
  transform: translateY(0);
}
/* stagger the link animations */
.mobile-menu a:nth-child(2) { transition-delay: .05s; }
.mobile-menu a:nth-child(3) { transition-delay: .1s; }
.mobile-menu a:nth-child(4) { transition-delay: .15s; }
.mobile-menu a:nth-child(5) { transition-delay: .2s; }
.mobile-menu a:nth-child(6) { transition-delay: .25s; }
.mobile-menu a:nth-child(7) { transition-delay: .3s; }
.mobile-menu a:hover,
.mobile-menu a.active { color: var(--gold); }
/* CTA inside mobile menu */
.mobile-menu .btn-white {
  margin-top: 2rem;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  font-style: italic;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--dark);
  background: var(--white);
  min-width: 213px;
  padding: 14px 36px;
  border-radius: 200px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity .3s var(--ease), transform .35s var(--ease), color .4s var(--ease);
  opacity: 0;
  transform: translateY(20px);
}
.mobile-menu.open .btn-white {
  opacity: 1;
  transform: translateY(0);
  transition-delay: .35s;
}

/* ── Responsive: nav at ≤900px ───────────────────────────── */
@media (max-width: 900px) {
  nav { padding: 1.5rem 0; }
  nav.pinned { padding: 1rem 0; }
  .nav-logo img { width: 80px; }
  .nav-links { display: none; }
  .nav-btn { display: none; }
  .nav-hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: .5rem;
  }
  .nav-hamburger span {
    display: block;
    width: 24px; height: 1.5px;
    background: var(--white);
    transform-origin: center;
    transition: transform .3s var(--ease), opacity .25s var(--ease);
  }
  /* Hamburger morphs into an X while the menu is open */
  body.menu-open .nav-hamburger span:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
  }
  body.menu-open .nav-hamburger span:nth-child(2) {
    opacity: 0;
  }
  body.menu-open .nav-hamburger span:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
  }
  /* Float the navbar above the open menu so the X-hamburger is clickable.
     Strip the pinned background so only the logo + X show over the overlay. */
  body.menu-open nav { z-index: 10001; }
  body.menu-open nav.pinned {
    background: transparent;
    -webkit-backdrop-filter: none;
            backdrop-filter: none;
    border-color: transparent;
    box-shadow: none;
  }
  /* The hamburger toggles open/close — hide the redundant in-menu × button */
  .mobile-close { display: none; }
}
