/* Pásame's splash background: --paper of brands/pasame.css in its light, dark and contrast themes. */
:root { --boot-paper: #faf7f0; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="contrast"]) { --boot-paper: #16110e; }
}
:root[data-theme="dark"] { --boot-paper: #16110e; }
:root[data-theme="contrast"] { --boot-paper: #ffffff; }
@media (prefers-contrast: more) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) { --boot-paper: #ffffff; }
}

/* Boot splash: index.html's #boot, shown by boot.js from the first paint until the app is drawn
 * with its stylesheets and fonts. Without it the page showed the app for a moment in the browser's
 * default font (Dioxus links the app's stylesheets from the wasm, after the first render).
 * Copied to /boot/ of every app by scripts/add-boot-splash.mjs, after the brand's colour block
 * (brand-<brand>.css). Nothing happens without the `booting` class, so without JavaScript (or
 * without these files, as in `dx serve`) the page behaves as if there were no splash.
 */

#boot { display: none; }

.booting #boot,
.boot-fading #boot {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: var(--boot-paper);
}
.booting body { background: var(--boot-paper); }
.booting #main { visibility: hidden; }

/* The brand's mark, the size of the Android loading screen. */
#boot img { width: auto; height: 6.5rem; }

/* Slow networks: after a moment the mark breathes, so the page doesn't look frozen. */
.booting #boot img { animation: boot-breathe 1.6s ease-in-out 0.8s infinite; }
@keyframes boot-breathe {
  50% { opacity: 0.55; transform: scale(0.94); }
}

/* Ready: the app shows under the splash, which fades out (boot.js removes it afterwards). */
.boot-fading #boot { opacity: 0; pointer-events: none; transition: opacity 0.25s ease-out; }

@media (prefers-reduced-motion: reduce) {
  .booting #boot img { animation: none; }
  .boot-fading #boot { transition: none; }
}
