/* Versão 2 do site: animação entre as áreas (o resto do visual vem de ../site/site.css).
   Ida: o quadro clicado cresce até cobrir a tela na cor da área (.transicao, criado pelo anim.js).
   Chegada: a mesma cor cobre a página (html.entrando::before) e sobe como uma cortina, revelando a capa da área. */
@view-transition { navigation: none; }

.transicao {
  position: fixed; z-index: 200; pointer-events: none; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  color: #fff; will-change: top, left, width, height, border-radius;
}
.transicao-conteudo { display: flex; flex-direction: column; align-items: center; gap: 18px; opacity: 0; }
.transicao-conteudo svg { width: 64px; height: 64px; }
.transicao-conteudo b { font-size: clamp(2rem, 6vw, 3.6rem); font-weight: 600; letter-spacing: -0.02em; }

html.entrando::before {
  content: ""; position: fixed; inset: 0; z-index: 200; background: var(--entrada);
  pointer-events: none;
}
html.entrando.revelar::before { animation: cortina .7s cubic-bezier(.76, 0, .24, 1) forwards; }
@keyframes cortina { to { clip-path: inset(0 0 100% 0); } }

/* a capa da área chega logo atrás da cortina */
html.entrando.revelar .area-capa .texto > *,
html.entrando.revelar .area-capa .simbolo,
html.entrando.revelar .capa-texto > *,
html.entrando.revelar .mosaico { animation: subir .6s cubic-bezier(.2, .7, .2, 1) both; }
html.entrando.revelar .area-capa .texto > :nth-child(2), html.entrando.revelar .capa-texto > :nth-child(2) { animation-delay: .32s; }
html.entrando.revelar .area-capa .texto > :nth-child(3), html.entrando.revelar .capa-texto > :nth-child(3) { animation-delay: .38s; }
html.entrando.revelar .area-capa .texto > :nth-child(n+4) { animation-delay: .44s; }
html.entrando.revelar .area-capa .texto > :first-child, html.entrando.revelar .capa-texto > :first-child { animation-delay: .26s; }
html.entrando.revelar .area-capa .simbolo, html.entrando.revelar .mosaico { animation-delay: .4s; }
@keyframes subir { from { opacity: 0; transform: translateY(18px); } }

/* o símbolo da área "pousa" girando um pouco */
html.entrando.revelar .area-capa .simbolo { animation-name: pousar; }
@keyframes pousar { from { opacity: 0; transform: scale(.7) rotate(-12deg); } }

@media (prefers-reduced-motion: reduce) {
  html.entrando::before, .transicao { display: none; }
  html.entrando.revelar * { animation: none !important; }
}
