/* motel.ia — tela de abertura da landing
   Logo vetorizada do arquivo oficial (output/branding/motel-ia-final/logo-motel-ia.png).
   Só aparece com JavaScript: o splash.js cria o elemento e liga html.splash-on. */

.mi-splash {
  --sp-bg: #0c0c0b;
  --sp-accent: #d6ff5f;
  position: fixed; inset: 0; z-index: 2147483000;
  display: grid; place-items: center;
  background: var(--sp-bg);
  overflow: hidden;
  contain: strict;
  will-change: transform, opacity;
}
html.splash-on, html.splash-on body { overflow: hidden; }

.mi-splash__stage { display: grid; justify-items: center; gap: clamp(22px, 3.2vw, 34px); }
.mi-splash__logo { display: block; width: min(560px, 62vw); height: auto; overflow: visible; }
.mi-splash.is-stacked .mi-splash__logo { width: min(300px, 72vw); }

/* barra de carregamento */
.mi-splash__bar { position: relative; width: min(180px, 40vw); height: 2px; background: rgb(255 255 255 / .08); overflow: hidden; opacity: 0; animation: mi-sp-fade .4s .35s ease-out forwards; }
.mi-splash__bar i { position: absolute; inset: 0; background: var(--sp-accent); transform-origin: left center; transform: scaleX(0); animation: mi-sp-bar 1.9s .35s cubic-bezier(.22, .61, .36, 1) forwards; }
.mi-splash.is-ready .mi-splash__bar i { animation: none; transform: scaleX(1); transition: transform .25s ease-out; }

/* cortina */
.mi-splash__curtain { position: absolute; inset: 0; background: var(--sp-accent); transform: translateY(101%); }
.mi-splash.is-leaving .mi-splash__curtain { animation: mi-sp-curtain-in .36s cubic-bezier(.65, 0, .35, 1) forwards; }
.mi-splash.is-leaving { animation: mi-sp-lift .38s .34s cubic-bezier(.65, 0, .35, 1) forwards; }

/* ---------- a logo se monta (≈1,55 s) ---------- */
.mi-splash .sp-pop, .mi-splash .sp-stamp { transform-box: fill-box; transform-origin: center; }

/* 1 · o batente se desenha (topo → lateral) */
.mi-splash .sp-mask-jamb { stroke-dasharray: 520 640; stroke-dashoffset: 560; animation: mi-sp-draw-jamb .5s .05s cubic-bezier(.33, 1, .68, 1) forwards; }
/* 2 · a porta se desenha a partir da dobradiça */
.mi-splash .sp-mask-leaf { stroke-dasharray: 790 900; stroke-dashoffset: 860; animation: mi-sp-draw-leaf .62s .28s cubic-bezier(.45, 0, .2, 1) forwards; }
/* 3 · maçaneta e brilho pulam para dentro */
.mi-splash .sp-handle { opacity: 0; animation: mi-sp-pop .34s .78s cubic-bezier(.34, 1.56, .64, 1) forwards; }
.mi-splash .sp-spark { opacity: 0; animation: mi-sp-spark .46s .86s cubic-bezier(.34, 1.56, .64, 1) forwards; }
/* 4 · o nome desliza da esquerda */
.mi-splash .sp-motel { opacity: 0; animation: mi-sp-slide .5s 1s cubic-bezier(.22, 1, .36, 1) forwards; }
.mi-splash .sp-ia { opacity: 0; animation: mi-sp-slide .5s 1.08s cubic-bezier(.22, 1, .36, 1) forwards; }
/* 5 · o ponto entra como carimbo */
.mi-splash .sp-dot { opacity: 0; animation: mi-sp-stamp .32s 1.24s cubic-bezier(.34, 1.4, .64, 1) forwards; }

@keyframes mi-sp-draw-jamb { to { stroke-dashoffset: 0; } }
@keyframes mi-sp-draw-leaf { to { stroke-dashoffset: 0; } }
@keyframes mi-sp-pop { 0% { opacity: 0; transform: scale(.2); } 60% { opacity: 1; } 100% { opacity: 1; transform: scale(1); } }
@keyframes mi-sp-spark { 0% { opacity: 0; transform: translate(-60px, 26px) scale(.15) rotate(-70deg); } 55% { opacity: 1; } 100% { opacity: 1; transform: none; } }
@keyframes mi-sp-slide { from { opacity: 0; transform: translateX(-90px); } to { opacity: 1; transform: none; } }
@keyframes mi-sp-stamp { 0% { opacity: 0; transform: scale(2.6); } 55% { opacity: 1; transform: scale(.86); } 100% { opacity: 1; transform: scale(1); } }
@keyframes mi-sp-fade { to { opacity: 1; } }
@keyframes mi-sp-bar { 0% { transform: scaleX(0); } 100% { transform: scaleX(.86); } }
@keyframes mi-sp-curtain-in { to { transform: translateY(0); } }
@keyframes mi-sp-lift { to { transform: translateY(-101%); } }
@keyframes mi-sp-fadeout { to { opacity: 0; } }

/* reduzir movimento: logo pronta, sem cortina, sai esmaecendo */
.mi-splash.is-reduced .sp-mask-jamb, .mi-splash.is-reduced .sp-mask-leaf { animation: none; stroke-dashoffset: 0; }
.mi-splash.is-reduced .sp-handle, .mi-splash.is-reduced .sp-spark, .mi-splash.is-reduced .sp-motel,
.mi-splash.is-reduced .sp-ia, .mi-splash.is-reduced .sp-dot { animation: none; opacity: 1; transform: none; }
.mi-splash.is-reduced .mi-splash__bar { display: none; }
.mi-splash.is-reduced.is-leaving { animation: mi-sp-fadeout .3s ease-out forwards; }
.mi-splash.is-reduced.is-leaving .mi-splash__curtain { animation: none; }

/* integração com a landing: a entrada do título espera a abertura sair */
html.splash-on .hero__title .ln > span { animation-play-state: paused; }
