/*
 * Motion System — Estilo Smooth (60/120 fps reais na GPU):
 * - Curva unificada quintic silk: cubic-bezier(.16, 1, .3, 1)
 * - Exclusivamente `transform` e `opacity` no compositor (zero filter:blur, zero reflow)
 */

/* Sublinhado fluido nos links do menu desktop */
@media (min-width: 981px) {
  .site-nav a:not(.site-nav__grade) {
    padding-bottom: 3px;
    background: linear-gradient(currentColor, currentColor) no-repeat 100% 100% / 0 1px;
    transition: color .3s cubic-bezier(.16, 1, .3, 1), background-size .45s cubic-bezier(.16, 1, .3, 1);
  }
  .site-nav a:not(.site-nav__grade):hover,
  .site-nav a:not(.site-nav__grade):focus-visible {
    background-position: 0 100%;
    background-size: 100% 1px;
  }
}

/* Título do Hero */
.hero__title .line { display: block; overflow: clip; padding-bottom: .08em; margin-bottom: -.08em; }
.hero__title .word { display: inline-block; }

/* Entrada sedosa do Hero */
[data-live] .hero__content > .hero__eyebrow { animation: sx-fade-up .65s .02s cubic-bezier(.16, 1, .3, 1) backwards; }
[data-live] .hero__title .word {
  animation: sx-word-up .75s cubic-bezier(.16, 1, .3, 1) backwards;
  animation-delay: calc(.04s + .055s * var(--i, 0));
}
[data-live] .hero__content > .hero__text { animation: sx-fade-up .72s .16s cubic-bezier(.16, 1, .3, 1) backwards; }
[data-live] .hero__content > .hero__actions { animation: sx-fade-up .72s .24s cubic-bezier(.16, 1, .3, 1) backwards; }
[data-live] .hero__perks li { animation: sx-fade-up .62s cubic-bezier(.16, 1, .3, 1) backwards; }
[data-live] .hero__perks li:nth-child(1) { animation-delay: .32s; }
[data-live] .hero__perks li:nth-child(2) { animation-delay: .38s; }
[data-live] .hero__perks li:nth-child(3) { animation-delay: .44s; }

@keyframes sx-word-up { from { transform: translate3d(0, 104%, 0); } }
@keyframes sx-fade-up { from { transform: translate3d(0, 18px, 0); opacity: 0; } }

/* Cabeçalhos de seção e painéis principais entram com deslizamento suave */
[data-live] :is(.section-head, .trust-strip__inner, .td-panel) {
  opacity: 0;
  transform: translate3d(0, 20px, 0);
  transition:
    opacity .72s cubic-bezier(.16, 1, .3, 1),
    transform .72s cubic-bezier(.16, 1, .3, 1);
}
[data-live] :is(.section-head, .trust-strip__inner, .td-panel).is-in {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* Revelação em cascata sedosa dos cards e blocos */
[data-live] :is([data-motion~="rise"], [data-motion~="rule"], [data-motion~="deal"], [data-motion~="fly"], [data-motion~="split"], [data-motion~="zoom"]) > * {
  opacity: 0;
  transform: translate3d(0, 22px, 0);
  transition:
    opacity .7s cubic-bezier(.16, 1, .3, 1),
    transform .7s cubic-bezier(.16, 1, .3, 1);
  transition-delay: calc(min(var(--i, 0), 5) * 65ms);
}
[data-live] [data-motion].is-in > * {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

@media (max-width: 768px) {
  [data-live] :is(.section-head, .trust-strip__inner, .td-panel) {
    transform: translate3d(0, 14px, 0);
    transition-duration: .55s;
  }
  [data-live] :is([data-motion~="rise"], [data-motion~="rule"], [data-motion~="deal"], [data-motion~="fly"], [data-motion~="split"], [data-motion~="zoom"]) > * {
    transform: translate3d(0, 14px, 0);
    transition-duration: .55s;
    transition-delay: calc(min(var(--i, 0), 3) * 45ms);
  }
}

/* ===== Barra de selos: caixa entra, selos em sequência, ícone se desenha e um brilho percorre a borda ===== */
@media (prefers-reduced-motion: no-preference) {
  [data-live] .trust-strip__inner { position: relative; }
  [data-live] .trust-item { --d: calc(.14s + var(--n, 0) * .09s); }
  [data-live] .trust-item:nth-child(2) { --n: 1; }
  [data-live] .trust-item:nth-child(3) { --n: 2; }
  [data-live] .trust-item:nth-child(4) { --n: 3; }
  [data-live] .trust-item > div {
    opacity: 0; transform: translate3d(10px, 0, 0);
    transition: opacity .6s var(--d) cubic-bezier(.16, 1, .3, 1), transform .6s var(--d) cubic-bezier(.16, 1, .3, 1);
  }
  [data-live] .trust-item__icon {
    opacity: 0; scale: .6;
    transition:
      opacity .45s var(--d) ease-out,
      scale .7s var(--d) cubic-bezier(.34, 1.56, .64, 1),
      translate .3s ease, box-shadow .3s ease, border-color .3s ease;
  }
  [data-live] .trust-item__icon path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .9s calc(var(--d) + .15s) cubic-bezier(.65, 0, .35, 1); }
  [data-live] .trust-strip__inner.is-in .trust-item > div { opacity: 1; transform: none; }
  [data-live] .trust-strip__inner.is-in .trust-item__icon { opacity: 1; scale: 1; }
  [data-live] .trust-strip__inner.is-in .trust-item__icon path { stroke-dashoffset: 0; }

  /* Fio de luz que dá uma volta só pela borda da caixa */
  [data-live] .trust-strip__inner::after {
    content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(var(--glow-b), .95), transparent) no-repeat;
    background-size: 28% 100%; background-position: -40% 0;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    opacity: 0;
  }
  [data-live] .trust-strip__inner.is-in::after { animation: trust-sweep 1.6s .35s cubic-bezier(.45, 0, .2, 1) both; }
  @keyframes trust-sweep {
    0% { opacity: 0; background-position: -40% 0; }
    15% { opacity: 1; }
    85% { opacity: 1; }
    100% { opacity: 0; background-position: 140% 0; }
  }
}
/* Hover (só com mouse): o ícone sobe um pouco e acende */
@media (hover: hover) and (pointer: fine) {
  .trust-item:hover .trust-item__icon {
    translate: 0 -2px; border-color: rgba(var(--glow-b), .55);
    box-shadow: 0 16px 30px -12px rgba(var(--glow-a), .75), 0 0 18px -4px rgba(var(--glow-b), .5), inset 0 1px 0 rgba(255, 255, 255, .14);
  }
}

/* ===== Faixa que corre: losangos pulsam em sequência (o ritmo e a pausa ficam no main.js) ===== */
@media (prefers-reduced-motion: no-preference) {
  .marquee__track b { display: inline-block; animation: marquee-diamond 2.4s ease-in-out infinite; }
  .marquee__track b:nth-of-type(3n+2) { animation-delay: .8s; }
  .marquee__track b:nth-of-type(3n) { animation-delay: 1.6s; }
  @keyframes marquee-diamond {
    0%, 100% { opacity: .55; scale: 1; text-shadow: none; }
    50% { opacity: 1; scale: 1.35; text-shadow: 0 0 10px rgba(var(--glow-b), .9); }
  }
}

/* ===== Seção do app: botões das lojas e selos entram em sequência; ícones dos selos se desenham ===== */
@media (prefers-reduced-motion: no-preference) {
  [data-live] #app .store, [data-live] #app .app-qr {
    opacity: 0; translate: 0 12px;
    transition: opacity .6s var(--d, .3s) cubic-bezier(.16, 1, .3, 1), translate .6s var(--d, .3s) cubic-bezier(.16, 1, .3, 1),
      border-color .4s, transform .4s, background-color .4s, box-shadow .4s;
  }
  [data-live] #app .store:nth-child(1) { --d: .3s; }
  [data-live] #app .store:nth-child(2) { --d: .38s; }
  [data-live] #app .store:nth-child(3) { --d: .46s; }
  [data-live] #app .app-qr { --d: .6s; }
  [data-live] #app .anywhere__inner.is-in :is(.store, .app-qr) { opacity: 1; translate: 0 0; }

  [data-live] #app .app__badge { opacity: 0; scale: .85; transition: opacity .6s var(--d) ease-out, scale .8s var(--d) cubic-bezier(.34, 1.56, .64, 1); }
  [data-live] #app .app__badge--sec { --d: .55s; }
  [data-live] #app .app__badge--gli { --d: .75s; }
  [data-live] #app .app__badge path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1s calc(var(--d) + .2s) cubic-bezier(.65, 0, .35, 1); }
  [data-live] #app .anywhere__inner.is-in .app__badge { opacity: 1; scale: 1; }
  [data-live] #app .anywhere__inner.is-in .app__badge path { stroke-dashoffset: 0; }
}
