/* ─────────────────────────────────────────────────────────────────
   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;
}

#navbar.frosted {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.nav-logo img {
  height: 60px;
  display: block;
  /* Default: navbar sits over a dark section → render the logo white. */
  filter: brightness(0) invert(1);
  transition: filter 0.2s ease;
}
#navbar.frosted .nav-logo img {
  /* Light section → render the logo near-black so it's readable on the
     frosted-white background. */
  filter: brightness(0.2) saturate(0);
}

.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-signin {
  background: var(--primary);
  color: #fff !important;
  padding: 8px 22px;
  border-radius: var(--radius-btn);
  transition: background 0.2s, transform 0.15s !important;
}
.btn-nav-signin:hover {
  background: var(--primary-dark) !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 img { height: 40px; }
  .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(40, 42, 66, 0.98);
    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: rgba(76, 78, 100, 0.08);
  }
  #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: rgba(76, 78, 100, 0.08); }
  .nav-links li:last-child a   { border-bottom: 0; }

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

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