/* Initial loader - only shows after 500ms delay */
#initial-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--background);
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms linear;
}
#initial-loader.visible {
  opacity: 1;
}

/* Orbit spinner */
.loader {
  width: calc(100px - 24px);
  height: 50px;
  position: relative;
  animation: flippx 2s infinite linear;
}
.loader::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  transform-origin: -24px 50%;
  animation: spin 1s infinite linear;
}
.loader::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: var(--primary);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  /* Prevent flicker from parent scaleX flip */
  backface-visibility: hidden;
}
@keyframes flippx {
  0%,
  49.999% {
    transform: scaleX(1);
  }
  50%,
  100% {
    transform: scaleX(-1);
  }
}
@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}
