/* ClipAI -- landing sem imagens (FASE 2 do redesign).
   Carrega depois do style.css e refina o bloco "LANDING" de la. Tudo o que
   se move usa transform/opacity e os tokens de motion/tokens.css. */

/* ============ AURORA EM WEBGL ============
   O canvas entra em .fx (motion/scenes/aurora.js). Com ele no ar, a aurora
   em CSS sai -- se o WebGL faltar, a classe nunca entra e o CSS continua. */
.fx-aurora-gl { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; }
.fx.com-gl .fx-aurora { display: none; }

/* ============ TITULO: revelacao por palavra ============ */
.m-palavra {
  display: inline-block; overflow: hidden; vertical-align: bottom;
  /* folga para as descendentes (g, p, ç) nao serem cortadas pela mascara */
  padding-bottom: 0.16em; margin-bottom: -0.16em;
}
.m-titulo .m-palavra > * {
  /* Curta de proposito: o titulo e o maior texto da pagina (o LCP). Cada
     palavra escondida atrasa a "pintura principal" -- com 900 ms + 70 ms por
     palavra o LCP da landing triplicou. Assim a frase fecha em ~0,6 s. */
  display: inline-block; transform: translateY(112%);
  transition: transform var(--m-dur-3) var(--m-ease-saida);
  transition-delay: calc(var(--m-i, 0) * 36ms);
}
.m-titulo.m-titulo-visto .m-palavra > * { transform: none; }

/* ============ HERO: VOD virando clipe ============ */
.lp-vod-canvas { display: block; width: 100%; height: calc(100% - 35px); }
/* O fragmento que se solta da faixa e pousa no card. Fica centrado no ponto
   do translate (margens negativas) para o JS so informar coordenadas. */
.lp-voo {
  position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none;
  width: 190px; height: 338px; margin: -169px 0 0 -95px; border-radius: 22px;
  opacity: 0;
  background: linear-gradient(165deg,
    hsl(var(--m-matiz, 205) 80% 62% / 0.95), hsl(var(--m-matiz, 205) 70% 30% / 0.9));
  box-shadow: 0 0 46px hsl(var(--m-matiz, 205) 90% 60% / 0.55);
}
/* O card muda de "cena" a cada clipe: a matiz vem do JS por --m-matiz. */
.lp-clip-cam {
  background: linear-gradient(160deg,
    hsl(var(--m-matiz, 205) 42% 26%), hsl(var(--m-matiz, 205) 44% 12%));
}
.lp-clip { border-color: hsl(var(--m-matiz, 205) 85% 66% / 0.4); }
.lp-clip-score b { font-variant-numeric: tabular-nums; font-weight: 800; }
/* Legenda karaoke: cada palavra e um <i>; acende quando "falada". */
.lp-clip-legenda span i {
  display: inline-block; font-style: normal; color: rgba(255, 255, 255, 0.5);
  margin: 0 0.16em;   /* o espaco entre palavras e margem: a palavra ativa cresce sem encostar */
  transition: color var(--m-dur-1) linear, scale var(--m-dur-2) var(--m-mola-viva);
}
.lp-clip-legenda span i.dita { color: #fff; }
.lp-clip-legenda span i.ativa { color: #ffe14d; scale: 1.14; }

/* ============ ANTES E DEPOIS, em codigo ============ */
.lp-vod-faixa { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.lp-vod-faixa rect { fill: rgba(92, 192, 245, 0.24); }
.lp-vod-faixa rect.quente { fill: #d7f0ff; opacity: 0.4; }
@keyframes m-lp-quente { to { opacity: 1; } }
.rodando .lp-vod-faixa rect.quente {
  animation: m-lp-quente var(--m-dur-3) var(--m-ease-saida) 1.2s both;
}
.lp-vod-horas {
  position: absolute; left: 12px; right: 12px; bottom: 24px; z-index: 2;
  display: flex; justify-content: space-between;
  font-size: 0.6rem; font-weight: 600; color: rgba(255, 255, 255, 0.5);
  font-variant-numeric: tabular-nums;
}
/* A varredura e o cursor da barra andavam animando `left`; agora e translate. */
@keyframes m-lp-scan {
  0%   { transform: translateX(-100%); opacity: 0; }
  12%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { transform: translateX(300%); opacity: 0; }
}
.lp-tcard-vod .lp-vod-scan { left: 0; transform: translateX(-100%); }
.rodando .lp-tcard-vod .lp-vod-scan {
  animation: m-lp-scan 1.5s cubic-bezier(0.5, 0, 0.5, 1) 0.2s both;
}
@keyframes m-lp-scrub { 0%, 100% { transform: translateX(3%); } 50% { transform: translateX(92%); } }
.lp-tcard-barra i {
  left: 0; top: -3px; width: 100%; height: 11px; background: none; box-shadow: none;
  border-radius: 0; animation: m-lp-scrub 4s ease-in-out infinite;
}
.lp-tcard-barra i::after {
  content: ""; position: absolute; left: 0; top: 0; width: 11px; height: 11px;
  border-radius: 3px; background: var(--accent); box-shadow: 0 0 10px var(--accent);
}

/* Capas geradas: gradiente + tipografia, no mesmo desenho da capa real
   (quadro cheio + titulo em caixa alta numa faixa azul no centro). */
.lp-clipe { --m-matiz: 205; }
.lp-clipe:nth-child(2) { --m-matiz: 262; }
.lp-clipe:nth-child(3) { --m-matiz: 158; }
.lp-clipe:nth-child(4) { --m-matiz: 24; }
.lp-clipe {
  background:
    radial-gradient(70% 34% at 50% 26%, hsl(var(--m-matiz) 70% 58% / 0.55), transparent 70%),
    radial-gradient(90% 40% at 50% 96%, hsl(var(--m-matiz) 80% 40% / 0.5), transparent 72%),
    linear-gradient(170deg, hsl(var(--m-matiz) 46% 24%), hsl(var(--m-matiz) 50% 9%));
}
.lp-capa-titulo {
  position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%);
  padding: 4px 2px; text-align: center; line-height: 1.12;
  background: var(--accent-forte); color: var(--sobre-accent);
  font-size: clamp(0.4rem, 0.85vw, 0.56rem); font-weight: 800;
  letter-spacing: 0.02em; text-transform: uppercase;
}

/* ============ TRES PASSOS: micro-cenas ============
   Cada passo troca o icone por uma cena SVG. O estado BASE (sem animacao) ja
   e a cena completa -- e o que aparece com movimento reduzido. As animacoes
   so rodam com o passo revelado na tela. */
.lp-step-cena {
  display: block; width: 132px; height: 72px; margin: 6px auto 16px;
  color: var(--accent);
}
.lp-step-cena * { transform-box: fill-box; transform-origin: center; }
.lp-step-cena .c-traco { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.lp-step-cena .c-fraco { opacity: 0.32; }
.lp-step-cena .c-cheio { fill: currentColor; }
.lp-step-cena .c-campo { fill: rgba(92, 192, 245, 0.08); stroke: rgba(92, 192, 245, 0.4); stroke-width: 1.4; }
.lp-step.revelado .lp-step-cena .anima { animation-play-state: running; }
.lp-step-cena .anima { animation-play-state: paused; }

@keyframes m-cena-cola   { 0%, 12% { opacity: 0; transform: translateX(26px); } 30%, 100% { opacity: 1; transform: none; } }
@keyframes m-cena-pisca  { 0%, 45% { opacity: 1; } 50%, 95% { opacity: 0; } 100% { opacity: 1; } }
@keyframes m-cena-varre  { 0% { transform: translateX(0); opacity: 0; } 8% { opacity: 1; } 62% { opacity: 1; } 70%, 100% { transform: translateX(104px); opacity: 0; } }
@keyframes m-cena-pico   { 0%, 20% { opacity: 0.3; transform: scaleY(0.72); } 34%, 100% { opacity: 1; transform: scaleY(1); } }
@keyframes m-cena-cai    { 0%, 10% { opacity: 0; transform: translateY(-16px); } 34%, 100% { opacity: 1; transform: none; } }
@keyframes m-cena-check  { 0%, 40% { opacity: 0; transform: scale(0.4); } 56%, 100% { opacity: 1; transform: scale(1); } }

.cena-colar .link   { animation: m-cena-cola 4.2s var(--m-ease-saida) infinite; }
.cena-colar .cursor { animation: m-cena-pisca 1.1s linear infinite; }
.cena-varrer .agulha { animation: m-cena-varre 4.2s linear infinite; }
.cena-varrer .pico   { transform-origin: bottom; animation: m-cena-pico 4.2s var(--m-ease-saida) infinite; }
.cena-varrer .pico.p2 { animation-delay: 0.5s; }
.cena-varrer .pico.p3 { animation-delay: 1s; }
.cena-baixar .clipe { animation: m-cena-cai 4.2s var(--m-mola-suave) infinite; }
.cena-baixar .ok    { animation: m-cena-check 4.2s var(--m-mola-viva) infinite; }

/* ============ BENTO: inclinacao 3D + borda de luz + mini-cenas ============ */
.lp-bento { perspective: 1100px; }
/* A inclinacao usa a propriedade `rotate` (eixo + angulo), separada de
   `transform`: o reveal do efeitos.js e o hover ja ocupam o transform. */
.lp-b {
  rotate: var(--m-ex, 1) var(--m-ey, 0) 0 var(--m-ang, 0deg);
  transition: transform var(--m-dur-3) var(--m-ease-saida),
              rotate var(--m-dur-3) var(--m-ease-saida),
              border-color var(--m-dur-3) linear, box-shadow var(--m-dur-3) linear;
}
.lp-b-luz {
  position: absolute; inset: 0; border-radius: inherit; padding: 1.5px;
  overflow: hidden; pointer-events: none; opacity: 0;
  transition: opacity var(--m-dur-3) linear;
  /* so o anel da borda fica visivel: caixa inteira MENOS a caixa de conteudo */
  -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);
}
@keyframes m-gira { to { transform: rotate(1turn); } }
.lp-b-luz i {
  position: absolute; left: 50%; top: 50%; width: 220%; aspect-ratio: 1;
  margin: -110% 0 0 -110%;
  background: conic-gradient(from 0deg, transparent 0 60%,
              rgba(92, 192, 245, 0.85) 76%, #fff 84%, rgba(92, 192, 245, 0.85) 92%, transparent 100%);
  animation: m-gira 4.5s linear infinite; animation-play-state: paused;
}
.lp-b:hover .lp-b-luz, .lp-b-grande .lp-b-luz { opacity: 1; }
.lp-b:hover .lp-b-luz i, .lp-b-grande .lp-b-luz i { animation-play-state: running; }
.lp-b:hover { border-color: transparent; }

/* Mini-cena no topo de cada card (no lugar do icone parado). */
.lp-b-mini {
  position: relative; height: 62px; margin-bottom: 14px; border-radius: 12px;
  background: var(--accent-suave); border: 1px solid rgba(92, 192, 245, 0.26);
  overflow: hidden; display: flex; align-items: center; justify-content: center; gap: 6px;
  color: var(--accent);
}
.lp-b-grande .lp-b-mini { height: 150px; margin-bottom: 20px; flex: 1; min-height: 150px; }

/* 9:16 -- o quadro deitado vira em pe */
@keyframes m-mini-vira {
  0%, 18%   { rotate: 90deg; scale: 0.9; }
  40%, 82%  { rotate: 0deg; scale: 1; }
  100%      { rotate: 90deg; scale: 0.9; }
}
.mini-vertical .quadro {
  width: 58px; height: 103px; border-radius: 10px; position: relative;
  border: 2px solid var(--accent); background: rgba(92, 192, 245, 0.14);
  animation: m-mini-vira 4.6s var(--m-ease-ida-volta) infinite;
}
.mini-vertical .quadro::before, .mini-vertical .quadro::after {
  content: ""; position: absolute; left: 22%; right: 22%; height: 3px; border-radius: 2px;
  background: currentColor; opacity: 0.6; bottom: 22%;
}
.mini-vertical .quadro::after { left: 32%; right: 32%; bottom: 14%; opacity: 0.35; }

/* legenda -- as palavras acendem em sequencia */
@keyframes m-mini-fala { 0%, 100% { opacity: 0.35; scale: 1; } 12%, 30% { opacity: 1; scale: 1.08; } }
.mini-legenda b {
  font-size: 0.74rem; font-weight: 800; letter-spacing: 0.03em; color: #fff;
  animation: m-mini-fala 2.7s linear infinite;
}
.mini-legenda b:nth-child(2) { animation-delay: 0.45s; }
.mini-legenda b:nth-child(3) { animation-delay: 0.9s; }

/* capa -- a faixa do titulo entra no quadro */
@keyframes m-mini-faixa { 0%, 14% { transform: translateX(-104%); } 36%, 86% { transform: none; } 100% { transform: translateX(104%); } }
.mini-capa .quadro {
  position: relative; width: 28px; height: 48px; border-radius: 5px; overflow: hidden;
  background: linear-gradient(170deg, hsl(205 46% 34%), hsl(205 50% 12%));
  border: 1px solid rgba(92, 192, 245, 0.5);
}
.mini-capa .quadro i {
  position: absolute; left: 0; right: 0; top: 50%; height: 9px; margin-top: -4.5px;
  background: var(--accent-forte); animation: m-mini-faixa 3.6s var(--m-ease-saida) infinite;
}

/* titulo e hashtags -- as linhas "se escrevem" */
@keyframes m-mini-escreve { 0%, 10% { transform: scaleX(0); } 40%, 90% { transform: none; } 100% { transform: scaleX(0); } }
.mini-titulo { flex-direction: column; align-items: flex-start; padding: 0 18px; gap: 7px; }
.mini-titulo i {
  display: block; height: 5px; border-radius: 3px; background: currentColor;
  transform-origin: left; animation: m-mini-escreve 3.8s var(--m-ease-saida) infinite;
}
.mini-titulo i:nth-child(1) { width: 78%; }
.mini-titulo i:nth-child(2) { width: 52%; opacity: 0.6; animation-delay: 0.3s; }
.mini-titulo i:nth-child(3) { width: 34%; opacity: 0.38; animation-delay: 0.6s; }

/* ao vivo -- radar */
@keyframes m-mini-radar { from { transform: scale(0.4); opacity: 0.9; } to { transform: scale(2.6); opacity: 0; } }
.mini-aovivo .ponto { position: relative; width: 12px; height: 12px; border-radius: 50%; background: #ef4444; }
.mini-aovivo .ponto::before, .mini-aovivo .ponto::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid #ef4444; animation: m-mini-radar 2s ease-out infinite;
}
.mini-aovivo .ponto::after { animation-delay: 1s; }
.mini-aovivo span { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; color: #fca5a5; margin-left: 8px; }

/* ============ CTA FINAL ============
   Bug corrigido: `.lp-final-card > *` (position: relative, no style.css) vinha
   DEPOIS da regra da aura e tirava o `absolute` dela. A aura virava um bloco
   de 500 px no fluxo, empurrando o conteudo do card para baixo. */
.lp-final-card > .lp-final-aura { position: absolute; z-index: 0; }

/* Grade sem buraco: "ao vivo" (largo) sobe para a 2a linha, ao lado do card
   grande, e "titulo e hashtags" vira uma faixa de ponta a ponta embaixo. */
@media (min-width: 901px) {
  .lp-bento { grid-auto-rows: auto; }
  .lp-bento > .lp-b-largo { order: 1; }
  .lp-bento > .lp-b-faixa {
    order: 2; grid-column: 1 / -1;
    display: grid; grid-template-columns: 240px 1fr; column-gap: 26px; align-items: center;
  }
  .lp-b-faixa .lp-b-mini { grid-row: span 2; margin-bottom: 0; height: 74px; }
  .lp-b-faixa h3 { align-self: end; }
  .lp-b-faixa p { align-self: start; }
}

@media (max-width: 900px) {
  .lp-b-grande .lp-b-mini { height: 110px; min-height: 110px; flex: none; }
}

/* Posicao das marcas de corte na barra do "antes" (era style="left:.."
   no HTML; com a CSP sem 'unsafe-inline' passou para ca). */
.lp-corte:nth-of-type(1) { left: 18%; }
.lp-corte:nth-of-type(2) { left: 41%; }
.lp-corte:nth-of-type(3) { left: 63%; }
.lp-corte:nth-of-type(4) { left: 84%; }
