/* =========================================================
   Carregamento / transição de páginas — site todo (js/loader.js)
   Painel azul da Santa + brinde das taças do Figma (frame "taças").
   ========================================================= */
.loader {
  --loader-blue: #1737c3;
  --loader-cover: .55s;      /* = js/loader.js */
  --loader-lift: .6s;
  --loader-toast: .8s;
  --ease-premium: cubic-bezier(.645, .045, .355, 1);   /* transição de página da Agrumea */
  position: fixed; inset: 0; z-index: 1000;
  overflow: hidden;
  pointer-events: none;
}
.loader:not(.is-done) { pointer-events: auto; }   /* bloqueia cliques até o painel sair totalmente */
.loader.is-done { visibility: hidden; }

/* o conteúdo da página só aparece quando o painel começa a revelar */
body.is-loading > :not(.loader) { visibility: hidden; }

.loader__panel {
  position: absolute; left: 0; right: 0; top: 100%;           /* começa logo abaixo da tela */
  height: 100vh; height: 100dvh;
  background: var(--loader-blue);
  transform: translate3d(0, 0, 0);
  will-change: transform;
}
.loader.is-covering .loader__panel { animation: loader-cover var(--loader-cover) var(--ease-premium) both; }
.loader.is-covered  .loader__panel { transform: translate3d(0, -100%, 0); }
.loader.is-lifting  .loader__panel { animation: loader-lift var(--loader-lift) var(--ease-premium) both; }
@keyframes loader-cover { from { transform: translate3d(0, 0, 0); }     to { transform: translate3d(0, -100%, 0); } }
@keyframes loader-lift  { from { transform: translate3d(0, -100%, 0); } to { transform: translate3d(0, -205%, 0); } }

/* ---------- Brinde ---------- */
.loader__art {
  position: absolute; left: 50%; top: 50%;
  width: min(54vw, 300px);
  translate: -50% -50%;
  color: #fff;
}
.toast { display: block; width: 100%; height: auto; overflow: visible; fill: currentColor; }

/* cada taça gira presa pelo pé (no laço), como se estivesse na mão.
   Afastadas e inclinadas enquanto o painel sobe (sobem junto com o azul); a pausa é só o brinde */
.toast__glass { transform-box: view-box; }
.toast__glass--l { transform-origin: 140px 330px; transform: translate(-48px, 34px) rotate(-19deg); }
.toast__glass--r { transform-origin: 460px 330px; transform: translate(48px, 34px) rotate(19deg); }
.loader.is-toasting .toast__glass--l { animation: toast-l var(--loader-toast) both; }
.loader.is-toasting .toast__glass--r { animation: toast-r var(--loader-toast) both; }

/* afastadas e mais baixas → se aproximam → TIM-TIM (toque) → pequeno recuo → repousam encostadas.
   Sem tempo parado no fim: assim que as taças assentam, o painel sobe */
@keyframes toast-l {
  0%   { transform: translate(-48px, 34px) rotate(-19deg); animation-timing-function: cubic-bezier(.3, 0, .2, 1); }
  55%  { transform: translate(0, 0) rotate(0deg); animation-timing-function: cubic-bezier(.2, .7, .3, 1); }
  66%  { transform: translate(-5px, 1px) rotate(-3.4deg); animation-timing-function: cubic-bezier(.4, 0, .3, 1); }
  82%  { transform: translate(0, 0) rotate(.7deg); }
  94%, 100% { transform: translate(0, 0) rotate(0deg); }
}
@keyframes toast-r {
  0%   { transform: translate(48px, 34px) rotate(19deg); animation-timing-function: cubic-bezier(.3, 0, .2, 1); }
  55%  { transform: translate(0, 0) rotate(0deg); animation-timing-function: cubic-bezier(.2, .7, .3, 1); }
  66%  { transform: translate(5px, 1px) rotate(3.4deg); animation-timing-function: cubic-bezier(.4, 0, .3, 1); }
  82%  { transform: translate(0, 0) rotate(-.7deg); }
  94%, 100% { transform: translate(0, 0) rotate(0deg); }
}

/* traços do brinde: invisíveis até o toque; nascem no ponto de contato e "estalam" para fora */
.toast__spark { transform-box: fill-box; opacity: 0; }
.toast__spark--l { transform-origin: 100% 100%; }
.toast__spark--c { transform-origin: 50% 100%; }
.toast__spark--r { transform-origin: 0% 100%; }
.loader.is-toasting .toast__spark { animation: toast-spark var(--loader-toast) both; }
.loader.is-toasting .toast__spark--l,
.loader.is-toasting .toast__spark--r { animation-delay: 30ms; }
@keyframes toast-spark {
  0%, 55% { opacity: 0; transform: scale(.15); }
  56%     { opacity: 1; }
  64%     { transform: scale(1.14); animation-timing-function: cubic-bezier(.3, 0, .3, 1); }
  76%     { transform: scale(.95); }
  86%, 100% { opacity: 1; transform: scale(1); }
}

/* espera (página ainda carregando): os traços cintilam suavemente, as taças seguem encostadas */
.loader.is-holding .toast__spark { animation: toast-twinkle 1.1s ease-in-out infinite; opacity: 1; transform: scale(1); }
.loader.is-holding .toast__spark--l { animation-delay: .15s; }
.loader.is-holding .toast__spark--r { animation-delay: .3s; }
@keyframes toast-twinkle { 50% { opacity: .35; transform: scale(.82); } }

@media (prefers-reduced-motion: reduce) {
  .loader { display: none; }
}
