:root {
  --site-nav-height: 82px;
  --site-nav-shell: min(1400px, calc(100vw - 32px));
}

.global-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  background: rgba(1, 3, 35, 0.82);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.global-nav-inner {
  width: var(--site-nav-shell);
  min-height: var(--site-nav-height);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 0;
}

.global-nav-spacer {
  min-height: 1px;
}

.global-nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.8rem, 2vw, 2rem);
  flex-wrap: wrap;
  min-width: 0;
}

.global-nav-link {
  font-size: 0.88rem;
  line-height: 1;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.78);
  border-bottom: 2px solid transparent;
  padding-bottom: 0.22rem;
  transition: color 180ms ease, border-color 180ms ease;
  white-space: nowrap;
}

.global-nav-link:hover,
.global-nav-link.is-active {
  color: rgba(255, 255, 255, 0.98);
  border-color: rgba(90, 200, 250, 0.9);
}

.global-lang-switcher {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
}

.global-nav .global-lang-switcher {
  display: none;
}

.global-lang-button {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  min-width: 42px;
  padding: 0.55rem 0.8rem;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  font-family: inherit;
  color: inherit;
  font-size: 0.78rem;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.global-lang-button:hover {
  transform: translateY(-1px);
}

.bg-cyan-500\/20 {
  background: rgba(34, 211, 238, 0.18);
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.18);
}

.text-cyan-300 {
  color: #9cecff;
}

.text-white\/70 {
  color: rgba(255, 255, 255, 0.72);
}

.hover\:text-white:hover {
  color: rgba(255, 255, 255, 0.98);
}

.hover\:bg-white\/10:hover {
  background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 840px) {
  .global-nav-inner {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 0.2rem;
    padding: 0.45rem 0 0.5rem;
  }

  .global-nav-spacer {
    display: none;
  }

  .global-lang-switcher {
    justify-self: center;
  }
}

@media (max-width: 720px) {
  :root {
    --site-nav-height: 64px;
    --site-nav-shell: min(100vw - 16px, 1400px);
  }

  .global-nav-links {
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 0.55rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 0.1rem 0.08rem;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    touch-action: pan-x;
  }

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

  .global-nav-links.is-overflowing {
    justify-content: flex-start;
    padding-inline: 1rem;
    scroll-padding-inline: 1rem;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 22px, #000 calc(100% - 22px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 22px, #000 calc(100% - 22px), transparent 100%);
    box-shadow:
      inset 18px 0 22px -22px rgba(1, 3, 35, 0.96),
      inset -18px 0 22px -22px rgba(1, 3, 35, 0.96);
    cursor: grab;
  }

  .global-nav-links.is-overflowing.is-dragging {
    cursor: grabbing;
  }

  .global-nav-link {
    flex: 0 0 auto;
    min-width: max-content;
    text-align: left;
    font-size: 0.74rem;
    line-height: 1.15;
    padding-bottom: 0.22rem;
    scroll-snap-align: start;
  }

  .global-lang-switcher {
    margin-top: 0.08rem;
  }
}
