/*
 * First-visit welcome popup (templates/welcome.php). Uses the shared --bcb-* tokens from site.css.
 * The art box keeps the hero image's own 1024:608 ratio, so the moon glow and the cat's eye stay
 * pinned to the picture at every width.
 */

html.bcb-wl-lock { overflow: hidden; }

.bcb-wl[hidden] { display: none; }
.bcb-wl {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	font-family: var(--bcb-sans);
	color: var(--bcb-ink);
}

.bcb-wl-backdrop {
	position: absolute;
	inset: 0;
	background:
		radial-gradient(ellipse 60% 55% at 50% 50%, rgba(92, 8, 12, 0.62) 0%, rgba(32, 3, 5, 0.86) 48%, rgba(2, 2, 3, 0.97) 82%),
		rgba(2, 2, 3, 0.55);
	opacity: 0;
	transition: opacity 700ms ease;
}
.bcb-wl.is-open .bcb-wl-backdrop { opacity: 1; }

/* Fog drifting across the whole screen, behind the card */
.bcb-wl-fog {
	position: absolute;
	inset: -20% -40%;
	pointer-events: none;
	opacity: 0;
	transition: opacity 1600ms ease 300ms;
	background:
		radial-gradient(ellipse 30% 18% at 20% 70%, rgba(220, 220, 230, 0.10), transparent 70%),
		radial-gradient(ellipse 26% 14% at 60% 80%, rgba(220, 220, 230, 0.08), transparent 70%),
		radial-gradient(ellipse 34% 20% at 85% 60%, rgba(200, 60, 60, 0.07), transparent 70%),
		radial-gradient(ellipse 22% 12% at 40% 30%, rgba(220, 220, 230, 0.06), transparent 70%);
	filter: blur(6px);
}
.bcb-wl.is-open .bcb-wl-fog { opacity: 1; }
.bcb-wl-fog-a { animation: bcb-wl-drift 38s linear infinite alternate; }
.bcb-wl-fog-b { animation: bcb-wl-drift 54s linear infinite alternate-reverse; transform: scaleX(-1); }

/* ---------- Card ---------- */
.bcb-wl-card {
	position: relative;
	width: min(920px, 100%);
	min-width: 0;
	box-sizing: border-box;
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	overflow: hidden;
	border: 1px solid rgba(230, 60, 60, 0.7);
	border-radius: var(--bcb-radius-lg);
	background: var(--bcb-bg);
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), 0 0 34px rgba(201, 40, 44, 0.5), 0 0 110px rgba(201, 40, 44, 0.32), 0 40px 100px rgba(0, 0, 0, 0.9);
	opacity: 0;
	transform: translateY(14px) scale(1.05);
	filter: blur(10px);
}
.bcb-wl.is-open .bcb-wl-card { animation: bcb-wl-materialise 1500ms cubic-bezier(0.2, 0.7, 0.2, 1) forwards; }

.bcb-wl-art {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 1024 / 608;
	overflow: hidden;
	background: #0a0203;
}
.bcb-wl-img {
	display: block;
	width: 100%;
	max-width: none;
	min-width: 0;
	height: 100%;
	object-fit: cover;
	transform-origin: 78% 35%;
	animation: bcb-wl-breathe 18s ease-in-out infinite alternate;
}
/* Darkens the left of the picture so the copy reads over it */
.bcb-wl-art::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(90deg, rgba(5, 5, 5, 0.94) 0%, rgba(5, 5, 5, 0.82) 34%, rgba(5, 5, 5, 0.2) 58%, transparent 72%);
	pointer-events: none;
}

.bcb-wl-moon {
	position: absolute;
	left: 81%;
	top: 12%;
	width: 34%;
	aspect-ratio: 1;
	transform: translate(-50%, -50%);
	border-radius: 50%;
	background: radial-gradient(circle, rgba(255, 60, 50, 0.45) 0%, rgba(255, 40, 40, 0.18) 38%, transparent 68%);
	mix-blend-mode: screen;
	animation: bcb-wl-moon 6s ease-in-out infinite;
	pointer-events: none;
}

/* The cat's eye: a glow over the painted eye that pulses and blinks */
.bcb-wl-eye {
	position: absolute;
	left: 77.8%;
	top: 27.7%;
	width: 1.5%;
	aspect-ratio: 1.5;
	transform: translate(-50%, -50%);
	border-radius: 50%;
	background: radial-gradient(ellipse, #fff6c2 0%, #ffd23f 40%, rgba(255, 190, 40, 0) 75%);
	box-shadow: 0 0 10px 3px rgba(255, 200, 60, 0.75), 0 0 26px 8px rgba(255, 170, 40, 0.35);
	animation: bcb-wl-blink 7s ease-in-out infinite, bcb-wl-eyeglow 2.6s ease-in-out infinite;
	pointer-events: none;
}

/* Ground mist rolling along the bottom of the picture */
.bcb-wl-mist {
	position: absolute;
	left: -30%;
	right: -30%;
	bottom: -6%;
	height: 42%;
	background:
		radial-gradient(ellipse 22% 40% at 15% 70%, rgba(230, 225, 230, 0.20), transparent 70%),
		radial-gradient(ellipse 26% 45% at 45% 80%, rgba(230, 225, 230, 0.16), transparent 70%),
		radial-gradient(ellipse 20% 38% at 75% 75%, rgba(230, 225, 230, 0.18), transparent 70%);
	filter: blur(8px);
	animation: bcb-wl-mist 22s ease-in-out infinite alternate;
	pointer-events: none;
}

/* Distant lightning */
.bcb-wl-flash {
	position: absolute;
	inset: 0;
	background: radial-gradient(ellipse at 60% 15%, rgba(255, 220, 220, 0.55), rgba(255, 60, 60, 0.15) 45%, transparent 75%);
	opacity: 0;
	animation: bcb-wl-flash 11s linear infinite 2.5s;
	pointer-events: none;
}

/* Wisps that rise and fade */
.bcb-wl-ghost {
	position: absolute;
	bottom: -20%;
	width: 12%;
	aspect-ratio: 0.55;
	border-radius: 50% 50% 45% 45%;
	background: radial-gradient(ellipse at 50% 35%, rgba(240, 240, 250, 0.38), rgba(240, 240, 250, 0.08) 55%, transparent 72%);
	filter: blur(6px);
	opacity: 0;
	pointer-events: none;
	animation: bcb-wl-rise 12s ease-in infinite;
}
.bcb-wl-ghost-1 { left: 52%; animation-delay: 1.2s; }
.bcb-wl-ghost-2 { left: 38%; width: 9%; animation-delay: 5.5s; animation-duration: 14s; }
.bcb-wl-ghost-3 { left: 64%; width: 10%; animation-delay: 9s; animation-duration: 11s; }

/* ---------- Copy ---------- */
.bcb-wl-copy {
	position: absolute;
	inset: 0 auto 0 0;
	z-index: 2;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: flex-start;
	gap: 16px;
	width: 50%;
	padding: 48px;
	box-sizing: border-box;
}
.bcb-wl-eyebrow {
	margin: 0;
	font-size: var(--bcb-fs-small);
	font-weight: 600;
	letter-spacing: var(--bcb-ls-wider);
	text-transform: uppercase;
	color: var(--bcb-gold);
	opacity: 0;
	animation: bcb-wl-in 900ms ease forwards 900ms;
}
.bcb-wl .bcb-wl-title {
	margin: 0;
	font-family: var(--bcb-serif);
	font-size: 40px;
	font-weight: 400;
	line-height: var(--bcb-lh-tight);
	color: var(--bcb-ink);
	text-shadow: 0 0 18px rgba(201, 40, 44, 0.55), 0 0 2px rgba(255, 255, 255, 0.3);
	opacity: 0;
	animation: bcb-wl-in 1100ms ease forwards 1100ms, bcb-wl-flicker 7s linear infinite 3s;
}
.bcb-wl-text {
	margin: 0;
	font-size: var(--bcb-fs-body);
	line-height: var(--bcb-lh-body);
	color: var(--bcb-ink-muted);
	opacity: 0;
	animation: bcb-wl-in 900ms ease forwards 1400ms;
}
.bcb-wl-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 20px;
	margin-top: 8px;
	opacity: 0;
	animation: bcb-wl-in 900ms ease forwards 1700ms;
}
.bcb-wl .bcb-wl-cta {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: var(--bcb-btn-h-lg);
	padding: 0 var(--bcb-btn-px-lg);
	border-radius: var(--bcb-radius);
	background: var(--bcb-red);
	color: var(--bcb-ink);
	font-size: var(--bcb-btn-fs);
	font-weight: 600;
	letter-spacing: var(--bcb-ls-caps);
	text-transform: uppercase;
	text-decoration: none;
	animation: bcb-wl-pulse 2.8s ease-in-out infinite 2.6s;
	transition: background-color 160ms;
}
.bcb-wl .bcb-wl-cta:hover,
.bcb-wl .bcb-wl-cta:focus-visible { background: var(--bcb-red-deep); color: var(--bcb-ink); }
.bcb-wl .bcb-wl-skip {
	padding: 4px 0;
	border: 0;
	background: none;
	color: var(--bcb-ink-dim);
	font-family: var(--bcb-sans);
	font-size: var(--bcb-fs-small);
	font-weight: 500;
	letter-spacing: var(--bcb-ls-wide);
	text-transform: uppercase;
	cursor: pointer;
	transition: color 160ms;
}
.bcb-wl .bcb-wl-skip:hover,
.bcb-wl .bcb-wl-skip:focus-visible { background: none; color: var(--bcb-ink); }

.bcb-wl .bcb-wl-x {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1px solid rgba(242, 236, 225, 0.25);
	border-radius: 50%;
	background: rgba(5, 5, 5, 0.55);
	color: var(--bcb-ink);
	cursor: pointer;
	transition: border-color 160ms, color 160ms;
}
.bcb-wl .bcb-wl-x:hover,
.bcb-wl .bcb-wl-x:focus-visible { border-color: var(--bcb-gold); background: rgba(5, 5, 5, 0.75); color: var(--bcb-gold); }
.bcb-wl :focus-visible { outline: 2px solid var(--bcb-gold); outline-offset: 3px; }
.bcb-wl .bcb-wl-card:focus { outline: none; }

/* Closing: the card dissolves back into the fog */
.bcb-wl.is-closing .bcb-wl-card { animation: bcb-wl-vanish 600ms ease forwards; }
.bcb-wl.is-closing .bcb-wl-backdrop,
.bcb-wl.is-closing .bcb-wl-fog { opacity: 0; transition-duration: 600ms; transition-delay: 0ms; }

/* ---------- Tablet and phone: picture on top, copy below ---------- */
@media (max-width: 1024px) {
	.bcb-wl .bcb-wl-title { font-size: 32px; }
	.bcb-wl-copy { width: 54%; padding: 36px; }
}
@media (max-width: 720px) {
	.bcb-wl-card { overflow-y: auto; }
	.bcb-wl-art::after { background: linear-gradient(0deg, rgba(5, 5, 5, 1) 0%, rgba(5, 5, 5, 0.4) 30%, transparent 60%); }
	.bcb-wl-copy { position: relative; inset: auto; width: auto; gap: 12px; padding: 4px 24px 28px; margin-top: -12px; }
	.bcb-wl .bcb-wl-title { font-size: 28px; }
	.bcb-wl-actions { width: 100%; }
	.bcb-wl .bcb-wl-cta { flex: 1 1 100%; justify-content: center; }
	.bcb-wl .bcb-wl-skip { margin: 0 auto; }
}

/* ---------- Motion ---------- */
@keyframes bcb-wl-materialise {
	0% { opacity: 0; transform: translateY(14px) scale(1.05); filter: blur(10px); }
	55% { opacity: 0.85; filter: blur(2px); }
	62% { opacity: 0.55; }
	70% { opacity: 0.95; }
	100% { opacity: 1; transform: none; filter: none; }
}
@keyframes bcb-wl-vanish {
	to { opacity: 0; transform: scale(0.97) translateY(-8px); filter: blur(8px); }
}
@keyframes bcb-wl-in {
	from { opacity: 0; transform: translateY(8px); filter: blur(3px); }
	to { opacity: 1; transform: none; filter: none; }
}
@keyframes bcb-wl-drift {
	from { transform: translateX(-8%); }
	to { transform: translateX(8%); }
}
@keyframes bcb-wl-mist {
	from { transform: translateX(-6%); opacity: 0.75; }
	to { transform: translateX(6%); opacity: 1; }
}
@keyframes bcb-wl-breathe {
	from { transform: scale(1); }
	to { transform: scale(1.06); }
}
@keyframes bcb-wl-moon {
	0%, 100% { opacity: 0.55; transform: translate(-50%, -50%) scale(1); }
	50% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
}
@keyframes bcb-wl-eyeglow {
	0%, 100% { opacity: 0.75; }
	50% { opacity: 1; }
}
@keyframes bcb-wl-blink {
	0%, 90%, 96%, 100% { transform: translate(-50%, -50%) scaleY(1); }
	93% { transform: translate(-50%, -50%) scaleY(0.08); }
}
@keyframes bcb-wl-flash {
	0%, 86%, 100% { opacity: 0; }
	87% { opacity: 0.9; }
	88% { opacity: 0.1; }
	89.5% { opacity: 0.6; }
	92% { opacity: 0; }
}
@keyframes bcb-wl-rise {
	0% { opacity: 0; transform: translateY(0) translateX(0) scale(0.8); }
	20% { opacity: 1; }
	60% { opacity: 0.6; transform: translateY(-70%) translateX(10%) scale(1.05); }
	100% { opacity: 0; transform: translateY(-140%) translateX(-6%) scale(1.25); }
}
@keyframes bcb-wl-flicker {
	0%, 18%, 22%, 25%, 53%, 57%, 100% { opacity: 1; }
	20%, 24%, 55% { opacity: 0.35; }
}
@keyframes bcb-wl-pulse {
	0%, 100% { box-shadow: 0 0 0 0 rgba(201, 40, 44, 0); }
	50% { box-shadow: 0 0 22px 2px rgba(201, 40, 44, 0.55); }
}

@media (prefers-reduced-motion: reduce) {
	.bcb-wl *,
	.bcb-wl *::after { animation: none !important; }
	.bcb-wl.is-open .bcb-wl-card { animation: none; opacity: 1; transform: none; filter: none; }
	.bcb-wl-eyebrow,
	.bcb-wl .bcb-wl-title,
	.bcb-wl-text,
	.bcb-wl-actions { opacity: 1; }
	.bcb-wl-ghost,
	.bcb-wl-flash { display: none; }
}

/* ---------- Smoke, embers and the red aura around the card ---------- */
.bcb-wl-smoke,
.bcb-wl-embers {
	position: absolute;
	inset: 0;
	overflow: hidden;
	pointer-events: none;
	opacity: 0;
	transition: opacity 1800ms ease 200ms;
}
.bcb-wl.is-open .bcb-wl-smoke,
.bcb-wl.is-open .bcb-wl-embers { opacity: 1; }
.bcb-wl-smoke span {
	position: absolute;
	width: 75vmax;
	aspect-ratio: 1;
	border-radius: 50%;
	background: radial-gradient(closest-side, rgba(170, 160, 170, 0.26), rgba(130, 24, 30, 0.16) 45%, transparent 72%);
	filter: blur(28px);
	mix-blend-mode: screen;
	animation: bcb-wl-swirl 34s ease-in-out infinite alternate;
}
.bcb-wl-smoke span:nth-child(1) { left: -30vmax; top: -25vmax; }
.bcb-wl-smoke span:nth-child(2) { right: -32vmax; top: -20vmax; animation-duration: 42s; animation-delay: -8s; }
.bcb-wl-smoke span:nth-child(3) { left: -25vmax; bottom: -35vmax; animation-duration: 38s; animation-delay: -14s; }
.bcb-wl-smoke span:nth-child(4) { right: -28vmax; bottom: -32vmax; animation-duration: 46s; animation-delay: -4s; }
.bcb-wl-smoke span:nth-child(5) { left: 20%; bottom: -45vmax; width: 60vmax; animation-duration: 30s; animation-delay: -20s; background: radial-gradient(closest-side, rgba(200, 190, 200, 0.22), transparent 70%); }
.bcb-wl-smoke span:nth-child(6) { left: 25%; top: -48vmax; width: 55vmax; animation-duration: 50s; animation-delay: -11s; background: radial-gradient(closest-side, rgba(160, 30, 36, 0.24), transparent 70%); }

.bcb-wl-embers span {
	position: absolute;
	left: var(--x);
	bottom: -12px;
	width: 4px;
	height: 4px;
	border-radius: 50%;
	background: #ff7a45;
	box-shadow: 0 0 6px 2px rgba(255, 90, 40, 0.8), 0 0 14px 4px rgba(201, 40, 44, 0.45);
	opacity: 0;
	animation: bcb-wl-ember var(--t) linear infinite var(--d);
}
.bcb-wl-embers span:nth-child(3n) { width: 3px; height: 3px; }
.bcb-wl-embers span:nth-child(4n) { width: 5px; height: 5px; background: #ffb36b; }

.bcb-wl-aura {
	position: absolute;
	left: 50%;
	top: 50%;
	width: min(1240px, 135vw);
	height: min(860px, 105vh);
	transform: translate(-50%, -50%);
	border-radius: 50%;
	background: radial-gradient(closest-side, rgba(201, 40, 44, 0.5), rgba(150, 20, 24, 0.2) 55%, transparent 78%);
	filter: blur(24px);
	opacity: 0;
	pointer-events: none;
	transition: opacity 1400ms ease 400ms;
}
.bcb-wl.is-open .bcb-wl-aura { opacity: 1; animation: bcb-wl-aura 4.5s ease-in-out infinite 1.8s; }
.bcb-wl.is-closing .bcb-wl-smoke,
.bcb-wl.is-closing .bcb-wl-embers,
.bcb-wl.is-closing .bcb-wl-aura { opacity: 0; transition-duration: 600ms; transition-delay: 0ms; }

@keyframes bcb-wl-swirl {
	0% { transform: translate(0, 0) rotate(0deg) scale(1); }
	50% { transform: translate(6vmax, -4vmax) rotate(40deg) scale(1.12); }
	100% { transform: translate(-5vmax, 5vmax) rotate(-30deg) scale(0.95); }
}
@keyframes bcb-wl-ember {
	0% { opacity: 0; transform: translate(0, 0) scale(1); }
	10% { opacity: 1; }
	35% { transform: translate(18px, -35vh) scale(0.9); }
	55% { opacity: 0.9; }
	70% { transform: translate(-14px, -70vh) scale(0.7); opacity: 0.5; }
	100% { opacity: 0; transform: translate(10px, -105vh) scale(0.4); }
}
@keyframes bcb-wl-aura {
	0%, 100% { opacity: 0.75; transform: translate(-50%, -50%) scale(1); }
	50% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
}
@media (prefers-reduced-motion: reduce) {
	.bcb-wl-embers { display: none; }
}
/* "Not tonight" was 21px tall; give it a proper tap size (40px; 32px in the short landscape layout below). */
.bcb-wl .bcb-wl-skip { display: inline-flex; align-items: center; min-height: 40px; }

/* Phones turned sideways (short screens, e.g. 568x320 or 640x360): keep the picture-with-text layout instead of the stacked one, which was taller than the screen and left the text and buttons hidden below the picture. */
@media (max-width: 720px) and (max-height: 520px) and (orientation: landscape) {
	.bcb-wl-card { overflow-y: hidden; }
	.bcb-wl-art::after { background: linear-gradient(90deg, rgba(5, 5, 5, 0.94) 0%, rgba(5, 5, 5, 0.82) 40%, rgba(5, 5, 5, 0.2) 64%, transparent 78%); }
	.bcb-wl-copy { position: absolute; inset: 0 auto 0 0; width: 64%; padding: 14px 20px; margin-top: 0; gap: 6px; }
	.bcb-wl .bcb-wl-title { font-size: 22px; }
	.bcb-wl-text { font-size: 14px; line-height: 1.4; }
	.bcb-wl-actions { width: auto; margin-top: 2px; }
	.bcb-wl .bcb-wl-cta { flex: 0 0 auto; min-height: 40px; }
	.bcb-wl .bcb-wl-skip { margin: 0; min-height: 32px; }
}
/* Welcome popup: the button and "Not tonight" are stacked at every width, "Not tonight" starts on the same left edge as the heading, text and button, sits right under the button, and is a little smaller. */
.bcb-wl .bcb-wl-actions { flex-direction: column !important; align-items: flex-start !important; gap: 0 !important; }
.bcb-wl .bcb-wl-cta { flex: 0 0 auto !important; align-self: flex-start; }
.bcb-wl .bcb-wl-skip { margin: 0 !important; padding: 0 !important; min-height: 32px !important; font-size: 12px !important; letter-spacing: 1.4px !important; }
@media (max-width: 720px) { .bcb-wl .bcb-wl-cta { align-self: stretch; } }
@media (max-width: 720px) and (max-height: 520px) and (orientation: landscape) { .bcb-wl .bcb-wl-cta { align-self: flex-start; } }