#loading {
  z-index: 100000;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #000;
  opacity: 1;
  pointer-events: none;
  transition: opacity 200ms ease, visibility 0s linear 200ms;
  animation: preloader-timeout 200ms ease 900ms forwards;
}

#loading.loading-hidden {
  opacity: 0;
  visibility: hidden;
}

#loading svg {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(45deg) scale(1);
}

.stroke-still { stroke: #232323; }

.stroke-animation {
  animation: stroke-spacing 1.2s ease-in infinite, stroke-color 4.8s linear infinite;
  transform-origin: center center;
}

@keyframes preloader-timeout {
  to { opacity: 0; visibility: hidden; }
}

@keyframes stroke-spacing {
  0% { stroke-dasharray: 0 200; }
  45% { stroke-dashoffset: 0; stroke-dasharray: 200 200; }
  90%, 100% { stroke-dashoffset: -200; stroke-dasharray: 200 200; }
}

@keyframes stroke-color {
  0% { stroke: #3498db; }
  24% { stroke: #643232; }
  25%, 49% { stroke: #327864; }
  50%, 74% { stroke: #32326e; }
  75%, 99% { stroke: #78325a; }
}

@media (prefers-reduced-motion: reduce) {
  #loading {
    animation-duration: 1ms;
    animation-delay: 100ms;
    transition-duration: 1ms;
  }

  #loading .stroke-animation { animation: none; }
}
