/**
 * SCBL - Gallery block.
 *
 * Arcade gallery adapted from the standalone HTML. Typography comes from the
 * project tokens/utilities; this file handles layout, frame chrome and image
 * normalization.
 */

.scbl-gallery {
	--gallery-orange: var(--color-orange-500);
	--gallery-purple: var(--color-indigo-600);
	--gallery-purple-soft: var(--color-indigo-400);
	--gallery-ink: var(--color-indigo-950);
	--gallery-muted: rgba(255, 255, 255, 0.68);
	--gallery-teal: #6fe6d0;
	--gallery-header-pull: calc(2 * clamp(1rem, 3vw, 2.5rem) + 7rem);
	position: relative;
	overflow-x: clip;
	overflow-y: visible;
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	background: var(--gallery-ink);
	color: var(--color-white);
	overflow-anchor: none;
	padding-block: clamp(3.5rem, 7vw, 6.5rem);
	z-index: 0;
}

.site-header {
	position: relative;
	z-index: 5;
}

.scbl-gallery-lightbox-open,
.scbl-gallery-lightbox-open body {
	overflow: hidden;
}

.scbl-gallery::after {
	content: "";
	position: absolute;
	inset-inline: 0;
	top: calc(-1 * var(--gallery-header-pull));
	bottom: 0;
	z-index: 0;
	background:
		radial-gradient(circle at 25% 22%, rgba(95, 47, 157, 0.5), transparent 28rem),
		radial-gradient(circle at 78% 18%, rgba(255, 77, 0, 0.36), transparent 30rem),
		linear-gradient(180deg, var(--color-indigo-950) 0%, #0b0418 100%);
	pointer-events: none;
}

.scbl-gallery__floor {
	position: absolute;
	inset: 0;
	z-index: 1;
	overflow: clip;
	pointer-events: none;
}

.scbl-gallery__floor::before {
	content: "";
	position: absolute;
	left: 50%;
	bottom: 0;
	width: 200%;
	height: 50%;
	background-image:
		linear-gradient(rgba(155, 107, 224, 0.2) 2px, transparent 2px),
		linear-gradient(90deg, rgba(155, 107, 224, 0.2) 2px, transparent 2px);
	background-size: 80px 80px;
	mask-image: linear-gradient(180deg, black 30%, transparent 100%);
	transform: translateX(-50%) perspective(600px) rotateX(60deg);
	transform-origin: top center;
}

.scbl-gallery__ball {
	position: absolute;
	z-index: 1;
	border-radius: 999px;
	background: radial-gradient(circle at 35% 30%, var(--color-orange-300), var(--gallery-orange) 60%, #8a2400 100%);
	box-shadow: 0 0 3.75rem rgba(255, 77, 0, 0.45), inset -0.5rem -0.625rem 1.125rem rgba(0, 0, 0, 0.45);
	pointer-events: none;
}

.scbl-gallery__ball::before,
.scbl-gallery__ball::after {
	content: "";
	position: absolute;
	inset: 0;
	border: 1px solid rgba(24, 12, 39, 0.45);
	border-radius: inherit;
}

.scbl-gallery__ball::before {
	clip-path: polygon(0 50%, 100% 50%, 100% 52%, 0 52%);
}

.scbl-gallery__ball::after {
	clip-path: polygon(50% 0, 52% 0, 52% 100%, 50% 100%);
}

.scbl-gallery__ball--one {
	top: 32%;
	left: 3%;
	width: clamp(3rem, 6vw, 5rem);
	height: clamp(3rem, 6vw, 5rem);
}

.scbl-gallery__ball--two {
	right: 4%;
	bottom: 7%;
	width: clamp(4rem, 7vw, 5.75rem);
	height: clamp(4rem, 7vw, 5.75rem);
}

.scbl-gallery__stage {
	position: relative;
	z-index: 2;
	box-sizing: border-box;
	width: min(100% - 2rem, 80rem);
	margin-inline: auto;
	max-width: 100%;
}

.scbl-gallery__frame {
	position: relative;
	width: 100%;
	max-width: 100%;
	margin-inline: auto;
	border-radius: 1.375rem;
	padding: clamp(3.5rem, 6vw, 5rem) clamp(1.25rem, 5vw, 3.5rem) clamp(3rem, 6vw, 5rem);
	background:
		linear-gradient(180deg, rgba(95, 47, 157, 0.18), rgba(24, 12, 39, 0.5)),
		rgba(11, 4, 24, 0.28);
	backdrop-filter: blur(12px) saturate(130%);
	box-shadow: 0 0 0 1px rgba(155, 107, 224, 0.12), 0 1.75rem 5rem rgba(0, 0, 0, 0.22);
}

.scbl-gallery__corner {
	position: absolute;
	width: 4rem;
	height: 4rem;
	border: 2px solid rgba(155, 107, 224, 0.75);
	box-shadow: 0 0 0.875rem rgba(255, 77, 0, 0.45);
	pointer-events: none;
}

.scbl-gallery__corner--tl {
	top: 0;
	left: 0;
	border-right: 0;
	border-bottom: 0;
	border-top-left-radius: 0.875rem;
}

.scbl-gallery__corner--tr {
	top: 0;
	right: 0;
	border-left: 0;
	border-bottom: 0;
	border-top-right-radius: 0.875rem;
}

.scbl-gallery__corner--bl {
	bottom: 0;
	left: 0;
	border-right: 0;
	border-top: 0;
	border-bottom-left-radius: 0.875rem;
}

.scbl-gallery__corner--br {
	right: 0;
	bottom: 0;
	border-left: 0;
	border-top: 0;
	border-bottom-right-radius: 0.875rem;
}

.scbl-gallery__corner--tl,
.scbl-gallery__corner--br {
	border-color: var(--gallery-orange);
}

.scbl-gallery__status {
	position: absolute;
	top: -1rem;
	left: 0;
	right: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	max-width: 100%;
	padding-inline: clamp(1.5rem, 5vw, 3.75rem);
	pointer-events: none;
}

.scbl-gallery__chips {
	display: flex;
	gap: 0.625rem;
}

.scbl-gallery__chip,
.scbl-gallery__timer,
.scbl-gallery__eyebrow,
.scbl-gallery__caption,
.scbl-gallery__footer {
	font-family: var(--font-mono, monospace);
}

.scbl-gallery__chip {
	border-radius: 0.5rem;
	background: var(--gallery-orange);
	color: var(--color-white);
	padding: 0.625rem 0.875rem;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	box-shadow: 0 0.375rem 1.25rem -0.375rem rgba(255, 77, 0, 0.7);
}

.scbl-gallery__chip--purple {
	background: var(--gallery-purple);
	box-shadow: 0 0.375rem 1.25rem -0.375rem rgba(95, 47, 157, 0.7);
}

.scbl-gallery__timer {
	display: inline-flex;
	align-items: center;
	gap: 0.625rem;
	border: 2px solid var(--gallery-orange);
	border-radius: 0.5rem;
	background: rgba(10, 5, 20, 0.85);
	color: var(--gallery-orange);
	padding: 0.625rem 1rem;
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	white-space: nowrap;
	box-shadow: inset 0 0 1.25rem rgba(255, 77, 0, 0.25), 0 0 1.125rem rgba(255, 77, 0, 0.35);
}

.scbl-gallery__timer-dot {
	width: 0.45rem;
	height: 0.45rem;
	border-radius: 999px;
	background: currentColor;
	box-shadow: 0 0 0.5rem currentColor;
	animation: scbl-gallery-pulse 1.4s infinite;
}

.scbl-gallery__header {
	max-width: 56rem;
	margin-inline: auto;
	margin-bottom: clamp(2.5rem, 5vw, 4rem);
	text-align: center;
}

.scbl-gallery__eyebrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	margin: 0 0 1.25rem;
	color: var(--color-orange-300);
}

.scbl-gallery__cursor {
	animation: scbl-gallery-blink 1s steps(1) infinite;
}

.scbl-gallery__title {
	display: flex;
	justify-content: center;
	gap: 0.35em;
	margin: 0;
	color: var(--color-white);
	font-family: var(--font-primary);
	font-size: clamp(2.75rem, 6vw + 1rem, 5.75rem);
	font-weight: var(--fw-extrabold);
	line-height: 0.95;
	text-transform: uppercase;
	overflow-wrap: anywhere;
	text-shadow: 0.25rem 0.25rem 0 var(--gallery-orange), 0.4rem 0.4rem 0 rgba(0, 0, 0, 0.35);
}

.scbl-gallery__title-accent {
	color: var(--gallery-orange);
	text-shadow: 0.25rem 0.25rem 0 rgba(0, 0, 0, 0.4);
}

.scbl-gallery__intro {
	max-width: 51rem;
	margin: 1.5rem auto 0;
	color: var(--gallery-muted);
	line-height: var(--lh-snug);
}

.scbl-gallery__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: clamp(1rem, 2vw, 1.375rem);
	min-width: 0;
}

.scbl-gallery__card {
	position: relative;
	overflow: hidden;
	margin: 0;
	border: 1.5px solid rgba(255, 255, 255, 0.08);
	border-radius: 0.875rem;
	background: linear-gradient(180deg, #0e0620 0%, #0a0418 100%);
	box-shadow: 0 1.125rem 2.5rem -1rem rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.04);
	transition: transform 350ms var(--scbl-ease-out), border-color 250ms var(--scbl-ease-out), box-shadow 350ms var(--scbl-ease-out);
}

.scbl-gallery__card[hidden] {
	display: none;
}

.scbl-gallery__card:hover,
.scbl-gallery__card:focus-within {
	border-color: var(--gallery-orange);
	box-shadow: 0 1.875rem 3.75rem -1.25rem rgba(255, 77, 0, 0.5), 0 0 0 1px var(--gallery-orange) inset;
	transform: translateY(-0.25rem);
}

.scbl-gallery__photo-button {
	position: relative;
	display: block;
	width: 100%;
	border: 0;
	background: var(--gallery-ink);
	color: inherit;
	cursor: pointer;
	padding: 0;
	overflow: hidden;
	aspect-ratio: 4 / 3;
}

.scbl-gallery--shape-tall .scbl-gallery__photo-button {
	aspect-ratio: 3 / 4;
}

.scbl-gallery--shape-box .scbl-gallery__photo-button {
	aspect-ratio: 4 / 3;
}

.scbl-gallery__photo-button:disabled {
	cursor: default;
}

.scbl-gallery__photo-button::before,
.scbl-gallery__photo-button::after {
	content: "";
	position: absolute;
	z-index: 2;
	width: 1.375rem;
	height: 1.375rem;
	border: 2px solid var(--gallery-orange);
	opacity: 0;
	pointer-events: none;
	transition: opacity 250ms var(--scbl-ease-out);
}

.scbl-gallery__photo-button::before {
	top: 0.625rem;
	left: 0.625rem;
	border-right: 0;
	border-bottom: 0;
}

.scbl-gallery__photo-button::after {
	right: 0.625rem;
	bottom: 0.625rem;
	border-left: 0;
	border-top: 0;
}

.scbl-gallery__card:hover .scbl-gallery__photo-button::before,
.scbl-gallery__card:hover .scbl-gallery__photo-button::after,
.scbl-gallery__card:focus-within .scbl-gallery__photo-button::before,
.scbl-gallery__card:focus-within .scbl-gallery__photo-button::after {
	opacity: 1;
}

.scbl-gallery__image,
.scbl-gallery__video,
.scbl-gallery__video-placeholder {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 600ms var(--scbl-ease-out), filter 350ms var(--scbl-ease-out);
}

.scbl-gallery__video-placeholder {
	position: relative;
	background:
		linear-gradient(135deg, rgba(255, 77, 0, 0.12), transparent 42%),
		repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 5px),
		var(--gallery-ink);
}

.scbl-gallery__video-placeholder::before {
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(circle at center, rgba(255, 77, 0, 0.18), transparent 45%);
}

.scbl-gallery__card:hover .scbl-gallery__image,
.scbl-gallery__card:hover .scbl-gallery__video,
.scbl-gallery__card:hover .scbl-gallery__video-placeholder,
.scbl-gallery__card:focus-within .scbl-gallery__image,
.scbl-gallery__card:focus-within .scbl-gallery__video,
.scbl-gallery__card:focus-within .scbl-gallery__video-placeholder {
	transform: scale(1.04);
}

.scbl-gallery__play {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 3;
	display: grid;
	place-items: center;
	width: 3.25rem;
	height: 3.25rem;
	border: 2px solid rgba(255, 255, 255, 0.72);
	border-radius: 999px;
	background: rgba(10, 5, 20, 0.64);
	backdrop-filter: blur(6px);
	box-shadow: 0 0 1.5rem rgba(255, 77, 0, 0.5);
	transform: translate(-50%, -50%);
	pointer-events: none;
}

.scbl-gallery__play::before {
	content: "";
	width: 0;
	height: 0;
	margin-left: 0.1875rem;
	border-top: 0.625rem solid transparent;
	border-bottom: 0.625rem solid transparent;
	border-left: 0.875rem solid var(--gallery-orange);
}

.scbl-gallery__tag {
	position: absolute;
	top: 0.75rem;
	left: 0.75rem;
	z-index: 2;
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: 0.375rem;
	background: rgba(10, 5, 20, 0.85);
	backdrop-filter: blur(6px);
	color: var(--color-white);
	padding: 0.4375rem 0.625rem;
	font-family: var(--font-mono, monospace);
	font-size: 0.625rem;
	font-weight: 700;
	letter-spacing: 0.16em;
	line-height: 1;
	text-transform: uppercase;
}

.scbl-gallery__tag--game {
	border-color: var(--gallery-orange);
	color: var(--gallery-orange);
}

.scbl-gallery__tag--practice,
.scbl-gallery__tag--camp {
	border-color: var(--gallery-teal);
	color: var(--gallery-teal);
}

.scbl-gallery__tag--awards {
	border-color: var(--gallery-purple-soft);
	color: var(--color-indigo-200);
}

.scbl-gallery__caption {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	border-top: 1px dashed rgba(255, 255, 255, 0.1);
	color: var(--color-white);
	padding: 0.875rem 1rem 1rem;
	font-size: 0.875rem;
	font-weight: 500;
	line-height: 1.45;
}

.scbl-gallery__load-more-wrap {
	display: flex;
	justify-content: center;
	margin-top: clamp(2rem, 4vw, 3rem);
}

.scbl-gallery__load-more {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.875rem;
	min-height: 3.75rem;
	border: 0;
	border-radius: 0.625rem;
	background: var(--gallery-orange);
	color: var(--color-white);
	cursor: pointer;
	padding: 0.875rem 1.5rem;
	font-family: var(--font-mono, monospace);
	font-size: 0.8125rem;
	font-weight: 800;
	letter-spacing: 0.16em;
	line-height: 1;
	text-transform: uppercase;
	box-shadow: 0 0.75rem 0 rgba(10, 5, 20, 0.82), 0 1.25rem 2.5rem rgba(255, 77, 0, 0.22);
	transition: transform 220ms var(--scbl-ease-out), opacity 220ms var(--scbl-ease-out), box-shadow 220ms var(--scbl-ease-out);
}

.scbl-gallery__load-more:hover,
.scbl-gallery__load-more:focus-visible {
	opacity: 0.86;
	transform: translateY(-0.125rem);
	box-shadow: 0 0.875rem 0 rgba(10, 5, 20, 0.82), 0 1.5rem 3rem rgba(255, 77, 0, 0.28);
}

.scbl-gallery__load-more[hidden] {
	display: none;
}

.scbl-gallery__load-more-key {
	display: none;
}

.scbl-gallery__load-more-arrow {
	width: 0;
	height: 0;
	border-top: 0.5rem solid transparent;
	border-bottom: 0.5rem solid transparent;
	border-left: 0.75rem solid currentColor;
	flex: 0 0 auto;
}

.scbl-gallery__prompt,
.scbl-gallery__footer strong {
	color: var(--gallery-orange);
}

.scbl-gallery__footer {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 1rem;
	margin-top: clamp(2.5rem, 5vw, 4.375rem);
	border-top: 1px dashed rgba(255, 255, 255, 0.12);
	padding-top: 1.875rem;
	color: var(--gallery-muted);
}

.scbl-gallery__empty {
	border: 1px dashed rgba(255, 255, 255, 0.25);
	border-radius: 0.875rem;
	background: rgba(255, 255, 255, 0.04);
	padding: 2rem;
	text-align: center;
}

.scbl-gallery__empty p {
	margin: 0;
	color: var(--gallery-muted);
}

.scbl-gallery__lightbox {
	position: fixed;
	inset: 0;
	z-index: 200;
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba(5, 2, 12, 0.92);
	backdrop-filter: blur(8px);
	padding: 2.5rem;
}

.scbl-gallery__lightbox.is-open {
	display: flex;
}

.scbl-gallery__lightbox-frame {
	position: relative;
	overflow: hidden;
	max-width: 90vw;
	max-height: 88vh;
	border-radius: 0.875rem;
	box-shadow: 0 0 0 1.5px var(--gallery-orange), 0 1.875rem 5rem -1.25rem rgba(255, 77, 0, 0.5);
}

.scbl-gallery__lightbox-frame img,
.scbl-gallery__lightbox-frame video {
	display: block;
	width: auto;
	max-width: 90vw;
	max-height: 78vh;
	object-fit: contain;
}

.scbl-gallery__lightbox-frame [hidden] {
	display: none;
}

.scbl-gallery__lightbox-caption {
	position: absolute;
	inset-inline: 0;
	bottom: 0;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0;
	background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.85) 100%);
	color: var(--color-white);
	padding: 3rem 1.375rem 1.125rem;
}

.scbl-gallery__lightbox-close,
.scbl-gallery__lightbox-nav {
	position: absolute;
	display: grid;
	place-items: center;
	border: 0;
	border-radius: 999px;
	background: var(--gallery-orange);
	color: var(--color-white);
	cursor: pointer;
	box-shadow: 0 0 1.25rem rgba(255, 77, 0, 0.6);
	transition: opacity 220ms var(--scbl-ease-out), transform 220ms var(--scbl-ease-out);
}

.scbl-gallery__lightbox-close:hover,
.scbl-gallery__lightbox-nav:hover,
.scbl-gallery__lightbox-close:focus-visible,
.scbl-gallery__lightbox-nav:focus-visible {
	opacity: 0.82;
	transform: scale(1.04);
}

.scbl-gallery__lightbox-close {
	top: 0.75rem;
	right: 0.75rem;
	z-index: 3;
	width: 2.625rem;
	height: 2.625rem;
	font-size: 1.125rem;
	font-weight: 700;
}

.scbl-gallery__lightbox-nav {
	top: 50%;
	z-index: 3;
	width: 3rem;
	height: 3rem;
	font-size: 1.375rem;
	transform: translateY(-50%);
}

.scbl-gallery__lightbox-nav:hover,
.scbl-gallery__lightbox-nav:focus-visible {
	transform: translateY(-50%) scale(1.04);
}

.scbl-gallery__lightbox-nav--prev {
	left: clamp(0.75rem, 4vw, 2rem);
}

.scbl-gallery__lightbox-nav--next {
	right: clamp(0.75rem, 4vw, 2rem);
}

@keyframes scbl-gallery-pulse {
	0%,
	100% { opacity: 1; }
	50% { opacity: 0.35; }
}

@keyframes scbl-gallery-blink {
	50% { opacity: 0; }
}

@media (min-width: 42rem) {
	.scbl-gallery__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 68rem) {
	.scbl-gallery__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 74.9375rem) {
	.scbl-gallery {
		padding-block: clamp(2.5rem, 5vw, 4rem) clamp(4rem, 7vw, 5.5rem);
	}

	.scbl-gallery__stage {
		width: min(100% - 2rem, 56rem);
	}

	.scbl-gallery__frame {
		padding: clamp(3rem, 5vw, 4rem) clamp(1rem, 4vw, 2rem) clamp(2.75rem, 5vw, 4rem);
	}
}

@media (max-width: 48rem) {
	.scbl-gallery {
		padding-block: 3rem 4.5rem;
	}

	.scbl-gallery__ball {
		display: none;
	}

	.scbl-gallery__frame {
		padding: 3.5rem 1rem 2.75rem;
	}

	.scbl-gallery__status {
		top: -0.875rem;
		padding-inline: 1rem;
		gap: 0.5rem;
	}

	.scbl-gallery__chip {
		padding: 0.5rem 0.625rem;
		font-size: 0.625rem;
	}

	.scbl-gallery__timer {
		padding: 0.5rem 0.625rem;
		font-size: 0.625rem;
	}

	.scbl-gallery__title {
		flex-direction: column;
		gap: 0;
		font-size: clamp(2.5rem, 14vw, 4.5rem);
	}

	.scbl-gallery__intro {
		margin-top: 1.125rem;
	}

	.scbl-gallery__footer {
		justify-content: center;
		text-align: center;
	}

	.scbl-gallery__lightbox {
		padding: 1rem;
	}
}

@media (max-width: 28rem) {
	.scbl-gallery__status {
		padding-inline: 0.75rem;
	}

	.scbl-gallery__chips {
		gap: 0.375rem;
	}

	.scbl-gallery__chip,
	.scbl-gallery__timer {
		border-radius: 0.375rem;
		font-size: 0.5625rem;
		letter-spacing: 0.08em;
		padding: 0.45rem 0.5rem;
	}
}
