/* Mobile nav — pairs with page styles that hide .nav-links ≤1024px */

/* Menu button hidden on desktop */
.nav-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  min-width: 38px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink, #14110d);
  cursor: pointer;
  flex-shrink: 0;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    0 1px 1px rgba(20, 17, 13, 0.06);
  transition: background 0.25s ease;
}
.nav-menu-btn:hover { background: #f5f2ec; }

.nav-menu-bars {
  position: relative;
  display: block;
  width: 16px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: background 0.2s ease;
}
.nav-menu-bars::before,
.nav-menu-bars::after {
  content: '';
  position: absolute;
  left: 0;
  width: 16px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.25s ease, top 0.25s ease;
}
.nav-menu-bars::before { top: -5px; }
.nav-menu-bars::after { top: 5px; }

.nav.nav-mobile-open .nav-menu-bars { background: transparent; }
.nav.nav-mobile-open .nav-menu-bars::before {
  top: 0;
  transform: rotate(45deg);
}
.nav.nav-mobile-open .nav-menu-bars::after {
  top: 0;
  transform: rotate(-45deg);
}

/* Short CTA label on very narrow screens */
.nav-cta-short { display: none; }

.nav-mobile-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: max(12px, env(safe-area-inset-left, 0px));
  right: max(12px, env(safe-area-inset-right, 0px));
  max-width: 980px;
  margin: 0 auto;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition:
    opacity 0.22s ease,
    transform 0.22s ease,
    visibility 0s linear 0.22s;
  z-index: 9100;
}
.nav.nav-mobile-open .nav-mobile-panel {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition:
    opacity 0.22s ease,
    transform 0.22s ease,
    visibility 0s linear 0s;
}

.nav-mobile-panel-inner {
  padding: 8px;
  border: 1px solid rgba(20, 17, 13, 0.08);
  border-radius: 16px;
  background: rgba(251, 248, 241, 0.96);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 18px 50px -18px rgba(20, 17, 13, 0.18);
}

.nav-mobile-heading {
  margin: 0;
  padding: 10px 14px 6px;
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3, #6b6459);
}

.nav-mobile-item {
  display: block;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink, #14110d);
  text-decoration: none;
  transition: background 0.18s ease;
}
a.nav-mobile-item:hover { background: var(--paper-warm, #f3ede3); }
.nav-mobile-item.is-current {
  color: var(--ink, #14110d);
  background: var(--paper-warm, #f3ede3);
}
span.nav-mobile-item.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  font-weight: 450;
}
.nav-mobile-soon {
  display: inline-block;
  margin-left: 6px;
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.75;
}

.nav-mobile-divider {
  height: 1px;
  margin: 6px 10px;
  background: rgba(20, 17, 13, 0.08);
}

.nav-mobile-item--signin {
  font-weight: 450;
  color: var(--ink-3, #6b6459);
}

@media (max-width: 1024px) {
  .nav-menu-btn { display: inline-flex; }

  /* Prevent header overflow / wrapping breakage */
  .nav-pill {
    gap: 0.5rem;
    min-width: 0;
    padding-left: 14px;
    padding-right: 6px;
  }
  .nav-brand {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
  }
  .brand-word {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .nav-actions {
    flex: 0 0 auto;
    flex-shrink: 0;
    gap: 0.35rem;
    min-width: 0;
  }
  .nav-actions > a,
  .nav-actions > .cta {
    flex-shrink: 0;
  }
}

@media (max-width: 640px) {
  /* Login lives in the mobile menu — frees horizontal space */
  .nav-actions .nav-signin { display: none; }
}

@media (max-width: 420px) {
  .nav-cta-long { display: none; }
  .nav-cta-short { display: inline; }
}

/* Homepage hero: nav-on-dark */
.nav.nav-on-dark .nav-menu-btn {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 1px 1px rgba(0, 0, 0, 0.2);
}
.nav.nav-on-dark .nav-menu-btn:hover { background: rgba(255, 255, 255, 0.12); }
.nav.nav-on-dark .nav-mobile-panel-inner {
  background: rgba(22, 20, 18, 0.92);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 28px 56px -16px rgba(0, 0, 0, 0.55);
}
.nav.nav-on-dark .nav-mobile-heading { color: rgba(255, 255, 255, 0.5); }
.nav.nav-on-dark .nav-mobile-item { color: rgba(255, 255, 255, 0.88); }
.nav.nav-on-dark a.nav-mobile-item:hover,
.nav.nav-on-dark .nav-mobile-item.is-current {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.nav.nav-on-dark span.nav-mobile-item.is-disabled { color: rgba(255, 255, 255, 0.45); }
.nav.nav-on-dark .nav-mobile-divider { background: rgba(255, 255, 255, 0.1); }
.nav.nav-on-dark .nav-mobile-item--signin { color: rgba(255, 255, 255, 0.72); }
