.navbar {
  position: fixed;
  width: 100%;
  z-index: 1000;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px); 
  height: 8rem;
}


.navbar.scrolled {
  height: 6.5rem;
  padding: 1rem 5rem; 
  box-shadow: 0 5px 25px rgba(10, 248, 6, 0.15), 
              0 0 30px rgba(var(--accent-primary-rgb), 0.25);
  animation: slideDown 0.5s forwards cubic-bezier(0.17, 0.67, 0.83, 0.67);
}

@keyframes slideDown {
  0% { transform: translateY(-15px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}


.navbar-container {
  max-width: 100%;
  margin: 0 auto;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem clamp(1rem, 5vw, 5rem); 
  background: linear-gradient(135deg, 
    rgba(255,255,255,0.8) 0%, 
    rgba(50, 48, 48, 0.5) 50%,
    rgba(0, 0, 0, 0.3) 100%);
  border-bottom: 3px solid #00cc99;
  transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
  position: relative;
  overflow: hidden;
}

.navbar.scrolled .navbar-container {
  max-width: min(95%, 1200px);
  border-radius: 50px;
  background: linear-gradient(135deg, 
              rgba(255,255,255,0.8) 0%, 
              rgba(50, 48, 48, 0.5) 50%,
              rgba(0, 0, 0, 0.3) 100%);
  border: 1px solid #00cc99;
  animation: pulseGlow 6s infinite alternate;
}

@keyframes pulseGlow {
  0%, 100% { 
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15), 
                0 0 15px rgba(var(--accent-primary-rgb), 0.2); 
  }
  50% {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15), 
                0 0 25px rgba(var(--accent-primary-rgb), 0.4);
  }
}

.navbar-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 2px;
  background: linear-gradient(90deg, 
              transparent, 
              rgba(var(--accent-primary-rgb), 0.8), 
              transparent);
  animation: scanline 8s linear infinite;
  z-index: 1;
}

@keyframes scanline {
  0% { left: -100%; }
  50% { left: 100%; }
  100% { left: 100%; }
}

.logo {
  font-family: var(--font-secondary);
  font-size: clamp(2.2rem, 3vw, 3rem);
  font-weight: 700;
  letter-spacing: 0.1rem;
  position: relative;
  z-index: 1001; 
}

.logo a {
  color: var(--text-primary);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
}

.logo a:hover {
  color: var(--accent-primary);
  text-shadow: 0 0 8px rgba(var(--accent-primary-rgb), 0.5);
}

.logo span {
  color: var(--accent-primary);
}

.nav-menu {
  display: flex;
  list-style: none;
  transition: all 0.4s ease;
  margin: 0;
  padding: 0;
}

.nav-menu li {
  margin-left: clamp(1.5rem, 2vw, 3rem);
}

.nav-link {
  font-size: clamp(1.4rem, 1.6vw, 1.6rem);
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  position: relative;
  transition: all 0.3s ease;
  display: inline-block;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--accent-primary);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}
 
.nav-link:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 4px;
  border-radius: 4px;
}

 
.menu-toggle {
  display: none;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 0.5rem;
  z-index: 1001;  
}

.menu-toggle .bar {
  display: block;
  width: 28px;
  height: 3px;
  background: var(--text-primary);
  margin: 5px auto;
  transition: all 0.3s ease;
  border-radius: 3px;
}

#checkbox {
  display: none;
}

.toggle {
  position: relative;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition-duration: 0.3s;
}

.bars {
  width: 100%;
  height: 4px;
  background-color: rgb(253, 255, 243);
  border-radius: 5px;
  transition-duration: 0.3s;
}

#checkbox:checked + .toggle #bar2 {
  transform: translateY(14px) rotate(60deg);
  margin-left: 0;
  transform-origin: right;
  transition-duration: 0.3s;
  z-index: 2;
}

#checkbox:checked + .toggle #bar1 {
  transform: translateY(28px) rotate(-60deg);
  transition-duration: 0.3s;
  transform-origin: left;
  z-index: 1;
}

#checkbox:checked + .toggle {
  transform: rotate(-90deg);
}

@media (max-width: 992px) {
  .mobile-toggle-container {
    display: block;
  }
}

@media (min-width: 993px) {
  .mobile-toggle-container {
    display: none;
  }
}

 
@media (max-width: 992px) {
  .menu-toggle {
    display: block;
  }
  
  .menu-toggle.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  
  .menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
  }
  
  .menu-toggle.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }
  
  .nav-menu {
    position: fixed;
    top: 8rem;
    left: 0;
    width: 100%;
    height: calc(100vh - 8rem);
    flex-direction: column;
    background: rgba(var(--bg-secondary-rgb), 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    align-items: center;
    justify-content: flex-start;
    padding-top: 3rem;
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 998;
    animation: fadeIn 0.5s ease-in-out;
  }
  
  .navbar.scrolled {
    animation: slideDown 0.5s forwards cubic-bezier(0.17, 0.67, 0.83, 0.67);
  }
  
  .navbar.scrolled .nav-menu {
    top: 6.5rem;
    height: calc(100vh - 6.5rem);
  }
  
  .nav-menu.active {
    transform: translateX(0);
  }
  
  .nav-menu li {
    margin: 1.5rem 0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    transition-delay: calc(0.05s * var(--item-index, 0));
  }
  
  .nav-menu.active li {
    opacity: 1;
    transform: translateY(0);
  }
  
  .nav-link {
    font-size: 2rem;
    padding: 1rem 2rem;
  }
  
  .navbar-container {
    padding: 1rem 2rem;
  }

  @keyframes fadeIn {
    0% {
      opacity: 0;
      transform: translateY(-10px);
    }
    100% {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

@media (max-width: 576px) {
  .navbar {
    height: 7rem;
  }
  
  .navbar.scrolled {
    height: 6rem;
  }
  
  .nav-menu {
    top: 7rem;
    height: calc(100vh - 7rem);
  }
  
  .navbar.scrolled .nav-menu {
    top: 6rem;
    height: calc(100vh - 6rem);
  }
  
  .navbar.scrolled .navbar-container {
    border-radius: 25px;
  }
}
