/* public/assets/styles/integrio-splash.css
   Shared by public/index.html boot splash and FuseSplashScreen.
   Spec: docs/superpowers/specs/2026-07-24-web-loading-splash-design.md

   Palette is Integrio's: #1C2450 primary / #283264 secondary, the same values
   themeColorHandler applies to the INTEGRIO theme. Layout, timings and the
   reveal animation are SiteSurvey's originals and are unchanged — only the
   colours and the wordmark differ. The filename is left as-is because it is an
   internal reference used by index.html, not user-visible branding.
*/

body #fuse-splash-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse 90% 55% at 50% 42%, rgba(22, 93, 252, 0.14) 0%, transparent 58%),
    linear-gradient(165deg, #283264 0%, #1C2450 48%, #141A3A 100%);
  color: #f9fafb;
  z-index: 999999;
  pointer-events: none;
  opacity: 1;
  visibility: visible;
  transition: opacity 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

body #fuse-splash-screen.ss-splash--revealing {
  transition: none;
  animation: ss-splash-fade 640ms cubic-bezier(0.4, 0.1, 0.2, 1) forwards;
}

.ss-splash-mark {
  position: relative;
  font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 300;
  letter-spacing: 0.5px;
  color: #fff;
  line-height: 1;
  white-space: nowrap;
  z-index: 2;
}

.ss-splash-mark b {
  font-weight: 800;
}

/* The wordmark is the production logo asset (the same PNG admin.integrio.app
   serves). Height tracks the mark's font-size so the `em` units below — which
   position the reveal ring — stay in proportion at every viewport width. */
.ss-splash-logo {
  height: clamp(28px, 5vw, 42px);
  width: auto;
  display: block;
}

body #fuse-splash-screen.ss-splash--revealing .ss-splash-mark {
  animation: ss-mark-out 640ms cubic-bezier(0.4, 0.1, 0.2, 1) forwards;
}

/* Anchor only — the logo already draws its own dot and ring, so this element
   is invisible. It sits concentric with the ring in the artwork (centre at
   ~86.5% of the logo's width, outer diameter ~0.74 of its height) so the
   reveal ring below expands from exactly that circle rather than from a
   second dot tacked on after the wordmark. */
.ss-splash-dot {
  position: absolute;
  left: 86.5%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 0.74em;
  height: 0.74em;
  border-radius: 50%;
  background: transparent;
}

.ss-splash-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100%;
  height: 100%;
  margin-left: -50%;
  margin-top: -50%;
  border-radius: 50%;
  border-style: solid;
  border-color: #165DFC;
  border-width: 1px;
  opacity: 0;
  pointer-events: none;
  z-index: 3;
  box-sizing: border-box;
}

body #fuse-splash-screen.ss-splash--revealing .ss-splash-ring {
  animation: ss-ring-reveal 640ms cubic-bezier(0.4, 0.1, 0.2, 1) forwards;
}

/* thin at period → fat as ring rushes toward viewer */
@keyframes ss-ring-reveal {
  0% {
    opacity: 0;
    width: 100%;
    height: 100%;
    margin-left: -50%;
    margin-top: -50%;
    border-width: 1px;
  }
  8% {
    opacity: 0.95;
    width: 160%;
    height: 160%;
    margin-left: -80%;
    margin-top: -80%;
    border-width: 1.5px;
  }
  35% {
    opacity: 0.85;
    width: 14em;
    height: 14em;
    margin-left: -7em;
    margin-top: -7em;
    border-width: 6px;
  }
  75% {
    opacity: 0.55;
    width: 90vmax;
    height: 90vmax;
    margin-left: -45vmax;
    margin-top: -45vmax;
    border-width: 28px;
  }
  100% {
    opacity: 0;
    width: 140vmax;
    height: 140vmax;
    margin-left: -70vmax;
    margin-top: -70vmax;
    border-width: 48px;
  }
}

@keyframes ss-mark-out {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.05);
  }
}

@keyframes ss-splash-fade {
  0%,
  55% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    visibility: hidden;
  }
}
