/*
 * Boot splash — the navy band and cream logo that paint before the bundle is
 * parsed, so moving between the website, the admin panel and this portal never
 * flashes a different brand.
 *
 * Why this is a file in `public/` when the admin panel keeps the same rules in
 * a <style> block inside its index.html:
 *
 * Vite's build turns an inline <style> into an "html proxy" CSS module, and in
 * this app that step fails — `[vite:html-inline-proxy] No matching HTML proxy
 * module found`, before a single app module is transformed. It is not
 * something in this folder: the panel's own index.html, vite.config.js and
 * stylesheet all fail here too, and pinning vite, rollup and @tailwindcss/vite
 * to the exact versions the panel builds on does not help. Whatever it is, it
 * is in the dependency tree rather than in the source, and it was not worth
 * more of a hunt for a splash screen.
 *
 * Everything in `public/` is copied to the output verbatim and never goes
 * through that pipeline, so a <link> to this file cannot hit the bug. The cost
 * is one extra request of a few hundred bytes, same-origin, cached after the
 * first visit — and nginx serves it with a long max-age (see
 * nginx.conf.template, which caches .css under the static rule).
 *
 * Keep this in step with the markup in index.html, which is the only thing
 * that uses it.
 */

#staff-splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  padding: 0 1.5rem;
  background-color: #061a2b;
}

#staff-splash img {
  height: 44px;
  width: auto;
}

#staff-splash .staff-splash-bar {
  position: relative;
  width: min(70vw, 240px);
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.12);
}

/* A travelling sweep rather than a spinner — it reads as the same family as
   the public site's heartbeat trace without redrawing it. */
#staff-splash .staff-splash-bar::after {
  content: '';
  position: absolute;
  inset-block: 0;
  width: 40%;
  border-radius: 999px;
  background: linear-gradient(90deg, #1f78e0, #21a58e);
  animation: staff-sweep 1.15s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

@keyframes staff-sweep {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(250%);
  }
}

#staff-splash p {
  margin: 0;
  color: #9bc1d9;
  font:
    500 0.8125rem/1.5 'Plus Jakarta Sans',
    system-ui,
    sans-serif;
  letter-spacing: 0.02em;
}

@media (prefers-reduced-motion: reduce) {
  #staff-splash .staff-splash-bar::after {
    animation-duration: 3s;
  }
}
