nav {
  background-color: #191a1b;
  padding: 1rem 2rem;
  border-bottom: 1px solid #2a2b2c;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 100;
}

nav .container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-weight: 700;
  font-size: 1.5rem;
  color: #bfbfba;
  text-decoration: none;
  transition: color 0.2s;
}

.logo:hover {
  color: #3994bc;
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

nav li {
  margin: 0;
}

nav a {
  color: #bfbfba;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
  padding: 0.5rem 0.75rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

nav a:hover {
  color: #3994bc;
  text-decoration: none;
}

nav ul a {
  position: relative;
}

nav ul a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0.75rem;
  right: 0.75rem;
  height: 2px;
  background-color: #3994bc;
  transform: scaleX(0);
  transition: transform 0.2s ease;
}

nav ul a.active::after {
  transform: scaleX(1);
}

nav ul a.active {
  color: #3994bc;
}

.skip-link {
  position: absolute;
  top: -9999px;
  left: -9999px;
  z-index: 999;
}

.skip-link:focus {
  position: fixed;
  top: 0;
  left: 0;
  background-color: #3994bc;
  color: #191a1b;
  padding: 0.75rem 1.5rem;
  z-index: 1000;
  text-decoration: none;
  font-weight: 600;
}

nav a:focus {
  outline: 3px solid #ffff00;
  outline-offset: 2px;
}

/* Mobile Navigation Styles */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  min-width: 44px;
  padding: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.nav-toggle:hover {
  background-color: #2a2b2c;
}

.nav-toggle:focus {
  outline: 3px solid #3994bc;
  outline-offset: 2px;
}

.nav-toggle .hamburger-icon {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  width: 24px;
  height: 18px;
  position: relative;
}

.nav-toggle .hamburger-icon span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: #bfbfba;
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

.nav-toggle[aria-expanded="true"] .hamburger-icon span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .hamburger-icon span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .hamburger-icon span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.nav-toggle .nav-toggle-text {
  color: #bfbfba;
  font-size: 0.9rem;
  font-weight: 500;
}

@media (max-width: 520px) {
  .nav-toggle .nav-toggle-text {
    display: none;
  }
}

.nav-menu {
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-menu-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.nav-menu-backdrop.is-visible {
  display: block;
  opacity: 1;
}

@media (max-width: 768px) {
  nav .container {
    flex-direction: row;
    justify-content: space-between;
  }

  .nav-toggle {
    display: flex;
  }

  nav ul {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 80%;
    max-width: 300px;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    background-color: #191a1b;
    border-left: 1px solid #2a2b2c;
    padding: 5rem 1rem 1rem;
    transform: translateX(100%);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    z-index: 100;
    overflow-y: auto;
    font-size: 1rem;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.3);
  }

  nav ul.is-open {
    transform: translateX(0);
  }

  nav li {
    width: 100%;
    border-bottom: 1px solid #2a2b2c;
  }

  nav li:last-child {
    border-bottom: none;
  }

  nav ul a {
    width: 100%;
    padding: 1rem 0.75rem;
    min-height: 48px;
  }

  nav ul a::after {
    left: 0.75rem;
    right: 0.75rem;
  }

  body.nav-open {
    overflow: hidden;
  }
}

@media print {
  nav,
  .skip-link {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  nav a {
    transition: none;
  }
}
