/* Внедрение: deploy-hub — путь, тур по этапам, микро-анимации */

.site-premium .deploy-hub {
  position: relative;
  padding: clamp(72px, 9vw, 108px) 0 clamp(80px, 10vw, 112px);
  overflow: hidden;
  background:
    radial-gradient(ellipse 90% 70% at 50% -10%, rgba(45, 128, 194, 0.16), transparent 55%),
    linear-gradient(180deg, #eef4fa 0%, #f6f9fc 48%, #eef3f8 100%);
}

.site-premium .deploy-hub .container {
  position: relative;
  z-index: 2;
}

/* ——— Фон ——— */
.deploy-hub__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.deploy-hub__bg-mesh {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 50% 40% at 15% 60%, rgba(45, 128, 194, 0.12), transparent 58%),
    radial-gradient(ellipse 45% 38% at 85% 30%, rgba(15, 136, 147, 0.1), transparent 55%);
}

.deploy-hub__bg-grid {
  position: absolute;
  inset: 0;
  opacity: 0.4;
  background-image:
    linear-gradient(rgba(45, 128, 194, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45, 128, 194, 0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, #000 10%, transparent 85%);
}

.deploy-hub__bg-path {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8%;
  width: 100%;
  height: 45%;
  opacity: 0.5;
}

.deploy-hub__bg-path-line {
  fill: none;
  stroke: var(--primary-color);
  stroke-width: 2;
  stroke-dasharray: 12 14;
  opacity: 0.35;
  animation: deploy-path-flow 14s linear infinite;
}

.deploy-hub__bg-path-glow {
  fill: none;
  stroke: var(--info-color);
  stroke-width: 4;
  stroke-dasharray: 12 14;
  opacity: 0.15;
  filter: blur(4px);
  animation: deploy-path-flow 14s linear infinite;
  animation-delay: -4s;
}

@keyframes deploy-path-flow {
  to {
    stroke-dashoffset: -52;
  }
}

.deploy-hub__bg-pulse {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary-color);
  box-shadow: 0 0 20px rgba(45, 128, 194, 0.6);
  opacity: 0;
  animation: deploy-bg-pulse-travel 8s ease-in-out infinite;
}

.deploy-hub__bg-pulse--1 {
  left: 12%;
  bottom: 28%;
  animation-delay: 0s;
}

.deploy-hub__bg-pulse--2 {
  left: 48%;
  bottom: 42%;
  animation-delay: -2.6s;
  background: var(--info-color);
}

.deploy-hub__bg-pulse--3 {
  left: 82%;
  bottom: 22%;
  animation-delay: -5.2s;
}

@keyframes deploy-bg-pulse-travel {
  0%,
  100% {
    opacity: 0;
    transform: translate(0, 0) scale(0.6);
  }
  15% {
    opacity: 0.9;
    transform: translate(0, -8px) scale(1);
  }
  50% {
    opacity: 0.5;
    transform: translate(24px, -20px) scale(0.85);
  }
  85% {
    opacity: 0;
    transform: translate(40px, -10px) scale(0.5);
  }
}

/* ——— Шапка ——— */
.deploy-hub__head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto clamp(32px, 5vw, 48px);
}

.deploy-hub__hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 12px;
  margin: 16px 0 0;
}

.deploy-hub__hint-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-color);
  background: rgba(45, 128, 194, 0.1);
  border: 1px solid rgba(45, 128, 194, 0.22);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.deploy-hub__stage[data-deploy-paused] .deploy-hub__hint-pill {
  background: rgba(15, 136, 147, 0.12);
  border-color: rgba(15, 136, 147, 0.35);
  color: var(--info-color);
}

.deploy-hub__hint-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary-color);
  animation: deploy-hint-blink 1.4s ease-in-out infinite;
}

.deploy-hub__stage[data-deploy-paused] .deploy-hub__hint-pill::before {
  animation: none;
  opacity: 0.45;
}

@keyframes deploy-hint-blink {
  0%,
  100% {
    opacity: 0.4;
    transform: scale(0.85);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

.deploy-hub__hint-sub {
  font-size: 12px;
  color: var(--text-muted);
}

/* ——— Рельса прогресса ——— */
.deploy-hub__stage {
  position: relative;
  --deploy-progress: 0;
}

.deploy-hub__rail {
  position: relative;
  margin-bottom: clamp(20px, 3vw, 32px);
  padding: 0 clamp(8px, 2vw, 24px);
}

.deploy-hub__track {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: rgba(45, 128, 194, 0.12);
  overflow: visible;
}

.deploy-hub__track-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: calc(var(--deploy-progress) * 100%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary-color), var(--info-color));
  box-shadow: 0 0 16px rgba(45, 128, 194, 0.35);
  transition: width 0.65s cubic-bezier(0.34, 1.1, 0.64, 1);
}

.deploy-hub__runner {
  position: absolute;
  left: calc(var(--deploy-progress) * 100%);
  top: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--info-color));
  box-shadow:
    0 0 0 4px rgba(45, 128, 194, 0.2),
    0 8px 24px rgba(45, 128, 194, 0.45);
  transition: left 0.65s cubic-bezier(0.34, 1.1, 0.64, 1);
  animation: deploy-runner-pulse 2s ease-in-out infinite;
}

@keyframes deploy-runner-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.12);
  }
}

.deploy-hub__nav {
  display: flex;
  justify-content: space-between;
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  gap: 4px;
}

.deploy-hub__nav-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 2px solid rgba(45, 128, 194, 0.2);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  cursor: pointer;
  transition:
    transform 0.3s ease,
    border-color 0.3s ease,
    color 0.3s ease,
    box-shadow 0.3s ease,
    background 0.3s ease;
}

.deploy-hub__nav-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: scale(1.08);
}

.deploy-hub__nav-btn.is-active {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--primary-color), var(--info-color));
  box-shadow: 0 8px 22px rgba(45, 128, 194, 0.4);
  transform: scale(1.1);
}

/* ——— Карточки этапов ——— */
.deploy-hub__cards {
  display: grid;
  gap: 14px;
  list-style: none;
}

@media (min-width: 900px) {
  .deploy-hub__cards {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: clamp(10px, 1.2vw, 16px);
    align-items: stretch;
  }
}

.deploy-hub__card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 18px 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(45, 128, 194, 0.14);
  box-shadow: 0 12px 36px rgba(15, 35, 55, 0.06);
  backdrop-filter: blur(8px);
  min-height: 100%;
  transition:
    transform 0.5s cubic-bezier(0.34, 1.15, 0.64, 1),
    opacity 0.45s ease,
    border-color 0.45s ease,
    box-shadow 0.45s ease;
  opacity: 0.72;
  transform: translateY(4px) scale(0.97);
}

.deploy-hub__card--active {
  opacity: 1;
  transform: translateY(-8px) scale(1.03);
  border-color: rgba(45, 128, 194, 0.42);
  box-shadow:
    0 28px 56px rgba(45, 128, 194, 0.18),
    0 0 0 1px rgba(45, 128, 194, 0.08);
  z-index: 2;
}

.deploy-hub__card-glow {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(45, 128, 194, 0.2), rgba(15, 136, 147, 0.15));
  opacity: 0;
  z-index: -1;
  transition: opacity 0.45s ease;
  pointer-events: none;
}

.deploy-hub__card--active .deploy-hub__card-glow {
  opacity: 1;
  animation: deploy-card-glow 2.5s ease-in-out infinite;
}

@keyframes deploy-card-glow {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

.deploy-hub__card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(45, 128, 194, 0.12), rgba(15, 136, 147, 0.08));
  color: var(--primary-color);
  transition: transform 0.4s ease, background 0.4s ease;
}

.deploy-hub__card--active .deploy-hub__card-icon {
  background: linear-gradient(135deg, var(--primary-color), var(--info-color));
  color: #fff;
  transform: scale(1.08);
  box-shadow: 0 10px 28px rgba(45, 128, 194, 0.35);
}

.deploy-hub-icon {
  width: 28px;
  height: 28px;
  display: block;
}

.deploy-hub__card-step {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--info-color);
}

.deploy-hub__card h3 {
  margin: 0;
  font-size: clamp(0.95rem, 1.4vw, 1.05rem);
  line-height: 1.3;
  font-weight: 700;
}

.deploy-hub__card p {
  flex: 1;
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.deploy-hub__card .btn {
  align-self: stretch;
  width: 100%;
  justify-content: center;
  margin-top: auto;
}

.site-premium .deploy-hub__card .btn--outline {
  background: #fff !important;
  border: 1px solid rgba(45, 128, 194, 0.35) !important;
  color: var(--primary-dark) !important;
}

.site-premium .deploy-hub__card .btn--outline:hover {
  border-color: var(--primary-color) !important;
  background: #f0f7fd !important;
}

/* Микро-анимации иконок (только активная карточка) */
.deploy-hub__card--active[data-deploy-anim="request"] .deploy-hub-icon__dot {
  animation: deploy-icon-dot 0.8s ease-in-out 3;
  transform-origin: center;
  transform-box: fill-box;
}

@keyframes deploy-icon-dot {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.75);
  }
  50% {
    opacity: 1;
    transform: scale(1.25);
  }
}

.deploy-hub__card--active[data-deploy-anim="demo"] .deploy-hub-icon__play {
  animation: deploy-icon-play 0.6s ease-in-out 3;
  transform-origin: center;
  transform-box: fill-box;
}

@keyframes deploy-icon-play {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
}

.deploy-hub__card--active[data-deploy-anim="trial"] .deploy-hub-icon__hand {
  animation: deploy-icon-clock 1.2s ease-in-out 2;
  transform-origin: 12px 12px;
}

@keyframes deploy-icon-clock {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.deploy-hub__card--active[data-deploy-anim="partner"] .deploy-hub-icon__link {
  stroke-dasharray: 20;
  stroke-dashoffset: 20;
  animation: deploy-icon-link 0.9s ease forwards 2;
}

@keyframes deploy-icon-link {
  to {
    stroke-dashoffset: 0;
  }
}

.deploy-hub__card--active[data-deploy-anim="use"] .deploy-hub-icon__check {
  stroke-dasharray: 28;
  stroke-dashoffset: 28;
  animation: deploy-icon-check 0.7s ease forwards 2;
}

@keyframes deploy-icon-check {
  to {
    stroke-dashoffset: 0;
  }
}

/* Мобильная вертикальная линия */
@media (max-width: 899px) {
  .deploy-hub__rail {
    padding-left: 28px;
  }

  .deploy-hub__track {
    position: absolute;
    left: 11px;
    top: 0;
    bottom: 0;
    width: 4px;
    height: auto;
    margin: 0;
  }

  .deploy-hub__track-fill {
    width: 100% !important;
    height: calc(var(--deploy-progress) * 100%);
    transition: height 0.65s cubic-bezier(0.34, 1.1, 0.64, 1);
  }

  .deploy-hub__runner {
    left: 2px;
    top: calc(var(--deploy-progress) * 100%);
    transition: top 0.65s cubic-bezier(0.34, 1.1, 0.64, 1);
  }

  .deploy-hub__nav {
    flex-direction: column;
    gap: 8px;
    margin-top: 0;
    margin-left: 36px;
    margin-bottom: 20px;
    align-items: flex-start;
  }

  .deploy-hub__nav li {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .deploy-hub__cards {
    padding-left: 8px;
  }

  .deploy-hub__card--active {
    transform: translateY(-4px) scale(1.01);
  }
}

@media (prefers-reduced-motion: reduce) {
  .deploy-hub__bg-path-line,
  .deploy-hub__bg-path-glow,
  .deploy-hub__bg-pulse,
  .deploy-hub__runner,
  .deploy-hub__hint-pill::before,
  .deploy-hub__card-glow,
  .deploy-hub__card--active .deploy-hub-icon__dot,
  .deploy-hub__card--active .deploy-hub-icon__play,
  .deploy-hub__card--active .deploy-hub-icon__hand,
  .deploy-hub__card--active .deploy-hub-icon__link,
  .deploy-hub__card--active .deploy-hub-icon__check {
    animation: none;
  }

  .deploy-hub__track-fill,
  .deploy-hub__runner,
  .deploy-hub__card {
    transition: none;
  }
}
