html,
body {
  margin: 0;
}

#boot-splash {
  --boot-bg: #070b11;
  --boot-bg-glow: rgb(37 99 235 / 17%);
  --boot-text: #f8fafc;
  --boot-faint: #303a47;
  --boot-muted: #6b7788;
  --boot-subtle: #475569;
  --boot-accent: #60a5fa;
  --boot-accent-soft: #93c5fd;
  --boot-grid: rgb(148 163 184 / 6%);
  --boot-divider: rgb(96 165 250 / 48%);
  --boot-track: #1a2330;
  --boot-glow: rgb(96 165 250 / 28%);
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--boot-text);
  background:
    radial-gradient(circle at 50% 34%, var(--boot-bg-glow), transparent 38%),
    radial-gradient(circle at 50% 115%, rgb(37 99 235 / 8%), transparent 46%),
    var(--boot-bg);
  font-family:
    'Public Sans', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei',
    'Noto Sans SC', system-ui, sans-serif;
  isolation: isolate;
  opacity: 1;
  transition:
    opacity 0.55s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0s linear 0.55s;
}

#boot-splash::before {
  content: '';
  position: absolute;
  inset: -18%;
  z-index: 0;
  background-image:
    linear-gradient(var(--boot-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--boot-grid) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 50% 48%, #000 0, transparent 62%);
  animation: bootGridIn 1.4s ease 0.08s both;
  pointer-events: none;
}

#boot-splash::after {
  content: '';
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: -36%;
  z-index: 1;
  width: 34%;
  background: linear-gradient(
    90deg,
    transparent,
    rgb(96 165 250 / 7%),
    transparent
  );
  transform: skewX(-12deg);
  animation: bootSweep 4.8s ease-in-out 0.35s infinite;
  pointer-events: none;
}

.boot-splash__aura {
  position: absolute;
  z-index: 0;
  width: min(72vw, 760px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, var(--boot-glow), transparent 64%);
  filter: blur(18px);
  animation: bootAura 4.2s ease-in-out 0.2s infinite;
  pointer-events: none;
}

.boot-splash__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px;
  text-align: center;
  animation: bootContentIn 0.62s cubic-bezier(0.22, 1, 0.36, 1) 0.06s both;
}

.boot-splash__wordmark {
  display: flex;
  align-items: baseline;
  gap: 0.12em;
  margin: 0;
  color: var(--boot-text);
  font-size: clamp(2.75rem, 8.4vw, 5.7rem);
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.04;
  text-transform: uppercase;
  white-space: nowrap;
}

.boot-splash__word {
  display: flex;
  gap: 0.04em;
}

.boot-splash__char {
  display: inline-block;
  color: var(--boot-faint);
  text-shadow: none;
  transform: translateY(3px);
  animation: bootCharOn 0.76s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(0.22s + var(--char-index) * 0.07s);
}

.boot-splash__divider {
  width: 78px;
  height: 1px;
  margin-top: 22px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--boot-accent) 38%,
    var(--boot-accent-soft) 62%,
    transparent
  );
  opacity: 0;
  animation: bootDividerOn 0.72s ease 0.58s forwards;
}

.boot-splash__system {
  margin: 17px 0 0;
  color: var(--boot-muted);
  font-size: clamp(0.95rem, 1.8vw, 1.2rem);
  font-weight: 600;
  letter-spacing: 0.28em;
  line-height: 1.5;
  text-indent: 0.28em;
  opacity: 0;
  animation: bootSystemOn 0.8s ease 0.54s forwards;
}

.boot-splash__meter {
  position: relative;
  width: 184px;
  height: 2px;
  margin-top: 38px;
  overflow: hidden;
  background: var(--boot-track);
  border-radius: 999px;
}

.boot-splash__meter span {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 38%;
  background: linear-gradient(90deg, transparent, #60a5fa 42%, #dbeafe);
  border-radius: inherit;
  box-shadow: 0 0 14px var(--boot-glow);
  animation: bootMeter 1.3s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

.boot-splash__hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 15px 0 0;
  color: var(--boot-muted);
  font-size: 11px;
  letter-spacing: 0.13em;
}

.boot-splash__hint::before {
  content: '';
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  background: var(--boot-accent);
  border-radius: 50%;
  box-shadow: 0 0 0 0 var(--boot-glow);
  animation: bootPulse 1.8s ease-out infinite;
}

.boot-splash__meta {
  position: absolute;
  right: 0;
  bottom: max(28px, env(safe-area-inset-bottom, 0px) + 16px);
  left: 0;
  z-index: 2;
  margin: 0;
  color: var(--boot-subtle);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-align: center;
  text-indent: 0.3em;
}

.boot-splash__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

#boot-splash ~ #root {
  min-height: 100vh;
  opacity: 0;
  transition: opacity 0.55s ease 0.1s;
}

html.app-ready #boot-splash {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

html.app-ready #boot-splash ~ #root {
  opacity: 1;
}

@keyframes bootGridIn {
  from {
    opacity: 0;
    transform: scale(1.04);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes bootContentIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bootCharOn {
  0% {
    color: var(--boot-faint);
    text-shadow: none;
    transform: translateY(3px);
  }
  36% {
    color: var(--boot-accent-soft);
    text-shadow: 0 0 28px var(--boot-glow);
    transform: translateY(0);
  }
  100% {
    color: var(--boot-text);
    text-shadow: 0 0 16px var(--boot-glow);
    transform: translateY(0);
  }
}

@keyframes bootDividerOn {
  from {
    opacity: 0;
    transform: scaleX(0.24);
  }
  to {
    opacity: 1;
    transform: scaleX(1);
  }
}

@keyframes bootSystemOn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bootAura {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(0.94);
  }
  50% {
    opacity: 1;
    transform: scale(1.06);
  }
}

@keyframes bootSweep {
  0% {
    opacity: 0;
    transform: translateX(0) skewX(-12deg);
  }
  18% {
    opacity: 1;
  }
  72% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(430%) skewX(-12deg);
  }
}

@keyframes bootMeter {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(365%);
  }
}

@keyframes bootPulse {
  0% {
    box-shadow: 0 0 0 0 var(--boot-glow);
  }
  70% {
    box-shadow: 0 0 0 7px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

@media (max-width: 600px) {
  .boot-splash__content {
    padding: 24px 16px;
  }

  .boot-splash__wordmark {
    gap: 0.1em;
    font-size: clamp(2.35rem, 12.8vw, 3.6rem);
  }

  .boot-splash__divider {
    width: 60px;
    margin-top: 18px;
  }

  .boot-splash__system {
    margin-top: 14px;
    font-size: clamp(0.82rem, 4vw, 1rem);
    letter-spacing: 0.22em;
    text-indent: 0.22em;
  }

  .boot-splash__meter {
    width: 156px;
    margin-top: 32px;
  }

  .boot-splash__meta {
    bottom: max(20px, env(safe-area-inset-bottom, 0px) + 12px);
    font-size: 8px;
    letter-spacing: 0.22em;
    text-indent: 0.22em;
  }
}

@media (prefers-reduced-motion: reduce) {
  #boot-splash,
  #boot-splash::before,
  #boot-splash::after,
  .boot-splash__aura,
  .boot-splash__content,
  .boot-splash__divider,
  .boot-splash__system,
  .boot-splash__char,
  .boot-splash__meter span,
  .boot-splash__hint::before {
    animation: none;
  }

  #boot-splash::after,
  .boot-splash__aura {
    opacity: 0;
  }

  .boot-splash__char {
    color: var(--boot-text);
    text-shadow: none;
    transform: none;
  }

  .boot-splash__divider,
  .boot-splash__system {
    opacity: 1;
    transform: none;
  }

  .boot-splash__meter span {
    width: 100%;
    opacity: 0.45;
    transform: none;
  }

  #boot-splash,
  #boot-splash ~ #root {
    transition-duration: 0.01s;
  }
}
