body {
  margin: 0;
}

html {
  overflow: hidden scroll;
}

#loading-bg {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--initial-loader-bg, #fff);
  block-size: 100%;
  inline-size: 100%;
  overflow: hidden;
}

/* Subtle radial glow behind the mascot */
#loading-bg::before {
  content: '';
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--initial-loader-color, #3a9d5c) 12%, transparent) 0%,
    transparent 70%
  );
  animation: glow-pulse 3s ease-in-out infinite;
}

/* Container for mascot + orbit system */
.loading-stage {
  position: relative;
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Parrot mascot */
.loading-logo {
  position: relative;
  z-index: 2;
  animation: breathe 3s ease-in-out infinite;
  filter: drop-shadow(0 8px 24px rgba(58, 157, 92, 0.2));
}

.loading-logo img {
  display: block;
  width: 72px;
  height: auto;
}

/* Orbit ring — the track the dots follow */
.orbit-ring {
  position: absolute;
  inset: 0;
  animation: orbit-spin 4s linear infinite;
}

/* Each orbiting dot */
.orbit-dot {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--initial-loader-color, #3a9d5c);
  filter: blur(0.5px);
}

.orbit-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: var(--initial-loader-color, #3a9d5c);
  opacity: 0.25;
  filter: blur(4px);
}

/* Position dots evenly around the elliptical path */
.orbit-dot:nth-child(1) {
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  opacity: 1;
}

.orbit-dot:nth-child(2) {
  bottom: 12%;
  right: 4%;
  opacity: 0.7;
}

.orbit-dot:nth-child(3) {
  bottom: 12%;
  left: 4%;
  opacity: 0.4;
}

/* Brand text */
.loading-text {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 2;
}

.loading-brand {
  font-family: 'Poppins', sans-serif;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: color-mix(in srgb, var(--initial-loader-color, #3a9d5c) 85%, #000);
  animation: text-fade-in 0.8s ease-out both;
}

.loading-tagline {
  font-family: 'Inter', 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--initial-loader-color, #3a9d5c) 50%, #999);
  animation: text-fade-in 0.8s ease-out 0.2s both;
}

/* Progress bar */
.loading-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
}

.loading-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(
    90deg,
    transparent,
    var(--initial-loader-color, #3a9d5c),
    transparent
  );
  animation: progress-sweep 2s ease-in-out infinite;
}

/* ──────── Animations ──────── */

@keyframes breathe {
  0%, 100% {
    transform: scale(1) translateY(0);
  }
  50% {
    transform: scale(1.04) translateY(-3px);
  }
}

@keyframes glow-pulse {
  0%, 100% {
    opacity: 0.6;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

@keyframes orbit-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes text-fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes progress-sweep {
  0% {
    width: 0%;
    margin-left: 0%;
  }
  50% {
    width: 40%;
    margin-left: 30%;
  }
  100% {
    width: 0%;
    margin-left: 100%;
  }
}
