/* Pure Vanilla Navbar - Mobile Optimized */

/* Skip link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #ff4d4d;
  color: #fff;
  padding: 8px 16px;
  text-decoration: none;
  font-weight: 600;
  z-index: 1001;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 0;
}

/* Header container - MOBILE FIRST */
.site-header {
  position: fixed;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 1000;
}

/* Main navigation */
.main-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(20, 20, 20, 0.95);
  padding: 10px 16px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
  min-height: 52px;
}

/* Logo */
.nav-logo {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  white-space: nowrap;
}

/* Hamburger button - OPTIMIZED */
.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  gap: 5px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.hamburger {
  display: block;
  width: 20px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
  will-change: transform;
}

/* Hamburger to X - SIMPLIFIED */
.nav-toggle[aria-expanded="true"] .hamburger:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

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

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

/* Menu container - MOBILE OPTIMIZED */
.nav-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  list-style: none;
  margin: 0;
  padding: 12px;
  gap: 2px;
  background: rgba(20, 20, 20, 0.98);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.1);
  
  /* Hidden by default - GPU ACCELERATED */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.98);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  will-change: transform, opacity;
}

/* Show menu */
.nav-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Navigation links - BIGGER TOUCH TARGETS */
.nav-link {
  display: block;
  color: #fff;
  text-decoration: none;
  padding: 16px 20px;
  font-size: 1.1rem;
  font-weight: 500;
  border-radius: 10px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: background 0.15s ease;
  min-height: 48px;
  line-height: 1;
}

.nav-link:last-child {
  border-bottom: none;
}

/* Active/hover states */
.nav-link:hover,
.nav-link:active {
  background: rgba(255,255,255,0.08);
}

.nav-link.active {
  color: #ff4d4d;
  background: rgba(255, 77, 77, 0.12);
  font-weight: 600;
}

/* Focus visible */
.nav-link:focus-visible,
.nav-toggle:focus-visible {
  outline: 2px solid #ff4d4d;
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .nav-link,
  .hamburger,
  .nav-menu {
    transition: none;
  }
}

/* DESKTOP OVERRIDES */
@media (min-width: 769px) {
  .site-header {
    top: 20px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: auto;
  }
  
  .main-nav {
    padding: 12px 24px;
    border-radius: 50px;
    justify-content: center;
    gap: 24px;
    min-height: auto;
  }
  
  .nav-toggle {
    display: none;
  }
  
  .nav-menu {
    position: static;
    flex-direction: row;
    opacity: 1;
    visibility: visible;
    transform: none;
    background: transparent;
    box-shadow: none;
    border: none;
    padding: 0;
    gap: 4px;
  }
  
  .nav-link {
    padding: 8px 16px;
    font-size: 1rem;
    border-bottom: none;
    min-height: auto;
  }
}
