/* Inline pre-loader served before the JS bundle, so the very first paint
   shows the Azoma boot loader instead of a blank page. Mirrors the React
   <AzomaBootLoader /> visually so the swap at mount is seamless. */

#az-preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: hsl(0 0% 99%);
  color: hsl(0 0% 9%);
  font-family:
    'Inter',
    ui-sans-serif,
    system-ui,
    -apple-system,
    'Segoe UI',
    sans-serif;
}

html.dark #az-preloader {
  background: radial-gradient(
    ellipse 80% 60% at 50% 40%,
    hsl(0 0% 18%),
    hsl(0 0% 4%) 70%
  );
  color: hsl(0 0% 98%);
}

#az-preloader .az-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding: 24px;
}

#az-preloader .az-shimmer-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  --az-mark: url(/azoma-mark.png);
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.08));
}

#az-preloader .az-shimmer-base,
#az-preloader .az-shimmer-sweep,
#az-preloader .az-shimmer-inv {
  position: absolute;
  inset: 0;
  -webkit-mask: var(--az-mark) center / contain no-repeat;
  mask: var(--az-mark) center / contain no-repeat;
}

#az-preloader .az-shimmer-base {
  background: linear-gradient(
    135deg,
    #1a1a1a 0%,
    #6e6e6e 30%,
    #d4d4d4 50%,
    #6e6e6e 70%,
    #1a1a1a 100%
  );
  background-size: 220% 220%;
  animation: az-shimmer-pan 4.5s ease-in-out infinite;
}

#az-preloader .az-shimmer-sweep {
  background: linear-gradient(
    115deg,
    transparent 30%,
    rgba(255, 255, 255, 0) 42%,
    rgba(255, 255, 255, 0.85) 50%,
    rgba(255, 255, 255, 0) 58%,
    transparent 70%
  );
  background-size: 250% 250%;
  background-position: 200% 200%;
  animation: az-shimmer-sweep 2.6s cubic-bezier(0.16, 1, 0.3, 1) infinite;
  mix-blend-mode: screen;
}

#az-preloader .az-shimmer-inv {
  background: linear-gradient(135deg, #cfcfcf, #ffffff 50%, #cfcfcf);
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
}

html.dark #az-preloader .az-shimmer-inv {
  opacity: 0.18;
}

#az-preloader .az-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  letter-spacing: 0.01em;
  opacity: 0.62;
  font-variant-numeric: tabular-nums;
  min-height: 18px;
}

#az-preloader .az-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
  animation: az-dot-pulse 1.4s ease-in-out infinite;
}

#az-preloader .az-status-text {
  animation: az-status-in 450ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

#az-preloader .az-progress {
  position: relative;
  width: 220px;
  height: 2px;
  border-radius: 2px;
  background: color-mix(in oklab, currentColor 10%, transparent);
  overflow: hidden;
  margin-top: 2px;
}

#az-preloader .az-progress-bar {
  position: absolute;
  inset: 0;
  width: 38%;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.85;
  animation: az-progress-slide 1.6s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

@keyframes az-shimmer-pan {
  0%,
  100% {
    background-position: 0% 0%;
  }
  50% {
    background-position: 100% 100%;
  }
}

@keyframes az-shimmer-sweep {
  0% {
    background-position: 200% 200%;
  }
  60% {
    background-position: -100% -100%;
  }
  100% {
    background-position: -100% -100%;
  }
}

@keyframes az-dot-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.4;
  }
  50% {
    transform: scale(1.4);
    opacity: 1;
  }
}

@keyframes az-progress-slide {
  0% {
    left: -40%;
  }
  100% {
    left: 100%;
  }
}

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

@keyframes az-status-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
