:root {
  --loader-bg: #000;
  --loader-muted: rgba(255, 255, 255, 0.5);
  --loader-track: rgba(255, 255, 255, 0.08);
  --loader-glow: rgba(255, 255, 255, 0.15);
  --loader-accent-start: #f97316;
  --loader-accent-end: #22d3ee;
}

#site-preloader {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--loader-bg);
  color: #fff;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  z-index: 9999;
  overflow: hidden;
}

#site-preloader::before {
  content: "";
  position: absolute;
  width: 120vw;
  height: 120vw;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08), transparent 65%);
  animation: subtle-spin 18s linear infinite;
}

#site-preloader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-wrapper {
  width: min(480px, calc(100vw - 3rem));
  padding: 3rem 2.5rem;
  border-radius: 32px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(12px);
  text-align: left;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.75);
}

.loader-kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.7em;
  font-size: 0.8rem;
  color: var(--loader-muted);
}

.loader-headline {
  margin: 1rem 0 2rem;
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  font-weight: 600;
  line-height: 1.3;
}

.loader-progress {
  position: relative;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: var(--loader-track);
  overflow: hidden;
  box-shadow: 0 0 20px var(--loader-glow);
}

.loader-progress__bar {
  position: absolute;
  inset: 0;
  transform: scaleX(0);
  transform-origin: left;
  background: linear-gradient(90deg, var(--loader-accent-start), var(--loader-accent-end));
  box-shadow: 0 0 30px rgba(34, 211, 238, 0.4);
  transition: transform 0.2s ease-out;
}

.loader-percent {
  margin: 0.8rem 0 0;
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
}

.loader-caption {
  margin: 1.5rem 0 0;
  font-size: 0.9rem;
  color: var(--loader-muted);
}

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