:root {
	--color-paper-primary: #fffdf7;
	--color-paper-secondary: #d5ceb8;
	--color-paper-text: #224a2e;
	--color-paper-shadow: #ece5d1;
}

@media screen and (prefers-color-scheme: dark) {
	:root:not(.light) {
		--color-paper-primary: #d7d7d2;
		--color-paper-secondary: #a8a79d;
		--color-paper-text: #224a2e;
		--color-paper-shadow: #bebeb7;
	}
}

:root.dark {
	--color-paper-primary: #d7d7d2;
	--color-paper-secondary: #a8a79d;
	--color-paper-text: #224a2e;
	--color-paper-shadow: #bebeb7;
}

:root.light {
	--color-paper-primary: #fffdf7;
	--color-paper-secondary: #d5ceb8;
	--color-paper-text: #224a2e;
	--color-paper-shadow: #ece5d1;
}

body.policy-page {
	--frame-accent: var(--color-paper-secondary);
	--footer-link-hover-color: var(--color-secondary);
	--paper-grid-inline-offset: 24px;
	--header-divider-size: 2px;
	--header-square-size: calc(var(--font-ui-size) + 16px);
	color: var(--color-paper-text);
	line-height: 1;
}

.paper-shell {
	margin: 8px;
	box-shadow: 0 4px 0 0 var(--color-paper-shadow);
}

.paper {
	display: flex;
	flex-direction: column;
	background-color: var(--color-paper-primary);
	padding: 16px;
	position: relative;
	overflow: hidden;
	isolation: isolate;
	-webkit-mask-image: -webkit-radial-gradient(white, black);
	min-height: calc(100svh - (1.5rem));
}

.paper::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	pointer-events: none;
	z-index: 1;
	opacity: 0.25;
	mix-blend-mode: multiply;
	filter: grayscale(1);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.72' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
	background-size: 190px 190px;
}

.paper::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	pointer-events: none;
	z-index: 0;
	opacity: 0.14;
	mix-blend-mode: screen;
	background: linear-gradient(
		125deg,
		hsl(320deg 100% 75%) 0%,
		hsl(0deg 100% 78%) 15%,
		hsl(45deg 100% 75%) 30%,
		hsl(100deg 100% 72%) 45%,
		hsl(180deg 100% 72%) 60%,
		hsl(240deg 100% 76%) 75%,
		hsl(290deg 100% 75%) 88%,
		hsl(320deg 100% 75%) 100%
	);
	-webkit-mask-image: radial-gradient(
		circle max(70vh, 70vw) at var(--glare-x, 50%) var(--glare-y, 50%),
		black 18%,
		transparent 100%
	);
	mask-image: radial-gradient(
		circle max(70vh, 70vw) at var(--glare-x, 50%) var(--glare-y, 50%),
		black 18%,
		transparent 100%
	);
}

.paper-grid {
	display: flex;
	flex-direction: column;
	min-height: 100%;
	position: relative;
	z-index: 1;
	border: 2px solid var(--color-paper-secondary);
}

.policy-page header {
	display: flex;
	justify-content: space-between;
	align-items: stretch;
	flex-wrap: wrap;
	border-bottom: 2px solid var(--color-paper-secondary);
}

.policy-page .email,
.policy-page .language {
	display: flex;
	align-items: stretch;
	min-width: 0;
}

.policy-page .language {
	display: grid;
	grid-template-columns: repeat(
		3,
		calc(var(--header-square-size) + var(--header-divider-size))
	);
	grid-auto-rows: var(--header-square-size);
}

.policy-page .language > * {
	min-width: 0;
	min-height: 0;
}

.policy-page .email a {
	justify-content: flex-start;
	min-width: 0;
	display: block;
	text-align: center;
}

.policy-page .copy-btn {
	overflow: hidden;
	max-width: 0;
	padding-left: 0;
	padding-right: 0;
	border-left: none;
	border-right: 2px solid var(--color-paper-secondary);
	border-right-width: 0;
	opacity: 0;
	white-space: nowrap;
	pointer-events: none;
	transition:
		max-width 0.25s ease,
		padding-left 0.25s ease,
		padding-right 0.25s ease,
		border-right-width 0.25s ease,
		opacity 0.25s ease,
		background-color 0.3s ease;
}

.policy-page .copy-btn:focus-visible {
	max-width: 8rem;
	padding-left: 16px;
	padding-right: 16px;
	border-right-width: 2px;
	opacity: 1;
	pointer-events: auto;
}

.policy-page h1 {
	font-family: "Climate Crisis", sans-serif;
	font-size: clamp(2.5rem, 9vw, 8rem);
	line-height: 0.8;
	margin: 0;
	text-transform: uppercase;
	color: var(--color-paper-text);
	max-inline-size: 100%;
	overflow-wrap: break-word;
	word-break: normal;
	-webkit-hyphens: auto;
	hyphens: auto;
	text-wrap: balance;
}

.policy-page h2 {
	font-weight: var(--font-body-weight);
	font-size: 1.6rem;
	line-height: 1;
	margin: 0;
	color: var(--color-paper-text);
	max-inline-size: 100%;
	overflow-wrap: break-word;
	word-break: normal;
	-webkit-hyphens: auto;
	hyphens: auto;
	text-wrap: balance;
}

@media (hover: hover) and (pointer: fine) {
	.policy-page .email:hover .copy-btn {
		max-width: 8rem;
		padding-left: 16px;
		padding-right: 16px;
		border-right-width: 2px;
		opacity: 1;
		pointer-events: auto;
	}
}

@media (hover: none), (pointer: coarse) {
	.policy-page .copy-btn {
		max-width: 8rem;
		padding-left: 16px;
		padding-right: 16px;
		border-left: 2px solid var(--color-paper-secondary);
		border-right-width: 2px;
		opacity: 1;
		pointer-events: auto;
	}
}

.policy-page header a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--color-paper-text);
	text-decoration: none;
	font-size: var(--font-ui-size);
	padding: 8px 16px;
	line-height: 1;
	min-height: calc(var(--font-ui-size) + 16px);
	overflow-wrap: anywhere;
	transition:
		background-color 0.3s ease,
		color 0.3s ease;
}

.policy-page header a:hover {
	background-color: var(--color-paper-secondary);
	color: var(--color-paper-text);
}

.policy-page header a:active {
	box-shadow: inset 0 3px 0 rgba(0, 0, 0, 0.25);
	padding-top: 10px;
	padding-bottom: 6px;
	transition: none;
}

.policy-page .header-link {
	justify-content: center;
	border-right: 2px solid var(--color-paper-secondary);
}

.policy-page button {
	font-family: var(--font-body);
	font-weight: var(--font-body-weight);
	background: none;
	border: none;
	color: var(--color-paper-text);
	font-size: var(--font-ui-size);
	padding: 4px 16px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	min-height: calc(var(--font-ui-size) + 16px);
	transition:
		background-color 0.3s ease,
		color 0.3s ease;
	border-left: 2px solid var(--color-paper-secondary);
}

.policy-page button:hover {
	background-color: var(--color-paper-secondary);
}

.policy-page button:active {
	box-shadow: inset 0 4px 0 rgba(0, 0, 0, 0.3);
	padding-top: 6px;
	padding-bottom: 2px;
	transition: none;
}

.policy-page .language svg {
	height: calc(var(--font-ui-size) + 16px);
	width: auto;
	display: block;
}

.policy-page .face-icon svg.face,
.policy-page button.theme-toggle svg.star {
	display: block;
	inline-size: 100%;
	block-size: 100%;
	overflow: visible;
}

.policy-page .face-icon svg.face {
	inline-size: 100%;
	block-size: 100%;
}

.policy-page .back-link {
	border-right: 2px solid var(--color-paper-secondary);
}

.policy-page .face-icon {
	padding: 0;
	border-left: var(--header-divider-size) solid var(--color-paper-secondary);
	display: flex;
	align-items: center;
	justify-content: center;
}

.policy-page .language svg.star path {
	transition: fill 0.3s ease;
}

.policy-page button.theme-toggle {
	padding: 0;
	inline-size: 100%;
	block-size: 100%;
}

.policy-page .language-toggle {
	padding: 0;
	inline-size: 100%;
	block-size: 100%;
}

.policy-page button.theme-toggle:active {
	padding-top: 0;
	padding-bottom: 0;
}

.policy-page button.theme-toggle:active svg {
	transform: translateY(2px);
}

.policy-page button.theme-toggle:hover svg.star path {
	fill: var(--color-paper-text);
}

.policy-page .language svg.face {
	padding: 6px;
	transition:
		background-color 0.3s ease,
		transform 0.15s ease;
}

.policy-page .language svg.face path {
	transition: stroke 0.3s ease;
}

.policy-page .language svg.face:hover {
	background-color: var(--color-paper-secondary);
}

.policy-page .language svg.face:hover path {
	stroke: var(--color-paper-text) !important;
}

.policy-page main {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	padding: 3.5rem clamp(1rem, 3vw, 2.75rem) 2rem;
	max-width: 60rem;
	width: 100%;
	margin: 0 auto;
}

.policy-page p,
.policy-page li {
	font-size: var(--font-body-size);
	line-height: var(--font-body-line-height);
	margin: 0;
	overflow-wrap: break-word;
	word-break: normal;
	hyphens: auto;
}

.policy-page ul {
	margin: 0;
	padding-left: 1.2rem;
	display: grid;
	gap: 0.5rem;
	list-style: "– ";
}

.policy-page .content-link {
	display: inline;
	padding: 0;
	color: inherit;
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 0.12em;
}

.policy-page .content-link:hover {
	background: none;
}

.policy-page footer {
	margin: 28px var(--paper-grid-inline-offset) 24px;
}

@media (max-width: 720px) {
	.policy-page header {
		flex-direction: column;
	}

	.policy-page footer {
		margin: 20px var(--paper-grid-inline-offset) 8px;
	}

	.policy-page .language {
		width: 100%;
	}

	.policy-page .email {
		width: 100%;
		display: flex;
		align-items: stretch;
	}

	.policy-page .email > * {
		justify-content: center;
	}

	.policy-page .back-link {
		flex: 0 0 auto;
		border-right: 2px solid var(--color-paper-secondary);
	}

	.policy-page .header-link {
		flex: 1 1 auto;
		min-width: 0;
		justify-content: center;
		border-right: none;
	}

	.policy-page .copy-btn {
		position: static;
		border-right: none !important;
	}

	.policy-page .language {
		border-top: 2px solid var(--color-paper-secondary);
		grid-template-columns:
			var(--header-square-size)
			calc(var(--header-square-size) + var(--header-divider-size))
			minmax(0, 1fr);
	}

	.policy-page .language > :first-child {
		border-left: none;
	}

	.policy-page .language-toggle {
		inline-size: auto;
		padding-inline: 1rem;
	}

	.policy-page .language svg.face {
		padding: 6px;
	}

	.policy-page main {
		padding: 2rem 0.9rem 2rem;
	}

	.policy-page h1 {
		font-size: clamp(1.65rem, 9.6vw, 3.1rem);
	}

	.policy-page h2 {
		font-size: clamp(1.05rem, 5.2vw, 1.35rem);
		line-height: 1;
	}
}
