.popup {
	--f-heading-sm: clamp(1.2rem, 3vw, 1.8rem);
	--f-heading-md: clamp(1.6rem, 5vw, 2.4rem);
	--f-heading-lg: clamp(1.8rem, 7vw, 3.2rem);
	--f-heading-xl: clamp(2.2rem, 9vw, 4.0rem);
	--f-body-sm: clamp(0.9em, 2.0vw, 1.2em);
	--f-body-md: clamp(1em, 2.5vw, 1.6em);
	--f-body-lg: clamp(1.2em, 3.0vw, 1.8em);
	--f-body-xl: clamp(1.4em, 3.5vw, 2.0em);

	position: fixed;
	overflow: visible;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background-color: transparent;

	&::backdrop {
		background-color: rgba(0, 0, 0, 0.6);
		backdrop-filter: blur(4px);
	}

	&[open] {
		display: flex;
		align-items: center;
		justify-content: center;
	}

	&.mod-heading-sm { --f-heading: var(--f-heading-sm); }
	&.mod-heading-md { --f-heading: var(--f-heading-md); }
	&.mod-heading-lg { --f-heading: var(--f-heading-lg); }
	&.mod-heading-xl { --f-heading: var(--f-heading-xl); }

	&.mod-body-sm { --f-body: var(--f-body-sm); }
	&.mod-body-md { --f-body: var(--f-body-md); }
	&.mod-body-lg { --f-body: var(--f-body-lg); }
	&.mod-body-xl { --f-body: var(--f-body-xl); }

	> div {
		position: relative;
		overflow: hidden;
		display: flex;
		flex-direction: column;
		align-items: center;
		width: min(90vw, 666px);
		max-height: 90dvh;
		padding: 0 var(--s-sm) var(--s-md);
		border-radius: var(--s-sm);
		background-color: navy;
		text-align: center;
		outline: none; /* holds initial focus (autofocus) without a ring */
		animation: popup-in var(--a-s-md) ease-in-out;

		&:before {
			content: "";
			position: absolute;
			z-index: 1;
			top: 0;
			left: 50%;
			transform: translate(-50%, -50%);
			width: 250px;
			height: 200px;
			border-radius: 50%;
			background-color: rgba(255, 255, 255, 0.35);
			filter: blur(32px);
		}

		> div {
			position: absolute;
			top: 0;
			left: 0;
			width: 100%;
			height: 100%;
			border-radius: inherit;
			background-repeat: no-repeat;
			background-size: cover;
			background-color: rgba(0, 0, 0, 0.65);
			background-blend-mode: overlay;
		}

		> button {
			position: absolute;
			z-index: 2;
			top: var(--s-xs);
			right: var(--s-xs);
			display: flex;
			align-items: center;
			justify-content: center;
			width: var(--s-md);
			height: var(--s-md);
			margin: 0;
			padding: 0;
			border: 0;
			border-radius: 50%;
			background-color: rgba(0, 0, 0, 0.35);
			color: var(--c-white);
			font-family: var(--f-b);
			font-size: 1.25rem;
			line-height: 1;
			cursor: pointer;
			transition: background-color var(--a-xs);

			&:hover {
				background-color: rgba(0, 0, 0, 0.6);
			}
		}

		> header {
			position: relative;
			z-index: 1;
			display: flex;
			flex-direction: column;
			align-items: center;
			width: 100%;

			> img {
				display: block;
				max-width: 200px;
				margin-bottom: var(--s-sm);
			}

			/* Under WordPress this inherited Betheme's global Lato. Montserrat is
			   the closest face the site already loads. Tracking is looser than
			   the old -1.2px, which was tight for Lato and crowds Montserrat. */
			> h2 {
				margin: var(--s-xs) auto;
				font-family: var(--f-l);
				font-size: var(--f-heading, var(--f-heading-lg));
				line-height: 1.05em;
				font-weight: 400;
				color: var(--c-white);
				text-transform: uppercase;
				letter-spacing: -0.5px;
				text-shadow: 0 0 var(--s-xs) #4DE6FF;
				text-wrap: balance;
			}

			> p {
				margin: 0 auto;
				font-family: var(--f-b);
				line-height: 1.25em;
				font-size: var(--f-body, var(--f-body-md));
				color: var(--c-white);
				text-wrap: balance;
			}

			> nav {
				margin-top: var(--s-sm);
				text-transform: uppercase;
			}

			> small {
				margin-top: var(--s-xs);
				font-family: var(--f-b);
				font-size: 0.8em;
				color: var(--c-white);
				text-wrap: balance;
			}
		}

		em {
			font-style: italic;
		}
	}
}

@keyframes popup-in {
	from { opacity: 0; transform: translateY(var(--s-xs)); }
	to { opacity: 1; transform: translateY(0); }
}
