/* ==========================================================================
   CARTA MAGNA — Seamless navigation between sections
   ==========================================================================
   States used by transition.js while one section hands over to the next.
   The hand-over is a two-beat choreography: the outgoing content dissolves
   *progressively* (staggered block by block via --cm-delay, the clicked row
   last), and only then the incoming first section starts its own entrance
   (see escena.css: the type wall, the copy and the head video arrive one
   after another). The two beats never overlap.

   · .cm-out — an element that leaves; its place in the wave is its
     --cm-delay, set by transition.js.
   · .cm-incoming — the incoming <main>, held invisible for the instant of
     the swap, then faded in under its entrance.
   ========================================================================== */

/* --- Outgoing content: the progressive dissolve -------------------------- */
.cm-out {
  transition:
    opacity 420ms var(--ease-ola) var(--cm-delay, 0ms),
    transform 560ms var(--ease-ola) var(--cm-delay, 0ms),
    filter 420ms var(--ease-ola) var(--cm-delay, 0ms);
  will-change: opacity, transform;
}
body.is-cm-leaving .cm-out {
  opacity: 0;
  transform: translate3d(0, -26px, 0) scale(0.985);
  filter: blur(10px);
}

/* --- Incoming content ---------------------------------------------------- */
.cm-incoming {
  opacity: 0;
}

/* --- Reduced motion: no wave, no drift — a plain cross-fade ------------- */
@media (prefers-reduced-motion: reduce) {
  .cm-out {
    transition: opacity 160ms linear;
  }
  body.is-cm-leaving .cm-out {
    transform: none;
    filter: none;
  }
}
