/* O documento continua no fluxo normal. As camadas internas respondem ao avanço da leitura. */
.corre-foto-janela {
  display: block;
  overflow: hidden;
}

@media screen and (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
  main.roda-em-curso { translate: 0 var(--atraso-roda); }
}

@media (prefers-reduced-motion: no-preference) {
  :root {
    --curva-entrada: cubic-bezier(.165, .84, .44, 1);
    --curva-cortina: cubic-bezier(.77, 0, .175, 1);
  }

  [data-entrada] {
    --tempo-entrada: 720ms;
    --intervalo: 0ms;
  }
  [data-entrada="apoio"] { --intervalo: 90ms; }
  [data-entrada="foto"] { --tempo-entrada: 920ms; }
  [data-entrada="figura"] { --intervalo: 75ms; }
  .read-page--story [data-entrada] { --tempo-entrada: 480ms; }

  /* A espera é aplicada somente a elementos que ainda estão abaixo da tela. */
  [data-entrada].por-entrar { opacity: 0; }
  [data-entrada].em-cena {
    animation: corre-bloco var(--tempo-entrada) var(--curva-entrada) var(--intervalo) backwards;
  }
  [data-entrada="titulo"].em-cena {
    animation-name: corre-tipo;
    animation-duration: 850ms;
  }
  [data-entrada="foto"].em-cena { animation-name: corre-foto; }
  .read-page--story [data-entrada].em-cena { animation-name: corre-leitura; }
  .leitura-dinamica .read-page .listing section[data-entrada] {
    animation: none;
  }
  .leitura-dinamica .read-page .listing section[data-entrada].em-cena {
    animation: corre-bloco .64s var(--curva-entrada) backwards;
  }
  [data-entrada]:focus-within {
    opacity: 1;
    clip-path: none;
    animation: none;
  }
  @keyframes corre-tipo {
    from { clip-path: inset(0 -3% 92% -3%); opacity: .38; translate: 0 .47em; }
    to { clip-path: inset(-15% -3% -15% -3%); opacity: 1; translate: 0 0; }
  }
  @keyframes corre-bloco {
    from { opacity: 0; translate: 0 1.6rem; }
    to { opacity: 1; translate: 0 0; }
  }
  @keyframes corre-foto {
    from { clip-path: inset(0 0 85% 0); opacity: .45; }
    to { clip-path: inset(0); opacity: 1; }
  }
  @keyframes corre-leitura {
    from { opacity: .45; }
    to { opacity: 1; }
  }

  .leitura-dinamica .capa-arte svg {
    translate: calc(var(--mouse-x, 0) * 8px) calc(var(--mouse-y, 0) * 6px);
    transform: translate(calc(var(--curso, 0) * 17px), calc(var(--curso, 0) * clamp(72px, 10vh, 120px)))
      rotate(calc(var(--curso, 0) * 7deg)) scale(calc(1 + var(--curso, 0) * .05));
    transition: translate .22s ease-out;
  }
  .leitura-dinamica .faixa-trilho {
    transform: translateX(calc(-12px - var(--curso, 0) * min(44vw, 440px)));
  }
  .leitura-dinamica .vitrine [data-capa="pesquisa"] img,
  .leitura-dinamica .corre-foto-janela.movimento-foto img {
    transform: scale(1.15) translateY(calc((var(--curso, .5) - .5) * 11%));
  }
  .leitura-dinamica .vitrine .cartaz-projeto img {
    transform: translate(calc(var(--curso, .5) * -4%), calc(var(--curso, .5) * -7%));
  }

  .comparativo.em-cena .comparativo-linha b,
  .orcamento-figura.em-cena dd::after {
    transform-origin: left center;
    animation: corre-barra 820ms var(--curva-entrada) 120ms backwards;
  }
  .comparativo.em-cena .comparativo-linha + .comparativo-linha b,
  .orcamento-figura.em-cena dl > div + div dd::after { animation-delay: 260ms; }
  .distritos.em-cena .distritos-matriz {
    animation: corre-matriz 890ms var(--curva-cortina) 100ms backwards;
  }
  @keyframes corre-barra { from { transform: scaleX(0); } to { transform: scaleX(1); } }
  @keyframes corre-matriz { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0); } }
}

@media (prefers-reduced-motion: no-preference) and (max-width: 760px) {
  .leitura-dinamica .capa-arte svg {
    transform: translateY(calc(var(--curso, 0) * 42px)) rotate(calc(var(--curso, 0) * 4deg));
  }
}
@media print {
  [data-entrada] { opacity: 1 !important; animation: none !important; clip-path: none !important; }
}
