/* ===========================================================
   SPLASH de abertura (v10.2) — logo "Pilha": o ícone nasce no centro,
   as três camadas se desenham de baixo pra cima, ele encolhe e o nome
   "Ledger" desliza ao lado; a frase entra por último. Some revelando
   login/app (cortina). NÃO toca no auth. Respeita reduced-motion.
   Só transform/opacity/stroke-dashoffset animam (compositor), exceto o
   max-width do nome, que é um elemento pequeno.
   =========================================================== */
.splash {
  position: fixed; inset: 0; z-index: 9999;
  display: grid; place-content: center; justify-items: center;
  background: var(--bg);
  /* saída V3 (misto escolhido pelo dono): CORTINA — desliza pra cima revelando o app */
  transition: transform .7s cubic-bezier(.65, 0, .35, 1), visibility .7s;
  -webkit-tap-highlight-color: transparent;
}
.splash.gone { transform: translateY(-101%); visibility: hidden; pointer-events: none; }

.splash-lock { display: flex; align-items: center; }
.splash-mark {
  width: 60px; height: 60px; flex: none; border-radius: 28%;
  display: grid; place-items: center;
  background: var(--brand-grad);
  box-shadow: 0 12px 28px rgba(47, 107, 255, .3), inset 0 1px 0 rgba(255, 255, 255, .25);
  transform: scale(1.45); opacity: 0;
  will-change: transform, opacity;
}
.splash-mark svg { display: block; width: 64%; height: 64%; overflow: visible; }
.sp-layer { stroke-dasharray: 40; stroke-dashoffset: 40; }
.splash-word {
  color: var(--ink); white-space: nowrap; overflow: hidden;
  max-width: 0; padding-left: 0; opacity: 0;
}
.splash-sub {
  position: absolute; left: 16px; right: 16px; bottom: calc(env(safe-area-inset-bottom, 0px) + max(12vh, 100px));
  text-align: center; font-size: 13px; color: var(--ink-3); opacity: 0;
}
/* a animação só dispara com .play (adicionado por JS após a carga pesada,
   senão o app.js trava a main thread e a animação "passa" sem ser pintada) */
.splash.play .splash-mark { animation: sp-mark 1.25s cubic-bezier(.2, .9, .25, 1.1) both; }
.splash.play .sp-layer { animation: sp-draw .5s cubic-bezier(.6, 0, .2, 1) both; animation-delay: calc(.3s + var(--i) * .12s); }
.splash.play .splash-word { animation: sp-word .55s cubic-bezier(.2, .8, .2, 1) 1.05s both; }
.splash.play .splash-sub { animation: sp-sub .45s ease-out 1.45s both; }
@keyframes sp-mark {
  0%   { opacity: 0; transform: scale(.6); }
  25%  { opacity: 1; transform: scale(1.55); }
  35%  { transform: scale(1.45); }
  75%  { transform: scale(1.45); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes sp-draw { to { stroke-dashoffset: 0; } }
@keyframes sp-word {
  from { max-width: 0; padding-left: 0; opacity: 0; }
  to   { max-width: 190px; padding-left: 12px; opacity: 1; }
}
@keyframes sp-sub {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* v11.13: em janela baixa de computador, o botão do login ocupa este lugar; a frase some nos dois, para nada saltar */
@media (min-width: 720px) and (max-height: 560px) {
  .splash-sub { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .splash-mark, .splash.play .splash-mark { animation: none !important; opacity: 1 !important; transform: none !important; }
  .sp-layer, .splash.play .sp-layer { animation: none !important; stroke-dashoffset: 0 !important; }
  .splash-word, .splash.play .splash-word { animation: none !important; opacity: 1 !important; max-width: none !important; padding-left: 12px !important; }
  .splash-sub, .splash.play .splash-sub { animation: none !important; opacity: 1 !important; }
  /* sem cortina deslizante no reduced-motion: fade discreto */
  .splash { transition: opacity .2s linear; }
  .splash.gone { opacity: 0; transform: none; }
}
