/* ==========================================================================
   ЛЭТО-2026 · слой правок v2
   --------------------------------------------------------------------------
   Все правила ниже включаются только у тем с суффиксом -v2. Оригинальные
   темы не получают ни одного нового селектора: базовый hub.css остаётся
   нетронутым. Анимируются только transform и opacity.
   ========================================================================== */

html[data-hub-theme][data-hub-theme-edition="v2"] {
  --hub-header-h: 86px;
  --v2-header-bg: rgba(10, 10, 10, 0.8);
  --v2-header-border: rgba(255, 255, 255, 0.12);
  --v2-grid-line: rgba(255, 255, 255, 0.05);
  --v2-hero-glow: rgba(0, 229, 229, 0.16);
  --v2-medallion-glow: rgba(0, 229, 229, 0.3);
  --v2-ring: rgba(0, 229, 229, 0.44);
  --v2-pill-bg: rgba(255, 255, 255, 0.045);
  --v2-pill-border: rgba(255, 255, 255, 0.2);
  --v2-pill-text: #f3f3f3;
  --v2-medallion-hi: rgba(0, 229, 229, 0.3);
  --v2-medallion-deep: #0a2922;
  --v2-medallion-mid: #1a5a49;
}

html[data-hub-theme][data-hub-theme-edition="v2"][data-hub-theme="hub-summer"] {
  --v2-header-bg: rgba(255, 248, 240, 0.82);
  --v2-header-border: rgba(52, 31, 17, 0.14);
  --v2-grid-line: rgba(52, 31, 17, 0.055);
  --v2-hero-glow: rgba(243, 107, 33, 0.13);
  --v2-medallion-glow: rgba(243, 107, 33, 0.22);
  --v2-ring: rgba(243, 107, 33, 0.42);
  --v2-pill-bg: rgba(255, 255, 255, 0.58);
  --v2-pill-border: rgba(52, 31, 17, 0.18);
  --v2-pill-text: #24170f;
  --v2-medallion-hi: rgba(255, 178, 30, 0.34);
  --v2-medallion-deep: #2b170d;
  --v2-medallion-mid: #64351d;
}

html[data-hub-theme][data-hub-theme-edition="v2"][data-hub-theme="hub-winter"] {
  --v2-header-bg: rgba(242, 248, 255, 0.82);
  --v2-header-border: rgba(16, 33, 58, 0.14);
  --v2-grid-line: rgba(16, 33, 58, 0.055);
  --v2-hero-glow: rgba(121, 200, 255, 0.18);
  --v2-medallion-glow: rgba(121, 200, 255, 0.24);
  --v2-ring: rgba(40, 104, 216, 0.4);
  --v2-pill-bg: rgba(255, 255, 255, 0.58);
  --v2-pill-border: rgba(16, 33, 58, 0.18);
  --v2-pill-text: #10213a;
  --v2-medallion-hi: rgba(121, 200, 255, 0.34);
  --v2-medallion-deep: #07192d;
  --v2-medallion-mid: #174a77;
}

html[data-hub-theme][data-hub-theme-edition="v2"][data-hub-theme="hub-polis"]:not([data-hub-variant="dark"]) {
  --v2-header-bg: rgba(244, 255, 251, 0.82);
  --v2-header-border: rgba(30, 30, 30, 0.16);
  --v2-grid-line: rgba(30, 30, 30, 0.055);
  --v2-hero-glow: rgba(33, 240, 168, 0.22);
  --v2-medallion-glow: rgba(33, 240, 168, 0.32);
  --v2-ring: rgba(0, 139, 86, 0.46);
  --v2-pill-bg: rgba(255, 255, 255, 0.6);
  --v2-pill-border: rgba(30, 30, 30, 0.18);
  --v2-pill-text: #1e1e1e;
  --v2-medallion-hi: rgba(33, 240, 168, 0.36);
  --v2-medallion-deep: #0a2922;
  --v2-medallion-mid: #1a5a49;
}

html[data-hub-theme][data-hub-theme-edition="v2"][data-hub-theme="hub-polis"][data-hub-variant="dark"] {
  --v2-header-bg: rgba(7, 17, 13, 0.82);
  --v2-header-border: rgba(214, 255, 238, 0.14);
  --v2-grid-line: rgba(214, 255, 238, 0.055);
  --v2-hero-glow: rgba(33, 240, 168, 0.18);
  --v2-medallion-glow: rgba(33, 240, 168, 0.34);
  --v2-ring: rgba(33, 240, 168, 0.5);
  --v2-pill-bg: rgba(255, 255, 255, 0.045);
  --v2-pill-border: rgba(214, 255, 238, 0.2);
  --v2-pill-text: #f1fff8;
  --v2-medallion-hi: rgba(33, 240, 168, 0.34);
  --v2-medallion-deep: #061713;
  --v2-medallion-mid: #14503f;
}

/* --- Шапка: чуть больше воздуха, стекло только после начала скролла --- */
html[data-hub-theme][data-hub-theme-edition="v2"] .hub-header {
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

html[data-hub-theme][data-hub-theme-edition="v2"] .hub-header.is-scrolled {
  background: var(--v2-header-bg);
  border-bottom-color: var(--v2-header-border);
  -webkit-backdrop-filter: blur(12px) saturate(135%);
  backdrop-filter: blur(12px) saturate(135%);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12);
}

html[data-hub-theme][data-hub-theme-edition="v2"] .hub-nav a::after {
  height: 2px;
  border-radius: 2px;
  transform-origin: left center;
  box-shadow: 0 0 10px var(--v2-ring);
}

html[data-hub-theme][data-hub-theme-edition="v2"][data-hub-theme="hub-polis"] .hub-header::after {
  height: 14px;
  opacity: 0.25;
}

@media (max-width: 980px) {
  html[data-hub-theme][data-hub-theme-edition="v2"] {
    --hub-header-h: 74px;
  }

  html[data-hub-theme][data-hub-theme-edition="v2"] .hub-brand__mark,
  html[data-hub-theme][data-hub-theme-edition="v2"][data-hub-theme="hub-polis"] .hub-brand__mark {
    width: 44px;
    height: 44px;
  }

  html[data-hub-theme][data-hub-theme-edition="v2"][data-hub-theme="hub-polis"] .hub-brand__mark {
    padding: 4px;
  }
}

@media (min-width: 981px) {
  html[data-hub-theme][data-hub-theme-edition="v2"][data-hub-theme="hub-polis"] .hub-brand__mark {
    width: 54px;
    height: 54px;
    padding: 5px;
  }
}

/* --- Первый экран: архитектурная сетка и мягкое свечение --- */
html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--v2-grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--v2-grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 76% 70% at 50% 42%, #000 18%, transparent 78%);
  mask-image: radial-gradient(ellipse 76% 70% at 50% 42%, #000 18%, transparent 78%);
}

html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 32% 38% at 50% 34%, var(--v2-hero-glow), transparent 72%),
    radial-gradient(ellipse 24% 30% at 84% 24%, var(--v2-hero-glow), transparent 76%);
  opacity: 0.85;
}

html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__inner {
  position: relative;
  z-index: 1;
}

html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__scroll {
  z-index: 3;
}

/* --- Каскад первого экрана: 0.6s, шаг 90ms --- */
html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__copy > * {
  animation: hub-v2-hero-rise 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__copy > *:nth-child(1) { animation-delay: 0.09s; }
html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__copy > *:nth-child(2) { animation-delay: 0.18s; }
html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__copy > *:nth-child(3) { animation-delay: 0.27s; }
html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__copy > *:nth-child(4) { animation-delay: 0.27s; }

html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__note {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  max-width: 100%;
  padding: 7px 18px;
  border: 1px solid var(--v2-pill-border);
  border-radius: 999px;
  background: var(--v2-pill-bg);
  color: var(--v2-pill-text);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.35;
  text-align: center;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: hub-v2-hero-rise 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.36s both;
}

html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__note::before {
  content: "";
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--hub-accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--hub-accent) 18%, transparent);
  animation: hub-v2-status 2.8s ease-in-out infinite;
}

html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__social {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 44px;
  padding: 0 20px;
  transition: color 0.25s ease, border-color 0.25s ease, transform 0.18s ease;
  animation: hub-v2-hero-rise 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.45s both;
}

html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__social::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--hub-accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__social > * {
  position: relative;
  z-index: 1;
}

html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__social:hover {
  border-color: var(--hub-accent);
  color: var(--hub-accent-ink);
}

html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__social:hover::before {
  transform: scaleX(1);
}

html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__social:active {
  transform: scale(0.97);
}

html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__scroll {
  transition: opacity 0.35s ease, transform 0.35s ease;
}

html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__scroll svg {
  animation: hub-v2-arrow 2.4s ease-in-out infinite;
}

html[data-hub-theme][data-hub-theme-edition="v2"].hub-v2-scrolled .hub-hero__scroll {
  opacity: 0;
  transform: translate(50%, 8px);
  pointer-events: none;
}

@media (max-width: 980px) {
  html[data-hub-theme][data-hub-theme-edition="v2"].hub-v2-scrolled .hub-hero__scroll {
    transform: translateY(8px);
  }
}

/* --- Живой медальон на десктопе --- */
html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__aside {
  animation: hub-v2-hero-rise 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__aside .hub-hero__emblem {
  animation: hub-v2-float 4.5s ease-in-out infinite alternate;
}

html[data-hub-theme][data-hub-theme-edition="v2"][data-hub-theme="hub-polis"] .hub-hero__emblem {
  overflow: visible;
  box-shadow:
    0 0 0 1px rgba(33, 240, 168, 0.55),
    0 0 0 13px rgba(33, 240, 168, 0.055),
    0 0 70px 12px var(--v2-medallion-glow),
    0 30px 70px rgba(5, 34, 27, 0.18);
}

html[data-hub-theme][data-hub-theme-edition="v2"][data-hub-theme="hub-polis"] .hub-hero__emblem::after {
  content: "";
  position: absolute;
  inset: -13px;
  z-index: 2;
  border: 1px dashed var(--v2-ring);
  border-radius: 50%;
  pointer-events: none;
  animation: hub-v2-orbit 45s linear infinite;
}

/* --- Круглый медальон на мобильном и планшете: сверху по центру, без обрезки --- */
html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__mobile-seal {
  display: none;
}

@media (max-width: 980px) {
  html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: calc(100vh - var(--hub-header-h));
    min-height: calc(100svh - var(--hub-header-h));
    min-height: calc(100dvh - var(--hub-header-h));
    padding-top: 14px;
    padding-bottom: 58px;
    text-align: center;
  }

  html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    text-align: center;
  }

  html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__copy {
    align-items: center;
    text-align: center;
  }

  html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__kicker {
    justify-content: center;
    margin-bottom: 16px;
  }

  html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__subtitle {
    max-width: 34ch;
    margin-right: auto;
    margin-left: auto;
    text-align: center;
  }

  html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__foot {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 10px;
    margin-top: 24px;
  }

  html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__note {
    width: auto;
    text-align: center;
  }

  html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__social {
    min-width: 190px;
    justify-content: center;
  }

  html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__scroll {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    order: 2;
    display: inline-flex;
    margin: auto auto 0;
    padding-top: 14px;
    transform: none;
  }

  html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__mobile-seal {
    position: relative;
    inset: auto;
    left: auto;
    bottom: auto;
    order: -1;
    z-index: 2;
    display: block;
    flex: 0 0 auto;
    width: clamp(130px, 36vw, 150px);
    height: auto;
    aspect-ratio: 1 / 1;
    margin: 4px auto 18px;
    overflow: visible;
    border-radius: 50%;
    transform: none;
    background:
      radial-gradient(circle at 32% 24%, var(--v2-medallion-hi), transparent 46%),
      radial-gradient(circle at 72% 78%, var(--v2-medallion-mid), var(--v2-medallion-deep) 58%, #04100c 100%);
    box-shadow:
      0 0 0 1px var(--v2-ring),
      0 0 0 7px color-mix(in srgb, var(--v2-ring) 13%, transparent),
      0 0 58px 10px var(--v2-medallion-glow),
      0 18px 38px rgba(3, 20, 15, 0.22);
    isolation: isolate;
    animation: hub-v2-hero-rise 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__mobile-seal::before {
    content: "";
    position: absolute;
    inset: -30%;
    z-index: -1;
    border-radius: 50%;
    background: radial-gradient(circle, var(--v2-medallion-glow) 0%, transparent 68%);
    filter: blur(10px);
    opacity: 0.82;
    mix-blend-mode: normal;
    pointer-events: none;
  }

  html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__mobile-seal::after {
    content: "";
    position: absolute;
    inset: -10px;
    z-index: 2;
    border: 1px dashed var(--v2-ring);
    border-radius: 50%;
    pointer-events: none;
    animation: hub-v2-orbit 45s linear infinite;
  }

  html[data-hub-theme][data-hub-theme-edition="v2"] #hub-page .hub-hero__mobile-seal img {
    position: absolute;
    top: 50%;
    left: 50%;
    display: block;
    width: 56%;
    height: auto;
    max-width: none;
    transform: translate(-50%, -50%);
    animation: hub-v2-seal-float 4.5s ease-in-out infinite alternate;
  }

  html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__title {
    text-align: center;
  }
}

@media (max-width: 520px) {
  html[data-hub-theme][data-hub-theme-edition="v2"] {
    --hub-header-h: 74px;
  }

  html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__mobile-seal {
    width: clamp(130px, 37vw, 150px);
    margin-bottom: 16px;
  }
}

@media (max-width: 360px) {
  html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__note {
    padding-right: 13px;
    padding-left: 13px;
    font-size: 10px;
    letter-spacing: 0.1em;
  }
}

@media (max-height: 700px) and (max-width: 760px) {
  html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero {
    padding-top: 14px;
    padding-bottom: 16px;
  }

  html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__scroll {
    padding-top: 8px;
  }

  html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__mobile-seal {
    margin-top: 0;
    margin-bottom: 5px;
  }

  html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__kicker {
    margin-bottom: 12px;
  }

  html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__mobile-seal {
    width: 130px;
  }

  html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__title {
    font-size: clamp(3.5rem, 22vw, 5.4rem);
  }
}

@media (max-height: 600px) and (max-width: 980px) {
  html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__scroll {
    margin-top: 2px;
  }
}

@media (max-height: 520px) and (orientation: landscape) and (max-width: 980px) {
  html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__mobile-seal {
    display: none;
  }
}

/* --- Scroll reveal: партнёры и карточки появляются мягко --- */
html[data-hub-theme][data-hub-theme-edition="v2"] .hub-v2-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--v2-reveal-delay, 0ms);
}

html[data-hub-theme][data-hub-theme-edition="v2"] .hub-v2-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

html[data-hub-theme][data-hub-theme-edition="v2"].hub-anim #hub-page .hub-reveal.is-revealed {
  animation: hub-v2-reveal-rise 0.72s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: var(--hub-reveal-delay, 0ms);
}

/* --- Ключевые кадры: только transform и opacity --- */
@keyframes hub-v2-hero-rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes hub-v2-reveal-rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes hub-v2-float {
  from { transform: translateY(0); }
  to { transform: translateY(-6px); }
}

@keyframes hub-v2-seal-float {
  from { transform: translate(-50%, -50%) translateY(0); }
  to { transform: translate(-50%, -50%) translateY(-6px); }
}

@keyframes hub-v2-orbit {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes hub-v2-arrow {
  0%, 100% { transform: translateY(0); opacity: 0.55; }
  50% { transform: translateY(5px); opacity: 1; }
}

@keyframes hub-v2-status {
  0%, 100% { opacity: 0.55; transform: scale(0.82); }
  50% { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__copy > *,
  html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__note,
  html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__social,
  html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__mobile-seal,
  html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__aside,
  html[data-hub-theme][data-hub-theme-edition="v2"] #hub-page .hub-hero__mobile-seal img,
  html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__aside .hub-hero__emblem,
  html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__mobile-seal::after,
  html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__emblem::after,
  html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__note::before,
  html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__scroll svg {
    animation: none;
  }

  html[data-hub-theme][data-hub-theme-edition="v2"] .hub-hero__scroll {
    transition: none;
  }

  html[data-hub-theme][data-hub-theme-edition="v2"] .hub-v2-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}