/* ────────────────────────────────────────────────
   ThetaZero Unified Navbar — navbar.css
   Used by public/js/navbar.js
   All selectors are scoped to #tz-nav / .tz-nav-*
   to avoid conflicts with page-level styles.
──────────────────────────────────────────────── */

/* Hide old nav implementations when unified nav is active.
   Scoped broadly to catch navs nested inside wrapper divs. */
body.tz-nav-active .nav-wrapper {
  display: none !important;
}
body.tz-nav-active nav:not(#tz-nav):not(.sidebar-nav) {
  display: none !important;
}
body.tz-nav-active .nav-mobile-menu:not(#tz-mobile-menu) {
  display: none !important;
}
/* Also hide the simple <nav> pattern (used in about/blog/etc) */
body.tz-nav-active > nav:not(#tz-nav) {
  display: none !important;
}

/* ── Layout wrapper ─────────────────────────── */
#tz-nav {
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 60px;
  background: rgba(9, 9, 11, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(39, 39, 42, 1);
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ── Brand ──────────────────────────────────── */
.tz-nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fafafa;
  flex-shrink: 0;
}
.tz-nav-logo-mark {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #22d3ee, #a78bfa);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #09090b;
  letter-spacing: -0.5px;
}
.tz-nav-wordmark {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

/* ── Desktop links ──────────────────────────── */
.tz-nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 16px;
}
.tz-nav-link {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 14px;
  color: #a1a1aa;
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}
.tz-nav-link:hover {
  color: #fafafa;
  background: #18181c;
}
.tz-nav-link.active {
  color: #22d3ee;
  background: rgba(34, 211, 238, 0.06);
}

/* ── Actions (right side) ───────────────────── */
.tz-nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.tz-nav-run {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #22d3ee;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.2);
  text-decoration: none;
  transition: all 0.15s;
}
.tz-nav-run:hover {
  background: rgba(34, 211, 238, 0.15);
  border-color: rgba(34, 211, 238, 0.4);
}
.tz-btn-ghost {
  display: inline-flex;
  align-items: center;
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #a1a1aa;
  background: transparent;
  border: 1px solid #27272a;
  text-decoration: none;
  transition: all 0.15s;
  cursor: pointer;
  font-family: inherit;
}
.tz-btn-ghost:hover {
  background: #18181c;
  color: #fafafa;
}
.tz-btn-primary {
  display: inline-flex;
  align-items: center;
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #09090b;
  background: linear-gradient(135deg, #22d3ee, #a78bfa);
  border: none;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.15s;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.tz-btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* ── Hamburger ──────────────────────────────── */
.tz-nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}
.tz-nav-hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: #a1a1aa;
  border-radius: 2px;
  transition: all 0.2s;
}
.tz-nav-hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
  background: #fafafa;
}
.tz-nav-hamburger.open span:nth-child(2) {
  opacity: 0;
}
.tz-nav-hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
  background: #fafafa;
}

/* ── Mobile menu ────────────────────────────── */
#tz-mobile-menu {
  display: none;
  flex-direction: column;
  padding: 8px 20px 16px;
  background: rgba(9, 9, 11, 0.97);
  border-bottom: 1px solid #27272a;
  position: sticky;
  top: 60px;
  z-index: 199;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
}
#tz-mobile-menu.open {
  display: flex;
}
.tz-mob-link {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  color: #a1a1aa;
  padding: 11px 4px;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: color 0.15s;
}
.tz-mob-link.active {
  color: #22d3ee;
}
.tz-mob-link:hover {
  color: #fafafa;
}
.tz-mob-divider {
  height: 1px;
  background: #27272a;
  margin: 8px 0;
}
.tz-mob-cta {
  display: block;
  text-align: center;
  margin-top: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #09090b;
  background: linear-gradient(135deg, #22d3ee, #a78bfa);
  padding: 10px 20px;
  border-radius: 100px;
  text-decoration: none;
}

/* ── Responsive ─────────────────────────────── */
@media (max-width: 768px) {
  .tz-nav-links {
    display: none;
  }
  .tz-nav-actions {
    display: none;
  }
  .tz-nav-hamburger {
    display: flex;
  }
  #tz-nav {
    padding: 0 16px;
  }
}
@media (max-width: 480px) {
  .tz-nav-wordmark {
    display: none;
  }
}
