/* Barangay Sta. Lucia - page-load splash screen.
 * Linked as a normal (blocking) stylesheet in <head> so it paints before anything else.
 * The markup is the first element in <body>; js/splash.js hides it.
 */
html.is-loading { background: #0B1D3A; }
html.is-loading body { overflow: hidden; }

#splash {
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  box-sizing: border-box;
  background: #0B1D3A;
  background: radial-gradient(ellipse at 50% 42%, #1d4089 0%, #142e63 40%, #0B1D3A 100%);
  color: #fff;
  text-align: center;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  /* the page body may still be hidden by the auth guard; the splash itself is always visible */
  visibility: visible !important;
  opacity: 1;
  transition: opacity .35s ease, visibility .35s ease;
  -webkit-user-select: none;
  user-select: none;
}
#splash.is-hiding { opacity: 0; visibility: hidden !important; pointer-events: none; }

#splash .splash-emblem {
  position: relative;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#splash .splash-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);           /* the ring starts drawing at 12 o'clock */
  overflow: visible;
}
#splash .splash-ring-track { fill: none; stroke: rgba(227, 199, 102, .16); stroke-width: 2.5; }
#splash .splash-ring-draw {
  fill: none;
  stroke: #E3C766;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 352;               /* 2 x pi x r (r = 56) */
  stroke-dashoffset: 352;
  animation: splash-draw .65s cubic-bezier(.65, 0, .35, 1) .05s forwards,
             splash-glow 2.6s ease-in-out .8s infinite;
}
#splash .splash-seal {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .45);
  opacity: 0;
  transform: scale(.9);
  animation: splash-pop .4s cubic-bezier(.2, .8, .2, 1) 0s forwards;
}
#splash .splash-title {
  margin-top: 26px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: .01em;
  line-height: 1.2;
  opacity: 0;
  transform: translateY(10px);
  animation: splash-up .4s ease .25s forwards;
}
#splash .splash-sub {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: #E3C766;
  opacity: 0;
  transform: translateY(10px);
  animation: splash-up .4s ease .4s forwards;
}

@keyframes splash-draw { to { stroke-dashoffset: 0; } }
@keyframes splash-glow {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(227, 199, 102, 0)); }
  50%      { filter: drop-shadow(0 0 6px rgba(227, 199, 102, .55)); }
}
@keyframes splash-pop { to { opacity: 1; transform: scale(1); } }
@keyframes splash-up  { to { opacity: 1; transform: translateY(0); } }

@media (max-width: 400px) {
  #splash .splash-emblem { width: 116px; height: 116px; }
  #splash .splash-seal { width: 82px; height: 82px; }
  #splash .splash-title { font-size: 24px; margin-top: 22px; }
  #splash .splash-sub { font-size: 11px; letter-spacing: .18em; }
}

/* No motion: everything is shown at once and the splash simply fades. */
@media (prefers-reduced-motion: reduce) {
  #splash { transition: opacity .2s linear, visibility .2s linear; }
  #splash .splash-ring-draw { animation: none; stroke-dashoffset: 0; }
  #splash .splash-seal,
  #splash .splash-title,
  #splash .splash-sub { animation: none; opacity: 1; transform: none; }
}

/* Continuing a splash that is already on screen (see js/splash.js): finished look, no animation. */
#splash.splash-quick .splash-ring-draw { animation: none; stroke-dashoffset: 0; }
#splash.splash-quick .splash-seal,
#splash.splash-quick .splash-title,
#splash.splash-quick .splash-sub { animation: none; opacity: 1; transform: none; }
