/* MARSWAY intro overlay — timings in one place (seconds after .play) */
html.sp-lock, html.sp-lock body { overflow: hidden; }
/* the app-bar logo waits for the flying logo to land in its slot */
html.sp-lock #appbar .brand img { opacity: 0; }

#splash {
  position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; cursor: pointer;
  font-family: "Manrope", "Segoe UI", system-ui, sans-serif;
}
#splash::before { /* backdrop as its own layer so it can fade out smoothly */
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(900px 520px at 50% 46%, #fbf7f0 0%, #f3e8d8 55%, #ead8c0 100%);
  transition: opacity .75s ease .1s;
}
#splash::after { /* soft sand horizon */
  content: ""; position: absolute; left: -10%; right: -10%; bottom: -22vh; height: 46vh; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(196,112,79,.22), transparent 70%);
  transition: opacity .6s ease;
}
.sp-sky { position: absolute; inset: 0; pointer-events: none; transition: opacity .5s ease; }
.sp-sky i { position: absolute; width: 6px; height: 6px; transform: scale(var(--s));
  background: #2b2725; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  opacity: 0; animation: spTwinkle 2.6s ease-in-out infinite; }
@keyframes spTwinkle { 0%, 100% { opacity: .05; } 50% { opacity: .45; } }

.sp-center { position: relative; z-index: 1; width: min(760px, 86vw); }
.sp-logo svg { display: block; width: 100%; height: auto; overflow: visible;
  transition: transform .9s cubic-bezier(.7, 0, .2, 1); will-change: transform; }

.sp-status { display: flex; align-items: center; gap: 14px; justify-content: center; margin-top: 26px;
  transition: opacity .35s ease; }
.sp-bar { width: 160px; height: 3px; border-radius: 99px; background: rgba(169,74,42,.15); overflow: hidden; }
.sp-bar i { display: block; height: 100%; width: 0; background: #a94a2a; border-radius: 99px; }
#splash.play .sp-bar i { animation: spFill 3.8s cubic-bezier(.4, 0, .2, 1) forwards; }
@keyframes spFill { to { width: 100%; } }
.sp-msg { font: 600 12px/1 "JetBrains Mono", ui-monospace, Consolas, monospace; letter-spacing: .1em; text-transform: uppercase;
  color: #7a5a43; min-width: 270px; }
.sp-msg.in { animation: spMsg .45s ease both; }
@keyframes spMsg { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.sp-skip { position: absolute; z-index: 2; right: 22px; bottom: 20px; border: 1.5px solid rgba(43,39,37,.25); background: rgba(251,247,240,.8);
  color: #2b2725; font: 700 12px "Manrope", "Segoe UI", sans-serif; letter-spacing: .08em; text-transform: uppercase;
  padding: 9px 14px; border-radius: 999px; cursor: pointer; transition: border-color .2s, opacity .3s; }
.sp-skip:hover { border-color: #2b2725; }
.sp-si { position: absolute; z-index: 2; left: 22px; bottom: 26px; font: 700 11px "Manrope", "Segoe UI", sans-serif; letter-spacing: .06em;
  color: #7a5a43; background: rgba(251,247,240,.85); border: 1px solid rgba(43,39,37,.15); padding: 5px 10px; border-radius: 999px; }
#splash.out .sp-si { opacity: 0; }

/* ------------------------------------------------ logo parts (initial state) */
#splash .mw-planet { transform-box: fill-box; transform-origin: center; opacity: 0; transform: scale(.15) rotate(-140deg); }
#splash .mw-surface { opacity: 0; }
#splash .mw-orbit-back, #splash .mw-orbit-front { stroke-dasharray: 1; stroke-dashoffset: 1; }
#splash .mw-moon { transform-box: fill-box; transform-origin: center; transform: scale(0); }
#splash .sp-way-reveal { stroke-dasharray: 1; stroke-dashoffset: 1; }
#splash .mw-pin { opacity: 0; transform: translateY(-46px); }
#splash .mw-flag { transform-box: fill-box; transform-origin: 0% 50%; }
#splash .mw-l { stroke-dasharray: 1; stroke-dashoffset: 1; }
#splash .mw-rule { transform-box: fill-box; transform-origin: 0 50%; transform: scaleX(0); }
#splash .mw-tag { opacity: 0; transform: translateY(10px); }

/* ------------------------------------------------ choreography */
#splash.play .mw-planet { animation: spPlanet 1s cubic-bezier(.2, 1.35, .35, 1) .05s forwards; }
#splash.play .mw-surface { animation: spFade .7s ease .6s forwards; }
#splash.play .mw-orbit-back { animation: spDraw .8s cubic-bezier(.6, 0, .3, 1) .55s forwards; }
#splash.play .mw-orbit-front { animation: spDraw .8s cubic-bezier(.6, 0, .3, 1) .85s forwards; }
#splash.play .mw-moon { animation: spPop .45s cubic-bezier(.2, 1.6, .4, 1) 1.45s forwards; }
#splash.play .sp-way-reveal { animation: spDraw 1.05s cubic-bezier(.45, 0, .55, 1) 1.05s forwards; }
#splash.play .mw-pin { animation: spDrop .65s cubic-bezier(.3, 1.6, .5, 1) 1.95s forwards; }
#splash.play .mw-flag { animation: spWave 1.1s ease-in-out 2.55s 2; }
#splash.play .mw-l { animation: spDraw .6s cubic-bezier(.6, 0, .25, 1) calc(1.25s + var(--i) * .11s) forwards; }
#splash.play .mw-rule { animation: spGrow .5s cubic-bezier(.6, 0, .2, 1) 2.3s forwards; }
#splash.play .mw-tag { animation: spUp .6s ease 2.5s forwards; }

@keyframes spPlanet { to { opacity: 1; transform: none; } }
@keyframes spFade { to { opacity: 1; } }
@keyframes spDraw { to { stroke-dashoffset: 0; } }
@keyframes spPop { to { transform: scale(1); } }
@keyframes spDrop { to { opacity: 1; transform: none; } }
@keyframes spWave { 0%, 100% { transform: none; } 30% { transform: skewY(-9deg) scaleX(.9); } 65% { transform: skewY(6deg); } }
@keyframes spGrow { to { transform: scaleX(1); } }
@keyframes spUp { to { opacity: 1; transform: none; } }

/* ------------------------------------------------ exit: logo flies to the app bar */
#splash.settle .mw-planet, #splash.settle .mw-pin, #splash.settle .mw-tag { opacity: 1; transform: none; animation: none; }
#splash.settle .mw-surface { opacity: 1; animation: none; }
#splash.settle .mw-orbit-back, #splash.settle .mw-orbit-front, #splash.settle .sp-way-reveal, #splash.settle .mw-l { stroke-dashoffset: 0; animation: none; }
#splash.settle .mw-moon, #splash.settle .mw-rule { transform: none; animation: none; }
#splash.out { cursor: default; pointer-events: none; }
#splash.out::before, #splash.out::after, #splash.out .sp-sky, #splash.out .sp-status, #splash.out .sp-skip { opacity: 0; }
#splash.out .mw-tag, #splash.out .mw-rule { opacity: 0 !important; transition: opacity .3s ease; }

@media (max-width: 640px) {
  .sp-center { width: 92vw; }
  .sp-msg { min-width: 0; font-size: 10.5px; }
  .sp-bar { width: 90px; }
}
