.crime-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.crime-backdrop::before,
.crime-backdrop::after {
  position: absolute;
  inset: 0;
  content: '';
}

.crime-backdrop::before {
  background-image: url('./pattern.svg');
  background-size: 780px 480px;
  background-position: 24px -17px;
  mask-image: radial-gradient(ellipse 470px 300px at 50% 49%, #0000 32%, #0006 72%, #000 115%);
}

.crime-backdrop::after {
  background:
    radial-gradient(circle 11px at 11% 39%, #55e6df14 0%, #55e6df00 100%),
    radial-gradient(circle 7px at 25% 18%, #ffd27020 0%, #ffd27000 100%),
    radial-gradient(circle 12px at 89% 48%, #ffd27012 0%, #ffd27000 100%),
    radial-gradient(circle 10px at 71% 86%, #55e6df16 0%, #55e6df00 100%),
    radial-gradient(circle 6px at 8% 83%, #ffd27018 0%, #ffd27000 100%),
    radial-gradient(circle 2px at 11% 39%, #82ded37a 0%, #82ded300 100%),
    radial-gradient(circle 2px at 25% 18%, #ffd2708c 0%, #ffd27000 100%),
    radial-gradient(circle 2px at 89% 48%, #ffd27078 0%, #ffd27000 100%),
    radial-gradient(circle 2px at 71% 86%, #82ded38c 0%, #82ded300 100%),
    radial-gradient(circle 2px at 8% 83%, #ffd2707a 0%, #ffd27000 100%);
}

.crime-backdrop__icon {
  position: absolute;
  width: var(--size);
  height: var(--size);
  opacity: 0.32;
  object-fit: contain;
  transform: rotate(var(--tilt));
  animation: crime-weightless var(--duration) ease-in-out var(--delay) infinite;
}

.crime-backdrop__icon:nth-child(1) {
  top: 18%;
  left: 9%;
  --size: 84px;
  --tilt: -12deg;
  --drift-x: 8px;
  --drift-y: -12px;
  --spin: 5deg;
  --duration: 14s;
  --delay: -3s;
}

.crime-backdrop__icon:nth-child(2) {
  top: 15%;
  right: 11%;
  --size: 78px;
  --tilt: 14deg;
  --drift-x: -10px;
  --drift-y: 8px;
  --spin: -5deg;
  --duration: 16s;
  --delay: -9s;
}

.crime-backdrop__icon:nth-child(3) {
  bottom: 16%;
  left: 14%;
  --size: 76px;
  --tilt: 8deg;
  --drift-x: -6px;
  --drift-y: -10px;
  --spin: -4deg;
  --duration: 12s;
  --delay: -6s;
}

.crime-backdrop__icon:nth-child(4) {
  right: 10%;
  bottom: 18%;
  --size: 90px;
  --tilt: -10deg;
  --drift-x: 10px;
  --drift-y: -8px;
  --spin: 5deg;
  --duration: 15s;
  --delay: -11s;
}

.crime-backdrop__icon:nth-child(5) {
  top: 49%;
  left: 3%;
  --size: 94px;
  --tilt: 18deg;
  --drift-x: 6px;
  --drift-y: 10px;
  --spin: -5deg;
  --duration: 11s;
  --delay: -7s;
}

.crime-backdrop__icon:nth-child(6) {
  top: 48%;
  right: 3%;
  --size: 78px;
  --tilt: -18deg;
  --drift-x: -8px;
  --drift-y: -6px;
  --spin: 4deg;
  --duration: 13s;
  --delay: -2s;
}

.crime-backdrop__icon:nth-child(7) {
  top: 8%;
  left: 48%;
  --size: 78px;
  --tilt: -12deg;
  --drift-x: 6px;
  --drift-y: -8px;
  --spin: 4deg;
  --duration: 16s;
  --delay: -5s;
}

@keyframes crime-weightless {
  0%, 100% {
    transform: translate3d(0, 0, 0) rotate(var(--tilt));
  }
  50% {
    transform: translate3d(var(--drift-x), var(--drift-y), 0) rotate(calc(var(--tilt) + var(--spin)));
  }
}

[data-background-paused='true'] .crime-backdrop__icon {
  animation-play-state: paused;
}

@media (max-width: 760px) {
  .crime-backdrop::before {
    background-size: 585px 360px;
    background-position: -44px 0;
    mask-image: radial-gradient(ellipse 230px 330px at 50% 50%, #0000 35%, #0008 83%, #000 120%);
  }

  .crime-backdrop__icon {
    width: 48px;
    height: 48px;
    opacity: 0.24;
  }
  .crime-backdrop__icon:nth-child(1) {
    top: 8%;
  }

  .crime-backdrop__icon:nth-child(2),
  .crime-backdrop__icon:nth-child(3),
  .crime-backdrop__icon:nth-child(4) {
    display: none;
  }

  .crime-backdrop__icon:nth-child(5) {
    top: 8%;
    right: 9%;
    left: auto;
  }

  .crime-backdrop__icon:nth-child(6) {
    top: auto;
    bottom: 7%;
    left: 9%;
    right: auto;
  }

  .crime-backdrop__icon:nth-child(7) {
    top: auto;
    bottom: 7%;
    right: 9%;
    left: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .crime-backdrop__icon {
    animation: none;
  }
}

@media (forced-colors: active) {
  .crime-backdrop {
    display: none;
  }
}
