/* ══════════════════════════════════════════════════════════════════════════
   SHARED SITE HEADER
   The one definition of the top bar, used by every page including the home
   page. It used to live inline in index.html while the other pages carried a
   plain text link row from legal.css, which is why leaving the home page felt
   like landing on a different site.

   Every custom property is written with a fallback so this file stands on its
   own: the home page defines the full token set, legal.css defines a smaller
   one (no --teal2), and both must render the same bar.
   ══════════════════════════════════════════════════════════════════════════ */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  padding: 0 24px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all .25s;
}

.nav.scrolled {
  background: rgba(4, 8, 15, .88);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border, rgba(148, 163, 184, .15));
}

/* Subpages have no hero to scroll over, so the bar carries its backdrop from
   the start — without it the links sit on bare page background. */
.nav--solid {
  background: rgba(4, 8, 15, .88);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border, rgba(148, 163, 184, .15));
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 19px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
}

.nav-logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--teal, #0f766e), var(--teal2, #14b8a6));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px rgba(15, 118, 110, .45);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted, #94a3b8);
  text-decoration: none;
  transition: color .15s;
}

.nav-links a:hover { color: #fff; }

.nav-actions { display: flex; gap: 8px; align-items: center; }

.nav-login {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted, #94a3b8);
  text-decoration: none;
  transition: color .15s;
  margin: 0 6px;
}

.nav-login:hover { color: #fff; }

.nav-toggle { display: none; background: none; border: none; color: #fff; padding: 4px; }

/* Standalone CTA so pages that do not load the home page's button styles still
   get a real button rather than a bare link. */
.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 16px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, var(--teal, #0f766e), var(--teal2, #14b8a6));
  box-shadow: 0 4px 14px rgba(15, 118, 110, .35);
  transition: transform .12s, box-shadow .12s;
}

.nav-cta:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(15, 118, 110, .45); }

/* ── Mobile drawer ── */
.nav-mobile {
  display: none;
  position: fixed;
  top: 62px;
  left: 0;
  right: 0;
  z-index: 190;
  background: rgba(4, 8, 15, .97);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border, rgba(148, 163, 184, .15));
  /* Bottom padding clears the phone's home indicator so the last button isn't
     flush against the screen edge; the env() adds the safe-area inset on top. */
  padding: 16px 24px calc(28px + env(safe-area-inset-bottom, 0px));
  /* The drawer holds ~15 links plus two buttons; on a short phone that is taller
     than the viewport, so it must scroll within the space below the 62px bar
     instead of running off the bottom with its last items unreachable. */
  max-height: calc(100vh - 62px);
  max-height: calc(100dvh - 62px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.nav-mobile.open { display: block; }

.nav-mobile-sec {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--teal2, #14b8a6);
  margin: 18px 0 8px;
}

.nav-mobile-sec:first-child { margin-top: 0; }

.nav-mobile a {
  display: block;
  padding: 11px 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--text, #f1f5f9);
  text-decoration: none;
  border-bottom: 1px solid var(--border, rgba(148, 163, 184, .15));
}

.nav-mobile a:hover { color: var(--teal2, #14b8a6); }

.nav-mobile-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.nav-mobile-actions .btn,
.nav-mobile-actions .nav-cta { width: 100%; justify-content: center; }

/* The bar is fixed (62px), so content must start below it. Pages set their own
   `.wrap` padding — pricing inline, the legal pages via legal.css — and every
   one uses the `padding` *shorthand*, which resets padding-top. So the clearance
   can't live in padding at all: scroll-margin was overwritten too. A top margin
   on the page's first block is immune to any `.wrap { padding: … }` a page
   declares, and `scroll-padding-top` on the root keeps anchor jumps from hiding
   their target under the bar. The home page handles its own offset on .hero. */
:root { scroll-padding-top: 78px; }

.wrap > :first-child { margin-top: 78px; }

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-actions { display: none; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
}
