/* ============================================================
   TESTA — nav.css
   Site navigation · Hamburger · Mobile nav overlay
   ============================================================ */

/* ── Site Nav Bar ── */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 1000;
  background: transparent;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

/* When intersecting hero-b (blue section) */
.site-nav.on-hero-b {
  background-color: #3489E9 !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* On scroll (outside hero-b) */
.site-nav.scrolled {
  background: var(--navy);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 40px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo */
.nav-logo img {
  height: 40px;
  width: auto;
  display: block;
}

/* ── Desktop Links ── */
.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
}

.nav-links a {
  color: var(--white);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  position: relative;
  padding-bottom: 4px;
  transition: color 0.2s;
}


.nav-links a:hover          { color: var(--lime); }
.nav-links a:hover::after   { width: 100%; }
.nav-links a.active         { color: var(--lime); }
.nav-links a.active::after  { width: 100%; }

/* ── Hamburger Button ── */
.nav-hamburger {
  display: none;          /* shown via responsive.css */
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  position: relative;
  z-index: 1100;          /* above mobile-nav overlay */
}

.nav-hamburger span {
  display: block;
  width: 28px;
  height: 2px;
  background: var(--white);
  position: absolute;
  transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

.nav-hamburger span:nth-child(1) { transform: translateY(-8px); }
.nav-hamburger span:nth-child(2) { opacity: 1; }
.nav-hamburger span:nth-child(3) { transform: translateY(8px); }

/* Morph → X */
.nav-hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(0) rotate(45deg);
}
.nav-hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
  transform: translateX(-20px);
}
.nav-hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(0) rotate(-45deg);
}

/* ── Mobile Nav Overlay ── */
.mobile-nav {
  display: flex;            /* always flex so opacity transition works */
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  inset: 0;
  background: var(--navy);  /* brand blue */
  z-index: 1050;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.mobile-nav.open {
  visibility: visible;
  opacity: 1;
  pointer-events: all;
}

/* Logo at top of mobile overlay */
.mobile-nav-header {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.mobile-logo img {
  height: 36px;
  width: auto;
}

/* Link list */
.mobile-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  padding: 0 24px;
}

.mobile-links a {
  display: block;
  width: 100%;
  text-align: left;
  color: var(--white);
  font-family: var(--font-display);
  font-size: clamp(15px, 6vw, 15px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: color 0.2s, padding-left 0.2s;
}
.mobile-links a:first-child { border-top: 1px solid rgba(255, 255, 255, 0.08); }
.mobile-links a:hover {
  color: var(--lime);
}

/* Staggered slide-in for each link when nav opens */
.mobile-nav.open .mobile-links a {
  animation: mobileNavItem 0.4s ease forwards;
  opacity: 0;
}
.mobile-nav.open .mobile-links a:nth-child(1) { animation-delay: 0.08s; }
.mobile-nav.open .mobile-links a:nth-child(2) { animation-delay: 0.14s; }
.mobile-nav.open .mobile-links a:nth-child(3) { animation-delay: 0.20s; }
.mobile-nav.open .mobile-links a:nth-child(4) { animation-delay: 0.26s; }
.mobile-nav.open .mobile-links a:nth-child(5) { animation-delay: 0.32s; }

@keyframes mobileNavItem {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
