/* ──── Shared Site Navigation ──── */

#site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(5, 13, 26, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(100, 255, 218, 0.1);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-brand {
  font-family: monospace;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--text-dark);
  text-decoration: none;
  opacity: 0.9;
  flex-shrink: 0;
}

.nav-brand:hover {
  color: var(--accent);
}

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

.nav-links a {
  font-family: monospace;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dark);
  opacity: 0.6;
  text-decoration: none;
  transition: opacity 0.2s, color 0.2s;
  padding: 0.35rem 0.1rem;
  position: relative;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  opacity: 1;
  color: var(--accent);
}

.nav-links a.active {
  opacity: 1;
  color: var(--accent);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.4rem;
  height: 2px;
  background: var(--accent);
  opacity: 0.7;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 34px;
  height: 34px;
  background: none;
  border: 1px solid rgba(100, 255, 218, 0.25);
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
}

.nav-toggle-bar {
  width: 16px;
  height: 2px;
  margin: 0 auto;
  background: var(--accent);
  transition: transform 0.2s, opacity 0.2s;
}

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

@media (max-width: 720px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: rgba(5, 13, 26, 0.97);
    border-bottom: 1px solid rgba(100, 255, 218, 0.1);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }

  .nav-links.open {
    max-height: 26rem;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    display: block;
    width: 100%;
    padding: 0.9rem 1.5rem;
    box-sizing: border-box;
  }

  .nav-links a.active::after {
    display: none;
  }
}

/* ──── Focus visibility (keyboard navigation) ──── */

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
