/* OP-025-local: composited public motion; native scrolling remains authoritative. */

[data-public-reveal] {
  --public-reveal-duration: 800ms;
  transition: opacity var(--public-reveal-duration) var(--ease-out), transform var(--public-reveal-duration) var(--ease-out);
}

html[data-public-motion="ready"] [data-public-reveal]:not([data-public-visible]) {
  opacity: 0;
  transform: translateY(10px);
}

[data-public-reveal][data-public-visible] {
  transform: none;
}

[data-public-reveal-order="1"] { transition-delay: 160ms; }
[data-public-reveal-order="2"] { transition-delay: 320ms; }
[data-public-reveal-order="3"] { transition-delay: 480ms; }

/* A keyboard destination must be readable immediately, including during a stagger. */
html[data-public-motion="ready"] [data-public-reveal]:focus-within {
  opacity: 1;
  transform: none;
  transition: none;
}

.sheet[data-motion-state] {
  display: block;
  pointer-events: none;
}

.sheet[data-motion-state="open"] { pointer-events: auto; }
.sheet[data-motion-state="closed"] .sheet__scrim { opacity: 0; }
.sheet[data-motion-state="closed"] .sheet__body { opacity: 0; transform: translateY(-12px); }
.sheet[data-motion-state="open"] .sheet__scrim { opacity: 1; }
.sheet[data-motion-state="open"] .sheet__body { opacity: 1; transform: none; }

/* The canonical hover movement is meaningful only where hover really exists. */
.figure:hover,
.figure:hover .plate,
a.sheet__link:hover { transform: none; }

@media (hover: hover) and (pointer: fine) {
  .figure:hover { transform: translateY(-4px); }
  .figure:hover .plate { transform: scale(1.012); }
  a.sheet__link:hover { transform: translateX(var(--s3)); }
}

@media (prefers-reduced-motion: reduce) {
  /* The explicit Lyfera-only opt-in restores only the approved section reveal. */
  html[data-public-motion-preference="full"] [data-public-reveal] {
    transition-duration: var(--public-reveal-duration) !important;
  }

  html:not([data-public-motion-preference="full"]) [data-public-reveal],
  html:not([data-public-motion-preference="full"])[data-public-motion="ready"] [data-public-reveal] {
    transform: none !important;
    transition: none !important;
  }

  html:not([data-public-motion-preference="full"])[data-public-motion="ready"] [data-public-reveal]:not([data-public-visible]) {
    opacity: 1 !important;
  }

  html:not([data-public-motion-preference="full"]) .sheet[data-motion-state] .sheet__body { transform: none !important; }
}
