/* v35: аккуратная навигация без кнопки “Ещё” и без белой громоздкой плашки */
:root {
  --header-max-width: 1480px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 240;
  width: 100%;
  min-height: 76px;
  padding: 14px clamp(18px, 4vw, 56px);
  display: grid;
  grid-template-columns: minmax(230px, auto) minmax(340px, 1fr) auto;
  grid-template-areas: "brand nav auth";
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, rgba(9, 55, 132, .96), rgba(20, 68, 154, .94));
  border-bottom: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 18px 45px rgba(6, 28, 74, .22);
  backdrop-filter: blur(14px);
}

.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 16% 18%, rgba(255, 255, 255, .12), transparent 24%),
    radial-gradient(circle at 70% 10%, rgba(124, 58, 237, .18), transparent 32%);
  opacity: .85;
}

.site-header > * {
  position: relative;
  z-index: 1;
}

.site-header .brand {
  grid-area: brand;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: #fff;
  text-decoration: none;
  font-weight: 900;
  letter-spacing: .01em;
  white-space: nowrap;
}

.site-header .brand:hover {
  transform: translateY(-1px);
}

.site-header .brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: rgba(255, 255, 255, .96);
  color: #18459f;
  font-weight: 950;
  box-shadow: 0 14px 28px rgba(2, 15, 50, .18);
  flex: 0 0 auto;
}

#site-name {
  display: inline-block;
  max-width: 245px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: inherit;
}

.site-nav-shell {
  grid-area: nav;
  justify-self: stretch;
  align-self: center;
  min-width: 0;
  max-width: 100%;
  position: relative;
  overflow: hidden;
  padding: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .11);
  border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 10px 28px rgba(3, 17, 50, .12);
}

.site-nav-shell::before,
.site-nav-shell::after {
  content: '';
  position: absolute;
  top: 5px;
  bottom: 5px;
  width: 34px;
  z-index: 2;
  pointer-events: none;
}

.site-nav-shell::before {
  left: 5px;
  background: linear-gradient(90deg, rgba(20, 68, 154, .82), rgba(20, 68, 154, 0));
}

.site-nav-shell::after {
  right: 5px;
  background: linear-gradient(270deg, rgba(20, 68, 154, .82), rgba(20, 68, 154, 0));
}

.site-nav.site-nav-scroll,
.site-nav {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 7px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 26px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.site-nav.site-nav-scroll::-webkit-scrollbar,
.site-nav::-webkit-scrollbar {
  display: none;
}

.site-nav.site-nav-scroll > a,
.site-nav > a {
  flex: 0 0 auto;
  max-width: 170px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 8px 13px;
  color: rgba(255, 255, 255, .9);
  background: rgba(255, 255, 255, .10);
  border: 1px solid rgba(255, 255, 255, .12);
  text-decoration: none;
  font-weight: 850;
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: none;
  scroll-snap-align: start;
  transition: transform .16s ease, background .16s ease, color .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.site-nav.site-nav-scroll > a:hover,
.site-nav > a:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, .18);
  border-color: rgba(255, 255, 255, .22);
  color: #fff;
}

.site-nav.site-nav-scroll > a.active,
.site-nav > a.active {
  background: #fff;
  color: #18459f;
  border-color: rgba(255, 255, 255, .72);
  box-shadow: 0 12px 24px rgba(2, 15, 50, .18);
}

.auth-panel {
  grid-area: auth;
  justify-self: end;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
}

.auth-panel .btn,
.auth-panel .btn.secondary,
.auth-panel a.btn,
.auth-panel button.btn {
  min-height: 38px;
  padding: 9px 13px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .94);
  color: #143875;
  font-weight: 900;
  box-shadow: 0 12px 26px rgba(2, 15, 50, .14);
}

.auth-panel .btn:hover,
.auth-panel .btn.secondary:hover {
  transform: translateY(-1px);
  background: #fff;
  box-shadow: 0 16px 34px rgba(2, 15, 50, .20);
}

.auth-user-name {
  min-height: 38px;
  max-width: 145px;
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  color: #fff !important;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .14);
  font-weight: 850;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.social-links {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.social-link {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  color: #fff;
  text-decoration: none;
  font-weight: 900;
  font-size: 12px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .16);
}

.social-link:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, .22);
}

.nav-more {
  display: none !important;
}

@media (min-width: 1320px) {
  .site-header {
    grid-template-columns: minmax(250px, auto) minmax(620px, 1fr) auto;
  }

  .site-nav-shell {
    max-width: 980px;
    justify-self: center;
  }
}

@media (max-width: 1180px) {
  .site-header {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand auth"
      "nav nav";
    gap: 12px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .site-nav-shell {
    justify-self: stretch;
  }

  .auth-panel {
    max-width: 100%;
  }
}

@media (max-width: 760px) {
  .site-header {
    display: flex;
    min-height: 64px;
    padding: 12px 16px;
  }

  .site-nav-shell,
  .site-nav {
    display: none !important;
  }

  .site-header .brand-mark {
    width: 36px;
    height: 36px;
  }

  #site-name {
    max-width: 190px;
  }

  .auth-panel {
    margin-left: auto;
  }

  .auth-panel .auth-user-name,
  .auth-panel .btn:not(:first-child) {
    display: none;
  }

  .auth-panel .btn,
  .auth-panel .btn.secondary {
    min-height: 36px;
    padding: 8px 12px;
    border-radius: 12px;
  }
}
