/* Floating pill navbar — matched to Desert Coast visuals/behavior.
   Desert Coast uses html { font-size: 62.5% } (1rem ≈ 10px). Values below
   are the same pixel sizes expressed for Westwood's 16px root. */

:root {
  --ink: #1C1C22;
  --text-secondary: #6B6B6B;
}

#main-nav {
  position: fixed;
  /* Center with inset + margin (not translateX) so retina logos stay sharp */
  left: 0;
  right: 0;
  top: 1rem; /* 16px — Desert Coast 1.6rem @ 10px */
  z-index: 50;
  margin-inline: auto;
  width: max-content;
  max-width: calc(100% - 2rem); /* 32px */
  flex-shrink: 0;
  font-family: 'DM Sans', 'Geist', Inter, ui-sans-serif, system-ui, sans-serif;
}

.nav-pill {
  position: relative;
  flex-shrink: 0;
  background: rgba(227, 221, 207, 0.4);
  backdrop-filter: blur(13px);
  -webkit-backdrop-filter: blur(13px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1.125rem; /* 18px */
  box-shadow: none;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 4.125rem; /* 66px */
  min-height: 4.125rem;
  padding: 0 0.75rem; /* ~12px — a bit more breathing room like Desert Coast */
  flex-shrink: 0;
}

.nav-logo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 3.375rem; /* 54px */
  min-height: 3.375rem;
  padding: 0 0.625rem; /* 10px */
  border-radius: 0.75rem; /* 12px */
  background: transparent !important;
  box-shadow: none;
  flex-shrink: 0;
  overflow: visible;
  transition: background 0.3s ease;
  text-decoration: none;
}

.nav-logo-btn:hover {
  background: rgba(232, 228, 220, 0.55) !important;
}

.nav-logo-btn img {
  display: block;
  height: 4rem; /* 64px — taller than btn, overflows like Desert Coast */
  width: auto;
  max-width: none;
  flex-shrink: 0;
  object-fit: contain;
  object-position: left center;
  image-rendering: auto;
  -webkit-user-drag: none;
  background: transparent !important;
  box-shadow: none;
  opacity: 1 !important; /* never inherit global img.loading shimmer */
  /* Own compositing layer — avoids soft paint under backdrop-filter */
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

#main-nav img.loading,
#main-nav img.loaded {
  background: transparent !important;
  animation: none !important;
  opacity: 1 !important;
}

.nav-logo-btn .nav-logo-img--dark {
  display: none;
}

#main-nav.nav-over-hero .nav-logo-btn .nav-logo-img--light {
  display: none;
}

#main-nav.nav-over-hero .nav-logo-btn .nav-logo-img--dark {
  display: block;
}

@media (min-width: 1024px) {
  .nav-pill {
    border-radius: 1.25rem; /* 20px */
  }
}

.nav-desktop-links {
  display: flex;
  align-items: center;
  height: 100%;
  margin-left: auto;
}

.nav-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-left: auto;
  padding: 0;
  border: none;
  border-radius: 0.75rem;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.nav-menu-toggle:hover {
  background: rgba(232, 228, 220, 0.55);
}

.nav-menu-icon,
.nav-menu-icon::before,
.nav-menu-icon::after {
  display: block;
  width: 1.25rem;
  height: 2px;
  border-radius: 1px;
  background: var(--ink);
  transition: transform 0.25s ease, opacity 0.2s ease, background 0.3s ease;
}

.nav-menu-icon {
  position: relative;
}

.nav-menu-icon::before,
.nav-menu-icon::after {
  content: '';
  position: absolute;
  left: 0;
}

.nav-menu-icon::before {
  top: -6px;
}

.nav-menu-icon::after {
  top: 6px;
}

#main-nav.nav-over-hero .nav-menu-icon,
#main-nav.nav-over-hero .nav-menu-icon::before,
#main-nav.nav-over-hero .nav-menu-icon::after {
  background: rgba(255, 255, 255, 0.92);
}

#main-nav.is-menu-open .nav-menu-icon {
  background: transparent;
}

#main-nav.is-menu-open .nav-menu-icon::before {
  top: 0;
  transform: rotate(45deg);
}

#main-nav.is-menu-open .nav-menu-icon::after {
  top: 0;
  transform: rotate(-45deg);
}

.text-nav {
  font-size: 0.96875rem; /* 15.5px */
  line-height: 1;
  font-weight: 400;
}

@media (min-width: 1024px) {
  .text-nav {
    font-size: 1.03125rem; /* 16.5px */
  }
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 3.375rem; /* 54px — rem so font-size on .text-nav cannot inflate this */
  min-height: 3.375rem;
  padding: 0 1.125rem; /* 18px */
  border-radius: 0.75rem; /* 12px */
  color: var(--text-secondary) !important;
  text-decoration: none;
  transition: color 0.3s ease, background 0.3s ease;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--ink) !important;
}

.nav-link.is-active {
  background: #fff;
  color: var(--ink) !important;
}

.nav-link.is-active:hover {
  color: var(--ink) !important;
}

#main-nav.nav-over-hero .nav-link {
  color: rgba(255, 255, 255, 0.85) !important;
}

#main-nav.nav-over-hero .nav-link:hover {
  color: #fff !important;
}

#main-nav.nav-over-hero .nav-link.is-active,
#main-nav.nav-over-hero .nav-link.is-active:hover {
  color: var(--ink) !important;
}

@media (max-width: 767px) {
  #main-nav {
    top: 0.625rem; /* 10px */
    width: 100%;
    max-width: calc(100% - 1rem); /* 16px */
  }

  .nav-pill,
  .nav-inner {
    min-width: 0;
    width: 100%;
  }

  .nav-inner {
    height: 3.875rem; /* 62px */
    min-height: 3.875rem;
    padding: 0 0.4rem 0 0.3125rem;
    gap: 0.35rem;
    justify-content: space-between;
  }

  .nav-logo-btn {
    height: 52px;
    min-height: 52px;
    padding: 0 7px;
    flex-shrink: 0;
  }

  .nav-logo-btn img {
    /* Whole-pixel size + explicit width keeps 2x/3x resampling crisp */
    height: 60px;
    width: 138px;
  }

  .nav-menu-toggle {
    display: inline-flex;
  }

  .nav-desktop-links {
    display: none;
    position: absolute;
    top: calc(100% + 0.45rem);
    left: 0;
    right: 0;
    margin: 0;
    height: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    padding: 0.5rem;
    background: rgba(227, 221, 207, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 1.125rem;
    box-shadow: 0 12px 32px rgba(28, 28, 34, 0.12);
  }

  #main-nav.is-menu-open .nav-desktop-links {
    display: flex;
  }

  #main-nav.nav-over-hero .nav-desktop-links {
    background: rgba(28, 28, 34, 0.72);
    border-color: rgba(255, 255, 255, 0.12);
  }

  .nav-link {
    height: 2.85rem;
    min-height: 2.85rem;
    padding: 0 0.9rem;
    min-width: 0;
    flex-shrink: 0;
    justify-content: flex-start;
    width: 100%;
    border-radius: 0.85rem;
  }

  .nav-link.is-active {
    background: #fff;
  }

  #main-nav.nav-over-hero .nav-link.is-active {
    background: rgba(255, 255, 255, 0.95);
  }

  .text-nav {
    font-size: 1rem;
  }
}
