body {
  background-color: rgb(var(--color-portal-500, 255, 255, 255));
}

.global-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  z-index: 9990;
  inset: 0;
  transition: all 200ms cubic-bezier(1, 0.5, 0.8, 1);
  pointer-events: none;
  overflow: hidden;
}

.global-loader__bg {
  content: '';
  position: absolute;
  background-color: rgb(var(--color-portal-500));
  inset: 0;
  z-index: -1;
}

.global-loader__content {
  display: flex;
  flex-direction: column;
  row-gap: 12px;
  transition: all 300ms cubic-bezier(1, 0.5, 0.8, 1);
}

.global-loader__progress,
.global-loader__progress:before {
  height: 4px;
  border-radius: 4px;
}

.global-loader__progress {
  position: relative;
  background-color: theme('colors.mist.DEFAULT / 0.3');
  box-shadow:
    0 0 0 0 rgba(0, 0, 0, 0.2),
    0 0 0 0 rgba(0, 0, 0, 0.14),
    0 0 0 0 rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.global-loader__progress:before {
  content: '';
  position: absolute;
  inset: 0;
  background-color: rgb(var(--color-mist-500));
  transform: translateX(-100%);
  animation: 300ms load ease-in forwards;
  transition: transform 100ms ease-out;
}

.global-loader--complete {
  opacity: 0;
  transition-delay: 300ms;
}

.global-loader--complete .global-loader__progress:before {
  animation: 300ms full-load ease-in forwards;
}

.global-loader--complete .global-loader__content {
  transition-delay: 200ms;
  transform: translateY(-10px);
  opacity: 0;
}

@keyframes load {
  to {
    transform: translateX(-20%);
  }
}

@keyframes full-load {
  from {
    transform: translateX(-20%);
  }
  to {
    transform: translateX(0%);
  }
}
