/* INÍCIO: "vitrine única", sem legendas. Título tamanho cartaz, a máquina como objeto e UM botão.
   Fundo: luz C + duas luzes que respiram devagar (só transform) + grade fina com máscara.
   Máquina (src/ui/hero.js): entra de baixo, flutua, inclina em 3D seguindo o cursor (ou o dedo), um reflexo de luz corre pela
   superfície dela, a sombra no chão encolhe quando ela sobe e, ao clicar/tocar, ela "aprova" um pagamento.
   Rolagem: as duas linhas do título se afastam e a máquina sobe girando. */
.hero { position: relative; z-index: 2; isolation: isolate; overflow-x: clip; overflow-y: visible; min-height: max(100svh, 680px); display: grid; grid-template-rows: minmax(0, 1fr) auto;
  padding-top: calc(var(--header-h) + 22px); color: var(--text-on-dark); background: var(--pf-c4); }

/* ---------- fundo ---------- */
.hero__fundo { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.hero__fundo .luz-c { opacity: .92; }
.aurora { position: absolute; border-radius: 50%; will-change: transform; }
.aurora--a { left: -18%; top: -30%; width: 75vw; height: 75vw; background: radial-gradient(closest-side, rgba(58, 134, 255, .38), rgba(11, 50, 153, .12) 55%, transparent 72%); animation: aurora-a 22s ease-in-out infinite alternate; }
.aurora--b { right: -22%; bottom: -38%; width: 70vw; height: 70vw; background: radial-gradient(closest-side, rgba(223, 11, 82, .42), rgba(223, 11, 82, .1) 55%, transparent 72%); animation: aurora-b 26s ease-in-out infinite alternate; }
@keyframes aurora-a { to { transform: translate(14vw, 10vh) scale(1.12); } }
@keyframes aurora-b { to { transform: translate(-12vw, -8vh) scale(1.08); } }
.hero__grade { position: absolute; inset: 0; opacity: .5;
  background-image: linear-gradient(rgba(181, 212, 244, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(181, 212, 244, .07) 1px, transparent 1px);
  background-size: 88px 88px; background-position: center top;
  -webkit-mask: radial-gradient(60% 55% at 50% 45%, #000, transparent 100%); mask: radial-gradient(60% 55% at 50% 45%, #000, transparent 100%); }
.hero { --gx: 70%; --gy: 45%; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; background: radial-gradient(560px circle at var(--gx) var(--gy), rgba(181, 212, 244, .1), transparent 70%); }
.hero::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 30%; z-index: 0; pointer-events: none; background: linear-gradient(rgba(2, 10, 34, 0), rgba(2, 10, 34, .7) 55%, var(--pf-c3)); }
.hero > .container, .hero__palco { position: relative; z-index: 1; }

/* ---------- palco: título cartaz + objeto ---------- */
.hero__palco { position: relative; display: grid; place-items: center start; min-height: 0; }
.hero__titulo { position: relative; z-index: 1; width: 100%; max-width: min(var(--max), 60vw); margin-inline: auto; padding-inline: var(--gutter); text-align: left; font-size: clamp(3.4rem, 6.4vw, 6.6rem); line-height: .98; letter-spacing: -.012em; }
.hero__l2 { margin-top: .04em; }
.hero__l1, .hero__l2 { display: block; white-space: normal; will-change: transform; }
.hero__l2 .t-red { color: var(--pf-red); }

/* ---------- a máquina ---------- */
.hero__obj { --mx: 30%; --my: 25%; position: absolute; z-index: 2; right: max(12px, min(4vw, calc((100% - var(--max)) / 2 + var(--gutter) * .15))); top: 50%; width: clamp(260px, 27vw, 440px);
  translate: 0 -30%; will-change: transform; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: pan-y; }
/* inclinação, flutuação e balanço vêm do JS (mola com inércia): aqui só a base */
.hero__inclina { position: relative; z-index: 1; will-change: transform; }
.hero__flutua { position: relative; }
html:not(.js) .hero__flutua { animation: flutua 7s ease-in-out infinite; }
@keyframes flutua { 50% { translate: 0 -14px; } }
/* halo de luz da marca atrás da máquina (anda um pouco ao contrário da inclinação: dá profundidade) */
.hero__halo { position: absolute; z-index: 0; left: -28%; right: -28%; top: -8%; bottom: 2%; border-radius: 50%; pointer-events: none; will-change: transform;
  background: radial-gradient(closest-side, rgba(58, 134, 255, .34), rgba(11, 50, 153, .16) 50%, transparent 72%); }
.hero__halo::after { content: ""; position: absolute; inset: 22% 18% 10% 30%; border-radius: 50%; background: radial-gradient(closest-side, rgba(223, 11, 82, .22), transparent 70%); }
.hero__montada img { position: relative; width: 100%; height: auto; rotate: -3deg; filter: drop-shadow(0 40px 46px rgba(1, 5, 16, .65)) drop-shadow(0 10px 14px rgba(1, 5, 16, .4)); }
/* reflexo de luz recortado no formato da máquina (a própria imagem é a máscara) e guiado pelo cursor/dedo */
.hero__brilho { position: absolute; inset: 0; rotate: -3deg; pointer-events: none; mix-blend-mode: screen; opacity: .9;
  -webkit-mask: url("../../assets/img/hero-maq-520.webp") center / 100% 100% no-repeat; mask: url("../../assets/img/hero-maq-520.webp") center / 100% 100% no-repeat;
  background: radial-gradient(42% 30% at var(--mx) var(--my), rgba(181, 212, 244, .42), rgba(181, 212, 244, .08) 55%, transparent 75%),
    linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, .16) 47%, transparent 56%) no-repeat;
  background-size: 100% 100%, 260% 100%; background-position: 0 0, 120% 0; }
.js .hero.is-pronto .hero__brilho { animation: varre 1.6s var(--ease) 1.1s 1 both; }
@keyframes varre { to { background-position: 0 0, -40% 0; } }
.hero__obj.is-aprovando .hero__brilho { animation: varre .9s var(--ease) 1 both; }
/* sombra no chão em duas camadas: ambiente (larga e suave) + contato (curta e escura). Escala e opacidade vêm do JS. */
.hero__chao { position: absolute; z-index: 0; left: 8%; right: 8%; bottom: -7%; height: 13%; border-radius: 50%; pointer-events: none; transform-origin: 50% 50%; will-change: transform, opacity;
  background: radial-gradient(closest-side, rgba(1, 5, 16, .55), rgba(1, 5, 16, .2) 60%, transparent); }
.hero__chao i { position: absolute; left: 24%; right: 24%; top: 30%; bottom: 30%; border-radius: 50%; background: radial-gradient(closest-side, rgba(1, 5, 16, .9), transparent); }
/* clique/toque: "aprovado" */
.hero__ok { position: absolute; z-index: 3; left: 4%; top: 30%; display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px 8px 8px; border-radius: 999px; pointer-events: none;
  background: var(--pf-white); color: var(--pf-blue); font-weight: 600; font-size: .9375rem; box-shadow: 0 18px 40px -14px rgba(1, 5, 16, .8);
  opacity: 0; scale: .6; translate: 0 10px; transition: opacity .3s ease, scale .5s cubic-bezier(.3, 1.6, .5, 1), translate .5s var(--ease); }
.hero__ok i { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--pf-ok); color: var(--pf-white); }
.hero__ok svg { width: 16px; }
.hero__obj.is-aprovando .hero__ok { opacity: 1; scale: 1; translate: 0 0; }
.hero__obj.is-aprovando .hero__montada img { animation: aperta .45s var(--ease); }
.hero__inclina { transition: none; }
@keyframes aperta { 30% { scale: .97; } }
/* anel que se expande do toque */
.hero__obj::after { content: ""; position: absolute; left: var(--tx, 50%); top: var(--ty, 50%); width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; pointer-events: none;
  box-shadow: 0 0 0 2px rgba(39, 196, 107, .8); opacity: 0; scale: 1; }
.hero__obj.is-aprovando::after { animation: anel .8s var(--ease); }
@keyframes anel { from { opacity: 1; scale: 1; } to { opacity: 0; scale: 6; } }

/* entrada */
.js .hero__obj { opacity: 0; }
/* a máquina só aparece quando se decide como ela entra: desmontada (is-3d) ou montada (is-sem-3d: sem peças/movimento reduzido) */
.js .hero.is-pronto .hero__obj:is(.is-3d, .is-sem-3d) { opacity: 1; transition: opacity .7s var(--ease); }
.js .hero__obj:not(.is-3d):not(.is-sem-3d) :is(.hero__montada, .hero__brilho) { opacity: 0; }
.js .hero__entra { translate: 0 70px; scale: .9; rotate: 6deg; transition: translate 1.4s var(--ease) .2s, scale 1.4s var(--ease) .2s, rotate 1.4s var(--ease) .2s; }
.js .hero.is-pronto .hero__entra { translate: 0 0; scale: 1; rotate: 0deg; }

/* ---------- base: frase + um CTA ---------- */
.hero__base { display: grid; align-items: end; padding-bottom: clamp(28px, 5vh, 56px); }
.hero__cta { display: grid; gap: 22px; justify-items: start; }
.hero__sub { font-size: clamp(1.125rem, 1rem + .5vw, 1.4rem); line-height: 1.4; color: var(--muted-on-dark); max-width: 34ch; text-wrap: balance; }
.hero__sub strong { color: var(--pf-white); font-weight: 600; white-space: nowrap; }
.hero__acoes { display: flex; }
.btn--grande { min-height: 66px; padding: 8px 8px 8px 30px; gap: 22px; font-size: 1.0625rem; }
.btn--grande .btn__ico, .btn--grande::before { width: 50px; height: 50px; }
.btn--grande::before { right: 8px; margin-top: -25px; }
.js .hero [data-in] { opacity: 0; translate: 0 16px; transition: opacity .9s var(--ease), translate .9s var(--ease); transition-delay: calc(var(--i, 0) * 90ms + .45s); }
.js .hero.is-pronto [data-in] { opacity: 1; translate: 0 0; }

/* ---------- celular: título, frase e botão na primeira tela; a máquina logo depois ---------- */
@media (max-width: 639px) {
  .hero { min-height: auto; display: flex; flex-direction: column; padding-top: 86px; }
  .hero__palco { display: contents; }
  .hero__titulo { order: 1; margin-top: 14px; padding: 0 var(--gutter); font-size: 14.2vw; line-height: .96; max-width: none; }
  .hero__l1, .hero__l2 { white-space: normal; }
  .hero__base { order: 2; padding-top: 22px; padding-bottom: 8px; }
  .hero__acoes, .hero__acoes .btn { width: 100%; }
  .hero__obj { order: 3; position: relative; right: auto; top: auto; translate: none; width: min(66vw, 270px); margin: 30px auto 44px; }
  .hero__ok { left: -6%; font-size: .875rem; }
  .aurora--a { width: 140vw; height: 140vw; } .aurora--b { width: 130vw; height: 130vw; }
}

@media (prefers-reduced-motion: reduce) {
  .aurora, .hero__flutua, .hero__brilho { animation: none !important; }
  .hero__halo { display: none; }
  .js .hero__obj, .js .hero [data-in] { opacity: 1; translate: none; transition: none; }
  .js .hero__obj :is(.hero__montada, .hero__brilho) { opacity: 1 !important; }
  .js .hero__entra { translate: none; scale: 1; rotate: 0deg; transition: none; }
  .hero__obj.is-aprovando::after, .hero__obj.is-aprovando .hero__montada img { animation: none; }
}

/* ---------- montagem 3D (src/ui/montagem.js) ----------
   As peças de fora são fatias da própria foto montada, no mesmo lugar e no mesmo giro dela: montada, as fatias SÃO a foto
   (nenhuma troca de imagem aparece). Por baixo a foto inteira fica visível só com a máquina fechada (cobre fios de 1 px entre
   as fatias e dá a sombra do conjunto). Aberta (is-aberta): só as peças, cada uma com sombra própria; as de dentro aparecem pelas frestas.
   Sem JS ou com "reduzir movimento": só a foto. */
.hero__inclina, .hero__flutua { transform-style: preserve-3d; }
.hero__montada { display: block; position: relative; }
.hero__exp { position: absolute; z-index: 2; left: 0; top: 0; width: 100%; height: auto; rotate: -3deg; transform-style: preserve-3d; pointer-events: none; display: none; }
.hero__obj.is-3d .hero__exp { display: block; }
.peca { position: absolute; max-width: none; will-change: transform; backface-visibility: hidden; transition: filter .45s ease; }
.peca[data-tipo="dentro"] { opacity: 0; will-change: transform, opacity; }
.hero__obj.is-aberta .peca { filter: drop-shadow(0 22px 22px rgba(1, 5, 16, .55)) drop-shadow(0 4px 5px rgba(1, 5, 16, .35)); }
.hero__obj.is-aberta .peca[data-tipo="dentro"] { filter: drop-shadow(0 12px 12px rgba(1, 5, 16, .6)); }
.hero__obj.is-3d :is(.hero__montada, .hero__brilho) { opacity: var(--montada, 1); }
@media (prefers-reduced-motion: reduce) { .hero__exp { display: none !important; } }

/* o botão e a frase ficam sempre na frente da máquina (desmontando, ela não cobre o CTA) */
.hero > .hero__base { position: relative; z-index: 4; }

/* área de confiança (logo abaixo do topo): números que só vão ao ar depois da confirmação escrita do cliente, e o selo PagSeguro */
.confianca { position: relative; padding: 0 0 clamp(40px, 5vw, 64px); }
.confianca__in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 32px; padding-top: 22px; border-top: 1px solid var(--line-dark); }
.confianca__nums { display: flex; flex-wrap: wrap; gap: 10px 36px; margin: 0; padding: 0; list-style: none; }
.confianca__nums b { font-family: var(--font-display); font-weight: 900; font-size: clamp(1.75rem, 1.2rem + 1.8vw, 2.75rem); line-height: 1; text-transform: uppercase; color: var(--pf-white); }
.selo-pagseguro { display: inline-flex; align-items: center; gap: 10px; margin: 0; padding: 8px 18px 8px 8px; border-radius: 999px; background: var(--pf-white); color: var(--pf-blue); font-weight: 800; font-size: .9375rem; box-shadow: 0 16px 30px -18px rgba(1, 5, 16, .9); }
.selo-pagseguro__ico { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--pf-ok); color: var(--pf-white); }
.selo-pagseguro__ico .ico { width: 16px; height: 16px; }
@media (max-width: 639px) { .confianca__in { justify-content: flex-start; } }