/* nav */
.nav {
  position: fixed;
  left: 50%;
  top: max(24px, env(safe-area-inset-top) + 16px);
  transform: translateX(-50%);
  z-index: 1000;
  background: var(--nav-bg); 
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--nav-border);
  border-radius: 100px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  padding: 6px 8px 6px 20px;
  width: max-content;
  max-width: calc(100% - 32px);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.nav::-webkit-scrollbar {
  display: none;
}

/* Align Logo */
.nav .logo {
  display: flex;
  align-items: center;
  margin-right: 8px;
  flex-shrink: 0;
  position: relative;
}

.nav img {
  height: 22px;
  width: auto;
  display: block;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
  filter: invert(1) brightness(0.95);
  opacity: 0.85;
}

.nav .logo:hover img {
  transform: scale(1.05) rotate(-2deg);
  opacity: 1;
}

/* Center vertical divider */
.nav .logo::after {
  content: '';
  position: absolute;
  right: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 16px;
  background: var(--nav-border);
  opacity: 0.8;
}

.nav-list {
  list-style: none;
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 0;
  align-items: center;
  flex-wrap: nowrap;
}

.nav-item {
  flex-shrink: 0;
}

/* Nav Item Button */
.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 18px;
  color: var(--nav-button-text);
  background: transparent;
  border: none;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  letter-spacing: 1px;
  font-size: 0.72rem;
  text-transform: uppercase;
  border-radius: 100px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  position: relative;
  overflow: hidden;
}

/* Elegant floating hover */
.nav-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 100px;
  background: var(--nav-btn-hover-bg);
  transform: scale(0.8);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  z-index: -1;
}

.nav-btn:hover::before {
  transform: scale(1);
  opacity: 1;
}

.nav-btn:hover {
  color: var(--nav-btn-text-active);
}

/* New Modern Active State (Glass Capsule) */
.nav-item.active .nav-btn {
  color: var(--nav-btn-text-active);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* Subtle glow for the active capsule */
.nav-item.active .nav-btn::before {
  content: none;
}

.nav-btn:active {
  transform: scale(0.96);
  background: var(--nav-btn-press-bg);
}

/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
  .nav {
    padding: 6px 10px 6px 14px;
    gap: 8px;
    top: max(16px, env(safe-area-inset-top) + 12px);
  }

  .nav img {
    height: 18px;
  }

  .nav .logo::after {
    right: -6px;
    height: 14px;
  }

  .nav-list {
    gap: 4px;
  }

  .nav-btn {
    height: 34px;
    padding: 0 10px;
    font-size: 0.65rem;
    letter-spacing: 0.5px;
  }
}

@media (max-width: 480px) {
  .nav {
    padding: 5px 8px 5px 10px;
    gap: 6px;
  }

  .nav img {
    height: 16px;
  }

  .nav .logo {
    margin-right: 4px;
  }

  .nav .logo::after {
    right: -5px;
    height: 12px;
  }

  .nav-list {
    gap: 2px;
  }

  .nav-btn {
    height: 30px;
    padding: 0 8px;
    font-size: 0.58rem;
    letter-spacing: 0.3px;
  }
}
