#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 0 40px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(7,10,15,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s, border-color 0.3s;
}

html.light #navbar {
  background: rgba(245,240,235,0.88);
}

#logo {
  font-family: "Ubuntu", sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text);
  text-decoration: none;
}

#nav-links {
  display: flex;
  gap: 32px;
}

#nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.3px;
  transition: color 0.2s;
}

#nav-links a:hover,
#nav-links a.active { color: var(--brand); }

#nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

#theme-toggle {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#theme-toggle:hover { color: var(--brand); }

.nav-cta {
  padding: 9px 20px;
  background: var(--brand);
  color: #fff !important;
  text-decoration: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.3px;
  border: 2px solid var(--brand);
  transition: all 0.25s;
}

.nav-cta:hover {
  background: transparent;
  color: var(--brand) !important;
}

#menu-toggle {
  display: none;
  cursor: pointer;
  color: var(--text);
  background: none;
  border: none;
  padding: 4px;
  position: relative;
  width: 32px;
  height: 32px;
}

#menu-toggle .icon-menu,
#menu-toggle .icon-close {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  transition: opacity 0.25s, transform 0.25s;
}

#menu-toggle .icon-close {
  opacity: 0;
  transform: rotate(-45deg);
}

#menu-toggle.open .icon-menu {
  opacity: 0;
  transform: rotate(45deg);
}

#menu-toggle.open .icon-close {
  opacity: 1;
  transform: rotate(0deg);
}

@media (max-width: 768px) {
  #navbar {
    padding: 0 20px;
    height: 56px;
    flex-wrap: wrap;
  }

  #navbar.menu-open {
    height: 100dvh;
    background: var(--bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    align-content: flex-start;
  }

  #nav-links {
    display: none;
    order: 10;
    width: 100%;
  }

  #nav-links.open {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: calc(100dvh - 56px);
    gap: 8px;
  }

  #nav-links a {
    padding: 16px 0;
    font-size: 22px;
    width: 100%;
    text-align: center;
  }

  #menu-toggle { display: block; order: 3; height: 56px; }

  #nav-right {
    order: 2;
    margin-left: auto;
    height: 56px;
  }

  .nav-cta { display: none; }

  #logo { order: 1; height: 56px; display: flex; align-items: center; }
}
