/* Boot splash — loaded before Vue bundle for instant first paint */

#boot-splash {
  --splash-bg: #1a1a2e;
  --splash-text: #f0e6d8;
  --splash-muted: #9a8f82;
  --splash-coral: #e8725c;
  --splash-amber: #f5a623;
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--splash-bg);
  color: var(--splash-text);
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  transition:
    opacity 0.65s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}

html[data-theme='light'] #boot-splash {
  --splash-bg: #f4f1ea;
  --splash-text: #1a1a2e;
  --splash-muted: #6b6578;
}

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

#boot-splash.boot-splash--exit .boot-splash__content {
  transform: scale(1.04);
  opacity: 0;
}

/* Ambient orbs */
.boot-splash__bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.boot-splash__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  opacity: 0.32;
  animation: bootOrbDrift 16s ease-in-out infinite;
}

.boot-splash__orb--1 {
  width: 280px;
  height: 280px;
  top: -8%;
  left: -6%;
  background: #e8725c;
  animation-delay: 0s;
}

.boot-splash__orb--2 {
  width: 220px;
  height: 220px;
  top: 58%;
  right: -4%;
  background: #f5a623;
  animation-delay: -4s;
}

.boot-splash__orb--3 {
  width: 180px;
  height: 180px;
  bottom: 8%;
  left: 18%;
  background: #9b8ec4;
  animation-delay: -8s;
}

.boot-splash__orb--4 {
  width: 140px;
  height: 140px;
  top: 22%;
  right: 22%;
  background: #4ecdc4;
  animation-delay: -12s;
}

@keyframes bootOrbDrift {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(28px, -18px) scale(1.06);
  }
  66% {
    transform: translate(-16px, 22px) scale(0.94);
  }
}

/* Emotion spectrum bar */
.boot-splash__spectrum {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  height: 5px;
  opacity: 0.85;
}

.boot-splash__spectrum span {
  flex: 1;
  transform-origin: bottom;
  animation: bootSpectrumPulse 2.4s ease-in-out infinite;
}

.boot-splash__spectrum span:nth-child(1) {
  background: #ffd166;
  animation-delay: 0s;
}
.boot-splash__spectrum span:nth-child(2) {
  background: #ef476f;
  animation-delay: 0.15s;
}
.boot-splash__spectrum span:nth-child(3) {
  background: #e8725c;
  animation-delay: 0.3s;
}
.boot-splash__spectrum span:nth-child(4) {
  background: #118ab2;
  animation-delay: 0.45s;
}
.boot-splash__spectrum span:nth-child(5) {
  background: #7b68ee;
  animation-delay: 0.6s;
}
.boot-splash__spectrum span:nth-child(6) {
  background: #06d6a0;
  animation-delay: 0.75s;
}
.boot-splash__spectrum span:nth-child(7) {
  background: #4ecdc4;
  animation-delay: 0.9s;
}
.boot-splash__spectrum span:nth-child(8) {
  background: #ff6b9d;
  animation-delay: 1.05s;
}

@keyframes bootSpectrumPulse {
  0%,
  100% {
    transform: scaleY(1);
    opacity: 0.7;
  }
  50% {
    transform: scaleY(1.8);
    opacity: 1;
  }
}

/* Center content */
.boot-splash__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 24px;
  text-align: center;
  transition:
    transform 0.55s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.45s ease;
}

.boot-splash__logo-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  margin-bottom: 28px;
  animation: bootLogoReveal 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.boot-splash__logo-ring {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    #ffd166,
    #e8725c,
    #f5a623,
    #9b8ec4,
    #4ecdc4,
    #ffd166
  );
  opacity: 0.55;
  animation: bootRingSpin 4s linear infinite;
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
}

.boot-splash__logo-glow {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 166, 35, 0.35) 0%, transparent 70%);
  animation: bootGlowPulse 2.2s ease-in-out infinite;
}

.boot-splash__logo {
  position: relative;
  z-index: 1;
  width: 72px;
  height: 72px;
  margin: 12px;
  object-fit: contain;
  filter: drop-shadow(0 4px 24px rgba(245, 166, 35, 0.35));
}

.boot-splash__title {
  margin: 0 0 10px;
  font-family: 'Playfair Display', 'Noto Serif SC', Georgia, serif;
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.2;
  background: linear-gradient(135deg, var(--splash-text) 30%, var(--splash-coral) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: bootFadeUp 0.7s ease 0.15s both;
}

html[data-theme='light'] .boot-splash__title {
  background: linear-gradient(135deg, #1a1a2e 20%, #c4553f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.boot-splash__tagline {
  margin: 0 0 16px;
  font-size: clamp(0.95rem, 2.8vw, 1.08rem);
  font-weight: 300;
  color: var(--splash-muted);
  letter-spacing: 0.12em;
  animation: bootFadeUp 0.7s ease 0.35s both;
}

.boot-splash__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.82rem;
  color: var(--splash-muted);
  opacity: 0.75;
  letter-spacing: 0.08em;
  animation: bootFadeUp 0.7s ease 0.55s both;
}

.boot-splash__brand-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f3f06c, #dc6906);
  flex-shrink: 0;
  animation: bootDotPulse 1.8s ease-in-out infinite;
}

@keyframes bootLogoReveal {
  from {
    opacity: 0;
    transform: scale(0.72) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

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

@keyframes bootRingSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes bootGlowPulse {
  0%,
  100% {
    opacity: 0.6;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

@keyframes bootDotPulse {
  0%,
  100% {
    opacity: 0.6;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.25);
  }
}

@media (prefers-reduced-motion: reduce) {
  #boot-splash,
  #boot-splash *,
  #boot-splash *::before,
  #boot-splash *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }

  .boot-splash__logo-wrap,
  .boot-splash__title,
  .boot-splash__tagline,
  .boot-splash__brand {
    opacity: 1;
    transform: none;
  }
}
