/* A marca abre a primeira visita. Os títulos entram quando o fundo se afasta. */
.intro-marca { display: none; }
.linha-capa { display: block; }
.linha-capa > span { display: block; }

@media screen and (prefers-reduced-motion: no-preference) {
  html { --tempo-entrada: 0ms; --curva-pano: cubic-bezier(.77,0,.175,1); --curva-texto: cubic-bezier(.165,.84,.44,1); }
  html.intro-ativa { --tempo-entrada: 830ms; }
  html[data-corre-origem-interna] { --tempo-entrada: 125ms; }
  .intro-ativa .intro-marca {
    display: grid;
    place-items: center;
    position: fixed;
    inset: 0;
    isolation: isolate;
    z-index: 110;
    pointer-events: none;
    visibility: hidden;
    animation: abertura-visivel 1480ms step-end;
  }
  .intro-marca::before, .intro-marca::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: var(--cobalt);
    animation: abertura-planos 785ms 675ms var(--curva-pano) both;
  }
  .intro-marca::after {
    background: var(--ink);
    animation-delay: 530ms;
  }
  .intro-marca img {
    width: clamp(58px, 6vw, 78px);
    height: auto;
    animation: abertura-marca 930ms var(--curva-texto) both;
  }
  .intro-ativa body:has(:focus-visible) .intro-marca { display: none; }
  @keyframes abertura-visivel { from { visibility: visible; } to { visibility: hidden; } }
  @keyframes abertura-planos { from { transform: translateY(0); } to { transform: translateY(-101%); } }
  @keyframes abertura-marca {
    0% { opacity: 0; transform: translateY(10px) scale(.93); }
    33%, 61% { opacity: 1; transform: none; }
    100% { opacity: 0; transform: translateY(-40px) scale(.96); }
  }

  /* Cada linha da capa sobe por uma janela própria; a margem preserva acentos e itálicos. */
  html:not([data-corre-historico]) .linha-capa {
    clip-path: inset(-.055em -.22em -.11em -.05em);
  }
  html:not([data-corre-historico]) .linha-capa > span {
    animation: linha-aparece 800ms var(--tempo-entrada) var(--curva-texto) backwards;
  }
  html:not([data-corre-historico]) .linha-capa + .linha-capa > span { animation-delay: calc(var(--tempo-entrada) + 90ms); }
  html:not([data-corre-historico]) :is(.topic-hero h1, .hist-abre-texto h1, .articles-header__intro h1) {
    animation: titulo-aparece 720ms var(--tempo-entrada) var(--curva-texto) backwards;
  }
  html:not([data-corre-historico]) :is(.capa-linha, .topic-hero .lead, .hist-abre-texto > p, .articles-header__intro > p) {
    animation: resumo-aparece 720ms calc(var(--tempo-entrada) + 145ms) var(--curva-texto) backwards;
  }
  html:not([data-corre-historico]) .capa-arte {
    animation: simbolo-aparece 850ms calc(var(--tempo-entrada) + 50ms) cubic-bezier(.18,.76,.26,1.12) backwards;
  }
  @keyframes linha-aparece {
    from { transform: translateY(115%); }
    to { transform: none; }
  }
  @keyframes titulo-aparece {
    from { opacity: 0; clip-path: inset(0 0 90% 0); translate: 0 .34em; }
    to { opacity: 1; clip-path: inset(-.1em -.1em -.12em); translate: none; }
  }
  @keyframes resumo-aparece {
    from { opacity: 0; translate: 0 1.35rem; }
    to { opacity: 1; translate: none; }
  }
  @keyframes simbolo-aparece {
    from { opacity: .1; scale: .78; rotate: -7deg; }
    to { opacity: 1; scale: 1; rotate: 0deg; }
  }
}
