/* Start-up screen, shown from the first paint until Aurelia calls setRoot("app") and wipes the body.
   The club's mobile app carries the same composition (crest, zebra ground, gold glow, loading bar).
   It is duplicated here on purpose rather than shared: the two projects have no common asset
   pipeline, and a package for a hundred lines of CSS would cost more than the copy.

   This file is never removed - it stays live for the whole session and is the source of truth for the
   application theme. See the --primary/--secondary warning below before editing. */

:root,
html.theme-light {
  /* Read at runtime by digiwall-lib's ui-theme-observer, through
     getComputedStyle(document.documentElement), and used to derive further theme variables. Changing
     either of these recolours the whole back office, starting with the active navbar item - so the
     club's gold below is a NEW name and replaces neither.
     The html.theme-light specificity is deliberate: digiwall-lib ships its own :root with indigo and
     pink defaults, and the async injection order would flash blue without it. */
  --primary: #0A0A0A;
  --secondary: #9E8F37;

  /* Splash only. Same names as the mobile app's tokens, so the two stay comparable at a glance.
     Channels for the gold because the glow needs it at low alpha, which a hex cannot express. */
  --gold: #FCDD00;
  --gold-rgb: 252 221 0;
  --black-raised: #15151A;
  --on-black-line: #2A2B33;
  --on-black-muted: #8A8B96;
}

html,
body,
main,
.page-host,
section {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: "Heebo", sans-serif;
  font-weight: 400;
  color: #464d69;
  background-color: #f8f9fa;
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 100%;
}

body,
.theme-light body {
  margin: 0;
}

div.body-loader,
.theme-light div.body-loader {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: var(--primary);
  color: #FFFFFF;
  /* No webfont: this is the very first paint, and the only faces this project loads come from a CDN.
     A round trip there would delay the one thing the loader exists to show. */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* The club's nickname is Les Zèbres. Dark on dark, so it reads as texture behind the crest rather
   than as a pattern of its own. */
.splash__zebra {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(115deg, var(--primary) 0 26px, var(--black-raised) 26px 52px);
  opacity: 0.9;
}

.splash__glow {
  position: absolute;
  left: 50%;
  top: 44%;
  width: 460px;
  height: 460px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgb(var(--gold-rgb) / 0.17), rgb(var(--gold-rgb) / 0) 62%);
  animation: splash-glow 3.2s ease-in-out infinite;
}

.splash__center {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  margin-top: -40px;
  padding-inline: 24px;
}

/* Sized by height, not boxed into a square: the crest is 8:15, so a square slot would render it at
   half the width and leave it looking lost under the glow. */
.splash__crest {
  height: 200px;
  width: auto;
  animation: splash-crest 0.85s cubic-bezier(0.2, 0.8, 0.25, 1) both;
}

.splash__word {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  animation: splash-rise 0.7s ease 0.35s both;
}

.splash__rule {
  width: 38px;
  height: 2px;
  background: var(--on-black-line);
}

.splash__sub {
  color: var(--on-black-muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.splash__footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  display: flex;
  justify-content: center;
}

.splash__track {
  width: 104px;
  height: 3px;
  border-radius: 2px;
  background: var(--on-black-line);
  overflow: hidden;
}

/* Indeterminate by default so the bar still means something if the loader internals are unavailable.
   The inline script in index.html swaps in --determinate and drives scaleX from real module counts. */
.splash__bar {
  height: 100%;
  width: 100%;
  border-radius: 2px;
  background: var(--gold);
  transform-origin: left;
  animation: splash-load 1.6s cubic-bezier(0.35, 0.9, 0.3, 1) both;
}

.splash__bar--determinate {
  animation: none;
  transform: scaleX(0);
  transition: transform 0.25s ease-out;
}

@keyframes splash-crest {
  0% {
    opacity: 0;
    transform: scale(0.82);
  }

  60% {
    opacity: 1;
    transform: scale(1.03);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes splash-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes splash-load {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

@keyframes splash-glow {

  0%,
  100% {
    opacity: 0.5;
  }

  50% {
    opacity: 0.95;
  }
}

@media (prefers-reduced-motion: reduce) {

  .splash__crest,
  .splash__word,
  .splash__glow,
  .splash__bar {
    animation: none;
  }
}
