:root {
  --boot-bg: #08090b;
  --boot-accent: #c9a227;
  --boot-accent-soft: #e0c15a;
  --boot-white: #f5f5f5;
  --boot-muted: #a3a8b0;
}

html.booting,
html.booting body {
  background: var(--boot-bg);
}

#boot-loader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--boot-bg);
  transition:
    opacity 700ms cubic-bezier(0.22, 1, 0.36, 1),
    visibility 700ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

#boot-loader::before {
  content: '';
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle at 50% 42%, rgba(201, 162, 39, 0.16), transparent 42%),
    radial-gradient(circle at 80% 20%, rgba(245, 245, 245, 0.04), transparent 28%);
  animation: boot-glow 2.4s ease-in-out infinite alternate;
  pointer-events: none;
}

#boot-loader::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    115deg,
    transparent 35%,
    rgba(245, 245, 245, 0.045) 48%,
    transparent 62%
  );
  transform: translateX(-120%);
  animation: boot-sheen 2.2s ease-in-out 0.35s infinite;
  pointer-events: none;
}

#boot-loader.is-leaving {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(1.04);
}

#boot-loader.is-leaving .boot-stage {
  opacity: 0;
  transform: translateY(-12px) scale(0.98);
}

.boot-stage {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
  padding: 1.5rem;
  text-align: center;
  transition:
    opacity 450ms ease,
    transform 450ms ease;
}

.boot-emblem {
  position: relative;
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
}

.boot-emblem__ring {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(201, 162, 39, 0.55);
  border-radius: 50%;
  animation: boot-ring 1.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.boot-emblem__ring--outer {
  inset: -10px;
  border-color: rgba(245, 245, 245, 0.14);
  animation-delay: 0.12s;
}

.boot-emblem__mark {
  width: 58px;
  height: 58px;
  color: var(--boot-accent-soft);
  filter: drop-shadow(0 0 22px rgba(201, 162, 39, 0.42));
  animation: boot-mark 1.1s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

.boot-emblem__mark path:not(.boot-emblem__fill) {
  stroke-dasharray: 140;
  stroke-dashoffset: 140;
  animation: boot-draw 1.15s ease forwards 0.2s;
}

.boot-emblem__fill {
  animation: boot-fill 0.9s ease forwards 0.35s;
  opacity: 0;
}

@keyframes boot-fill {
  from {
    opacity: 0;
    transform: scale(0.86);
    transform-origin: center;
  }
  to {
    opacity: 0.2;
    transform: scale(1);
    transform-origin: center;
  }
}

.boot-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  font-family: 'Manrope', system-ui, sans-serif;
}

.boot-brand__name {
  margin: 0;
  font-size: clamp(1.45rem, 4.4vw, 2rem);
  font-weight: 800;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  text-transform: uppercase;
  color: var(--boot-white);
  text-shadow: 0 0 28px rgba(245, 245, 245, 0.12);
  animation: boot-rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}

.boot-brand__tag {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-indent: 0.24em;
  text-transform: uppercase;
  color: var(--boot-muted);
  animation: boot-rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.35s both;
}

.boot-progress {
  width: min(220px, 58vw);
  height: 2px;
  margin-top: 0.35rem;
  overflow: hidden;
  background: rgba(245, 245, 245, 0.08);
  border-radius: 999px;
  animation: boot-rise 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.45s both;
}

.boot-progress__bar {
  width: 100%;
  height: 100%;
  transform-origin: left center;
  transform: scaleX(0);
  background: linear-gradient(
    90deg,
    var(--boot-accent),
    var(--boot-accent-soft),
    var(--boot-accent)
  );
  background-size: 200% 100%;
  animation:
    boot-progress 1.65s cubic-bezier(0.22, 1, 0.36, 1) 0.55s forwards,
    boot-progress-shine 1.2s linear 0.55s infinite;
  box-shadow: 0 0 16px rgba(201, 162, 39, 0.45);
}

.boot-caption {
  margin: 0;
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  text-transform: uppercase;
  color: rgba(163, 168, 176, 0.8);
  animation: boot-rise 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.55s both;
}

@keyframes boot-glow {
  from {
    opacity: 0.65;
    transform: scale(1);
  }
  to {
    opacity: 1;
    transform: scale(1.05);
  }
}

@keyframes boot-sheen {
  0%,
  35% {
    transform: translateX(-120%);
  }
  70%,
  100% {
    transform: translateX(120%);
  }
}

@keyframes boot-ring {
  from {
    opacity: 0;
    transform: scale(0.72);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes boot-mark {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes boot-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes boot-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes boot-progress {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes boot-progress-shine {
  from {
    background-position: 0% 50%;
  }
  to {
    background-position: 200% 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  #boot-loader::before,
  #boot-loader::after,
  .boot-emblem__ring,
  .boot-emblem__mark,
  .boot-emblem__mark path,
  .boot-emblem__fill,
  .boot-brand__name,
  .boot-brand__tag,
  .boot-progress,
  .boot-progress__bar,
  .boot-caption {
    animation: none !important;
  }

  .boot-emblem__mark path:not(.boot-emblem__fill) {
    stroke-dashoffset: 0;
  }

  .boot-emblem__fill {
    opacity: 0.2;
  }

  .boot-progress__bar {
    transform: scaleX(1);
  }

  #boot-loader,
  #boot-loader.is-leaving .boot-stage {
    transition-duration: 0.01ms;
  }
}
