:root {
  --wk-motion-ease: cubic-bezier(.16, 1, .3, 1);
}

html,
body {
  overflow-x: clip;
}

/* The document stays fully visible until JavaScript opts the page into motion. */
.has-scroll-motion [data-motion-item] {
  opacity: .12;
  transform: translate3d(var(--motion-enter-x, 0), 30px, 0) scale(.965);
  transition:
    transform 680ms var(--wk-motion-ease),
    opacity 460ms ease-out;
}

.has-scroll-motion [data-motion-item][data-motion-state="active"] {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

.has-scroll-motion [data-motion-item][data-motion-state="past"] {
  opacity: .14;
  transform: translate3d(var(--motion-exit-x, -42px), -24px, 0) scale(.97);
  transition-duration: 360ms, 260ms;
}

.has-scroll-motion [data-motion-item][data-motion-side="right"] {
  --motion-enter-x: 54px;
  --motion-exit-x: -46px;
}

.has-scroll-motion [data-motion-item][data-motion-side="left"] {
  --motion-enter-x: -54px;
  --motion-exit-x: 46px;
}

.has-scroll-motion [data-motion-item][data-motion-side="depth"] {
  --motion-enter-x: 0;
  --motion-exit-x: 0;
  transform-origin: 50% 45%;
}

.has-scroll-motion [data-motion-group] [data-motion-item]:nth-child(2) {
  transition-delay: 55ms;
}

.has-scroll-motion [data-motion-group] [data-motion-item]:nth-child(3) {
  transition-delay: 110ms;
}

.has-scroll-motion [data-motion-group] [data-motion-item]:nth-child(4) {
  transition-delay: 165ms;
}

.has-scroll-motion [data-motion-group] [data-motion-item][data-motion-state="past"] {
  transition-delay: 0ms;
}

@supports (animation-timeline: view(block)) {
  .has-scroll-motion [data-motion-section] {
    animation-name: wk-section-left;
    animation-duration: 1ms;
    animation-fill-mode: both;
    animation-timing-function: linear;
    animation-timeline: view(block);
    animation-range: entry 2% exit 98%;
    transform-origin: 50% 42%;
  }

  .has-scroll-motion [data-motion-section="right"] {
    animation-name: wk-section-right;
  }

  .has-scroll-motion [data-motion-section="depth"] {
    animation-name: wk-section-depth;
  }

  .has-scroll-motion .proof-stage {
    animation-name: wk-proof-depth;
    animation-duration: 1ms;
    animation-fill-mode: both;
    animation-timing-function: linear;
    animation-timeline: view(block);
    animation-range: entry 0% exit 100%;
    transform-origin: 50% 45%;
  }

  .has-scroll-motion .featured-case {
    animation-name: wk-feature-depth;
    animation-duration: 1ms;
    animation-fill-mode: both;
    animation-timing-function: linear;
    animation-timeline: view(block);
    animation-range: entry 0% exit 100%;
    transform-origin: 50% 48%;
  }
}

@keyframes wk-section-left {
  0% { opacity: .16; transform: translate3d(9vw, 58px, 0) scale(.955); }
  24% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
  66% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
  100% { opacity: .14; transform: translate3d(-8vw, -44px, 0) scale(.965); }
}

@keyframes wk-section-right {
  0% { opacity: .16; transform: translate3d(-9vw, 58px, 0) scale(.955); }
  24% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
  66% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
  100% { opacity: .14; transform: translate3d(8vw, -44px, 0) scale(.965); }
}

@keyframes wk-section-depth {
  0% { opacity: .12; transform: perspective(1400px) translate3d(0, 86px, -160px) scale(.9); }
  25% { opacity: 1; transform: perspective(1400px) translate3d(0, 0, 0) scale(1); }
  64% { opacity: 1; transform: perspective(1400px) translate3d(0, 0, 0) scale(1); }
  100% { opacity: .13; transform: perspective(1400px) translate3d(-6vw, -60px, -130px) scale(.92); }
}

@keyframes wk-proof-depth {
  0% { opacity: .22; transform: perspective(1600px) translate3d(0, 96px, -220px) rotateX(2.2deg) scale(.87); }
  28% { opacity: 1; transform: perspective(1600px) translate3d(0, 0, 0) rotateX(0) scale(1); }
  62% { opacity: 1; transform: perspective(1600px) translate3d(0, 0, 0) rotateX(0) scale(1); }
  100% { opacity: .2; transform: perspective(1600px) translate3d(0, -74px, -190px) rotateX(-1.8deg) scale(.89); }
}

@keyframes wk-feature-depth {
  0% { opacity: .2; transform: perspective(1500px) translate3d(0, 78px, -170px) scale(.9); }
  26% { opacity: 1; transform: perspective(1500px) translate3d(0, 0, 0) scale(1); }
  68% { opacity: 1; transform: perspective(1500px) translate3d(0, 0, 0) scale(1); }
  100% { opacity: .2; transform: perspective(1500px) translate3d(5vw, -58px, -150px) scale(.92); }
}

@media (max-width: 720px) {
  .has-scroll-motion [data-motion-item] {
    --motion-enter-x: 24px;
    --motion-exit-x: -20px;
    transform: translate3d(var(--motion-enter-x), 22px, 0) scale(.975);
    transition-duration: 560ms, 380ms;
  }

  .has-scroll-motion [data-motion-item][data-motion-side="left"] {
    --motion-enter-x: -24px;
    --motion-exit-x: 20px;
  }

  .has-scroll-motion [data-motion-item][data-motion-state="active"] {
    transform: translate3d(0, 0, 0) scale(1);
  }

  .has-scroll-motion [data-motion-item][data-motion-state="past"] {
    transform: translate3d(var(--motion-exit-x), -18px, 0) scale(.98);
  }

  @supports (animation-timeline: view(block)) {
    .has-scroll-motion [data-motion-section] {
      animation-range: entry 4% exit 96%;
    }
  }

  @keyframes wk-section-left {
    0% { opacity: .18; transform: translate3d(7vw, 38px, 0) scale(.97); }
    22% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
    72% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
    100% { opacity: .16; transform: translate3d(-6vw, -28px, 0) scale(.975); }
  }

  @keyframes wk-section-right {
    0% { opacity: .18; transform: translate3d(-7vw, 38px, 0) scale(.97); }
    22% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
    72% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
    100% { opacity: .16; transform: translate3d(6vw, -28px, 0) scale(.975); }
  }
}

@media (prefers-reduced-motion: reduce) {
  .has-scroll-motion [data-motion-item],
  .has-scroll-motion [data-motion-item][data-motion-state],
  .has-scroll-motion [data-motion-section],
  .has-scroll-motion .proof-stage,
  .has-scroll-motion .featured-case {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    transition: opacity 160ms ease-out !important;
  }
}
