/* Simple Age Gate */

/* Lock scrolling while the gate is up. */
html.sag-locked,
html.sag-locked body {
	overflow: hidden !important;
}

#sag-gate {
	--sag-accent: #1a1a1a;
	--sag-ink: #141414;
	--sag-muted: #5f5f5f;
	--sag-line: #e4e4e4;

	display: none;
	position: fixed;
	inset: 0;
	z-index: var(--sag-z, 2147482000);
	align-items: center;
	justify-content: center;
	padding: 24px 16px;
	box-sizing: border-box;
	font-family: inherit;
	-webkit-font-smoothing: antialiased;
	text-align: center;
}

html.sag-locked #sag-gate {
	display: flex;
}

#sag-gate *,
#sag-gate *::before,
#sag-gate *::after {
	box-sizing: border-box;
}

/* Blurs and darkens the page underneath. */
#sag-gate .sag-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(12, 12, 12, 0.55);
	-webkit-backdrop-filter: blur(18px) saturate(120%);
	backdrop-filter: blur(18px) saturate(120%);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	#sag-gate .sag-backdrop {
		background: rgba(12, 12, 12, 0.94);
	}
}

/* The central box. */
#sag-gate .sag-card {
	position: relative;
	width: 100%;
	max-width: 440px;
	max-height: calc(100vh - 48px);
	overflow-y: auto;
	padding: 44px 36px 28px;
	background: #fff;
	color: var(--sag-ink);
	border-radius: 20px;
	box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 0, 0, 0.04);
	animation: sag-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

#sag-gate .sag-logo {
	display: block;
	max-width: 150px;
	max-height: 80px;
	width: auto;
	height: auto;
	margin: 0 auto 22px;
}

#sag-gate .sag-heading {
	margin: 0 0 10px;
	padding: 0;
	font-family: inherit;
	font-size: 28px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.01em;
	text-transform: none;
	color: var(--sag-ink);
}

#sag-gate .sag-message,
#sag-gate .sag-message p {
	margin: 0;
	font-size: 15.5px;
	line-height: 1.6;
	color: var(--sag-muted);
}

#sag-gate .sag-message p + p {
	margin-top: 0.6em;
}

#sag-gate .sag-message a {
	color: inherit;
	text-decoration: underline;
}

/* ---- Checkbox ---- */

#sag-gate .sag-check {
	position: relative;
	display: flex;
	align-items: center;
	gap: 14px;
	width: 100%;
	margin: 28px 0 0;
	padding: 16px 18px;
	border: 1.5px solid var(--sag-line);
	border-radius: 14px;
	background: #fff;
	text-align: left;
	cursor: pointer;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
	transition: border-color 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;
}

#sag-gate .sag-check:hover {
	border-color: #c8c8c8;
	background: #fafafa;
}

/* Real input is visually hidden but stays keyboard / screen-reader accessible. */
#sag-gate .sag-input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	padding: 0;
	opacity: 0;
	pointer-events: none;
}

#sag-gate .sag-box {
	flex: 0 0 auto;
	display: grid;
	place-items: center;
	width: 26px;
	height: 26px;
	border: 2px solid #c4c4c4;
	border-radius: 8px;
	background: #fff;
	transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

#sag-gate .sag-box svg {
	width: 16px;
	height: 16px;
	fill: none;
	stroke: #fff;
	stroke-width: 3;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-dasharray: 22;
	stroke-dashoffset: 22;
	transition: stroke-dashoffset 0.3s ease 0.05s;
}

#sag-gate .sag-label {
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
	color: var(--sag-ink);
}

#sag-gate .sag-check:active .sag-box {
	transform: scale(0.92);
}

#sag-gate .sag-input:focus-visible + .sag-box {
	box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--sag-accent);
}

#sag-gate .sag-input:checked + .sag-box {
	background: var(--sag-accent);
	border-color: var(--sag-accent);
}

#sag-gate .sag-input:checked + .sag-box svg {
	stroke-dashoffset: 0;
}

#sag-gate .sag-check:has(.sag-input:checked) {
	border-color: var(--sag-accent);
}

/* Waiting for the cookie banner. */
#sag-gate.sag-waiting .sag-check {
	opacity: 0.5;
	cursor: not-allowed;
}

#sag-gate.sag-waiting .sag-check:hover {
	border-color: var(--sag-line);
	background: #fff;
}

#sag-gate .sag-note {
	display: none;
	margin: 12px 0 0;
	padding: 9px 12px;
	border-radius: 10px;
	background: #f4f4f4;
	font-size: 13.5px;
	line-height: 1.45;
	color: var(--sag-ink);
}

#sag-gate.sag-waiting .sag-note:not(:empty) {
	display: block;
}

#sag-gate .sag-note.sag-nudge {
	animation: sag-nudge 0.4s ease;
}

/* ---- Links & small print ---- */

#sag-gate .sag-exit {
	display: inline-block;
	margin-top: 18px;
	font-size: 13.5px;
	color: var(--sag-muted);
	text-decoration: underline;
	text-underline-offset: 3px;
}

#sag-gate .sag-exit:hover {
	color: var(--sag-ink);
}

#sag-gate .sag-footer {
	margin-top: 24px;
	padding-top: 18px;
	border-top: 1px solid #efefef;
	font-size: 12px;
	line-height: 1.5;
	color: #8a8a8a;
}

#sag-gate .sag-footer a {
	color: inherit;
	text-decoration: underline;
}

/* ---- Exit animation ---- */

#sag-gate.sag-leaving {
	opacity: 0;
	transition: opacity 0.45s ease;
}

#sag-gate.sag-leaving .sag-card {
	transform: translateY(-8px) scale(0.98);
	transition: transform 0.45s ease;
}

@keyframes sag-in {
	from { opacity: 0; transform: translateY(12px) scale(0.97); }
	to   { opacity: 1; transform: none; }
}

@keyframes sag-nudge {
	0%, 100% { transform: translateX(0); }
	25%      { transform: translateX(-5px); }
	75%      { transform: translateX(5px); }
}

@media (max-width: 480px) {
	#sag-gate .sag-card {
		padding: 36px 22px 22px;
		border-radius: 18px;
	}
	#sag-gate .sag-heading {
		font-size: 24px;
	}
}

@media (prefers-reduced-motion: reduce) {
	#sag-gate .sag-card,
	#sag-gate .sag-note.sag-nudge {
		animation: none;
	}
	#sag-gate,
	#sag-gate * {
		transition: none !important;
	}
}
