/* ==========================================================================
   IDO Edge — shared brand layer for hub.idoedge.com splash screens
   Tokens sourced from the IDO Edge branding skill (design-system/build.py).
   ========================================================================== */

/* Self-hosted: the four cuts the splashes use, subset to Latin. */
@font-face { font-family: 'Source Sans 3'; font-weight: 300; font-style: normal; font-display: swap;
  src: url('../fonts/source-sans-3-light.woff2') format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-weight: 400; font-style: normal; font-display: swap;
  src: url('../fonts/source-sans-3-regular.woff2') format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-weight: 600; font-style: normal; font-display: swap;
  src: url('../fonts/source-sans-3-semibold.woff2') format('woff2'); }
@font-face { font-family: 'Source Code Pro'; font-weight: 400; font-style: normal; font-display: swap;
  src: url('../fonts/source-code-pro-regular.woff2') format('woff2'); }

:root {
  /* Brand palette — 8 stops, magenta → navy */
  --magenta: #D32D7D;
  --rose:    #BE2B7B;
  --plum:    #8A3178;
  --purple:  #613773;
  --violet:  #4E3A79;
  --indigo:  #424180;
  --cobalt:  #2F4888;
  --navy:    #005297;

  /* Logo-mark pink (brighter than palette stop 1 — used inside the mark only) */
  --mark-pink: #E6007E;

  /* Greyscale */
  --grey-1: #E5E8E8;
  --grey-2: #D1D1D3;
  --grey-3: #BBBDBF;
  --grey-4: #A5A8AB;
  --grey-5: #929496;
  --grey-6: #808284;
  --grey-7: #6E6E70;
  --grey-8: #59595C;

  /* Dark canvas */
  --ink:      #1A1A2E;
  --ink-deep: #0B0E1C;
  --ink-abyss:#05060F;

  /* Type */
  --sans: 'Source Sans 3', 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'Source Code Pro', 'Courier New', monospace;

  /* Geometry */
  --radius: 10px;
  --ease-out-soft: cubic-bezier(.16, 1, .3, 1);
  --ease-snap:     cubic-bezier(.34, 1.56, .64, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  height: 100%;
  background: var(--ink-deep);
  font-family: var(--sans);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* --- Splash container -------------------------------------------------- */
.splash {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  z-index: 100;
  opacity: 1;
  transition: opacity 700ms var(--ease-out-soft),
              transform 900ms var(--ease-out-soft),
              filter 700ms var(--ease-out-soft);
}
/* Preview mode keeps the element after the hand-off (splash-core removes it
   everywhere else); this stops it painting or animating while it waits. */
.splash.is-gone, .splash.is-gone * { visibility: hidden; animation-play-state: paused !important; }

.splash.is-done {
  opacity: 0;
  transform: scale(1.06);
  filter: blur(10px);
  pointer-events: none;
}

/* A concept reveal is playing instead (splash-core.js, "Reveals"). The concept
   draws it frame by frame, so the standard exit's transitions must not smear
   its first frames. */
.splash.is-exiting { transition: none; pointer-events: none; }

/* --- Logo mark grid (15 parallelogram tiles, viewBox 0 0 86 33) -------- */
.mark { display: block; overflow: visible; }
.mark polygon,
.logo polygon { transform-box: fill-box; transform-origin: center; }

/* The mark sits right up against the edge of the lock-up's viewBox, and a tile
   that animates — scattering in, turning, pulsing — leaves it. Anywhere the SVG
   clips, that tile is cut off mid-motion. Belt and braces after the geometry
   fix, but it costs nothing. */
.logo { overflow: visible; }

/* Numerals inside a splash are set in <i> for styling hooks, not for italics */
.splash i, .shell i { font-style: normal; }

/* --- Progress rail ---------------------------------------------------- */
.rail {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 2px; background: rgba(255,255,255,.10);
  overflow: hidden;
}
.rail__fill {
  height: 100%; width: 0%;
  background: var(--magenta);
  transition: width 180ms linear;
}

/* Keep-alive. Once the intro has played and we are simply waiting on the
   application, a lit segment shuttles along the filled part of the rail. The
   fill itself keeps creeping, so the bar reads as "still working" rather than
   as a bar that has stalled. */
.splash.is-waiting .rail__fill::after {
  content: '';
  position: absolute; top: 0; bottom: 0;
  width: 22%;
  background: rgba(255,255,255,.55);
  animation: rail-shuttle 1900ms var(--ease-out-soft) infinite;
  --freeze: no;                /* vanishes at hand-off rather than stopping (splash-core.js) */
}
@keyframes rail-shuttle {
  0%   { left: -24%; opacity: 0; }
  18%  { opacity: 1; }
  82%  { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}
.rail__fill { position: relative; }

/* Progress readouts hold steady during the wait rather than flickering */
.splash.is-waiting .status b:last-child { opacity: .85; }

/* --- Status line ------------------------------------------------------ */
.status {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--grey-6);
}
.status b { color: var(--grey-2); font-weight: 400; }


/* The simulated portal behind the splash styles itself — see shared/portal-shell.js. */

/* --- Accessibility ---------------------------------------------------- */
/* Reduced motion: every animation jumps straight to its end state.
   This used to be `animation: none`, which is not the same thing at all — most
   of what a splash shows arrives by an animation that runs *from* opacity 0
   and holds its last frame, so with the animations removed the lock-up, the
   wordmark, the glass panel and the captions simply never appeared. Anyone
   with reduced motion switched on was getting a blank screen with a progress
   bar. Collapsing duration and delay keeps every end state and drops the
   travel; infinite loops run once, instantly, and hold their last frame (the
   mosaic's sustain wave is what keeps its tiles lit, so letting it end and
   fall back to the base style blanked the field). */
@media (prefers-reduced-motion: reduce) {
  .splash *, .splash, .splash *::before, .splash *::after, .splash::before, .splash::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    animation-fill-mode: both !important;    /* hold the last frame — some loops ARE the state */
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
  }
}
