/* MobilyTech · Sites Express — texto vivo. Módulo: /assets/express/texto-vivo.js. Documentação: docs/express/TEXTO-VIVO.md.
   Só transform/opacity/filter; cada letra/palavra recebe --i e o atraso é calc(--i * --tv-passo). Herda cor e fonte (claro/escuro). */
.tv-oculto { opacity: 0; }
.tv-w { display: inline-block; white-space: nowrap; }
.tv-l { display: inline-block; position: relative; animation: tv-esm var(--tv-d, 520ms) cubic-bezier(.22, 1, .36, 1) calc(var(--tv-a, 0ms) + var(--i, 0) * var(--tv-passo, 10ms)) both; }
.tv-wc .tv-l, .tv-wc .tv-w { will-change: transform, opacity; }
.tv-m-digitar .tv-l { animation-name: tv-dig; animation-timing-function: ease-out; }
.tv-m-cair .tv-l { animation-name: tv-cai; animation-timing-function: linear; }
.tv-m-cair .tv-l:nth-child(even) { --tv-s: -1; }
.tv-m-palavras .tv-w { animation: tv-pal var(--tv-d, 620ms) cubic-bezier(.22, 1, .36, 1) calc(var(--tv-a, 0ms) + var(--i, 0) * var(--tv-passo, 40ms)) both; }

/* cursor suave: aparece na letra recém-digitada e some ao fim */
.tv-m-digitar .tv-l::after { content: ""; position: absolute; left: 100%; top: 12%; bottom: 12%; width: .075em; margin-left: .03em; border-radius: 1px; background: currentColor; opacity: 0;
  animation: tv-cur var(--tv-passo, 10ms) steps(1, end) calc(var(--tv-a, 0ms) + var(--i, 0) * var(--tv-passo, 10ms)) forwards; }
.tv-m-digitar .tv-fim::after { animation: tv-cur-fim 450ms ease-in-out calc(var(--tv-a, 0ms) + var(--i, 0) * var(--tv-passo, 10ms)) forwards; }

@keyframes tv-dig { from { opacity: 0 } to { opacity: 1 } }
@keyframes tv-esm { from { opacity: 0; filter: blur(.1em); transform: translateY(.2em) } 55% { opacity: 1 } to { opacity: 1; filter: none; transform: none } }
@keyframes tv-cai {
  0% { opacity: 0; filter: blur(.09em); transform: translateY(-.7em) rotate(calc(-6deg * var(--tv-s, 1))); animation-timing-function: cubic-bezier(.5, 0, .85, .55); }
  45% { opacity: 1; }
  70% { opacity: 1; filter: none; transform: translateY(.06em) rotate(calc(1.5deg * var(--tv-s, 1))); animation-timing-function: cubic-bezier(.2, .7, .3, 1); }
  100% { opacity: 1; filter: none; transform: none; }
}
@keyframes tv-pal { from { opacity: 0; filter: blur(.14em); transform: translateY(.5em) } to { opacity: 1; filter: none; transform: none } }
@keyframes tv-cur { from { opacity: 1 } to { opacity: 0 } }
@keyframes tv-cur-fim { 0%, 30% { opacity: 1 } 100% { opacity: 0 } }

@media (prefers-reduced-motion: reduce) {
  .tv-oculto { opacity: 1; }
  .tv-l, .tv-w { animation: none; }
  .tv-l::after { display: none; }
}
@media print { .tv-oculto { opacity: 1; } }
