/* Garoon motion: transitions section. OWNER FILE: only the transitions agent edits this file.
 * Tokens: see motion.css (:root). Hover rules only inside @media (hover:hover) and (pointer:fine).
 *
 * Curtain (SPEC 3.1 "Шторка между страницами", KOT): the panel is always full height and revealed with clip-path
 * (visually identical to KOT's height 0 -> 100lvh with the label anchored to the bottom edge, but compositor-only).
 * Exit = the whole panel (label included) translates up by -100%.
 */
#gm-curtain {
  height: 100vh; height: 100lvh;
  clip-path: inset(100% 0 0 0);
}
html.gm-pt-run #gm-curtain, html.gm-pt-run #gm-curtain .gm-curtain__label { will-change: clip-path, transform; }
#gm-curtain .gm-curtain__label {
  bottom: 4vh; padding: 0 3vw; overflow: hidden;
  letter-spacing: -.02em;
}
/* full-page navigation (phase A): the curtain is already closed before first paint */
html.pt-cover #gm-curtain { height: 100vh; height: 100lvh; clip-path: inset(0 0 0 0); }
@media (max-width: 768px) { #gm-curtain .gm-curtain__label { font-size: clamp(30px, 11vw, 64px); bottom: 3vh; } }
/* once the label is written into the DOM by JS, drop the ::before copy (so the label never vanishes when pt-cover is removed) */
html.pt-cover #gm-curtain .gm-curtain__label.is-set::before { content: none; }
/* the curtain swallows clicks while it is moving */
html.gm-pt-run #gm-curtain { pointer-events: auto; }
.gm-rm #gm-curtain { display: none !important; }

/* ---------- shared element (works / home / "You might also like" card -> case) ---------- */
#gm-ghost {
  position: fixed; left: 0; top: 0; width: 0; height: 0; margin: 0; padding: 0;
  overflow: hidden; z-index: 10; /* below the header (z-index 12), above page content */
  pointer-events: none; display: none; contain: strict;
  zoom: calc(1 / var(--zoom, 1));
  transform-origin: 0 0; /* SPEC: transform-origin top left */
}
#gm-ghost > * { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; display: block; }
html.gm-sh-on #gm-ghost { display: block; }
/* the incoming page stays invisible (header excepted) until the card has landed */
html.gm-sh-hold [data-barba="container"] > :not(header):not(script):not(style):not(link) { opacity: 0; }
