A panel in the top layer that still animates on the way out.
A <dialog> opened with showModal() gets the top layer, the backdrop pseudo-element, focus trapping and Escape for free — but it also disappears the instant it closes, because display and overlay are discrete properties. transition-behavior: allow-discrete makes both transitionable, and @starting-style supplies the values to animate from on entry. No JavaScript is involved in the motion at all.
This browser does not support @starting-style or allow-discrete, so the panel will appear and disappear without motion. Everything else still works.
Direction is an attribute on the dialog, not a separate component: the closed transform and its matching @starting-style are selected by [data-direction]. Timing lives in custom properties, so a page can retune every panel from one place.
overscroll-behavior: contain