/* Shared motion language for the customer-facing website. */
:root {
  --motion-ease: cubic-bezier(.22, 1, .36, 1);
  --motion-spring: cubic-bezier(.2, 1.35, .35, 1);
  --motion-duration: 720ms;
}

.motion-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 10000;
  height: 3px;
  pointer-events: none;
  background: linear-gradient(90deg, #00a85a, #35d78a, #f2aa22);
  box-shadow: 0 1px 8px rgba(0, 168, 90, .28);
  transform: scaleX(0);
  transform-origin: left center;
  will-change: transform;
  animation: motion-scroll-progress linear both;
  animation-timeline: scroll(root block);
}

html.motion-enabled .motion-reveal {
  opacity: 0;
  transform: translate3d(0, 28px, 0) scale(.985);
  transition:
    opacity var(--motion-duration) var(--motion-ease),
    transform var(--motion-duration) var(--motion-ease);
  transition-delay: var(--motion-delay, 0ms);
  will-change: opacity, transform;
}

html.motion-enabled .motion-reveal.motion-from-left {
  transform: translate3d(-34px, 0, 0);
}

html.motion-enabled .motion-reveal.motion-from-right {
  transform: translate3d(34px, 0, 0);
}

html.motion-enabled .motion-reveal.motion-scale-in {
  transform: scale(.94);
}

html.motion-enabled .motion-reveal.motion-in {
  opacity: 1;
  transform: none;
  will-change: auto;
}

html.motion-enabled .motion-page-intro {
  animation: motion-page-intro 680ms var(--motion-ease) both;
}

html.motion-enabled .motion-float {
  animation: motion-float 5.8s ease-in-out infinite;
  animation-delay: 900ms;
  will-change: translate;
}

html.motion-enabled .motion-interactive {
  transition-property: translate, scale, transform, box-shadow, border-color,
    background-color, color, opacity, filter, text-decoration-color;
  transition-duration: 220ms;
  transition-timing-function: var(--motion-ease);
}

@media (hover: hover) and (pointer: fine) {
  html.motion-enabled .motion-interactive:hover {
    translate: 0 -4px;
  }

  html.motion-enabled a.motion-interactive:hover,
  html.motion-enabled button.motion-interactive:hover {
    translate: 0 -2px;
  }
}

html.motion-enabled a.motion-interactive:active,
html.motion-enabled button.motion-interactive:active {
  scale: .97;
  transition-duration: 90ms;
}

@keyframes motion-page-intro {
  from { opacity: 0; translate: 0 -14px; }
  to { opacity: 1; translate: 0 0; }
}

@keyframes motion-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -10px; }
}

@keyframes motion-scroll-progress {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@media (max-width: 720px) {
  :root {
    --motion-duration: 600ms;
  }

  html.motion-enabled .motion-reveal {
    transform: translate3d(0, 20px, 0) scale(.99);
  }

  html.motion-enabled .motion-reveal.motion-from-left,
  html.motion-enabled .motion-reveal.motion-from-right {
    transform: translate3d(0, 20px, 0);
  }

  html.motion-enabled .motion-float {
    animation-duration: 7.5s;
  }
}

@media (prefers-reduced-motion: reduce) {
  .motion-progress { display: none !important; }

  html.motion-enabled .motion-reveal,
  html.motion-enabled .motion-page-intro,
  html.motion-enabled .motion-float,
  html.motion-enabled .motion-interactive {
    opacity: 1 !important;
    transform: none !important;
    translate: none !important;
    scale: none !important;
    animation: none !important;
    transition: none !important;
  }
}
