.app-splash {
  --splash-bg: #ffffff;
  --splash-text: #335776;
  --splash-accent: #335776;
  --splash-border: rgba(51, 87, 118, 0.12);
  --splash-spinner-track: rgba(51, 87, 118, 0.1);

  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.125rem;
  z-index: 1000;
  background: var(--splash-bg);
  color: var(--splash-text);
  transition:
    background-color 0.2s ease,
    opacity 0.35s ease;
}

html[data-theme="dark"] .app-splash {
  --splash-bg: #0a121c;
  --splash-text: #e2e8f0;
  --splash-accent: #60a5fa;
  --splash-border: rgba(148, 163, 184, 0.18);
  --splash-spinner-track: rgba(148, 163, 184, 0.14);
}

.app-splash-logo {
  width: 5rem;
  height: 5rem;
  object-fit: contain;
  border-radius: 1.125rem;
  box-shadow: 0 10px 28px color-mix(in srgb, var(--splash-accent) 18%, transparent);
}

.app-splash-wordmark {
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: 1.75rem;
  line-height: 1;
  letter-spacing: -0.02em;
  user-select: none;
}

.app-splash-wordmark-myne {
  font-weight: 700;
  color: var(--splash-accent);
}

.app-splash-wordmark-chat {
  font-weight: 600;
  margin-left: 1px;
  background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.app-splash-spinner {
  position: relative;
  width: 2rem;
  height: 2rem;
  margin-top: 0.25rem;
  flex-shrink: 0;
}

.app-splash-spinner::before,
.app-splash-spinner::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid transparent;
}

.app-splash-spinner::before {
  border-color: var(--splash-spinner-track);
}

.app-splash-spinner::after {
  border-top-color: var(--splash-accent);
  border-right-color: var(--splash-accent);
  animation: app-splash-spin 0.75s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.app-splash-retry {
  margin: 0.25rem 0 0;
  padding: 0.625rem 1rem;
  max-width: min(90vw, 20rem);
  border-radius: 9999px;
  border: 1px solid var(--splash-border);
  background: color-mix(in srgb, var(--splash-bg) 88%, var(--splash-accent));
  color: var(--splash-text);
  font-size: 0.8125rem;
  line-height: 1.35;
  cursor: pointer;
}

.app-splash-hiding {
  opacity: 0;
  pointer-events: none;
}

@keyframes app-splash-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-splash-spinner::after {
    animation: none;
    border-right-color: transparent;
    border-bottom-color: transparent;
  }
}
