/* ============================================================
   navbar.css — Beaverly Floating Liquid Glass Navbar
   ============================================================ */

/* ── Global: kill browser blue tap/focus highlight ────────── */
*,
*::before,
*::after {
  -webkit-tap-highlight-color: transparent;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid rgba(0, 0, 0, 0.3);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --nav-height: 64px;
  --nav-radius: 20px;
  --nav-blur: 24px;
  --nav-bg-light: rgba(255, 255, 255, 0.72);
  --nav-border-light: rgba(255, 255, 255, 0.9);
  --nav-shadow-light: 0 8px 40px rgba(0,0,0,0.10), 0 1px 0 rgba(255,255,255,0.5) inset;
  --nav-bg-dark: rgba(12, 12, 12, 0.60);
  --nav-border-dark: rgba(255, 255, 255, 0.10);
  --nav-shadow-dark: 0 8px 40px rgba(0,0,0,0.45), 0 1px 0 rgba(255,255,255,0.06) inset;
  --nav-text-light: #111111;
  --nav-text-dark: #f0f0f0;
  --nav-cta-bg-light: #0a0a0a;
  --nav-cta-text-light: #ffffff;
  --nav-cta-bg-dark: rgba(255,255,255,0.14);
  --nav-cta-text-dark: #f0f0f0;
  --nav-cta-border-dark: rgba(255,255,255,0.22);
  --sidebar-width: 280px;
  --sidebar-bg: rgba(255, 255, 255, 0.82);
  --t-nav: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast: 0.18s ease;
}

/* ── Page offset ───────────────────────────────────────────── */
.hero--nav-offset {
  padding-top: calc(var(--nav-height) + 72px);
}
.page--nav-offset {
  padding-top: calc(var(--nav-height) + 48px);
}

/* ── Navbar pill ───────────────────────────────────────────── */
.bvly-nav {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 48px);
  max-width: 1160px;
  height: var(--nav-height);
  z-index: 9000;
  border-radius: var(--nav-radius);
  background: var(--nav-bg-light);
  border: 1px solid var(--nav-border-light);
  box-shadow: var(--nav-shadow-light);
  backdrop-filter: blur(var(--nav-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--nav-blur)) saturate(180%);
  transition: background var(--t-nav), border-color var(--t-nav), box-shadow var(--t-nav), top var(--t-nav), width var(--t-nav);
}

.bvly-nav.nav-scrolled {
  top: 12px;
  width: calc(100% - 64px);
}

.bvly-nav.nav-dark-ctx {
  background: var(--nav-bg-dark);
  border-color: var(--nav-border-dark);
  box-shadow: var(--nav-shadow-dark);
}

/* ── Inner layout ──────────────────────────────────────────── */
.bvly-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 20px;
  position: relative;
}

/* ── Left: sidebar toggle ──────────────────────────────────── */
.bvly-nav__sidebar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 10px;
  color: var(--nav-text-light);
  transition: background var(--t-fast), color var(--t-fast);
  touch-action: manipulation;
}

.bvly-nav__sidebar-btn:hover {
  background: rgba(0,0,0,0.07);
}

.bvly-nav.nav-dark-ctx .bvly-nav__sidebar-btn {
  color: var(--nav-text-dark);
}

.bvly-nav.nav-dark-ctx .bvly-nav__sidebar-btn:hover {
  background: rgba(255,255,255,0.10);
}

/* Sidebar icon */
.sidebar-icon {
  width: 22px;
  height: 18px;
  position: relative;
}

.sidebar-icon__outer {
  position: absolute;
  inset: 0;
  border: 1.75px solid currentColor;
  border-radius: 4px;
}

.sidebar-icon__panel {
  position: absolute;
  top: 3px;
  left: 4px;
  width: 6px;
  height: 12px;
  background: currentColor;
  border-radius: 1.5px;
  opacity: 0.8;
}

/* ── Centre: brand ─────────────────────────────────────────── */
.bvly-nav__brand {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  text-decoration: none;
  user-select: none;
  /* Never let brand touch the side elements */
  max-width: calc(100% - 240px);
}

.bvly-nav__wordmark {
  font-family: 'Outfit', -apple-system, sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--nav-text-light);
  letter-spacing: -0.03em;
  white-space: nowrap;
  transition: opacity var(--t-nav), color var(--t-nav);
}

.bvly-nav__wordmark sup {
  font-size: 0.5rem;
  font-weight: 500;
  opacity: 0.55;
  vertical-align: super;
  letter-spacing: 0;
}

.bvly-nav.nav-dark-ctx .bvly-nav__wordmark {
  color: var(--nav-text-dark);
}

.bvly-nav__logo-img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  object-fit: contain;
  opacity: 0;
  position: absolute;
  left: 50%;
  transform: translateX(-50%) scale(0.85);
  transition: opacity var(--t-nav), transform var(--t-nav);
  pointer-events: none;
}

/* Scroll swap */
.bvly-nav.nav-scrolled .bvly-nav__wordmark {
  opacity: 0;
  pointer-events: none;
}

.bvly-nav.nav-scrolled .bvly-nav__logo-img {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) scale(1);
}

/* ── Right: desktop links + CTA ────────────────────────────── */
.bvly-nav__right {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

/* Desktop nav links — only visible ≥768px */
.bvly-nav__link {
  display: none;
  padding: 7px 14px;
  border-radius: 10px;
  font-family: 'Outfit', -apple-system, sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
  color: var(--nav-text-light);       /* dark text on light glass */
  transition: background var(--t-fast), color var(--t-fast);
}

.bvly-nav__link:hover {
  background: rgba(0,0,0,0.07);
  color: #000;
}

.bvly-nav.nav-dark-ctx .bvly-nav__link {
  color: rgba(240,240,240,0.85);
}

.bvly-nav.nav-dark-ctx .bvly-nav__link:hover {
  background: rgba(255,255,255,0.10);
  color: #ffffff;
}

@media (min-width: 768px) {
  .bvly-nav__link {
    display: inline-flex;
    align-items: center;
  }
}

/* CTA button */
.bvly-nav__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--nav-cta-bg-light);
  color: var(--nav-cta-text-light);
  border: 1px solid transparent;
  border-radius: 12px;
  font-family: 'Outfit', -apple-system, sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
  touch-action: manipulation;
}

.bvly-nav__cta:hover {
  opacity: 0.88;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}

.bvly-nav.nav-dark-ctx .bvly-nav__cta {
  background: var(--nav-cta-bg-dark);
  color: var(--nav-cta-text-dark);
  border-color: var(--nav-cta-border-dark);
}

.bvly-nav.nav-dark-ctx .bvly-nav__cta:hover {
  background: rgba(255,255,255,0.22);
}

/* Mobile: icon-only CTA by default — label hidden while wordmark visible */
@media (max-width: 767px) {
  .bvly-nav__cta-label {
    display: none;
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    transition: opacity var(--t-nav), max-width var(--t-nav);
  }
  .bvly-nav__cta {
    padding: 8px 11px;
    gap: 0;
    border-radius: 10px;
    transition: padding var(--t-nav), gap var(--t-nav), opacity var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
  }
  /* Once scrolled: wordmark gone → CTA can expand to show full label */
  .bvly-nav.nav-scrolled .bvly-nav__cta-label {
    display: inline;
    opacity: 1;
    max-width: 200px;
  }
  .bvly-nav.nav-scrolled .bvly-nav__cta {
    padding: 8px 16px;
    gap: 6px;
  }
  /* Brand safe width at rest */
  .bvly-nav__brand {
    max-width: calc(100% - 110px);
  }
  /* Brand safe width when scrolled (CTA expanded, no wordmark competing) */
  .bvly-nav.nav-scrolled .bvly-nav__brand {
    max-width: none;
    pointer-events: auto;
  }
}

/* ── Sidebar overlay ───────────────────────────────────────── */
.bvly-sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 8990;
  background: transparent;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  pointer-events: none;
  transition: background var(--t-nav), backdrop-filter var(--t-nav);
}

.bvly-sidebar-overlay.is-open {
  background: rgba(0,0,0,0.28);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  pointer-events: auto;
}

/* ── Sidebar panel ─────────────────────────────────────────── */
.bvly-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  z-index: 9100;
  display: flex;
  flex-direction: column;
  padding: 32px 0 40px;
  background: var(--sidebar-bg);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border-right: 1px solid rgba(255,255,255,0.75);
  box-shadow: 6px 0 48px rgba(0,0,0,0.12), 1px 0 0 rgba(255,255,255,0.6) inset;
  transform: translateX(-110%);
  transition: transform var(--t-nav);
  will-change: transform;
}

.bvly-sidebar.is-open {
  transform: translateX(0);
}

.bvly-sidebar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px 28px;
  border-bottom: 1px solid rgba(0,0,0,0.07);
  margin-bottom: 8px;
}

.bvly-sidebar__brand {
  font-family: 'Outfit', -apple-system, sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #111;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.bvly-sidebar__brand sup {
  font-size: 0.48rem;
  opacity: 0.5;
  vertical-align: super;
}

.bvly-sidebar__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: rgba(0,0,0,0.06);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: #111;
  transition: background var(--t-fast);
}

.bvly-sidebar__close:hover {
  background: rgba(0,0,0,0.11);
}

.bvly-sidebar__nav {
  display: flex;
  flex-direction: column;
  padding: 8px 12px;
  gap: 2px;
  flex: 1;
  overflow-y: auto;
}

.bvly-sidebar__section-label {
  padding: 16px 26px 6px;
  font-family: 'Outfit', -apple-system, sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #aaa;
}

.bvly-sidebar__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  text-decoration: none;
  color: #1a1a1a;
  font-family: 'Outfit', -apple-system, sans-serif;
  font-size: 0.93rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: background var(--t-fast), color var(--t-fast);
}

.bvly-sidebar__link:hover {
  background: rgba(0,0,0,0.055);
  color: #000;
}

.bvly-sidebar__link-icon {
  width: 18px;
  height: 18px;
  opacity: 0.4;
  flex-shrink: 0;
}

.bvly-sidebar__footer {
  padding: 20px 20px 0;
  border-top: 1px solid rgba(0,0,0,0.07);
  margin-top: 12px;
}

.bvly-sidebar__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px;
  background: #0a0a0a;
  color: #ffffff;
  border-radius: 14px;
  font-family: 'Outfit', -apple-system, sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: -0.01em;
  transition: opacity var(--t-fast), transform var(--t-fast);
}

.bvly-sidebar__cta:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

/* ── Footer disclaimer link blending ────────────────────────
   .footer-legal and .footer-bottom are in footer-main.html.
   Links must inherit the surrounding text colour and only show
   a subtle underline, not browser-default blue.
   ─────────────────────────────────────────────────────────── */
.footer-legal a,
.footer-legal-link,
.footer-bottom a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: currentColor;
  opacity: 0.65;
  transition: opacity var(--t-fast);
}

.footer-legal a:hover,
.footer-legal-link:hover,
.footer-bottom a:hover {
  opacity: 1;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  .bvly-nav {
    width: calc(100% - 24px);
    top: 12px;
    border-radius: 16px;
  }

  .bvly-nav.nav-scrolled {
    width: calc(100% - 32px);
    top: 8px;
  }

  .bvly-nav__inner {
    padding: 0 12px;
  }
}