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

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 3.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-mark {
  width: clamp(56px, 14vw, 84px);
  height: auto;
  margin-bottom: 1.5rem;
  overflow: visible;
}
.splash-mark .sm-a, .splash-mark .sm-b, .splash-mark .sm-c {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: splash-draw .9s cubic-bezier(.65, 0, .35, 1) forwards;
}
.splash-mark .sm-a { animation-delay: .05s; }
.splash-mark .sm-b { animation-delay: .35s; }
.splash-mark .sm-c { animation-delay: .6s; animation-duration: .7s; }

.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 .7s cubic-bezier(.22, .61, .36, 1) .1s 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 .7s cubic-bezier(.65, 0, .35, 1) .5s forwards,
    splash-glow 2.4s ease-in-out 1.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 .6s ease .9s 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 .6s ease .9s forwards;
}

@keyframes splash-draw   { to { stroke-dashoffset: 0; } }
@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-mark .sm-a, .splash-mark .sm-b, .splash-mark .sm-c { animation: none; stroke-dashoffset: 0; }
  #splash { transition-duration: .01s; }
}