/* Шапка: цельный баннер из макета (иконка + глитч «БабкаVPN») */

:root {
  --babka-neon-purple: #b026ff;
  --babka-glitch-top: #80ffff;
  --babka-glitch-bottom: #ffb0ff;
}

.header-tech-wrap .header-logo.header-wordmark {
  height: auto;
  min-height: calc(3.35rem - (0.75rem * var(--header-progress)));
  display: flex;
  align-items: center;
}

@media (max-width: 767px) {
  .header-tech-wrap--mobile-top .header-logo.header-wordmark {
    min-height: calc(2.95rem - (0.65rem * var(--header-progress)));
  }
}

@media (min-width: 768px) {
  .header-tech-wrap .header-logo.header-wordmark {
    min-height: calc(3.65rem - (0.85rem * var(--header-progress)));
  }
}

/* Логотип слева, панель по центру страницы — не слипаются */
.header-tech-wrap--split-brand .header-layout-row {
  align-items: center;
}

.header-tech-wrap--split-brand .header-brand-link {
  display: inline-flex;
  align-self: center;
  align-items: center;
}

.header-tech-wrap--split-brand .header-logo.header-wordmark {
  min-height: 0 !important;
  height: auto !important;
  transform: none !important;
  will-change: auto !important;
}

.header-tech-wrap--split-brand .header-panel-row {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  justify-content: center;
  padding-top: 0;
}

@media (min-width: 768px) {
  .header-tech-wrap--split-brand .header-layout-row--balanced {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    column-gap: clamp(1.5rem, 4vw, 3rem);
  }

  .header-tech-wrap--split-brand .header-layout-row--balanced .header-brand-link {
    grid-column: 1;
    justify-self: start;
    margin-right: 0;
  }

  .header-tech-wrap--split-brand .header-layout-row--balanced .header-panel-row {
    grid-column: 2;
    justify-self: center;
    flex: none;
    width: auto;
    max-width: min(62rem, calc(100vw - 2rem));
    padding-left: 0;
    padding-right: 0;
  }

  #siteHeader .header-nav-panel.header-tech {
    width: auto;
    max-width: 62rem;
    margin-left: auto;
    margin-right: auto;
  }

  .header-logo-icon-wrap {
    width: auto;
    height: 72px;
  }

  .header-logo-icon-neon {
    transform: none;
  }

  .header-wordmark-text.babkavps-wordmark--glitch {
    font-size: 2.3rem;
  }
}

#siteHeader .header-nav-panel.header-tech {
  width: 100%;
  max-width: 62rem;
}

@media (min-width: 768px) {
  #siteHeader .header-nav-panel.header-tech {
    width: auto;
  }
}

#siteHeader .header-logo.header-wordmark {
  background: transparent !important;
}

@media (min-width: 768px) {
  #siteHeader .header-tech-inner {
    flex-wrap: nowrap;
  }

  #siteHeader .header-nav-desktop {
    flex: 0 1 auto;
  }
}

/* Логотип: иконка + текст — одна связка, иконка шире по горизонтали */
.header-wordmark--split {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: clamp(0.45rem, 2vw, 0.75rem);
}

/* Иконка: только бабка с неоном (без круга/диска), рядом — глитч-текст */
.header-logo-icon-wrap {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: auto;
  height: clamp(52px, 11vw, 68px);
  overflow: visible;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0;
  position: relative;
}

.header-logo-icon-wrap::after {
  content: "";
  position: absolute;
  inset: -18% -12%;
  border-radius: 50%;
  background: radial-gradient(
    circle at 50% 52%,
    rgba(128, 255, 255, 0.42) 0%,
    rgba(56, 189, 248, 0.18) 42%,
    transparent 72%
  );
  pointer-events: none;
  z-index: 0;
}

.header-logo-icon-neon {
  display: block;
  width: auto;
  height: 100%;
  max-height: clamp(52px, 11vw, 68px);
  aspect-ratio: 1;
  object-fit: contain;
  object-position: center;
  background: transparent !important;
  border-radius: 0;
  animation: none !important;
  mix-blend-mode: normal;
  filter:
    drop-shadow(0 0 6px rgba(128, 255, 255, 0.95))
    drop-shadow(0 0 14px rgba(56, 189, 248, 0.65))
    drop-shadow(0 0 10px rgba(176, 38, 255, 0.5)) !important;
  transform: none;
  transform-origin: center center;
  position: relative;
  z-index: 1;
}

.header-wordmark-text.babkavps-wordmark--glitch {
  flex: 0 1 auto;
  font-size: clamp(1.55rem, 4.83vw, 2.36rem);
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 0;
  align-self: center;
}

.header-wordmark-text.babkavps-wordmark--glitch::before,
.header-wordmark-text.babkavps-wordmark--glitch::after {
  animation: header-text-glitch-jitter 2.9s steps(2, end) infinite;
}

@keyframes header-text-glitch-jitter {
  0%,
  86%,
  100% {
    transform: translate(0, 0);
  }
  88% {
    transform: translate(-3px, 0);
  }
  91% {
    transform: translate(3px, 1px);
  }
}

.header-tech-wrap--glitch-cyan-purple .header-logo.header-wordmark {
  filter: none !important;
  animation: none !important;
}

/* Старый цельный баннер — без глитч-анимации, если где-то остался */
.header-logo-wordmark-banner {
  animation: none !important;
}

/* Круглый неоновый логотип (только favicon / miniapp) */
.header-logo-circle {
  display: block;
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 50%;
  filter: drop-shadow(0 0 8px rgba(176, 38, 255, 0.65))
    drop-shadow(0 0 16px rgba(176, 38, 255, 0.35));
  animation: none !important;
}

@media (min-width: 640px) {
  .header-logo-circle {
    width: 48px;
    height: 48px;
  }
}

.header-brand-title.babka-glitch-wordmark {
  font-size: clamp(0.95rem, 3.8vw, 1.35rem);
}

/* Горизонтальный баннер */
.header-logo-wordmark-banner {
  display: block;
  height: clamp(58px, 15vw, 76px);
  width: auto;
  max-width: min(360px, 88vw);
  object-fit: contain;
  object-position: left center;
  background: transparent !important;
}

@media (min-width: 768px) {
  #siteHeader .header-logo-wordmark-banner {
    height: 96px;
    max-width: 440px;
  }
}

@media (min-width: 1280px) {
  #siteHeader .header-logo-wordmark-banner {
    height: 104px;
    max-width: 480px;
  }
}

/* main.css задаёт огромную высоту .header-logo — для баннера отключаем */
#siteHeader .header-logo.header-wordmark {
  height: auto !important;
  min-height: 0 !important;
  transform: none !important;
  will-change: auto !important;
}

#siteHeader .header-brand-link {
  will-change: auto !important;
  transform: none !important;
}

/* Опциональный CSS-глитч (если понадобится без картинки) */
.babka-glitch-wordmark,
.babkavps-wordmark.babkavps-wordmark--glitch {
  position: relative;
  display: inline-block;
  font-family: Montserrat, ui-sans-serif, system-ui, sans-serif;
  font-weight: 900;
  font-size: clamp(1rem, 2.6vw, 1.5rem);
  letter-spacing: -0.02em;
  line-height: 1.02;
  white-space: nowrap;
  color: transparent;
}

.babka-glitch-wordmark::before,
.babka-glitch-wordmark::after,
.babkavps-wordmark--glitch::before,
.babkavps-wordmark--glitch::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  font: inherit;
  letter-spacing: inherit;
}

.babka-glitch-wordmark::before,
.babkavps-wordmark--glitch::before {
  color: var(--babka-glitch-top);
  text-shadow: 0 0 8px rgba(128, 255, 255, 0.85), -2px 0 rgba(128, 255, 255, 0.4);
  clip-path: polygon(0 0, 100% 0, 100% 50%, 0 50%);
  transform: translate(-2px, 0);
}

.babka-glitch-wordmark::after,
.babkavps-wordmark--glitch::after {
  color: var(--babka-glitch-bottom);
  text-shadow: 0 0 8px rgba(255, 176, 255, 0.8), 2px 0 rgba(255, 176, 255, 0.4);
  clip-path: polygon(0 50%, 100% 50%, 100% 100%, 0 100%);
  transform: translate(2px, 0);
}

#siteHeader.header-tech-wrap {
  background: transparent !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  box-shadow:
    0 0 40px rgba(128, 255, 255, 0.08),
    0 0 56px rgba(176, 38, 255, 0.12),
    0 12px 36px rgba(0, 0, 0, 0.22) !important;
}

#siteHeader .header-tech {
  background: rgba(5, 7, 18, 0.72) !important;
  background-image: none !important;
  backdrop-filter: blur(14px) saturate(1.35) !important;
  -webkit-backdrop-filter: blur(14px) saturate(1.35) !important;
  border: 1px solid rgba(128, 255, 255, 0.22) !important;
  border-top: none !important;
  box-shadow:
    0 0 28px rgba(176, 38, 255, 0.28),
    0 0 42px rgba(56, 189, 248, 0.16),
    inset 0 1px 0 rgba(128, 255, 255, 0.12) !important;
}

#siteHeader .header-nav-panel.header-tech {
  border-top: 1px solid rgba(128, 255, 255, 0.12) !important;
  overflow: hidden;
}

.header-tech-wrap--glitch-cyan-purple .header-tech::before {
  opacity: 0.78 !important;
  inset: -2px -6px !important;
  background:
    repeating-linear-gradient(
      -62deg,
      transparent,
      transparent 10px,
      rgba(56, 80, 140, 0.06) 10px,
      rgba(56, 80, 140, 0.06) 11px
    ),
    linear-gradient(
      100deg,
      rgba(128, 255, 255, 0.18) 0%,
      rgba(176, 38, 255, 0.16) 45%,
      rgba(255, 120, 255, 0.12) 100%
    ) !important;
  animation: header-bar-glitch-sweep 3.8s ease-in-out infinite !important;
}

.header-tech-wrap--glitch-cyan-purple .header-tech::after {
  opacity: 0.95 !important;
  height: 2px !important;
  box-shadow:
    0 0 12px rgba(56, 189, 248, 0.75),
    0 0 22px rgba(176, 38, 255, 0.65) !important;
  animation: header-bar-glitch-line 2.4s linear infinite !important;
}

/* Панель: бегущая обводка голубой → фиолетовой → розовой */
@keyframes header-panel-border-run {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

.header-tech-wrap--glitch-cyan-purple .header-nav-panel.header-tech::after,
#siteHeader .header-nav-panel.header-tech::after {
  inset: -1px !important;
  left: -1px !important;
  right: -1px !important;
  top: -1px !important;
  bottom: -1px !important;
  width: auto !important;
  height: auto !important;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(
    90deg,
    #22d3ee 0%,
    #38bdf8 10%,
    #67e8f9 18%,
    #818cf8 32%,
    #a855f7 46%,
    #b026ff 56%,
    #c026d3 66%,
    #ec4899 78%,
    #f472b6 88%,
    #fb7185 96%,
    #22d3ee 100%
  ) !important;
  background-size: 320% 100% !important;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.94 !important;
  mix-blend-mode: screen;
  filter:
    drop-shadow(0 0 7px rgba(34, 211, 238, 0.7))
    drop-shadow(0 0 14px rgba(168, 85, 247, 0.55))
    drop-shadow(0 0 18px rgba(236, 72, 153, 0.45));
  box-shadow: none !important;
  animation: header-panel-border-run 3.2s linear infinite !important;
}

.header-mobile-menu {
  box-shadow:
    0 0 28px rgba(128, 255, 255, 0.12),
    0 0 44px rgba(176, 38, 255, 0.14),
    0 16px 40px rgba(0, 0, 0, 0.35) !important;
}

#siteHeader.header-tech-wrap {
  box-shadow: none !important;
}

#siteHeader .header-tech,
.header-tech-wrap--glitch-cyan-purple .header-tech::before,
.header-tech-wrap--glitch-cyan-purple .header-tech::after {
  box-shadow: none !important;
}

#siteHeader .header-nav-panel.header-tech {
  min-height: calc(3.5rem - (0.5rem * var(--header-progress))) !important;
  padding-top: calc(0.42rem - (0.1rem * var(--header-progress))) !important;
  padding-bottom: calc(0.42rem - (0.1rem * var(--header-progress))) !important;
  padding-left: 1rem !important;
  padding-right: 1rem !important;
  border-radius: 1.1rem;
  border-color: transparent !important;
}

#siteHeader .header-nav-panel .header-tech-inner {
  min-height: 0;
  max-width: 100%;
  align-items: center;
}

#siteHeader .header-nav-panel .header-nav-desktop {
  max-width: 100%;
  min-width: 0;
  flex-wrap: nowrap;
}

#siteHeader .header-nav-link {
  text-shadow: 0 0 12px rgba(128, 255, 255, 0.12);
  transition:
    color 0.2s ease,
    background 0.2s ease,
    text-shadow 0.2s ease;
}

#siteHeader .header-nav-link:hover {
  text-shadow:
    0 0 10px rgba(128, 255, 255, 0.55),
    0 0 18px rgba(176, 38, 255, 0.35);
}

#siteHeader #headerConnectBtn {
  box-shadow: none !important;
  max-height: 2.35rem;
}

#siteHeader #headerConnectBtn.tech-btn::before {
  inset: 0 !important;
  border-radius: inherit;
  opacity: 0.55;
}

#siteHeader #headerConnectBtn.tech-btn::after {
  inset: 1px !important;
  border-radius: calc(12px - 1px);
}

#siteHeader .header-nav-link {
  padding: 0.42rem 0.62rem !important;
  font-size: 0.875rem !important;
  line-height: 1.2;
  white-space: nowrap;
}

#siteHeader #headerConnectBtn {
  min-height: 2.15rem !important;
  max-height: 2.35rem !important;
  padding: 0.38rem 0.95rem !important;
  font-size: 0.8125rem !important;
  white-space: nowrap;
  margin-left: 0.15rem !important;
}

@media (prefers-reduced-motion: reduce) {
  .header-wordmark-text.babkavps-wordmark--glitch::before,
  .header-wordmark-text.babkavps-wordmark--glitch::after,
  .header-tech-wrap--glitch-cyan-purple .header-tech::before,
  .header-tech-wrap--glitch-cyan-purple .header-tech::after,
  .header-tech-wrap--glitch-cyan-purple .header-nav-panel.header-tech::after {
    animation: none !important;
  }
}

@media (min-width: 768px) {
  #siteHeader .header-tech {
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
  }

  #siteHeader .header-nav-panel .header-tech-inner {
    min-height: 0;
  }

  #siteHeader .header-nav-panel.header-tech {
    min-height: calc(3.65rem - (0.55rem * var(--header-progress))) !important;
    padding-left: 1.1rem !important;
    padding-right: 1.1rem !important;
  }

  #siteHeader .header-nav-panel .header-nav-desktop {
    gap: 0.2rem !important;
  }

  #siteHeader .header-nav-link {
    padding: 0.44rem 0.72rem !important;
    font-size: 0.9rem !important;
  }

  #siteHeader #headerConnectBtn {
    min-height: 2.2rem !important;
    max-height: 2.4rem !important;
    padding: 0.4rem 1.05rem !important;
    font-size: 0.85rem !important;
  }
}

@media (min-width: 1280px) {
  #siteHeader .header-nav-panel .header-nav-desktop {
    gap: 0.35rem !important;
  }

  #siteHeader .header-nav-link {
    padding: 0.46rem 0.8rem !important;
    font-size: 0.925rem !important;
  }

  #siteHeader #headerConnectBtn {
    padding: 0.42rem 1.15rem !important;
    font-size: 0.875rem !important;
  }
}

/* Miniapp — тот же split-бренд, что на сайте (иконка + глитч-текст) */
.miniapp-topbar-brand {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.miniapp-topbar .miniapp-topbar-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  max-width: 100%;
  height: auto !important;
  min-height: 0 !important;
  transform: none !important;
  filter: none !important;
  animation: none !important;
}

.miniapp-topbar .miniapp-topbar-icon-wrap {
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.miniapp-topbar .miniapp-topbar-icon {
  width: 2.25rem;
  height: 2.25rem;
  object-fit: contain;
}

.miniapp-topbar .miniapp-topbar-title-text.babkavps-wordmark--glitch {
  font-size: clamp(1.05rem, 4.2vw, 1.35rem);
  letter-spacing: -0.03em;
  line-height: 1;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.miniapp-topbar .miniapp-topbar-title-text.babkavps-wordmark--glitch::before,
.miniapp-topbar .miniapp-topbar-title-text.babkavps-wordmark--glitch::after {
  animation: none;
}
