/* Let cards pass behind the floating navigation instead of cutting off below it. */
#the-difference .change-stage {
  overflow: visible;
}

#the-difference .change-cards {
  overflow: visible;
  clip-path: inset(-100vh -64px -64px);
}

/* Retain the mobile incoming-card crop on the sides and bottom only. */
@media (max-width: 760px) {
  #the-difference .change-cards {
    clip-path: inset(-100vh 0 0);
  }
}

@media (min-width: 761px) {
  #the-difference .change-before {
    z-index: 1;
    opacity: 1;
    transform: translate(
      calc(var(--stack-progress) * 50% + var(--stack-progress) * 12px),
      calc(var(--before-read, 0px) + var(--stack-progress) * 18px)
    ) rotate(calc(var(--stack-progress) * -4deg));
    transform-origin: 50% 50%;
    box-shadow: 0 8px 18px #201b3010;
  }

  #the-difference .change-after {
    z-index: 2;
    transform: translate(
      calc(var(--stack-progress) * -50% - var(--stack-progress) * 12px),
      calc(var(--after-read, 0px) - var(--stack-progress) * 4px)
    ) rotate(calc(var(--stack-progress) * 1deg));
    transform-origin: 50% 50%;
  }
}

@media (min-width: 761px) and (prefers-reduced-motion: reduce) {
  #the-difference .change-before,
  #the-difference .change-after {
    transform: none;
    opacity: 1;
  }
}
