:root {
  --navbar-height: 64px;
  --navbar-bg: rgba(8, 12, 22, 0.92);
  --navbar-border: rgba(99, 179, 237, 0.18);
  --navbar-text: #e2e8f0;
  --navbar-muted: #94a3b8;
  --navbar-accent: #38bdf8;
  --navbar-accent-soft: rgba(56, 189, 248, 0.14);
  --navbar-glow: rgba(129, 140, 248, 0.35);
}

.site-navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  height: var(--navbar-height);
  background: var(--navbar-bg);
  border-bottom: 1px solid var(--navbar-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 8px 32px rgba(0, 0, 0, 0.28);
}

.site-navbar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--navbar-accent),
    transparent
  );
  opacity: 0.55;
  pointer-events: none;
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1200px;
  height: 100%;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.navbar-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--navbar-text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.navbar-logo:hover {
  color: #fff;
}

.navbar-logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.55rem;
  background: linear-gradient(135deg, #38bdf8, #818cf8);
  color: #0b1120;
  font-size: 0.85rem;
  box-shadow: 0 0 18px var(--navbar-glow);
}

.navbar-logo-text {
  background: linear-gradient(90deg, #f8fafc, #bae6fd);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.navbar-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--navbar-border);
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.navbar-toggle:hover {
  background: var(--navbar-accent-soft);
  border-color: rgba(56, 189, 248, 0.35);
}

.navbar-toggle-bar {
  display: block;
  width: 1.15rem;
  height: 2px;
  margin: 0 auto;
  border-radius: 999px;
  background: var(--navbar-text);
  transition:
    transform 0.25s ease,
    opacity 0.25s ease;
}

.site-navbar.is-open .navbar-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.site-navbar.is-open .navbar-toggle-bar:nth-child(2) {
  opacity: 0;
}

.site-navbar.is-open .navbar-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.navbar-menu {
  display: flex;
  align-items: center;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.navbar-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.95rem;
  border-radius: 0.65rem;
  color: var(--navbar-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition:
    color 0.2s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease;
}

.navbar-link:hover,
.navbar-link:focus-visible,
.navbar-link.is-active {
  color: #fff;
  background: var(--navbar-accent-soft);
  outline: none;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.18);
}

.navbar-link.is-active {
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.35);
}

.navbar-link::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  top: calc(100% + 0.65rem);
  transform: translateX(-50%) translateY(6px);
  min-width: 12rem;
  max-width: 16rem;
  padding: 0.55rem 0.75rem;
  border-radius: 0.55rem;
  background: #111827;
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: #cbd5e1;
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.45;
  text-align: center;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0.2s ease;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  z-index: 10;
}

.navbar-link::before {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(100% + 0.2rem);
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: #111827;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}

.navbar-link:hover::after,
.navbar-link:focus-visible::after,
.navbar-link:hover::before,
.navbar-link:focus-visible::before {
  opacity: 1;
  visibility: visible;
}

.navbar-link:hover::after,
.navbar-link:focus-visible::after {
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 768px) {
  .navbar-toggle {
    display: inline-flex;
  }

  .navbar-menu {
    position: absolute;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    display: none;
    padding: 0.85rem 1rem 1.1rem;
    background: rgba(8, 12, 22, 0.98);
    border-bottom: 1px solid var(--navbar-border);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  }

  .site-navbar.is-open .navbar-menu {
    display: block;
  }

  .navbar-links {
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
  }

  .navbar-link {
    width: 100%;
    padding: 0.85rem 1rem;
    font-size: 1rem;
  }

  .navbar-link::after,
  .navbar-link::before {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-navbar,
  .navbar-link,
  .navbar-toggle,
  .navbar-toggle-bar {
    transition: none;
  }
}
