.parallax-enabled section.parallax-section {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transform-style: preserve-3d;
  perspective: 1000px;
}

.parallax-enabled section.parallax-section::before {
  content: "";
  position: absolute;
  inset: -40% -25%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.08;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 72px 72px;
  background-position: var(--section-grid-x, 0px) var(--section-grid-y, 0px);
  transform-origin: 50% 100%;
  transform:
    perspective(1200px)
    rotateX(calc(62deg + var(--section-tilt-x, 0deg)))
    rotateY(var(--section-tilt-y, 0deg))
    translate3d(0, var(--section-grid-y, 0px), var(--section-depth, 0px))
    scale(1.3);
  mask-image: radial-gradient(
    ellipse at 50% 90%,
    rgba(0, 0, 0, 0.9) 15%,
    rgba(0, 0, 0, 0.35) 48%,
    transparent 76%
  );
  transition: transform 160ms linear, background-position 180ms linear;
}

.parallax-enabled section.parallax-section::after {
  content: "";
  position: absolute;
  inset: -10% -4%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.12;
  background:
    radial-gradient(45% 38% at 18% 22%, rgba(255, 255, 255, 0.16), transparent 72%),
    radial-gradient(38% 30% at 82% 72%, rgba(255, 255, 255, 0.12), transparent 74%),
    radial-gradient(55% 45% at 50% 115%, rgba(56, 189, 248, 0.08), transparent 70%);
  translate: var(--section-parallax-x, 0px) var(--section-parallax-y, 0px);
  transition: translate 140ms linear, opacity 200ms linear;
}

.parallax-enabled section.parallax-section > :not(.absolute) {
  position: relative;
  z-index: 1;
}

.parallax-enabled section img.parallax-image {
  translate: var(--image-parallax-x, 0px) var(--image-parallax-y, 0px);
  box-shadow: 0 calc(8px + var(--image-shadow-depth, 0px)) 32px rgba(0, 0, 0, 0.22);
  transition: translate 120ms linear, box-shadow 150ms linear;
  will-change: translate, box-shadow;
}

@media (prefers-reduced-motion: reduce) {
  .parallax-enabled section.parallax-section::before,
  .parallax-enabled section.parallax-section::after,
  .parallax-enabled section img.parallax-image {
    transition: none;
    translate: 0 0;
  }
}
