/* Splash screen: cream + terracotta + gold, matching the pitch deck and the home page hero. */
#splash {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(circle at 50% 40%, #fffaf0 0%, #f6e9d3 55%, #ecd9b8 100%);
  opacity: 1; visibility: visible; transition: opacity .5s ease, visibility .5s ease;
  /* Safety net: even if scripts never run, the splash fades away by itself. */
  animation: splash-failsafe .5s ease 6.5s forwards;
}
#splash.splash--hide { opacity: 0; visibility: hidden; pointer-events: none; }
.no-splash #splash { display: none; }
.splash-bar { position: absolute; left: 0; right: 0; height: 10px; background: var(--terracotta); border-bottom: 2px solid var(--gold); }
.splash-bar--top { top: 0; }
.splash-bar--bottom { bottom: 0; transform: scaleY(-1); }

.splash-stage { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 24px; transition: transform .5s ease; }
#splash.splash--hide .splash-stage { transform: scale(1.05); }

.splash-art { width: min(74vw, 300px, 44vh); height: auto; overflow: visible; }
.splash-glow { transform-box: fill-box; transform-origin: center; animation: splash-pop .8s ease-out both, splash-pulse 2.4s ease-in-out .8s infinite; }
.splash-ring { transform-box: fill-box; transform-origin: center; animation: splash-pop .8s ease-out both; }
.splash-ring--dots { animation: splash-pop .8s ease-out both, splash-spin 40s linear infinite; }
.splash-temple { animation: splash-rise 1.1s cubic-bezier(.2, .8, .2, 1) .2s both; }
.splash-flag { transform-box: fill-box; transform-origin: left center; animation: splash-wave 1.4s ease-in-out infinite; }
.splash-flame { transform-box: fill-box; transform-origin: 50% 100%; animation: splash-flicker .9s ease-in-out infinite; }
.splash-flame--right { animation-delay: .3s; }

.splash-title { margin: 6px 0 0; font: 700 clamp(2rem, 8vw, 2.7rem)/1.05 var(--font-serif); color: var(--terracotta-dark); animation: splash-fadeup .8s ease .9s both; }
.splash-title span { color: var(--terracotta); }
.splash-rule { width: 96px; height: 2px; margin: 12px auto 0; background: var(--gold); border-radius: 2px; position: relative; animation: splash-fadeup .8s ease 1.1s both; }
.splash-rule::after { content: ''; position: absolute; right: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.splash-tag { margin: 12px 0 0; max-width: 24ch; font: italic 1.05rem/1.4 var(--font-serif); color: var(--ink); animation: splash-fadeup .8s ease 1.3s both; }
.splash-progress { width: 140px; height: 4px; margin-top: 22px; border-radius: 4px; background: rgba(201, 154, 59, .25); overflow: hidden; animation: splash-fadeup .6s ease 1.2s both; }
.splash-progress span { display: block; height: 100%; width: 100%; background: var(--gold); border-radius: 4px; transform-origin: left center; animation: splash-fill 3s linear both; }

@keyframes splash-pop { from { opacity: 0; transform: scale(.82); } to { opacity: 1; transform: scale(1); } }
@keyframes splash-pulse { 0%, 100% { opacity: .85; transform: scale(1); } 50% { opacity: 1; transform: scale(1.05); } }
@keyframes splash-spin { to { transform: rotate(360deg); } }
@keyframes splash-rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes splash-wave { 0%, 100% { transform: skewY(0deg) scaleX(1); } 50% { transform: skewY(-9deg) scaleX(.9); } }
@keyframes splash-flicker { 0%, 100% { transform: scale(1, 1); opacity: 1; } 35% { transform: scale(.88, 1.12); opacity: .9; } 70% { transform: scale(1.06, .94); opacity: 1; } }
@keyframes splash-fadeup { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes splash-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes splash-failsafe { to { opacity: 0; visibility: hidden; pointer-events: none; } }

/* "Admin console" label (admin variant only) */
.splash-badge { margin-top: 12px; padding: 4px 14px; border-radius: 999px; background: var(--terracotta-dark); color: #fff; font: 700 .72rem/1.4 var(--font-sans); letter-spacing: .14em; text-transform: uppercase; animation: splash-fadeup .8s ease 1.2s both; }
.splash-badge + .splash-tag { margin-top: 10px; }

/* Short landscape screens: keep everything on one screen. */
@media (max-height: 520px) {
  .splash-art { width: min(40vh, 220px); }
  .splash-stage { padding: 12px; }
  .splash-tag { margin-top: 6px; }
  .splash-progress { margin-top: 12px; }
}

/* People who prefer less motion never see the splash. */
@media (prefers-reduced-motion: reduce) { #splash { display: none; } }
