/* Loader. First load: five bars sort themselves, like a bubble sort pass,
   until the app has rendered its first page (html.booted). It only fades in
   after 250ms, so fast loads never see it, and it hides itself after 8s even
   if scripts fail, so the static page is never trapped behind it.
   Page changes: a slim progress bar at the top, only for slow ones. */
.boot {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-content: center; justify-items: center; gap: 10px;
  background: var(--bg); color: var(--text); pointer-events: none;
  opacity: 0; animation: boot-in 0.2s ease 0.25s forwards, boot-out 0.3s ease 8s forwards;
}
html.booted .boot { display: none; }
.boot-bars { display: flex; align-items: flex-end; gap: 6px; height: 56px; }
.boot-bars i { width: 12px; border-radius: 4px; background: var(--accent); animation: boot-sort 1.6s ease-in-out infinite; }
.boot-bars i:nth-child(1) { height: 60%; animation-delay: 0s; }
.boot-bars i:nth-child(2) { height: 100%; animation-delay: 0.12s; }
.boot-bars i:nth-child(3) { height: 35%; animation-delay: 0.24s; }
.boot-bars i:nth-child(4) { height: 80%; animation-delay: 0.36s; }
.boot-bars i:nth-child(5) { height: 50%; animation-delay: 0.48s; }
.boot-name { margin: 6px 0 0; font: 700 22px var(--display, system-ui); letter-spacing: -0.01em; }
.boot-line { margin: 0; font-size: 13.5px; color: var(--muted); }
@keyframes boot-in { to { opacity: 1; } }
@keyframes boot-out { to { opacity: 0; visibility: hidden; } }
/* Each bar is "compared": it lifts, brightens and settles, one after another. */
@keyframes boot-sort {
  0%, 60%, 100% { transform: translateY(0); filter: none; }
  20% { transform: translateY(-10px); filter: brightness(1.25); }
  40% { transform: translateY(0) scaleY(0.92); }
}

.routebar { position: fixed; top: 0; left: 0; z-index: 1001; height: 3px; width: 0; background: linear-gradient(90deg, var(--accent), var(--series-5, var(--accent))); opacity: 0; pointer-events: none; }
.routebar.on { opacity: 1; width: 75%; transition: width 2.5s cubic-bezier(0.1, 0.6, 0.2, 1); }
.routebar.on.done { width: 100%; opacity: 0; transition: width 0.2s ease, opacity 0.3s ease 0.15s; }

@media (prefers-reduced-motion: reduce) {
  .boot-bars i { animation: none; }
  .routebar.on { transition: none; width: 100%; }
}
