:root {
  --motion-out: cubic-bezier(0.16, 1, 0.3, 1);
  --motion-soft: cubic-bezier(0.22, 1, 0.36, 1);
  --motion-organic: cubic-bezier(0.37, 0, 0.63, 1);
  --motion-fast: 180ms;
  --motion-reveal: 760ms;
}

.ambient-bg {
  animation: ambient-shift 28s var(--motion-organic) infinite alternate;
}

.ambient-bg::after {
  animation: ambient-image-breathe 18s var(--motion-organic) infinite alternate;
  transform-origin: center;
}

@keyframes ambient-shift {
  from {
    transform: scale(1) translate3d(0, 0, 0) rotate(0deg);
  }

  to {
    transform: scale(1.035) translate3d(-0.6%, -0.4%, 0) rotate(0.35deg);
  }
}

@keyframes ambient-image-breathe {
  from {
    opacity: 0.1;
    transform: scale(1.01);
  }

  to {
    opacity: 0.16;
    transform: scale(1.055);
  }
}

@media (max-width: 720px) {
  .ambient-bg,
  .ambient-bg::after {
    animation: none !important;
    transform: none !important;
  }
}

.motion-ready .mobile-topbar {
  opacity: 0;
  transform: translateY(-14px);
}

.motion-ready .hero-art {
  opacity: 0;
  transform: translateY(18px) scale(0.965);
}

.motion-ready .hero-copy > * {
  opacity: 0;
  transform: translateY(24px);
}

.motion-ready .mobile-topbar,
.motion-ready .hero-art,
.motion-ready .hero-copy > * {
  transition:
    opacity var(--motion-reveal) var(--motion-out),
    transform var(--motion-reveal) var(--motion-out);
}

.motion-loaded .mobile-topbar,
.motion-loaded .hero-art,
.motion-loaded .hero-copy > * {
  opacity: 1;
  transform: none;
}

.motion-loaded .mobile-topbar {
  transition-delay: 60ms;
}

.motion-loaded .hero-copy h1 {
  transition-delay: 150ms;
}

.motion-loaded .hero-copy .hero-lead {
  transition-delay: 260ms;
}

.motion-loaded .hero-art {
  transition-delay: 300ms;
}

.motion-ready .reveal-item {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity var(--motion-reveal) var(--motion-out),
    transform var(--motion-reveal) var(--motion-out);
  will-change: opacity, transform;
}

.motion-ready .reveal-item.is-visible {
  opacity: 1;
  transform: translateY(0);
  will-change: auto;
}

.footer-contacts a {
  transition:
    transform var(--motion-fast) var(--motion-soft),
    border-color var(--motion-fast) ease,
    background-color var(--motion-fast) ease,
    box-shadow var(--motion-fast) ease;
}

input,
.check-line {
  transition:
    border-color var(--motion-fast) ease,
    background-color var(--motion-fast) ease,
    box-shadow var(--motion-fast) ease;
}

input:focus {
  background-color: rgba(255, 255, 255, 0.1);
}

.copy-row.copied {
  border-color: rgba(87, 216, 170, 0.52);
  background-color: rgba(87, 216, 170, 0.14);
  box-shadow: 0 10px 28px rgba(24, 110, 83, 0.18);
}

.copy-row.copied em {
  animation: copy-confirm 480ms var(--motion-soft);
  background: rgba(87, 216, 170, 0.2);
  color: #c9ffe9;
}

.timeline-card.is-visible .timeline-dot {
  animation: timeline-dot-arrive 640ms var(--motion-soft) both;
}

.timeline-card.is-visible .timeline-item:nth-child(2) .timeline-dot {
  animation-delay: 120ms;
}

.form-message:not(.hidden),
.after-submit:not(.hidden) {
  animation: success-arrive 520ms var(--motion-out) both;
}

@keyframes copy-confirm {
  50% {
    transform: scale(1.08);
  }
}

@keyframes timeline-dot-arrive {
  from {
    opacity: 0;
    transform: scale(0.45);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes success-arrive {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (hover: hover) and (pointer: fine) {
  .footer-contacts a:hover {
    transform: translateY(-2px);
  }

  .motion-ready .reveal-item.is-visible.timeline-card:hover,
  .motion-ready .reveal-item.is-visible.registration-card:hover,
  .motion-ready .reveal-item.is-visible.payment-card:hover,
  .motion-ready .reveal-item.is-visible.map-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.2);
  }
}

.copy-row:active {
  transform: scale(0.98);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }

  .motion-ready .mobile-topbar,
  .motion-ready .hero-art,
  .motion-ready .hero-copy > *,
  .motion-ready .reveal-item {
    opacity: 1 !important;
    transform: none !important;
  }

  .ambient-bg,
  .ambient-bg::after {
    animation: none !important;
  }
}
