/**
 * Phoenix BioLabs — Entry Gate (age + research-use confirmation).
 *
 * Rendered at wp_body_open so it precedes any footer-injected popup
 * (OptinMonster 10%-off etc.). Default state is VISIBLE: the markup ships
 * inside LiteSpeed/GTranslate-cached HTML, so "has this visitor accepted?"
 * is decided client-side by the inline pre-paint script in the module —
 * it stamps html.ph-gate-done (hide, no flash) or html.ph-gate-lock (show).
 * No-JS clients get the <noscript> rule that hides the gate, so crawlers
 * and script-less browsers are never walled off.
 */

.ph-gate-scrim {
	/* Scoped tokens — mirrors the phoenixbiolabs-theme dark palette. */
	--ph-gate-surface: #09090b;
	--ph-gate-surface-2: #111113;
	--ph-gate-text: #ffffff;
	--ph-gate-muted: #a1a1aa;
	--ph-gate-muted-2: #71717a;
	--ph-gate-border: #27272a;
	--ph-gate-border-soft: #18181b;
	--ph-gate-accent: #c5a059;
	--ph-gate-radius: 0px; /* sharp corners — brand requirement */
	--ph-gate-trans: .3s ease;
	--ph-gate-font-display: "Cinzel", "Times New Roman", serif;

	position: fixed;
	inset: 0;
	z-index: 2147483647;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(0, 0, 0, .78);
	-webkit-backdrop-filter: blur(7px);
	backdrop-filter: blur(7px);
	overflow-y: auto;
	overscroll-behavior: contain;
}

.ph-gate {
	width: 100%;
	max-width: 468px;
	margin: auto;
	padding: 40px 40px 26px;
	text-align: center;
	color: var(--ph-gate-text);
	background: var(--ph-gate-surface);
	border: 1px solid var(--ph-gate-border);
	border-top: 2px solid var(--ph-gate-accent);
	border-radius: var(--ph-gate-radius);
	box-shadow: 0 40px 100px rgba(0, 0, 0, .7);
	animation: ph-gate-rise .5s cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes ph-gate-rise {
	from { opacity: 0; transform: translateY(16px); }
	to   { opacity: 1; transform: none; }
}

.ph-gate__logo {
	display: block;
	height: 46px;
	width: auto;
	margin: 0 auto 22px;
}

.ph-gate__title {
	margin: 0 0 12px;
	font-family: var(--ph-gate-font-display);
	font-size: 25px;
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--ph-gate-text);
}

.ph-gate__lede {
	margin: 0 0 26px;
	font-size: 13.5px;
	line-height: 1.6;
	color: var(--ph-gate-muted);
}

/* ---- language selector (EU: GTranslate sub-directory languages) ---- */
.ph-gate__field {
	position: relative;
	margin: 0 0 26px;
	text-align: left;
	border: 1px solid var(--ph-gate-border);
	border-radius: var(--ph-gate-radius);
	background: var(--ph-gate-surface-2);
}

.ph-gate__field-label {
	position: absolute;
	top: -7px;
	left: 12px;
	padding: 0 6px;
	font-size: 10px;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--ph-gate-accent);
	background: var(--ph-gate-surface);
}

.ph-gate__select {
	appearance: none;
	-webkit-appearance: none;
	width: 100%;
	margin: 0;
	padding: 15px 40px 15px 14px;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	color: var(--ph-gate-text);
	background-color: transparent;
	/* gold chevron */
	background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 7'%3E%3Cpath d='M1 1L5 5L9 1' fill='none' stroke='%23c5a059' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 15px center;
	background-size: 11px 8px;
	border: 0;
	border-radius: var(--ph-gate-radius);
	cursor: pointer;
}

.ph-gate__select option {
	color: #ffffff;
	background: var(--ph-gate-surface-2);
}

.ph-gate__select:focus-visible {
	outline: 2px solid var(--ph-gate-accent);
	outline-offset: 2px;
}

/* ---- questions ---- */
.ph-gate__q { margin: 0 0 18px; text-align: left; }

.ph-gate__label {
	margin: 0 0 9px;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .01em;
	color: #e4e4e7;
}

.ph-gate__pair {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}

.ph-gate__opt {
	appearance: none;
	cursor: pointer;
	font: inherit;
	font-size: 14px;
	font-weight: 500;
	color: var(--ph-gate-text);
	padding: 14px 12px;
	background: var(--ph-gate-surface-2);
	border: 1px solid var(--ph-gate-border);
	border-radius: var(--ph-gate-radius);
	transition: border-color var(--ph-gate-trans), background var(--ph-gate-trans), color var(--ph-gate-trans);
}

.ph-gate__opt:hover { border-color: #3f3f46; }

.ph-gate__opt[aria-pressed="true"] {
	border-color: var(--ph-gate-accent);
	color: var(--ph-gate-accent);
	background: linear-gradient(180deg, rgba(197, 160, 89, .14), rgba(197, 160, 89, .05));
	box-shadow: 0 0 0 1px var(--ph-gate-accent) inset;
}

.ph-gate__opt--deny[aria-pressed="true"] {
	border-color: #52525b;
	color: var(--ph-gate-muted);
	background: var(--ph-gate-surface-2);
	box-shadow: 0 0 0 1px #52525b inset;
}

.ph-gate__opt:focus-visible {
	outline: 2px solid var(--ph-gate-accent);
	outline-offset: 2px;
}

/* ---- blocked notice ---- */
.ph-gate__blocked {
	display: none;
	margin: 0 0 4px;
	padding: 12px 14px;
	text-align: left;
	font-size: 13px;
	line-height: 1.55;
	color: #e8d3a6;
	background: rgba(197, 160, 89, .08);
	border: 1px solid rgba(197, 160, 89, .45);
}

.ph-gate.is-blocked .ph-gate__blocked {
	display: block;
	animation: ph-gate-rise .3s ease both;
}

.ph-gate__divider {
	height: 1px;
	margin: 26px 0 20px;
	background: var(--ph-gate-border-soft);
}

/* ---- actions ---- */
.ph-gate__btn {
	display: block;
	width: 100%;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: .03em;
	text-transform: uppercase;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	padding: 15px 16px;
	border: 1px solid transparent;
	border-radius: var(--ph-gate-radius);
	transition: background var(--ph-gate-trans), color var(--ph-gate-trans), border-color var(--ph-gate-trans), opacity var(--ph-gate-trans);
}

.ph-gate__btn--primary {
	margin-bottom: 11px;
	color: #000000;
	background: #ffffff;
}

.ph-gate__btn--primary:hover { background: var(--ph-gate-accent); color: #000000; }

.ph-gate__btn--primary:disabled {
	color: #52525b;
	background: #1c1c1f;
	border-color: var(--ph-gate-border);
	cursor: not-allowed;
}

.ph-gate__btn--ghost {
	color: var(--ph-gate-text);
	background: transparent;
	border-color: var(--ph-gate-border);
}

.ph-gate__btn--ghost:hover { border-color: var(--ph-gate-accent); color: var(--ph-gate-accent); }

.ph-gate__btn:focus-visible {
	outline: 2px solid var(--ph-gate-accent);
	outline-offset: 2px;
}

.ph-gate__prefs {
	display: inline-block;
	margin: 16px 0 4px;
	font-size: 12px;
	letter-spacing: .06em;
	text-transform: uppercase;
	text-decoration: underline;
	text-underline-offset: 3px;
	color: var(--ph-gate-muted);
}

.ph-gate__prefs:hover { color: var(--ph-gate-accent); }

.ph-gate__fineprint {
	margin: 12px 0 4px;
	font-size: 11.5px;
	letter-spacing: .03em;
	color: var(--ph-gate-muted-2);
}

/* ---- state ---- */
html.ph-gate-done .ph-gate-scrim { display: none; }

/* Scroll lock only when JS actually showed the gate. */
html.ph-gate-lock,
html.ph-gate-lock body { overflow: hidden; }

/* Hold back injected marketing popups until the gate is cleared; the max
   z-index above already covers them — this stops them stacking underneath.
   Klaviyo onsite forms are what actually serve the 10%-off popup here
   (verified 2026-07-25: both OptinMonster campaigns are draft, but its
   selectors stay listed so a re-enabled campaign is covered too). */
html.ph-gate-lock.ph-gate-defer div[class*="klaviyo-form"],
html.ph-gate-lock.ph-gate-defer div[class*="kl-private-reset-css"],
html.ph-gate-lock.ph-gate-defer div[id^="om-"],
html.ph-gate-lock.ph-gate-defer div[class*="om-holder"] { display: none !important; }

@media (max-width: 480px) {
	.ph-gate-scrim { padding: 14px; }
	.ph-gate { padding: 30px 22px 20px; }
	.ph-gate__title { font-size: 21px; }
	.ph-gate__pair { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
	.ph-gate,
	.ph-gate.is-blocked .ph-gate__blocked { animation: none; }
	.ph-gate__opt,
	.ph-gate__btn { transition: none; }
}
