/* The document stays navigable when motion, scripting or cross-document
   transitions are unavailable. */
.corre-cortina {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  place-items: center;
  margin: 0;
  pointer-events: none;
  background: var(--ink, #102344);
}
.corre-cortina img {
  display: block;
  width: clamp(48px, 5vw, 64px);
  height: auto;
}

@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }

  html[data-corre-saida] .corre-cortina {
    display: grid;
    animation: corre-cobrir 400ms cubic-bezier(.77,0,.175,1) both;
  }
  html[data-corre-saida] .corre-cortina img {
    animation: corre-marca-cobrir 310ms 90ms cubic-bezier(.22,.75,.3,1) both;
  }
  html[data-corre-chegada] .corre-cortina {
    display: grid;
  }
  html[data-corre-revelar] .corre-cortina {
    animation: corre-abrir 400ms 55ms cubic-bezier(.77,0,.175,1) both;
  }
  html[data-corre-revelar] .corre-cortina img {
    animation: corre-marca-partir 400ms 55ms cubic-bezier(.77,0,.175,1) both;
  }
  html[data-corre-nativa] .corre-cortina { display: none; }

  /* Unmarked navigation (including history traversal) stays instant. */
  ::view-transition-group(root),
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
  }
  ::view-transition-old(root) { display: none; }

  /* The logo and its navy ground remain visible between the two documents.
     The incoming document is exposed from the bottom as the curtain lifts. */
  html[data-corre-nativa]::view-transition-group(root) {
    background: var(--ink, #102344) url("assets/simbolo-branco.svg") center / clamp(48px,5vw,64px) auto no-repeat;
    animation: corre-marca-fundo 400ms 55ms cubic-bezier(.77,0,.175,1) both;
  }
  html[data-corre-nativa]::view-transition-new(root) {
    mix-blend-mode: normal;
    animation: corre-revelar-documento 400ms 55ms cubic-bezier(.77,0,.175,1) both;
  }

  @keyframes corre-marca-cobrir {
    from { transform: scale(.78); }
    to { transform: scale(1); }
  }
  @keyframes corre-marca-partir {
    from { transform: scale(1); }
    to { transform: scale(.94); }
  }
  @keyframes corre-marca-fundo {
    from { background-size: clamp(48px,5vw,64px) auto; }
    to { background-size: clamp(45.12px,4.7vw,60.16px) auto; }
  }
  @keyframes corre-cobrir {
    from { clip-path: inset(100% 0 0); }
    to { clip-path: inset(0); }
  }
  @keyframes corre-abrir {
    from { clip-path: inset(0); }
    to { clip-path: inset(0 0 100%); }
  }
  @keyframes corre-revelar-documento {
    from { clip-path: inset(100% 0 0); }
    to { clip-path: inset(0); }
  }
}
