/* Splash screen — Sovereign Meridian Partners
   Timeline: wordmark fades in (0.2s) -> gold line expands (1.0s) -> label + percentage (1.5s)
   -> fade out at ~2.8s. */

html.splash-lock { overflow: hidden; }
html.splash-seen #splash { display: none; }

#splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1.5rem;
  background: #0A192F;
  opacity: 1;
  visibility: visible;
  transition: opacity .7s ease, visibility 0s linear .7s;
  /* CSS-only failsafe: if the script never runs, the splash still clears itself */
  animation: splash-failsafe .7s ease 4.5s forwards;
}
#splash.is-done { opacity: 0; visibility: hidden; pointer-events: none; }

/* Hold every animation until fonts are ready (JS adds .go) so the serif never swaps mid-animation */
#splash:not(.go) .splash-inner * { animation-play-state: paused; }

.splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 100%;
}

.splash-word {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  font-weight: 600;
  font-size: clamp(1.1rem, 4vw, 2.25rem);
  letter-spacing: .24em;
  margin-right: -.24em;
  line-height: 1.4;
  color: #F5F5F0;
  text-wrap: balance;
  opacity: 0;
  transform: translateY(10px);
  animation: splash-rise 1s cubic-bezier(.22, .61, .36, 1) .2s forwards;
}

.splash-line {
  width: min(260px, 56vw);
  height: 1px;
  margin: 1.6rem 0 1.3rem;
  background: #D4AF37;
  transform: scaleX(0);
  transform-origin: center;
  animation:
    splash-line 1s cubic-bezier(.65, 0, .35, 1) 1s forwards,
    splash-glow 2.4s ease-in-out 2s infinite;
}

.splash-sub {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-weight: 500;
  font-size: .7rem;
  letter-spacing: .5em;
  margin-right: -.5em;
  color: #D4AF37;
  opacity: 0;
  animation: splash-fade .8s ease 1.5s forwards;
}

.splash-pct {
  min-height: 1em;
  margin-top: 2.25rem;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: .75rem;
  letter-spacing: .2em;
  font-variant-numeric: tabular-nums;
  color: rgba(245, 245, 240, .5);
  opacity: 0;
  animation: splash-fade .8s ease 1.5s forwards;
}

@keyframes splash-rise   { to { opacity: 1; transform: none; } }
@keyframes splash-fade   { to { opacity: 1; } }
@keyframes splash-line   { to { transform: scaleX(1); } }
@keyframes splash-glow {
  0%, 100% { box-shadow: 0 0 0 rgba(212, 175, 55, 0); }
  50%      { box-shadow: 0 0 14px rgba(212, 175, 55, .55); }
}
@keyframes splash-failsafe { to { opacity: 0; visibility: hidden; pointer-events: none; } }

@media (prefers-reduced-motion: reduce) {
  .splash-word, .splash-sub, .splash-pct { animation: none; opacity: 1; transform: none; }
  .splash-line { animation: none; transform: scaleX(1); }
  #splash { transition-duration: .01s; }
}