.main-header {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  left: 16px;
  right: 16px;
  margin: 0 auto;
  z-index: 120;
  width: -moz-fit-content;
  width: fit-content;
  max-width: calc(100vw - 32px);
  border-radius: 999px;
  background: rgba(10, 5, 18, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  pointer-events: auto;
}

.main-header::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  padding: 1px;
  background: linear-gradient(90deg, rgba(145, 70, 255, 0.3), rgba(0, 242, 254, 0.1), rgba(145, 70, 255, 0.3));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.main-header::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 10%;
  width: 80%;
  height: 20px;
  background: radial-gradient(ellipse at top, rgba(145, 70, 255, 0.4) 0%, transparent 70%);
  filter: blur(15px);
  pointer-events: none;
  z-index: -1;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px;
  border-radius: 999px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

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

.header-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex: 0 0 auto;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.5);
  font-family: var(--font-tech);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  z-index: 1;
}

.header-link-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(255,255,255,0.05), transparent);
  border-radius: 999px;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.header-link::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  transform: skewX(-25deg);
  transition: left 0.5s ease;
  z-index: -1;
}

.header-link:hover {
  color: #fff;
  transform: translateY(-2px);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.header-link:hover .header-link-bg {
  opacity: 1;
  box-shadow: 
    inset 0 1px 0 rgba(255,255,255,0.2),
    0 4px 15px rgba(145, 70, 255, 0.3);
  border: 1px solid rgba(145, 70, 255, 0.4);
}

.header-link:hover::after {
  left: 200%;
}

.header-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.header-link:hover svg {
  color: #00f2fe;
  filter: drop-shadow(0 0 8px rgba(0, 242, 254, 0.8));
  transform: scale(1.15) rotate(-5deg);
}

.header-link:focus-visible {
  outline: 2px solid rgba(0, 242, 254, 0.8);
  outline-offset: 4px;
}

@media (max-width: 768px) {
  .main-header {
    top: max(12px, env(safe-area-inset-top));
    max-width: calc(100vw - 20px);
    left: 0;
    right: 0;
  }
  
  .header-nav {
    justify-content: center;
    gap: 12px;
    padding: 6px 12px;
  }
  
  .header-link span:not(.header-link-bg) {
    display: none;
  }
  
  .header-link {
    min-height: 44px;
    width: 44px;
    padding: 0;
    gap: 0;
    border-radius: 50%;
  }
  
  .header-link svg {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 480px) {
  .header-nav {
    gap: 8px;
    padding: 6px 10px;
  }
  
  .header-link {
    min-height: 42px;
    width: 42px;
  }
  
  .header-link svg {
    width: 18px;
    height: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .header-link {
    transition: none;
  }
  .header-link:hover .header-link-bg,
  .header-link:hover::after,
  .header-link:hover svg {
    transform: none;
    transition: none;
  }
}