You built your modal with a `<div>` and a focus trap library. The native `<dialog>` does all of that.
The `<dialog>` element ships with focus trapping, Escape-to-close, backdrop rendering, and correct ARIA semantics — no library, no boilerplate. It's been Baseline since 2022.