/* A Porta do mural: o momento em que a escola nasce e o momento em que as famílias podem entrar
   (protótipo aprovado em 01/11/2026, claude.ai/artifact/NgxmR2ni3f23bN1azQuxYz). Quem desenha é public/js/momento.js.
   Respeita "reduzir movimento": a cena aparece pronta, sem festa nem caminhada. */
.momento {
  --ceu-1: #BFE0FF; --ceu-2: #E6F0FF; --chao: #BDEBD3; --parede: #FFF6E5; --telhado: #FF8FB1; --folha-porta: #8A6CFF; --luz: #FFE9A8;
  position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; overflow-y: auto; background: var(--surface); color: var(--ink); font-family: var(--font-body);
}
.momento__cena { position: relative; flex: 0 0 330px; overflow: hidden; background: linear-gradient(180deg, var(--ceu-1), var(--ceu-2) 75%); }
.momento__chao { position: absolute; left: -10%; right: -10%; bottom: -62px; height: 124px; border-radius: 50% 50% 0 0 / 70% 70% 0 0; background: var(--chao); }

/* o sol é o símbolo da Redinha: nasce atrás da escola e a família chega em volta */
.momento__sol { position: absolute; left: 50%; top: calc(12px + env(safe-area-inset-top, 0px)); width: 112px; height: 112px; margin-left: -56px; animation: mom-nasce 1.1s cubic-bezier(.2, .9, .3, 1.1) both; }
.momento__sol svg { width: 100%; height: 100%; overflow: visible; display: block; }
.momento__sol .no { transform-box: fill-box; transform-origin: center; animation: mom-chega .5s cubic-bezier(.3, .8, .3, 1.6) both; }
.momento__sol .fio { stroke-dasharray: 50; animation: mom-liga .4s ease-out both; }
.momento__sol .n1, .momento__sol .f1 { animation-delay: .75s; } .momento__sol .n2, .momento__sol .f2 { animation-delay: .85s; }
.momento__sol .n3, .momento__sol .f3 { animation-delay: .95s; } .momento__sol .n4, .momento__sol .f4 { animation-delay: 1.05s; }
.momento__sol .n5, .momento__sol .f5 { animation-delay: 1.15s; }
@keyframes mom-nasce { from { transform: translateY(150px) scale(.8); } to { transform: none; } }
@keyframes mom-chega { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes mom-liga { from { stroke-dashoffset: 50; } to { stroke-dashoffset: 0; } }

/* a escola */
.momento__escola { position: absolute; left: 68%; bottom: 34px; width: 176px; height: 126px; margin-left: -88px; transform-origin: 50% 100%; animation: mom-brota .6s .35s cubic-bezier(.3, .8, .3, 1.3) both; }
@keyframes mom-brota { from { transform: scale(.4, .2); opacity: 0; } to { transform: none; opacity: 1; } }
.momento__telhado { position: absolute; left: -12px; right: -12px; top: 0; height: 40%; background: var(--telhado); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.momento__parede { position: absolute; left: 0; right: 0; top: 38%; bottom: 0; background: var(--parede); border-radius: 8px 8px 0 0; }
.momento__janela { position: absolute; top: 14%; width: 25%; aspect-ratio: 1; border-radius: 10px; background: var(--ceu-2); overflow: hidden; box-shadow: inset 0 0 0 3px #fff; transition: background-color .4s ease; }
.momento__janela--e { left: 8%; } .momento__janela--d { right: 8%; }
.momento__janela img { position: absolute; left: 8%; bottom: -8%; width: 84%; transform: translateY(110%); }
.momento__porta { position: absolute; left: 50%; bottom: 0; width: 28%; height: 66%; transform: translateX(-50%); background: var(--luz); border-radius: 40px 40px 0 0; perspective: 420px; box-shadow: 0 0 0 3px #fff; }
.momento__folha-porta { position: absolute; inset: 0; background: var(--folha-porta); border-radius: 40px 40px 0 0; transform-origin: 0 50%; transition: transform .75s cubic-bezier(.3, .8, .3, 1); }
.momento__folha-porta::after { content: ""; position: absolute; right: 12%; top: 54%; width: 10%; aspect-ratio: 1; background: #FFC94D; border-radius: 50%; }
.momento--aberta .momento__folha-porta { transform: rotateY(-105deg); }
.momento--aberta .momento__porta { animation: mom-brilha 1.6s ease-out both; }
.momento--aberta .momento__janela { background: var(--luz); }
@keyframes mom-brilha { 0% { box-shadow: 0 0 0 3px #fff; } 40% { box-shadow: 0 0 0 3px #fff, 0 0 42px 14px var(--luz); } 100% { box-shadow: 0 0 0 3px #fff, 0 0 18px 4px var(--luz); } }

/* a turma: cada bichinho anda até a porta aos pulinhos e entra de verdade */
.momento__turma { position: absolute; inset: 0; pointer-events: none; }
.momento__bicho { position: absolute; bottom: 30px; width: 40px; height: 40px; animation: mom-fila .5s cubic-bezier(.3, .8, .3, 1.3) both; }
.momento__bicho img { width: 100%; height: 100%; display: block; filter: drop-shadow(0 3px 0 rgba(43, 34, 51, .10)); }
@keyframes mom-fila { from { transform: translateX(-90px); opacity: 0; } to { transform: none; opacity: 1; } }
.momento--espera .momento__bicho img { animation: mom-espia 2.6s ease-in-out infinite; animation-delay: var(--espia); }
@keyframes mom-espia { 0%, 74%, 100% { transform: none; } 82% { transform: translateY(-9px); } 90% { transform: translateY(0) scale(1.06, .94); } }
.momento__bicho--entra { animation: mom-anda .95s cubic-bezier(.45, 0, .6, 1) both; animation-delay: var(--atraso); }
.momento__bicho--entra img { animation: mom-pulinhos .32s ease-in-out 3; animation-delay: var(--atraso); }
@keyframes mom-anda { 0% { transform: none; opacity: 1; } 82% { transform: translateX(var(--ate)) scale(1); opacity: 1; } 100% { transform: translateX(calc(var(--ate) + 6px)) scale(.55); opacity: 0; } }
@keyframes mom-pulinhos { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-13px); } }

/* a festa: bolinhas e coraçõezinhos nas cores da marca saem do sol */
.momento__festa { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 3; }
.momento__festa i { position: absolute; left: var(--ox); top: var(--oy); width: var(--t); height: var(--t); border-radius: 50%; background: var(--c); opacity: 0; animation: mom-voa 1.9s cubic-bezier(.15, .7, .4, 1) both; animation-delay: var(--d); }
.momento__festa i.momento__coracao { border-radius: 0; background: none; color: var(--c); }
.momento__coracao svg { width: 100%; height: 100%; display: block; fill: currentColor; }
@keyframes mom-voa { 0% { transform: translate(0, 0) scale(.3); opacity: 0; } 12% { opacity: 1; } 55% { transform: translate(var(--x), var(--y)) scale(1) rotate(var(--r)); opacity: 1; } 100% { transform: translate(var(--x), calc(var(--y) + 170px)) scale(.8) rotate(var(--r)); opacity: 0; } }

/* a folha com o texto */
.momento__texto { position: relative; z-index: 2; flex: 1 0 auto; margin-top: -22px; background: var(--surface); border-radius: 26px 26px 0 0; padding: 24px 22px calc(22px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 14px; }
.momento__texto > * { animation: mom-sobe .5s 1.25s cubic-bezier(.2, .9, .3, 1) both; }
.momento--troca .momento__texto > * { animation-delay: .1s; }
@keyframes mom-sobe { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.momento__titulo { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 34px; line-height: 1.08; text-wrap: balance; overflow-wrap: anywhere; }
.momento__frase { margin: 0; font-size: 16px; line-height: 23px; font-weight: 600; color: var(--ink-soft); text-wrap: pretty; }
.momento__endereco { align-self: flex-start; max-width: 100%; display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 7px 8px 7px 14px; border-radius: 16px; background: var(--surface-soft); font-size: 14px; font-weight: 700; }
.momento__endereco span { min-width: 0; overflow-wrap: anywhere; }
.momento__endereco button { flex-shrink: 0; font: 700 13px var(--font-body); min-height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--surface); color: var(--ink); cursor: pointer; }
.momento__passos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.momento__passos li { display: flex; align-items: center; gap: 10px; font-size: 15px; line-height: 20px; font-weight: 700; color: var(--ink-soft); }
.momento__passos small { display: block; font-size: 13px; font-weight: 600; }
.momento__marca { flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 800; background: var(--surface-soft); color: var(--ink-soft); }
.momento__passos .feito { color: var(--ink); } .momento__passos .feito .momento__marca { background: var(--mint-soft); color: var(--mint-ink); }
.momento__passos .agora { color: var(--ink); } .momento__passos .agora .momento__marca { background: var(--pink); color: var(--on-pink); }
.momento__acoes { display: flex; flex-direction: column; gap: 8px; margin-top: auto; }
.momento__botao { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 56px; border: 0; border-radius: 18px; font: 700 17px var(--font-body); text-decoration: none; cursor: pointer; background: var(--pink); color: var(--on-pink); }
.momento__botao--suave { min-height: 48px; font-size: 15px; background: var(--surface-soft); color: var(--ink); }
.momento__miudo { margin: 0; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--ink-soft); text-align: center; }

/* no computador, a cena à esquerda e o texto à direita */
@media (min-width: 860px) {
  .momento { flex-direction: row; overflow: hidden; }
  .momento__cena { flex: 1 1 56%; height: 100%; }
  .momento__chao { bottom: -48px; height: 150px; }
  .momento__sol { top: 12%; width: 150px; height: 150px; margin-left: -75px; }
  .momento__escola { left: 64%; bottom: 56px; width: 236px; height: 166px; margin-left: -118px; }
  .momento__bicho { bottom: 52px; width: 42px; height: 42px; }
  .momento__texto { flex: 1 1 44%; margin-top: 0; border-radius: 0; padding: 40px clamp(32px, 5vw, 72px); justify-content: center; overflow-y: auto; }
  .momento__acoes { margin-top: 6px; }
  .momento__titulo { font-size: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  .momento__sol, .momento__sol .no, .momento__sol .fio, .momento__escola, .momento__bicho, .momento__bicho img, .momento__texto > *, .momento--aberta .momento__porta { animation: none; }
  .momento__festa, .momento__bicho--entra { display: none; }
  .momento__folha-porta { transition: none; }
  .momento__janela img { transform: none; }
}
