/* ============================================================
   ПРОБА · набор анимаций (свой, без сторонних библиотек)
   Триггеры: на скролле через IntersectionObserver (data-reveal),
   автоматически (счётчики, shimmer, float, pulse),
   на ховере (lift, shine, glow).
   ============================================================ */

/* ---------- Базовый reveal ---------- */
[data-reveal] {
  opacity: 0;
  transition:
    opacity 720ms cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 720ms cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: opacity, transform;
}
[data-reveal="fade-up"]    { transform: translateY(28px); }
[data-reveal="fade-down"]  { transform: translateY(-28px); }
[data-reveal="fade-left"]  { transform: translateX(-32px); }
[data-reveal="fade-right"] { transform: translateX(32px); }
[data-reveal="zoom-in"]    { transform: scale(0.94); }
[data-reveal="zoom-out"]   { transform: scale(1.06); }
[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* Задержки (для каскада в сетках) */
[data-reveal-delay="1"].is-visible { transition-delay: 80ms; }
[data-reveal-delay="2"].is-visible { transition-delay: 160ms; }
[data-reveal-delay="3"].is-visible { transition-delay: 240ms; }
[data-reveal-delay="4"].is-visible { transition-delay: 320ms; }
[data-reveal-delay="5"].is-visible { transition-delay: 400ms; }
[data-reveal-delay="6"].is-visible { transition-delay: 480ms; }
[data-reveal-delay="7"].is-visible { transition-delay: 560ms; }

/* ---------- Плавающие иконки ---------- */
@keyframes p-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
.usp-card .icon-square {
  animation: p-float 4.2s ease-in-out infinite;
}
.usp-card:nth-child(2) .icon-square { animation-delay: 0.7s; }
.usp-card:nth-child(3) .icon-square { animation-delay: 1.4s; }

/* ---------- Hover-lift + shine на карточках ---------- */
.buy-card,
.soon-card,
.office-card,
.adv-card {
  position: relative;
  overflow: hidden;
}
.buy-card::after,
.soon-card::after,
.office-card::after {
  content: "";
  position: absolute;
  top: 0; left: -75%;
  width: 50%; height: 100%;
  background: linear-gradient(
    100deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0.55) 50%,
    rgba(255,255,255,0) 100%
  );
  transform: skewX(-20deg);
  pointer-events: none;
  transition: left 720ms cubic-bezier(0.2, 0.7, 0.2, 1);
  z-index: 2;
}
.buy-card:hover::after,
.soon-card:hover::after,
.office-card:hover::after {
  left: 125%;
}

/* Чуть-чуть приподнимаем + затемнение тени */
.buy-card,
.soon-card,
.office-card,
.adv-card,
.deal-full .step,
.deal-mini .step {
  transition:
    transform 380ms cubic-bezier(0.2, 0.7, 0.2, 1),
    box-shadow 380ms cubic-bezier(0.2, 0.7, 0.2, 1),
    border-color 380ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.deal-full .step:hover,
.deal-mini .step:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 38px rgba(0,0,0,0.12);
}

/* ---------- Shimmer на жёлтой плашке «Лучшие цены» ---------- */
.pill-accent {
  position: relative;
  overflow: hidden;
}
.pill-accent::before {
  content: "";
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(
    100deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0.85) 50%,
    rgba(255,255,255,0) 100%
  );
  transform: skewX(-20deg);
  animation: p-shimmer 3.8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes p-shimmer {
  0%       { left: -100%; }
  55%, 100% { left: 160%; }
}

/* ---------- Pulse-ring на круглой жёлтой кнопке акции ---------- */
.action-circle {
  position: relative;
}
.action-circle::before,
.action-circle::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--color-accent);
  animation: p-pulse-ring 2.4s ease-out infinite;
  pointer-events: none;
}
.action-circle::after { animation-delay: 1.2s; }
@keyframes p-pulse-ring {
  0%   { transform: scale(1); opacity: 0.75; }
  80%  { transform: scale(1.9); opacity: 0; }
  100% { transform: scale(1.9); opacity: 0; }
}

/* ---------- Slide-down липкой шапки ---------- */
@keyframes p-slide-down {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.site-header {
  animation: p-slide-down 540ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

/* ---------- Pop-in заголовка hero ---------- */
@keyframes p-pop-in {
  0%   { opacity: 0; transform: translateY(18px) scale(0.98); }
  100% { opacity: 1; transform: none; }
}
.hero-h1 {
  animation: p-pop-in 760ms cubic-bezier(0.2, 0.7, 0.2, 1) 120ms both;
}
.hero-pitch {
  animation: p-pop-in 760ms cubic-bezier(0.2, 0.7, 0.2, 1) 260ms both;
}
.hero-left .usp-row {
  animation: p-pop-in 760ms cubic-bezier(0.2, 0.7, 0.2, 1) 380ms both;
}
.hero-left .actions {
  animation: p-pop-in 760ms cubic-bezier(0.2, 0.7, 0.2, 1) 500ms both;
}
.hero-left .actions-row2 {
  animation: p-pop-in 760ms cubic-bezier(0.2, 0.7, 0.2, 1) 620ms both;
}
.hero-media {
  animation: p-pop-in 820ms cubic-bezier(0.2, 0.7, 0.2, 1) 200ms both;
}

/* ---------- Bounce-in иконок усиления в hero (после загрузки) ---------- */
@keyframes p-bounce-in {
  0%   { opacity: 0; transform: scale(0.4); }
  60%  { opacity: 1; transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* ---------- Счётчик цены + пульсация при смене слайда ---------- */
.price-now__right .value {
  font-variant-numeric: tabular-nums;
  transition: opacity 280ms ease, transform 280ms cubic-bezier(.34,1.56,.64,1), color 280ms ease;
  will-change: transform, color;
}
.price-now__right .value.is-counting { opacity: 0.85; }
.price-now__right .value.is-pulse {
  animation: p-price-pulse 600ms cubic-bezier(.34,1.56,.64,1);
}
@keyframes p-price-pulse {
  0%   { transform: scale(1);    color: var(--color-brand); }
  35%  { transform: scale(1.08); color: #0F7A3C; text-shadow: 0 0 18px rgba(19,139,69,.45); }
  100% { transform: scale(1);    color: var(--color-brand); text-shadow: none; }
}

/* Плавная смена заголовка «Цена на ...» */
#priceTitle {
  display: inline-block;
  transition: opacity 240ms ease, transform 240ms ease;
}
#priceTitle.is-changing {
  opacity: 0;
  transform: translateY(-4px);
}

/* Плавная смена дельты и офиса */
#priceDelta, #priceOffice {
  transition: opacity 240ms ease;
}

/* ---------- Gradient drift на зелёных полноширинных блоках ---------- */
.deal-full,
.soon-band {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(120deg,
      #138B45 0%,
      #18A352 25%,
      #138B45 50%,
      #0F7A3C 75%,
      #138B45 100%);
  background-size: 220% 220%;
  animation: p-drift 14s ease-in-out infinite;
}
@keyframes p-drift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Soft glow на цифрах рейтинга */
.rating-card .big {
  background: linear-gradient(90deg, #138B45 0%, #18A352 50%, #138B45 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: p-drift 8s ease-in-out infinite;
}

/* ---------- Кнопки: shine при наведении ---------- */
.btn-primary,
.btn-secondary {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.btn-primary::after,
.btn-secondary::after {
  content: "";
  position: absolute;
  top: 0; left: -120%;
  width: 60%; height: 100%;
  background: linear-gradient(
    100deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0.35) 50%,
    rgba(255,255,255,0) 100%
  );
  transform: skewX(-20deg);
  transition: left 620ms cubic-bezier(0.2, 0.7, 0.2, 1);
  pointer-events: none;
  z-index: -1;
}
.btn-primary:hover::after,
.btn-secondary:hover::after { left: 140%; }

/* ---------- Стрелки слайдера: лёгкое покачивание-приглашение ---------- */
@keyframes p-wiggle-right {
  0%, 100% { transform: translateY(-50%) translateX(0); }
  50%      { transform: translateY(-50%) translateX(3px); }
}
@keyframes p-wiggle-left {
  0%, 100% { transform: translateY(-50%) translateX(0); }
  50%      { transform: translateY(-50%) translateX(-3px); }
}
.slider-arrow--next { animation: p-wiggle-right 3.2s ease-in-out infinite; }
.slider-arrow--prev { animation: p-wiggle-left  3.2s ease-in-out infinite; }
.slider-arrow:hover { animation-play-state: paused; }

/* ---------- Кнопка наверх ---------- */
.to-top {
  position: fixed;
  right: 22px; bottom: 22px;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--color-brand);
  color: #fff;
  border: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(19,139,69,0.35);
  opacity: 0; pointer-events: none;
  transform: translateY(10px);
  transition: opacity 320ms ease, transform 320ms ease, background 200ms ease;
  z-index: 60;
}
.to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.to-top:hover { background: #0F7A3C; }

/* ---------- Респект к prefers-reduced-motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}

/* === Neva-Gold анимации (финальные) === */

/* Shimmer-блик на кнопке акции в today-banner */
.today-banner .btn-accent {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.today-banner .btn-accent::before {
  content: "";
  position: absolute;
  top: 0; left: -120%;
  width: 60%; height: 100%;
  background: linear-gradient(
    100deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0.55) 50%,
    rgba(255,255,255,0) 100%
  );
  transform: skewX(-20deg);
  animation: proba-shimmer 3.2s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}
.today-banner .btn-accent > * { position: relative; z-index: 2; }
@keyframes proba-shimmer {
  0%       { left: -120%; }
  55%      { left: 120%; }
  100%     { left: 120%; }
}

/* Плавающие иконки в USP-блоке (adv-grid) */
.adv-grid .adv-card__icon {
  animation: proba-icon-float 4.5s ease-in-out infinite;
  will-change: transform;
}
.adv-grid .adv-card:nth-child(2) .adv-card__icon { animation-delay: -0.6s; }
.adv-grid .adv-card:nth-child(3) .adv-card__icon { animation-delay: -1.2s; }
.adv-grid .adv-card:nth-child(4) .adv-card__icon { animation-delay: -1.8s; }
.adv-grid .adv-card:nth-child(5) .adv-card__icon { animation-delay: -2.4s; }
.adv-grid .adv-card:nth-child(6) .adv-card__icon { animation-delay: -3.0s; }

@keyframes proba-icon-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-6px) rotate(-2deg); }
}

@media (prefers-reduced-motion: reduce) {
  .today-banner .btn-accent::before,
  .adv-grid .adv-card__icon { animation: none !important; }
}
