/* Animações do site. Só valem com o token motion = subtle ou lively (classe co-motion-* no <body>).
   Regra de ouro: nada fica escondido sem JavaScript. O motion.js só esconde o que está fora da tela
   e mostra quando chega nela; quem pede menos movimento (prefers-reduced-motion) não vê animação. */

.co-motion-subtle { --co-m-dist: 16px; --co-m-dur: .6s;  --co-m-step: 70ms;  --co-m-ease: cubic-bezier(.2, .7, .2, 1); }
.co-motion-lively { --co-m-dist: 34px; --co-m-dur: .85s; --co-m-step: 110ms; --co-m-ease: cubic-bezier(.16, 1, .3, 1); }

@keyframes co-rise { from { opacity: 0; transform: translateY(var(--co-m-dist)); } to { opacity: 1; transform: none; } }
@keyframes co-settle { from { opacity: 0; transform: scale(1.03); } to { opacity: 1; transform: none; } }
@keyframes co-zoom-out { from { transform: scale(1.12); } to { transform: none; } }

/* Entrada ao rolar (o motion.js marca com data-co-reveal só o que começa fora da tela) */
[data-co-reveal] {
  opacity: 0; transform: translateY(var(--co-m-dist));
  transition: opacity var(--co-m-dur) var(--co-m-ease), transform var(--co-m-dur) var(--co-m-ease), clip-path 1s var(--co-m-ease);
  transition-delay: calc(var(--co-i, 0) * var(--co-m-step));
}
[data-co-reveal].is-in { opacity: 1; transform: none; }
/* Lively: fotos abrem como uma janela */
.co-motion-lively [data-co-reveal="media"] { transform: none; clip-path: inset(9% 9% 9% 9% round var(--co-radius)); }
.co-motion-lively [data-co-reveal="media"].is-in { clip-path: inset(0 0 0 0 round var(--co-radius)); }
.co-motion-lively [data-co-reveal="media"] img { transform: scale(1.08); transition: transform 1.2s var(--co-m-ease); }
.co-motion-lively [data-co-reveal="media"].is-in img { transform: none; }

/* Hero: entrada em cascata ao abrir a página (só CSS; termina visível) */
:is(.co-motion-subtle, .co-motion-lively) .co-hero__copy > * { animation: co-rise var(--co-m-dur) var(--co-m-ease) both; }
:is(.co-motion-subtle, .co-motion-lively) .co-hero__copy > :nth-child(2) { animation-delay: calc(var(--co-m-step) * 1); }
:is(.co-motion-subtle, .co-motion-lively) .co-hero__copy > :nth-child(3) { animation-delay: calc(var(--co-m-step) * 2); }
:is(.co-motion-subtle, .co-motion-lively) .co-hero__copy > :nth-child(4) { animation-delay: calc(var(--co-m-step) * 3); }
:is(.co-motion-subtle, .co-motion-lively) .co-hero__media { animation: co-settle 1s var(--co-m-ease) .12s both; }
.co-motion-lively .co-hero--fullbleed .co-hero__bg :is(img, video) { animation: co-zoom-out 2.6s cubic-bezier(.2, .6, .2, 1) both; }

/* Header: sombra suave depois de rolar */
.co-header { transition: box-shadow .3s ease, background-color .3s ease; }
:is(.co-motion-subtle, .co-motion-lively) .co-header.is-scrolled { box-shadow: 0 6px 24px color-mix(in srgb, var(--co-text) 8%, transparent); }

/* Menu: sublinhado que cresce da esquerda */
:is(.co-motion-subtle, .co-motion-lively) .co-nav__list a { position: relative; }
:is(.co-motion-subtle, .co-motion-lively) .co-nav__list a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -5px; height: 2px; border-radius: 2px;
  background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .35s var(--co-m-ease);
}
:is(.co-motion-subtle, .co-motion-lively) .co-nav__list a:hover::after { transform: scaleX(1); transform-origin: left; }

/* Botões: sobem um pouco */
:is(.co-motion-subtle, .co-motion-lively) .co-btn { transition: background .2s, color .2s, border-color .2s, transform .25s var(--co-m-ease), box-shadow .25s ease; }
:is(.co-motion-subtle, .co-motion-lively) .co-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px -8px color-mix(in srgb, var(--co-primary) 55%, transparent); }
:is(.co-motion-subtle, .co-motion-lively) .co-btn:active { transform: translateY(0); box-shadow: none; }

/* Cartões: levantam; fotos dos cartões e da galeria aproximam */
:is(.co-motion-subtle, .co-motion-lively) :is(.co-card, .co-testimonials--grid .co-tcard, .co-testimonials--wall .co-tcard, .co-why--cards .co-why__item, .co-why--bento .co-why__item) {
  transition: transform .35s var(--co-m-ease), box-shadow .35s ease;
}
:is(.co-motion-subtle, .co-motion-lively) :is(.co-card, .co-testimonials--grid .co-tcard, .co-testimonials--wall .co-tcard, .co-why--cards .co-why__item, .co-why--bento .co-why__item):hover {
  transform: translateY(-4px); box-shadow: 0 16px 32px -12px color-mix(in srgb, var(--co-text) 22%, transparent);
}
:is(.co-motion-subtle, .co-motion-lively) :is(.co-card__media, .co-gallery__grid > *) { display: block; overflow: hidden; border-radius: var(--co-radius); }
:is(.co-motion-subtle, .co-motion-lively) :is(.co-card__media, .co-gallery__grid > *) img { transition: transform .8s var(--co-m-ease); }
:is(.co-motion-subtle, .co-motion-lively) :is(.co-card:hover .co-card__media, .co-gallery__grid > :hover) img { transform: scale(1.05); }

/* Links com seta: a seta anda */
:is(.co-motion-subtle, .co-motion-lively) :is(.co-footer__more, .co-announce__link) span { display: inline-block; transition: transform .25s var(--co-m-ease); }
:is(.co-motion-subtle, .co-motion-lively) :is(.co-footer__more, .co-announce__link):hover span { transform: translateX(4px); }

/* Perguntas frequentes: o "+" gira e a resposta desliza */
:is(.co-motion-subtle, .co-motion-lively) .co-faq__item summary::after { transition: transform .3s var(--co-m-ease); }
:is(.co-motion-subtle, .co-motion-lively) .co-faq__item[open] summary::after { content: "+"; transform: translateY(-50%) rotate(45deg); }
:is(.co-motion-subtle, .co-motion-lively) .co-faq__item[open] .co-faq__answer { animation: co-rise .45s var(--co-m-ease) both; }

/* Redes sociais do rodapé */
:is(.co-motion-subtle, .co-motion-lively) .co-footer__social a { transition: background .2s, color .2s, transform .25s var(--co-m-ease); }
:is(.co-motion-subtle, .co-motion-lively) .co-footer__social a:hover { transform: translateY(-2px); }

@media (prefers-reduced-motion: reduce) {
  [data-co-reveal] { opacity: 1 !important; transform: none !important; clip-path: none !important; }
  [data-co-reveal] img { transform: none !important; }
  :is(.co-motion-subtle, .co-motion-lively) :is(.co-hero__copy > *, .co-hero__media, .co-hero__bg img, .co-hero__bg video, .co-faq__answer) { animation: none !important; }
  :is(.co-motion-subtle, .co-motion-lively) *:hover { transform: none !important; }
}
