/**
 * Compute Nordic Core: the cookie consent banner. A Nordic Purple panel with the gate page's glow
 * and Ice Cyan accent line, square corners, Lexend. It reads the theme's tokens and falls back to
 * the brand values, so it keeps its look under another theme. Both choices are the same button,
 * so neither is pushed. It sits under the header (z-index 1000), so the open phone menu covers it,
 * and bottom right, clear of the left-aligned headings and calls to action.
 */
.cn-consent {
	--c-purple: var(--purple, #563d6e);
	--c-deep: var(--deep, #2e1f3d);
	--c-ice: var(--ice, #00f0ff);
	--c-ease: var(--ease, cubic-bezier(0.2, 0.65, 0.2, 1));
	--c-inset: var(--gutter, 24px);
	position: fixed;
	z-index: 999;
	right: var(--c-inset);
	bottom: var(--c-inset);
	box-sizing: border-box;
	width: min(35rem, calc(100% - 2 * var(--c-inset)));
	margin: 0;
	padding: 34px 34px 30px;
	overflow: hidden;
	isolation: isolate;
	color: #fff;
	background: radial-gradient(120% 140% at 100% 0%, #6b4d88 0%, var(--c-purple) 46%, var(--c-deep) 100%);
	box-shadow: 0 28px 70px rgba(46, 31, 61, 0.38), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
	font-family: Lexend, Arial, Helvetica, sans-serif;
	font-size: 1rem;
	font-weight: 300;
	line-height: 1.55;
	text-align: left;
	opacity: 0;
	transform: translateY(32px) scale(0.985);
	transform-origin: right bottom;
	transition: opacity 0.5s var(--c-ease), transform 0.8s var(--c-ease);
}

.cn-consent[hidden] {
	display: none;
}

.cn-consent.is-in {
	opacity: 1;
	transform: none;
}

.cn-consent.is-out {
	opacity: 0;
	transform: translateY(18px);
	transition-duration: 0.3s, 0.32s;
}

/* The accent line draws across the top once the panel is in. */
.cn-consent::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 2px;
	background: var(--c-ice);
	box-shadow: 0 0 18px rgba(0, 240, 255, 0.7);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 1s var(--c-ease) 0.25s;
}

.cn-consent.is-in::before {
	transform: scaleX(1);
}

/* Faint grid, as on the preview page, fading out from the top right. */
.cn-consent::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
	background-size: 40px 40px;
	-webkit-mask-image: radial-gradient(ellipse at 100% 0%, #000 0%, transparent 70%);
	mask-image: radial-gradient(ellipse at 100% 0%, #000 0%, transparent 70%);
	pointer-events: none;
}

.cn-consent__glow {
	position: absolute;
	z-index: -1;
	top: -13rem;
	right: -11rem;
	width: 28rem;
	aspect-ratio: 1;
	background: radial-gradient(circle, rgba(0, 240, 255, 0.24) 0%, rgba(0, 240, 255, 0) 62%);
	animation: cn-consent-drift 14s ease-in-out infinite;
	pointer-events: none;
}

.cn-consent__eyebrow {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 0 0 14px;
	font-size: 0.8125rem;
	font-weight: 500;
	letter-spacing: 0.16em;
	line-height: 1.2;
	text-transform: uppercase;
	color: var(--c-ice);
}

.cn-consent__eyebrow svg {
	flex: none;
	width: 20px;
	height: 20px;
}

.cn-consent__title {
	margin: 0 0 10px;
	font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
	font-weight: 400;
	line-height: 1.25;
	letter-spacing: -0.01em;
	color: #fff;
	text-wrap: balance;
}

.cn-consent__text {
	margin: 0;
	font-size: 0.9375rem;
	font-weight: 400;
	color: rgba(255, 255, 255, 0.85);
	text-wrap: pretty;
}

.cn-consent__text a {
	color: #fff;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
	transition: color 0.25s;
}

.cn-consent__text a:is(:hover, :focus-visible) {
	color: var(--c-ice);
}

.cn-consent__state {
	margin: 12px 0 0;
	font-size: 0.875rem;
	font-weight: 400;
	color: var(--c-ice);
}

.cn-consent__state:empty {
	display: none;
}

.cn-consent__actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin-top: 26px;
}

/* One hover system with the theme: the colour wipes in from the left, the label stays purple. */
.cn-consent__btn {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	min-height: 52px;
	margin: 0;
	padding: 0 20px;
	border: 1px solid #fff;
	border-radius: 0;
	background: #fff;
	color: var(--c-purple);
	font: inherit;
	font-size: 1rem;
	font-weight: 500;
	line-height: 1;
	letter-spacing: normal;
	text-transform: none;
	cursor: pointer;
	transition: border-color 0.3s, transform 0.6s var(--c-ease);
}

.cn-consent__btn::before {
	content: "";
	position: absolute;
	inset: -1px;
	z-index: -1;
	background: var(--c-ice);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.4s var(--c-ease);
}

.cn-consent__btn:is(:hover, :focus-visible) {
	border-color: var(--c-ice);
}

.cn-consent__btn:is(:hover, :focus-visible)::before {
	transform: scaleX(1);
}

.cn-consent__btn:active {
	transform: scale(0.98);
}

.cn-consent__btn:focus-visible {
	outline: 2px solid var(--c-ice);
	outline-offset: 3px;
}

/* Phones: a sheet along the bottom edge, clear of the home indicator. */
@media (max-width: 600px) {
	.cn-consent {
		left: 0;
		right: 0;
		bottom: 0;
		width: 100%;
		padding: 26px 20px calc(20px + env(safe-area-inset-bottom, 0px));
		transform: translateY(100%);
	}

	.cn-consent.is-out {
		transform: translateY(100%);
	}

	.cn-consent__title {
		font-size: 1.25rem;
	}

	.cn-consent__actions {
		margin-top: 20px;
	}
}

@keyframes cn-consent-drift {
	0%,
	100% {
		transform: translate(0, 0) scale(1);
	}

	50% {
		transform: translate(-6%, 5%) scale(1.08);
	}
}

@media (prefers-reduced-motion: reduce) {
	.cn-consent,
	.cn-consent::before,
	.cn-consent__btn,
	.cn-consent__btn::before {
		transition: none;
	}

	.cn-consent,
	.cn-consent.is-out {
		transform: none;
	}

	.cn-consent__glow {
		animation: none;
	}
}
