/* =============================================================
   nav.css — Iversoft shared navigation stylesheet
   Single source of truth for all nav, hamburger, and mobile-menu
   CSS across every page. Loaded via <link> in every HTML file.
   ============================================================= */

/* ── Nav shell ─────────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 14px 0;
  background: transparent;
  transition: background .4s, border .4s, box-shadow .4s;
}

/* Scoped to the shared nav partial only.
   Excludes pages with their own nav markup (e.g. <nav class="nav">)
   while correctly matching the shared nav in both its default state
   and when the JS-added 'scrolled' class is present. */
nav:not(.nav) .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

nav.scrolled {
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 1px 8px rgba(0, 0, 0, .04);
}

/* ── Logo ───────────────────────────────────────────────────── */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo span {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 21px;
  color: #fff;
  letter-spacing: 0em;
  transition: color .4s;
}

nav.scrolled .nav-logo span {
  color: var(--gray-900);
}

.logo-svg {
  height: 36px;
  width: auto;
  transition: all .3s;
}

.logo-svg .logo-text {
  transition: fill .4s;
}

nav.scrolled .logo-svg .logo-text {
  fill: var(--gray-900);
}

/* ── Nav links ──────────────────────────────────────────────── */
.nav-links {
  display: flex;
  align-items: center;
  gap: 40px;
  list-style: none;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-links a {
  color: rgba(255, 255, 255, .75);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color .3s;
  white-space: nowrap;
}

nav.scrolled .nav-links a {
  color: var(--gray-600);
}

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

nav.scrolled .nav-links a:hover {
  color: var(--gray-900);
}

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

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

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

/* ── Nav CTA button ─────────────────────────────────────────── */
/* Fallbacks ensure the button stays visible on pages that don't
   define --primary-500 / --primary-600 (e.g. landing pages with
   their own colour palette). */
.nav-cta {
  background: var(--primary-500, #18b28d) !important;
  color: #fff !important;
  padding: 10px 24px;
  border-radius: 100px;
  font-weight: 600 !important;
  font-size: 13px !important;
  transition: all .3s;
}

.nav-cta:hover {
  background: var(--primary-600, #13967a) !important;
  box-shadow: 0 4px 16px rgba(24, 178, 141, .25);
}

/* ── Hamburger button (SVG swap approach) ───────────────────── */
/*
   The button contains two SVG children:
     .ham-icon   — three horizontal lines (hamburger state)
     .close-icon — two diagonal lines forming an X (close state)

   Toggling .active on the button swaps which SVG is visible.
   No CSS rotation, no span tips, no Safari iOS artefacts.
*/
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
  position: relative;
  width: 40px;
  height: 40px;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  align-items: center;
  justify-content: center;
}

.nav-hamburger svg {
  display: flex;
  stroke: #fff;
}

nav.scrolled .nav-hamburger svg {
  stroke: var(--gray-800);
}

/* Default: hamburger visible, X hidden */
.nav-hamburger .close-icon {
  display: none;
}

.nav-hamburger .ham-icon {
  display: flex;
}

/* Active: hamburger hidden, X visible */
.nav-hamburger.active .ham-icon {
  display: none;
}

.nav-hamburger.active .close-icon {
  display: flex;
}

/* ── Mobile menu overlay ────────────────────────────────────── */
.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gray-900);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all .4s cubic-bezier(.23, 1, .32, 1);
}

.mobile-menu.open {
  opacity: 1;
  visibility: visible;
}

.mobile-menu-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}

.mobile-menu-inner a {
  font-family: 'Outfit', sans-serif;
  font-size: 24px;
  font-weight: 600;
  color: rgba(255, 255, 255, .7);
  text-decoration: none;
  transition: color .3s;
  letter-spacing: -.01em;
}

.mobile-menu-inner a:hover {
  color: #fff;
}

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

.mobile-menu-inner .mobile-cta {
  background: var(--primary-500);
  color: #fff;
  padding: 14px 36px;
  border-radius: 100px;
  font-size: 16px;
  margin-top: 16px;
}

.mobile-menu-inner .mobile-cta:hover {
  background: var(--primary-600);
}

/* ── Footer logo overrides ──────────────────────────────────── */
footer .logo-svg .logo-text {
  fill: #fff;
}

footer .nav-logo span {
  color: #fff;
}

.footer-brand .nav-logo {
  margin-bottom: 20px;
}

/* ── Responsive: show hamburger on mobile ───────────────────── */
@media (max-width: 960px) {
  .nav-hamburger {
    display: flex;
  }
}

@media (max-width: 1200px) {
  .nav-links {
    gap: 32px;
  }
}
