Yeah, I don't think the menu should've been a separate page. It can be made JavaScript-less as a dialog opened by the popover HTML attributes,[0] and the escape key would be able to close it.
[0]: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/...
I'm not at all against using some js for the menu, but a native dialog or popover is definitely a nice idea here.