/* The launch splash in index.html: shown from the first paint (before any JS), removed by src/lib/splash.ts once the
   app has something to show. A static file (not inline) so the CSP stays style-src 'self'. The CSS animation at the
   end is the hard cap: even if the app never starts, the splash fades away and stops covering the page. */
#splash {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  background: #f2f5f9;
  padding: env(safe-area-inset-top, 0px) 16px env(safe-area-inset-bottom, 0px);
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
  animation: splash-cap 0.4s ease 6s forwards;
}
:root[data-theme="dark"] #splash { background: #0d1117; }
#splash .splash-mark {
  width: 104px; height: 104px; display: block;
  filter: drop-shadow(0 10px 24px rgb(29 78 216 / 28%));
  animation: splash-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both, splash-breathe 2.4s ease-in-out 0.5s infinite;
}
:root[data-theme="dark"] #splash .splash-mark { filter: drop-shadow(0 10px 28px rgb(59 130 246 / 30%)); }
#splash .splash-mark .spark { transform-box: fill-box; transform-origin: center; animation: splash-twinkle 2.4s ease-in-out 0.5s infinite; }
#splash .splash-word { width: 188px; height: auto; display: block; animation: splash-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) 0.12s both; }
#splash .wm-1 { fill: #111a22; }
#splash .wm-2 { fill: #1d4ed8; }
:root[data-theme="dark"] #splash .wm-1 { fill: #eaf1f2; }
:root[data-theme="dark"] #splash .wm-2 { fill: #93c5fd; }
#splash.splash-out { opacity: 0; visibility: hidden; pointer-events: none; }

@keyframes splash-in { from { opacity: 0; transform: translateY(6px) scale(0.94); } to { opacity: 1; transform: none; } }
@keyframes splash-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035); } }
@keyframes splash-twinkle { 0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; } 50% { transform: scale(0.78) rotate(45deg); opacity: 0.85; } }
@keyframes splash-cap { to { opacity: 0; visibility: hidden; pointer-events: none; } }

@media (prefers-reduced-motion: reduce) {
  #splash { transition: none; }
  #splash .splash-mark, #splash .splash-mark .spark, #splash .splash-word { animation: none; }
}
