/* The contact form: the arrow nudging while it sends, and the success state arriving. */

@layer utilities {
  @media (prefers-reduced-motion: no-preference) {
    .motion-safe\:animate-success-pop {
      animation: success-pop var(--duration-very-slow) var(--ease-smooth-out) both;
    }

    .motion-safe\:animate-success-draw {
      animation: success-draw var(--duration-very-slow) var(--ease-smooth-out) 200ms both;
    }

    .motion-safe\:animate-success-rise {
      animation: success-rise var(--duration-very-slow) var(--ease-smooth-out) 150ms both;
    }
  }

  .animate-form-nudge {
    animation: form-nudge 900ms var(--ease-in-out) infinite;
  }
}

@keyframes form-nudge {
  50% {
    transform: translateX(4px);
  }
}

@keyframes success-pop {
  from {
    opacity: 0;
    transform: scale(0.5) rotate(-20deg);
  }
}

/* The tick draws itself: the path is one dash (pathLength 1) that the offset slides into view. */
@keyframes success-draw {
  from {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
  }
  to {
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
  }
}

@keyframes success-rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}
