/**
 * Brink Tunnel Gallery — container & loader styles.
 *
 * Everything is scoped under .brink-tunnel-gallery so it can drop into a Divi,
 * Divi 5, Gutenberg or Elementor section without leaking styles or being
 * clobbered by theme resets. No global selectors are used.
 */

.brink-tunnel-gallery {
	position: relative;
	display: block;
	width: 100%;
	height: var(--brink-tunnel-height, 100vh);
	min-height: var(--brink-tunnel-min-height, 620px);
	margin: 0;
	overflow: hidden;
	background: radial-gradient(120% 120% at 50% 40%, #05070d 0%, #020308 70%, #010104 100%);
	color: #f4f6fb;
	font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	cursor: grab;
	user-select: none;
	-webkit-user-select: none;
	touch-action: none;
	isolation: isolate;
	contain: layout paint style;
}

.brink-tunnel-gallery.is-grabbing {
	cursor: grabbing;
}

.brink-tunnel-gallery.is-interactive {
	cursor: pointer;
}

.brink-tunnel-gallery__canvas {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	outline: none;
}

/* --- Loading screen -------------------------------------------------------- */

.brink-tunnel-gallery__loader {
	position: absolute;
	inset: 0;
	z-index: 4;
	display: flex;
	align-items: center;
	justify-content: center;
	background: radial-gradient(120% 120% at 50% 45%, #06080f 0%, #020308 65%, #010104 100%);
	opacity: 1;
	transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1);
	will-change: opacity;
}

.brink-tunnel-gallery.is-ready .brink-tunnel-gallery__loader {
	opacity: 0;
	pointer-events: none;
}

.brink-tunnel-gallery__loader-inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 22px;
	transform: translateY(-2%);
}

.brink-tunnel-gallery__loader-bar {
	position: relative;
	width: clamp(140px, 20vw, 240px);
	height: 2px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.09);
	overflow: hidden;
}

.brink-tunnel-gallery__loader-bar span {
	position: absolute;
	inset: 0;
	transform-origin: left center;
	transform: scaleX(0);
	border-radius: 999px;
	background: linear-gradient(90deg, rgba(255, 214, 92, 0.9), rgba(255, 246, 214, 0.98));
	box-shadow: 0 0 18px rgba(255, 214, 92, 0.55);
	transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

/* --- Cinematic click transition -------------------------------------------- */

.brink-tunnel-gallery__flash {
	position: absolute;
	inset: 0;
	z-index: 6;
	background: #010104;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.46s cubic-bezier(0.4, 0, 0.2, 1);
	will-change: opacity;
}

.brink-tunnel-gallery__flash.is-active {
	opacity: 1;
}

/* --- Ambient hint ---------------------------------------------------------- */

.brink-tunnel-gallery__hint {
	position: absolute;
	left: 50%;
	bottom: clamp(18px, 3.5vh, 36px);
	z-index: 3;
	transform: translateX(-50%);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	pointer-events: none;
	opacity: 0;
	transition: opacity 1s ease 0.3s;
	text-align: center;
}

.brink-tunnel-gallery.is-ready .brink-tunnel-gallery__hint {
	opacity: 1;
}

/* Once travelling, keep the legend but let it recede so it never distracts. */
.brink-tunnel-gallery.is-travelling .brink-tunnel-gallery__hint {
	opacity: 0.42;
}

.brink-tunnel-gallery__hint-keys {
	display: flex;
	align-items: center;
	gap: 8px;
}

.brink-tunnel-gallery__hint-keys span {
	display: inline-flex;
	align-items: center;
	padding: 6px 12px;
	font-size: clamp(10px, 1vw, 12px);
	font-weight: 500;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: rgba(244, 246, 251, 0.82);
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 8px;
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	box-shadow: 0 6px 22px rgba(0, 0, 0, 0.35);
	white-space: nowrap;
}

.brink-tunnel-gallery__hint-label {
	font-size: clamp(10px, 1vw, 12px);
	font-weight: 400;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: rgba(244, 246, 251, 0.55);
	text-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
}

@media (max-width: 600px) {
	.brink-tunnel-gallery__hint-label {
		display: none;
	}
}

.brink-tunnel-gallery noscript {
	position: absolute;
	inset: auto 0 40px;
	text-align: center;
	font-size: 14px;
	color: rgba(244, 246, 251, 0.7);
}

/* --- Reduced motion -------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.brink-tunnel-gallery.is-ready .brink-tunnel-gallery__hint {
		animation: none;
	}
	.brink-tunnel-gallery__loader {
		transition: opacity 0.3s linear;
	}
}

@media (max-width: 767px) {
	.brink-tunnel-gallery {
		height: var(--brink-tunnel-height, 82vh);
		min-height: var(--brink-tunnel-min-height, 520px);
	}
}
