/* ================================================
   Responsive Navigation Enhancements
   ================================================ */

/* Desktop polish */
@media (min-width: 851px) {
  .nav-drawer {
    position: static !important;
    height: auto !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    gap: 30px !important;
  }

  .nav-links {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 30px !important;
  }

  .nav-links a {
    position: relative;
  }

  .nav-links a::before {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    width: 0;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, #1e90ff 0%, #00d4ff 100%);
    transform: translateX(-50%);
    transition: width 0.3s ease;
  }

  .nav-links a:hover::before,
  .nav-links a.active::before {
    width: 100%;
  }
}

/* Mobile drawer styling & animations */
@media (max-width: 850px) {
  .navbar {
    position: sticky;
  }

  .navbar.is-open .menu-toggle {
    background: rgba(30, 144, 255, 0.18);
    border-color: rgba(30, 144, 255, 0.45);
    transform: translateY(-50%) rotate(90deg);
  }

  .nav-drawer {
    position: fixed;
    overflow: hidden;
  }

  .nav-drawer::before {
    content: '';
    position: absolute;
    inset: -40% -60%;
    background:
      radial-gradient(circle at 20% 40%, rgba(30, 144, 255, 0.18) 0%, transparent 60%),
      radial-gradient(circle at 80% 70%, rgba(0, 212, 255, 0.16) 0%, transparent 60%);
    animation: float 22s ease-in-out infinite;
    z-index: 0;
  }

  .nav-drawer > * {
    position: relative;
    z-index: 1;
  }

  .nav-drawer-header {
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .nav-links {
    padding-top: 6px;
  }

  .nav-links li {
    opacity: 0;
    transform: translateX(32px);
    transition: opacity 0.35s ease, transform 0.35s ease;
  }

  .navbar.is-open .nav-links li {
    opacity: 1;
    transform: translateX(0);
  }

  .navbar.is-open .nav-links li:nth-child(1) { transition-delay: 0.08s; }
  .navbar.is-open .nav-links li:nth-child(2) { transition-delay: 0.16s; }
  .navbar.is-open .nav-links li:nth-child(3) { transition-delay: 0.24s; }
  .navbar.is-open .nav-links li:nth-child(4) { transition-delay: 0.32s; }

  .nav-links a::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(30, 144, 255, 0.18), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
  }

  .nav-links a:hover::before {
    opacity: 1;
  }

  .nav-drawer-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 18px;
  }

  .nav-overlay {
    animation-duration: 0.3s;
    animation-fill-mode: forwards;
  }

  .navbar.is-open .nav-overlay {
    animation-name: fadeIn;
  }
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  40% { transform: translate(-25px, -15px) scale(1.05); }
  70% { transform: translate(18px, 22px) scale(0.97); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
