/* ─────────────────────────────────────────────────────────────────
   Navigation — top bar, mobile hamburger, slide-down menu panel
   ─────────────────────────────────────────────────────────── */

#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 56px;
  transition: background 0.35s, box-shadow 0.35s;
}

/* Dark frost: applied once the page is scrolled, over dark sections. */
#navbar.dark-frost {
  background: rgba(5, 11, 22, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* Light frost wins over dark-frost (declared later) on light sections. */
#navbar.frosted {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 0;
  box-shadow: var(--shadow-card);
}

/* Inline SVG logo: color flips via currentColor. */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  transition: color 0.2s ease;
}
#navbar.frosted .nav-logo { color: var(--text-primary); }

.nav-logo svg { height: 30px; width: auto; display: block; }

.nav-logo-word {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.4px;
}
.nav-logo-word b {
  font-weight: 700;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.1px;
  transition: color 0.2s;
}

#navbar.frosted .nav-links a   { color: var(--text-primary); }
.nav-links a:hover             { color: var(--primary) !important; }
.nav-links a.active-page       { color: var(--primary) !important; }

.btn-nav-cta {
  background: var(--primary);
  color: #04110C !important;
  font-weight: 600;
  padding: 9px 22px;
  border-radius: var(--radius-btn);
  transition: background 0.2s, transform 0.15s !important;
}
.btn-nav-cta:hover {
  background: var(--primary-light) !important;
  color: #04110C !important;
  transform: translateY(-1px);
}

/* ─── Hamburger ──────────────────────────────────────────────── */
.nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  width: 40px; height: 40px;
  padding: 8px;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 22px; height: 2px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 1px;
  transition: transform 0.25s, opacity 0.2s, background 0.2s;
}
#navbar.frosted .nav-toggle span { background: var(--text-primary); }

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}


/* ─────────────────────────────────────────────────────────────
   RESPONSIVE
   ─────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
  #navbar { padding: 0 32px; }
}

@media (max-width: 900px) {
  #navbar {
    padding: 0 20px;
    height: var(--nav-height-mobile);
  }
  .nav-logo svg { height: 26px; }
  .nav-logo-word { font-size: 18px; }
  .nav-toggle   { display: flex; }

  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-height-mobile);
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 20px 20px;
    background: rgba(5, 11, 22, 0.97);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.35);
    max-height: calc(100vh - var(--nav-height-mobile));
    max-height: calc(100dvh - var(--nav-height-mobile));
    overflow-y: auto;
  }
  #navbar.frosted .nav-links {
    background: rgba(255, 255, 255, 0.98);
    border-top-color: var(--line-on-light);
  }
  #navbar.menu-open .nav-links { display: flex; }

  .nav-links li { width: 100%; }
  .nav-links a {
    display: block;
    padding: 14px 4px;
    font-size: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }
  #navbar.frosted .nav-links a { border-bottom-color: var(--line-on-light); }
  .nav-links li:last-child a   { border-bottom: 0; }

  .btn-nav-cta {
    margin-top: 12px;
    padding: 12px 22px !important;
    text-align: center;
    border-bottom: 0 !important;
  }
}

@media (max-width: 420px) {
  #navbar { padding: 0 16px; }
}
