/* =============================================================
   NAV — Sticky, backdrop-blur navigation bar + mobile overlay
   ============================================================= */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: background-color 300ms ease, border-color 300ms ease;
}

.nav__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--s4);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
}

/* ── Logo / Name ── */
.nav__logo {
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--text-1);
  text-decoration: none;
  flex-shrink: 0;
  transition: color 200ms ease;
}

.nav__logo:hover {
  color: var(--accent-light);
  opacity: 1;
}

.nav__logo:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ── Desktop link list ── */
.nav__links {
  display: flex;
  align-items: center;
  gap: var(--s4);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__links a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  transition: color 200ms ease;
}

.nav__links a:hover {
  color: var(--text-1);
  opacity: 1;
}

.nav__links a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ── Actions cluster ── */
.nav__actions {
  display: flex;
  align-items: center;
  gap: var(--s1);
  flex-shrink: 0;
}

/* ── Theme toggle button ── */
.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--bg-elevated);
  border-color: var(--accent);
  color: var(--accent-light);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Icon visibility: show moon in dark mode, sun in light mode */
.theme-toggle .icon-sun  { display: none;  }
.theme-toggle .icon-moon { display: block; }

[data-theme="light"] .theme-toggle .icon-sun  { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none;  }

.theme-toggle svg {
  width: 17px;
  height: 17px;
  pointer-events: none;
}

/* ── Nav CTA (book a call pill) ── */
.nav-cta {
  margin-left: var(--s1);
}

/* ── Hamburger button (mobile) ── */
.nav__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 9px 8px;
  transition: border-color 200ms ease;
}

.nav__hamburger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.nav__hamburger span {
  display: block;
  width: 100%;
  height: 1.5px;
  background: var(--text-1);
  border-radius: 2px;
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1),
              opacity 200ms ease;
}

.nav__hamburger.is-open span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.nav__hamburger.is-open span:nth-child(2) {
  opacity: 0;
}
.nav__hamburger.is-open span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* ── Mobile full-screen overlay ── */
.nav__overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-base);
  z-index: 99;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s4);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 280ms ease, visibility 280ms ease;
}

.nav__overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.nav__overlay ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s3);
  padding: 0;
  margin: 0;
}

.nav__overlay ul a {
  font-size: var(--text-h3);
  font-weight: 700;
  color: var(--text-1);
  text-decoration: none;
  transition: color 200ms ease;
}

.nav__overlay ul a:hover {
  color: var(--accent-light);
  opacity: 1;
}

.nav__overlay ul a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.nav__overlay .overlay-cta {
  margin-top: var(--s2);
}

/* ── Mobile breakpoint ── */
@media (max-width: 768px) {
  .nav__links,
  .nav-cta {
    display: none;
  }

  .nav__hamburger {
    display: flex;
  }
}

@media (max-width: 480px) {
  .nav__inner {
    padding: 0 var(--s2);
  }
}
