body {
  min-height: 100vh;
  position: relative;
  margin: 0;
  overflow: hidden;
  perspective: 1000px;
  background: #123;
}

.donuts {
  width: 400px;
  height: 400px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotateX(70deg);
  transform-style: preserve-3d;
}

.donut {
  --color: #c9c;
  width: 100%;
  height: 100%;
  position: absolute;
  transform-style: preserve-3d;
  transform:  translateZ(var(--stack));
  animation: moveDisc 12s linear infinite;


  & i {
    --modifier: 1;
    --discColor: hsl(from var(--color) h s calc(l * var(--modifier)));
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-sizing: border-box;
    border: 50px solid var(--discColor);

    &:nth-child(2) { transform: translateZ(  5px) scale(0.992); }
    &:nth-child(3) { transform: translateZ( 10px) scale(0.975); }
    &:nth-child(4) { transform: translateZ( 15px) scale(0.95); }
    &:nth-child(5) { transform: translateZ( 20px) scale(0.88); }
    &:nth-child(6) { transform: translateZ( -5px) scale(0.992); }
    &:nth-child(7) { transform: translateZ(-10px) scale(0.975); }
    &:nth-child(8) { transform: translateZ(-15px) scale(0.95); }
    &:nth-child(9) { transform: translateZ(-20px) scale(0.88); }
  }
}

.donut:nth-of-type(2) {
  --color: #9cf;
  animation-delay: -3s;
}

.donut:nth-of-type(3) {
  --color: #6c8;
  animation-delay: -6s;
}

.donut:nth-of-type(4) {
  --color: #fc6;
  animation-delay: -9s;
}

@keyframes moveDisc {
  0%, 100% { transform:  translateZ(-100px) scale(1); }
  10%, 20% { transform:  translateZ(0px) scale(1); }
  30%, 40% {  transform:  translateZ(100px) scale(1); }
  50% { transform:  translateZ(100px) scale(1.65); }
  70%, 80% {  transform:  translateZ(-100px) scale(1.65); }
  90% {  transform:  translateZ(-100px) scale(1);}
}
