﻿.topbar {
  position: sticky;
  top: 16px;
  z-index: 120;
  width: min(calc(100% - 32px), 1240px);
  margin: 16px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  transition: background 220ms ease, border-color 220ms ease, backdrop-filter 220ms ease;
}

.topbar.is-scrolled {
  background: rgba(7, 12, 20, 0.72);
  backdrop-filter: blur(18px);
  border-color: rgba(118, 212, 255, 0.12);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.24);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar .brand {
  transform: translateY(4px);
}

.brand-logo {
  display: block;
  width: clamp(180px, 18vw, 300px);
  height: auto;
}

.topbar .brand-logo {
  transform: translateY(4px);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nav {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.nav a {
  color: rgba(243, 247, 255, 0.82);
  font-size: 0.95rem;
  white-space: nowrap;
}

.nav a:hover {
  color: #f3f7ff;
}

.nav-button {
  margin-left: 8px;
}

.language-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(118, 212, 255, 0.16);
  border-radius: 999px;
  background: rgba(8, 14, 23, 0.52);
}

.language-pill {
  min-width: 42px;
  height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(243, 247, 255, 0.76);
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.language-pill:hover {
  color: #f3f7ff;
}

.language-pill.is-active {
  background: linear-gradient(135deg, rgba(118, 212, 255, 0.22), rgba(77, 125, 255, 0.24));
  color: #f3f7ff;
  box-shadow: inset 0 0 0 1px rgba(118, 212, 255, 0.18);
}

.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid rgba(118, 212, 255, 0.22);
  overflow: hidden;
  white-space: nowrap;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  transform: translateX(-100%);
  transition: transform 420ms ease, opacity 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px rgba(118, 212, 255, 0.18), 0 16px 36px rgba(45, 98, 212, 0.22);
}

.button:hover::before {
  opacity: 1;
  transform: translateX(100%);
}

.button-ghost {
  background: rgba(8, 14, 23, 0.52);
}

.menu-toggle {
  display: none;
  width: 48px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(118, 212, 255, 0.18);
  background: rgba(7, 12, 20, 0.72);
  color: #f3f7ff;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
}

.menu-toggle span {
  width: 18px;
  height: 1px;
  background: currentColor;
}

@media (max-width: 980px) {
  .topbar {
    width: min(calc(100% - 72px), 1240px);
    top: 12px;
    margin-top: 12px;
    border-radius: 22px;
    align-items: flex-start;
    gap: 14px;
    padding: 11px 14px;
  }

  .menu-toggle {
    display: inline-flex;
    margin-top: 5px;
  }

  .nav {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    right: 0;
    display: none;
    gap: 12px;
    padding: 18px;
    grid-template-columns: minmax(0, 1fr);
    justify-items: stretch;
    border-radius: 24px;
    border: 1px solid rgba(118, 212, 255, 0.16);
    background: rgba(7, 12, 20, 0.95);
    backdrop-filter: blur(18px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35);
  }

  .nav.is-open {
    display: grid;
  }

  .nav a,
  .nav .language-switch {
    width: 100%;
    min-width: 0;
  }

  .nav a:not(.button) {
    display: flex;
    align-items: center;
    min-height: 44px;
  }

  .nav-button {
    margin-left: 0;
    justify-content: center;
  }

  .language-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .language-pill {
    min-width: 0;
    justify-content: center;
  }
}

@media (max-width: 760px) {
  .topbar {
    width: min(calc(100% - 32px), 1240px);
    padding: 10px 14px;
  }

  .menu-toggle {
    margin-top: 7px;
  }

  .brand-logo {
    width: min(100%, 230px);
  }
}

@media (max-width: 560px) {
  .topbar {
    gap: 12px;
    padding: 10px 12px;
  }

  .nav {
    padding: 16px;
  }
}
