/* don't even bother on mobile */
if (window.innerWidth > 650) {
	const dialog = document.querySelector("dialog");
	const closeButton = document.querySelector(".close-dialog");
	const hero = document.querySelector(".hero");

	hero.tabIndex = 0;

	hero.addEventListener("click", (e) => dialog.showModal());
	hero.addEventListener("keydown", (e) => {
		if (e.key === "Enter" || e.key === " ") {
			e.preventDefault();
			dialog.showModal();
		}
	});

	closeButton.addEventListener("click", (e) => dialog.close());
	closeButton.addEventListener("keydown", (e) => {
		if (e.key === "Enter" || e.key === " ") {
			e.preventDefault();
			dialog.close();
		}
	});
}
