/*
 * Splash (boot "Loading…", auth "Signing in/out…"). A static file linked from index.html, not part of the bundle: the
 * boot splash paints before main.ts runs, when neither the app CSS nor the kit tokens exist yet — and the strict CSP
 * (style-src 'self') refuses an inline <style>. Each colour reads the kit token once it is loaded, with the clay theme
 * value as the fallback for the pre-mount paint.
 */
:root {
  --ws-splash-canvas: #f5f5f5;
  --ws-splash-ink: #41362b;
  --ws-splash-faint: #746554;
  --ws-splash-accent: #a84e2f;
  --ws-splash-track: rgb(168 78 47 / 14%);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ws-splash-canvas: #16110e;
    --ws-splash-ink: #efe6d8;
    --ws-splash-faint: #9d8d79;
    --ws-splash-accent: #e07b55;
    --ws-splash-track: rgb(224 123 85 / 18%);
  }
}

/* No white flash in dark mode before Vuetify paints its own canvas over the body. */
body {
  margin: 0;
  background: var(--fx-canvas, var(--ws-splash-canvas));
}

.ws-splash {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px;
  box-sizing: border-box;
  font-family: var(--fx-font, "Manrope Variable", "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif);
  color: var(--fx-ink-faint, var(--ws-splash-faint));
}

/* Boot only: fade in after a beat so a warm-cache load never flashes the splash. */
.ws-splash--boot {
  animation: ws-splash-in 240ms ease-out 150ms both;
}

.ws-splash__logo {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--fx-ink, var(--ws-splash-ink));
}

.ws-splash__logo span {
  color: var(--fx-accent, var(--ws-splash-accent));
}

.ws-splash__spinner {
  width: 28px;
  height: 28px;
  margin-top: 18px;
  border: 3px solid var(--fx-accent-soft, var(--ws-splash-track));
  border-top-color: var(--fx-accent, var(--ws-splash-accent));
  border-radius: 50%;
  animation: ws-splash-spin 800ms linear infinite;
}

.ws-splash__status {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* Slowed, not stopped: the ring is the only sign the app is still working. */
@media (prefers-reduced-motion: reduce) {
  .ws-splash__spinner {
    animation-duration: 2.4s;
  }

  .ws-splash--boot {
    animation: none;
  }
}

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

@keyframes ws-splash-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}
