/* ===== Motion kit — ref: «Дарю анимацию» web UI microinteractions ===== */

:root {
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --motion-fast: 180ms;
  --motion-med: 320ms;
}

/* Hero cascade */
.hero__brand-line,
.hero .type-line,
.hero h1,
.hero__lead,
.hero .speed-banner,
.hero__actions {
  opacity: 0;
  transform: translateY(22px);
  animation: rise-in 0.8s var(--ease-out) forwards;
}
.hero__brand-line { animation-delay: 0.05s; }
.hero .type-line { animation-delay: 0.12s; }
.hero h1 { animation-delay: 0.2s; }
.hero__lead { animation-delay: 0.32s; }
.hero .speed-banner { animation-delay: 0.42s; }
.hero__actions { animation-delay: 0.52s; }

.page-hero h1,
.page-hero__eyebrow,
.page-hero p {
  opacity: 0;
  transform: translateY(16px);
  animation: rise-in 0.7s var(--ease-out) forwards;
}
.page-hero__eyebrow { animation-delay: 0.05s; }
.page-hero h1 { animation-delay: 0.12s; }
.page-hero p { animation-delay: 0.2s; }

@keyframes rise-in {
  to { opacity: 1; transform: none; }
}

/* Stronger scroll reveals */
.reveal {
  opacity: 0;
  transform: translateY(28px) scale(0.985);
  transition:
    opacity 0.75s var(--ease-out),
    transform 0.75s var(--ease-out);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Stagger children */
.stagger > * {
  opacity: 0;
  transform: translateY(20px);
}
.stagger.is-visible > * {
  animation: rise-in 0.65s var(--ease-out) forwards;
}
.stagger.is-visible > *:nth-child(1) { animation-delay: 0.04s; }
.stagger.is-visible > *:nth-child(2) { animation-delay: 0.1s; }
.stagger.is-visible > *:nth-child(3) { animation-delay: 0.16s; }
.stagger.is-visible > *:nth-child(4) { animation-delay: 0.22s; }
.stagger.is-visible > *:nth-child(5) { animation-delay: 0.28s; }
.stagger.is-visible > *:nth-child(6) { animation-delay: 0.34s; }
.stagger.is-visible > *:nth-child(7) { animation-delay: 0.4s; }
.stagger.is-visible > *:nth-child(8) { animation-delay: 0.46s; }

/* Magnetic / pressable buttons */
.btn {
  transition:
    transform var(--motion-fast) var(--ease-spring),
    box-shadow var(--motion-med) var(--ease-out),
    background var(--motion-fast) ease,
    border-color var(--motion-fast) ease,
    color var(--motion-fast) ease !important;
  will-change: transform;
}
.btn:active {
  transform: scale(0.96) !important;
}
.btn--primary:hover {
  transform: translateY(-3px) scale(1.02);
}

/* Ripple click */
.btn {
  overflow: hidden;
}
.btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transform: scale(0);
  animation: ripple 0.55s ease-out;
  pointer-events: none;
}
.btn--primary .ripple {
  background: rgba(0, 0, 0, 0.12);
}
@keyframes ripple {
  to { transform: scale(12); opacity: 0; }
}

/* Nav tabs — sliding underline feel */
.tabs a {
  transition: color 0.2s ease, background 0.25s var(--ease-out), transform 0.2s var(--ease-spring);
}
.tabs a:hover {
  transform: translateY(-1px);
}
.tabs a.is-active {
  animation: tab-pop 0.35s var(--ease-spring);
}
@keyframes tab-pop {
  0% { transform: scale(0.94); }
  100% { transform: scale(1); }
}

/* Spotlight cards (cursor flashlight border) */
.spot-card {
  position: relative;
  --mx: 50%;
  --my: 50%;
}
.spot-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(
    220px circle at var(--mx) var(--my),
    rgba(255, 255, 255, 0.55),
    transparent 55%
  );
  -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;
  transition: opacity 0.25s ease;
  pointer-events: none;
  z-index: 3;
}
.spot-card:hover::before { opacity: 1; }

.svc-card,
.review-card,
.panel,
.feature-card,
.plan {
  transition:
    transform 0.35s var(--ease-out),
    box-shadow 0.35s var(--ease-out),
    border-color 0.25s ease !important;
}
.svc-card:hover,
.review-card:hover,
.panel:hover,
.feature-card:hover,
.plan:hover {
  transform: translateY(-6px);
}

/* Image / video zoom already exists — soften */
.svc-card:hover .svc-card__media img,
.svc-card:hover .svc-card__media video {
  transform: scale(1.06);
  transition: transform 0.7s var(--ease-out);
}

/* Filter chips bounce */
.filter-chip {
  transition: transform 0.2s var(--ease-spring), background 0.2s ease, color 0.2s ease !important;
}
.filter-chip:hover { transform: translateY(-2px); }
.filter-chip:active { transform: scale(0.96); }
.filter-chip.is-active {
  animation: tab-pop 0.3s var(--ease-spring);
}

/* Link underline draw */
.footer a,
.breadcrumbs a,
.legal a {
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0% 1px;
  transition: background-size 0.25s var(--ease-out), color 0.2s ease;
}
.footer a:hover,
.breadcrumbs a:hover,
.legal a:hover {
  background-size: 100% 1px;
}

/* Modal spring */
.modal.is-open .modal__panel {
  animation: modal-in 0.35s var(--ease-spring);
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

/* Marquee soft pause on hover */
.marquee:hover .marquee__track {
  animation-play-state: paused;
}

/* Section titles slight slide when visible */
.section__title {
  transition: letter-spacing 0.6s var(--ease-out);
}
.reveal.is-visible .section__title {
  letter-spacing: -0.03em;
}

/* Loading pulse for empty grids */
.svc-grid:empty::after,
.reviews-list:empty::after {
  content: "Загрузка…";
  display: block;
  text-align: center;
  color: rgba(255, 255, 255, 0.45);
  padding: 2rem;
  animation: pulse-fade 1.2s ease-in-out infinite;
}
@keyframes pulse-fade {
  50% { opacity: 0.35; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__brand-line,
  .hero .type-line,
  .hero h1,
  .hero__lead,
  .hero .speed-banner,
  .hero__actions,
  .page-hero h1,
  .page-hero__eyebrow,
  .page-hero p,
  .stagger.is-visible > *,
  .tabs a.is-active,
  .filter-chip.is-active,
  .modal.is-open .modal__panel {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .btn:hover,
  .svc-card:hover,
  .spot-card:hover {
    transform: none !important;
  }
}
