/* ===== Burger ===== */
.burger {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: rgba(22, 27, 34, 0.55);
  cursor: pointer;
  transition:
    border-color var(--tr-fast),
    background var(--tr-fast),
    transform var(--tr-fast);
  flex: 0 0 44px;
}

.burger:hover {
  border-color: rgba(23, 190, 187, 0.55);
  background: rgba(22, 27, 34, 0.8);
}

.burger:focus-visible {
  outline: 2px solid rgba(23, 190, 187, 0.65);
  outline-offset: 2px;
}

.burger span {
  position: absolute;
  left: 50%;
  width: 18px;
  height: 3px;
  background: var(--color-text);
  border-radius: 2px;
  transform: translateX(-50%);
  transition:
    transform var(--tr-base),
    opacity var(--tr-base),
    top var(--tr-base),
    background var(--tr-fast);
}

.burger span:nth-child(1) {
  top: 6px;
}

.burger span:nth-child(2) {
  top: 15px;
}

.burger span:nth-child(3) {
  top: 24px;
}

/* active -> cross */
.burger.is-active span:nth-child(1) {
  top: 16px;
  transform: translateX(-50%) rotate(45deg);
}

.burger.is-active span:nth-child(2) {
  opacity: 0;
}

.burger.is-active span:nth-child(3) {
  top: 16px;
  transform: translateX(-50%) rotate(-45deg);
}

/* ===== Mobile menu ===== */
.mobile {
  display: none;
  overflow: hidden;
  border-top: 1px solid var(--color-border);
  background: rgba(13, 17, 23, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  max-height: 0;
  opacity: 0;
  transform: translateY(-8px);
  transition:
    max-height 0.32s ease,
    opacity 0.22s ease,
    transform 0.22s ease;
}

.mobile.is-open {
  opacity: 1;
  transform: translateY(0);
  max-height: 500px;
}

.mobile__inner {
  padding: 12px 0 18px;
  display: grid;
  gap: 12px;
}

.mobile__links {
  display: grid;
  gap: 8px;
}

.mobile__links a {
  padding: 13px 14px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: rgba(22, 27, 34, 0.55);
  color: var(--color-text-2);
  font-weight: 700;
  transition:
    color var(--tr-fast),
    border-color var(--tr-fast),
    background var(--tr-fast),
    transform var(--tr-fast);
}

.mobile__links a:hover {
  color: var(--color-text);
  border-color: rgba(23, 190, 187, 0.55);
  background: rgba(22, 27, 34, 0.8);
  transform: translateY(-1px);
}

.mobile__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.mobile__actions .btn {
  flex: 1 1 100%;
}

/* overlay под меню */
.mobile-backdrop {
  position: fixed;
  inset: 0;
  z-index: 998;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--tr-base);
}

.mobile-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* header above backdrop */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
}

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .nav {
    display: none;
  }

  .header-actions {
    min-width: auto;
  }

  .burger {
    display: inline-block;
  }

  .mobile {
    display: block;
  }

  .topbar__left .chip:last-child {
    display: none;
  }
}

@media (max-width: 520px) {
  .topbar__row {
    justify-content: center;
  }

  .topbar__left {
    display: none;
  }

  .logo__subtitle {
    display: none;
  }

  .header-actions > .btn-primary {
    display: none;
  }
}
