/* ============================================================
   navbar.css — Pureframe Labs
   Navigation bar, animated hamburger, mobile drawer
   ============================================================ */

/* ── PAGE TRANSITION OVERLAY ── */
#page-transition-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background: var(--primary);
  clip-path: circle(0% at 50% 50%);
  transition: clip-path 0.55s cubic-bezier(0.76, 0, 0.24, 1), opacity 0.3s ease;
  opacity: 0;
}

#page-transition-overlay.entering {
  pointer-events: all;
  opacity: 1;
  clip-path: circle(150% at 50% 50%);
}

#page-transition-overlay.leaving {
  opacity: 0;
  clip-path: circle(150% at 50% 50%);
  transition: opacity 0.4s ease 0.1s, clip-path 0s;
}

/* ── BODY LOCK (when mobile menu is open) ── */
body.menu-open {
  overflow: hidden;
}

/* ── NAV ── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-h);
  z-index: 1000;

  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);

  border-bottom: 1px solid rgba(37, 99, 235, 0.08);

  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 4px 24px rgba(37, 99, 235, 0.06);

  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.3s ease,
    box-shadow 0.3s ease,
    border-color 0.3s ease;
}

/* Subtle gradient shimmer overlay */
nav::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg,
      rgba(37, 99, 235, 0.03),
      transparent 40%,
      transparent 60%,
      rgba(6, 182, 212, 0.03));
  z-index: -1;
}

/* ── SCROLL STATES ── */
nav.scrolled {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.06),
    0 8px 32px rgba(37, 99, 235, 0.08);
  border-bottom-color: rgba(37, 99, 235, 0.12);
}

nav.nav-hidden {
  transform: translateY(-100%);
}

/* Keep nav visible when mobile menu is open */
nav.nav-menu-open {
  transform: translateY(0) !important;
}

/* ── NAV INNER ── */
.nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* ── LOGO ── */
.nav-logo,
.logo {
  display: flex;
  align-items: center;
  gap: 0;
  text-decoration: none;
  position: relative;
  flex-shrink: 0;
}

.logo::before {
  content: "";
  position: absolute;
  width: 60px;
  height: 60px;
  background: rgba(37, 99, 235, 0.1);
  filter: blur(20px);
  border-radius: 50%;
  z-index: -1;
  left: -5px;
  top: 50%;
  transform: translateY(-50%);
}

.nav-logo img,
.logo img {
  height: 44px;
  width: auto;
  display: block;
  transition: transform 0.3s ease;
}

.logo:hover img {
  transform: scale(1.05);
}

.logo-wordmark {
  font-size: 1.2rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
  white-space: nowrap;
  display: flex;
  align-items: center;
  letter-spacing: -0.01em;
}

.logo-dot {
  color: var(--primary);
}

.nav-logo,
.logo-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  display: inline-block;
  color: #111827;
  font-size: 1.15rem;
  font-weight: 700;
  margin-left: 10px;
  white-space: nowrap;
}

.nav-logo,
.logo-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
}

/* ── NAV LINKS (Desktop) ── */
.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1;
}

.nav-links a {
  font-size: 14.5px;
  font-weight: 550;
  color: var(--text2);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 10px;
  position: relative;
  transition:
    color 0.25s ease,
    background 0.25s ease;
  cursor: pointer;
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
  transform: translateX(-50%);
  transition: width 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-links a:hover {
  color: var(--text);
  background: rgba(37, 99, 235, 0.04);
}

.nav-links a:hover::after {
  width: 20px;
}

.nav-links a.active {
  color: var(--primary);
  font-weight: 600;
}

.nav-links a.active::after {
  width: 20px;
  background: var(--primary);
}

/* ── CTA BUTTON (Desktop) ── */
.btn-nav {
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  border: none;
  padding: 10px 22px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 550;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.btn-nav::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
      rgba(255, 255, 255, 0.15) 0%,
      transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-nav:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
}

.btn-nav:hover::before {
  opacity: 1;
}

/* ── HAMBURGER BUTTON ── */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  position: relative;
  z-index: 1001;
  transition: background 0.25s ease;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.hamburger:hover {
  background: rgba(37, 99, 235, 0.06);
}

.hamburger:active {
  background: rgba(37, 99, 235, 0.1);
}

/* Animated bars */
.hamburger-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.25s ease,
    width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.hamburger-bar:nth-child(1) {
  top: 13px;
}

.hamburger-bar:nth-child(2) {
  top: 21px;
}

.hamburger-bar:nth-child(3) {
  top: 29px;
}

/* Hamburger → X morphing */
.hamburger.active .hamburger-bar:nth-child(1) {
  transform: translateX(-50%) translateY(8px) rotate(45deg);
}

.hamburger.active .hamburger-bar:nth-child(2) {
  opacity: 0;
  transform: translateX(-50%) scaleX(0);
}

.hamburger.active .hamburger-bar:nth-child(3) {
  transform: translateX(-50%) translateY(-8px) rotate(-45deg);
}

/* ── MOBILE MENU OVERLAY ── */
.mobile-menu {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999;

  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);

  display: flex;
  flex-direction: column;
  padding: 16px 24px 32px;
  gap: 0;

  /* Animation */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px);
  transition:
    opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s 0.35s;

  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition:
    opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s 0s;
}

/* ── MOBILE LINKS ── */
.mobile-menu a {
  font-size: 17px;
  font-weight: 500;
  color: var(--text);
  padding: 16px 8px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
  text-decoration: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition:
    color 0.25s ease,
    padding-left 0.25s ease,
    background 0.25s ease;
  border-radius: 8px;

  /* Stagger animation */
  opacity: 0;
  transform: translateY(10px);
}

.mobile-menu.open a {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    color 0.25s ease,
    padding-left 0.25s ease,
    background 0.25s ease;
}

/* Stagger delays for each link */
.mobile-menu.open a:nth-child(1) {
  transition-delay: 0.05s, 0.05s;
}

.mobile-menu.open a:nth-child(2) {
  transition-delay: 0.1s, 0.1s;
}

.mobile-menu.open a:nth-child(3) {
  transition-delay: 0.15s, 0.15s;
}

.mobile-menu.open a:nth-child(4) {
  transition-delay: 0.2s, 0.2s;
}

.mobile-menu.open a:nth-child(5) {
  transition-delay: 0.25s, 0.25s;
}

/* Link arrow indicator */
.mobile-menu a::after {
  content: "→";
  font-size: 14px;
  color: var(--text2);
  opacity: 0;
  transform: translateX(-8px);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

.mobile-menu a:hover,
.mobile-menu a:active {
  color: var(--primary);
  padding-left: 16px;
  background: rgba(37, 99, 235, 0.04);
}

.mobile-menu a:hover::after,
.mobile-menu a:active::after {
  opacity: 1;
  transform: translateX(0);
}

.mobile-menu a.active {
  color: var(--primary);
  font-weight: 600;
}

/* ── MOBILE CTA ── */
.mobile-menu .btn-mobile-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  padding: 14px 24px;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-bottom: none;
  cursor: pointer;
  transition: all 0.3s ease;

  /* Reset link animation for CTA */
  opacity: 0;
  transform: translateY(10px);
}

.mobile-menu.open .btn-mobile-cta {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.3s, 0.3s;
}

.mobile-menu .btn-mobile-cta::after {
  display: none;
}

.mobile-menu .btn-mobile-cta:hover {
  background: var(--primary-dark);
  padding-left: 24px;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
}

/* ── RESPONSIVE: TABLET (1024px) ── */
@media (max-width: 1024px) {
  .nav-inner {
    padding: 0 24px;
  }

  .nav-links {
    gap: 2px;
  }

  .nav-links a {
    padding: 8px 12px;
    font-size: 14px;
  }

  .btn-nav {
    padding: 9px 18px;
    font-size: 13px;
  }
}

/* ── RESPONSIVE: MOBILE (768px) ── */
@media (max-width: 768px) {
  nav {
    height: var(--nav-h);
  }

  .nav-inner {
    padding: 0 20px;
  }

  .nav-links,
  .btn-nav,
  .btn-nav-calendly {
    display: none;
  }

  .hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .logo img {
    height: 36px;
    width: auto;
  }

  .logo-wordmark,
  .brand-name {
    font-size: 1rem;
  }

  .mobile-menu {
    padding: 12px 20px 32px;
  }
}

/* ── RESPONSIVE: SMALL MOBILE (480px) ── */
@media (max-width: 480px) {
  :root {
    --nav-h: 64px;
  }

  .nav-inner {
    padding: 0 12px;
    gap: 8px;
  }

  .logo {
    min-width: 0;
  }

  .logo img {
    height: 28px;
  }

  .logo-wordmark,
  .brand-name {
    font-size: 0.85rem;
  }

  .hamburger {
    width: 40px;
    height: 40px;
    padding: 6px;
  }

  .mobile-menu a {
    font-size: 16px;
    padding: 14px 8px;
  }
}