/* The loading screen (Adam, 21 Nov 2026: "start with a screen with the company logo and an animation of the logo being built.
   however, if this is going to delay the site loading more, dont implement it" … "use higgsfield for the logo animation to
   ensure a professional finish. ensure site speed is still optimised" … "keep the line under the word (vertex or Apex)
   cycling through" so people can see it hasn't frozen). It covers the page only while it loads anyway: app-events.js
   splashDone() takes it away the moment the page knows what to show (the sign-in box, or the person's data and menu), never
   waiting for the animation. Company colours come from each company's --black and --green.
   - The clip: each company's own logo-build video made in Higgsfield (company\web\splash.webm / .mp4, 34-55 KB, cached
     after the first visit). It plays once; from its last moment the accent line under the logo keeps cycling (draws across,
     clears, draws again) until the page is ready. Its edges fade into the page colour.
   - Until the clip starts, a short accent line cycles the same way. If it can't play (splash.js adds .no-video), the CSS
     build below takes over: the accent line draws, the logo rises from it floor by floor, then the line keeps cycling.
   - Safety: the screen fades away by itself after 30 s even if the page's scripts never run. */
#splash { position: fixed; inset: 0; z-index: 2147483200; display: grid; place-items: center; background: var(--black, #21292b);
  transition: opacity .35s ease, visibility 0s linear .35s; animation: sp-safety .3s ease 30s forwards; }
#splash > * { grid-area: 1 / 1; }
#splash.out { opacity: 0; visibility: hidden; pointer-events: none; }
#splash .sp-video { display: block; width: min(480px, 88vw); height: auto; aspect-ratio: 9 / 4; object-fit: cover; background: transparent;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent), linear-gradient(transparent, #000 9%, #000 91%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent), linear-gradient(transparent, #000 9%, #000 91%, transparent);
  mask-composite: intersect; }
/* The cycling line over the clip's own line, in a box the same size as the clip. splash.js adds .held near the clip's end.
   ::before covers the clip's still line in the page colour; ::after is the line that cycles, starting full so the hand-over
   can't be seen (sp-cycle starts full). The line's place in each company's clip comes from its company.css (--sp-line-x/-y/-w/-h; Vertex's are the
   defaults here). */
#splash .sp-run { display: block; position: relative; width: min(480px, 88vw); aspect-ratio: 9 / 4; pointer-events: none; opacity: 0; transition: opacity .25s ease; }
#splash.held .sp-run { opacity: 1; }
#splash.no-video .sp-run { display: none; }
#splash .sp-run::before, #splash .sp-run::after { content: ""; position: absolute; }
#splash .sp-run::before { left: calc(var(--sp-line-x, 15.14%) - .6%); width: calc(var(--sp-line-w, 69.86%) + 1.2%); top: calc(var(--sp-line-y, 74.375%) - 1%);
  height: calc(var(--sp-line-h, 1.25%) + 2%); background: var(--black, #21292b); }
#splash .sp-run::after { left: var(--sp-line-x, 15.14%); width: var(--sp-line-w, 69.86%); top: var(--sp-line-y, 74.375%); height: var(--sp-line-h, 1.25%); min-height: 2px;
  border-radius: 2px; background: var(--green, #c9dc50); animation: sp-cycle 1.6s ease-in-out infinite; }
#splash .sp-wait { width: 64px; height: 3px; border-radius: 2px; background: var(--green, #c9dc50); animation: sp-cycle 1.2s ease-in-out infinite; }
#splash.playing .sp-wait { display: none; }
#splash.no-video .sp-video { display: none; }
#splash .sp-box { display: none; position: relative; width: min(340px, 72vw); padding-bottom: 16px; }
#splash.no-video:has(.sp-box img[src]) .sp-wait { display: none; }
#splash.no-video:has(.sp-box img[src]) .sp-box { display: block; }
#splash .sp-box img { display: block; width: 100%; height: auto; animation: sp-rise 1.3s steps(6, jump-end) .35s both; }
#splash .sp-line { position: absolute; left: 0; bottom: 0; width: 100%; height: 3px; border-radius: 2px; background: var(--green, #c9dc50);
  transform-origin: left center; animation: sp-draw .45s ease-out both, sp-cycle 1.6s ease-in-out 1.7s infinite; }
@keyframes sp-safety { to { opacity: 0; visibility: hidden; pointer-events: none; } }
/* From a full line: it clears off to the right, then draws back in from the left, and again */
@keyframes sp-cycle { 0% { clip-path: inset(0 0 0 0); } 50% { clip-path: inset(0 0 0 100%); } 50.01% { clip-path: inset(0 100% 0 0); } 100% { clip-path: inset(0 0 0 0); } }
@keyframes sp-draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes sp-rise { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
@media (prefers-reduced-motion: reduce) { #splash .sp-wait, #splash .sp-box img, #splash .sp-line, #splash .sp-run::after { animation: none; } }
@media print { #splash { display: none; } }
