html.is-changing #primary {
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Leaving the current page */
html.is-leaving #primary {
  opacity: 0;
  transform: translateY(12px) scale(0.995);
}

/* Entering the new page (Swup applies this right after content swap) */
html.is-rendering #primary {
  opacity: 0;
  transform: translateY(12px) scale(0.995);
}

html.is-rendering.is-animating #primary {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-reduced-motion: reduce) {
  html.is-leaving #primary,
  html.is-rendering #primary,
  html.is-rendering.is-animating #primary {
    transition: opacity 0.15s linear !important;
    transform: none !important;
  }
}