/*
 * Homepage "See our Content" section.
 * Width, background, heading and stacking come from the shared
 * DDM Container / DDM Heading styles; only section-specific rules go here.
 */
.home-showcase {
	--home-showcase-shift: 0px;
	--home-showcase-pin: 0px;
	/* clip (not hidden) so the sticky viewport inside still sticks */
	overflow: clip;
	isolation: isolate;
}

/* Scroll-pinned phase: section = one screen + pin distance. */
.wp-block-ddm-container.home-showcase.is-pinned {
	height: calc(100svh + var(--home-showcase-pin));
	min-height: 0;
}

/* The visible scene: one screen tall, pinned while the section scrolls by. */
.home-showcase__viewport {
	position: sticky;
	top: 0;
	height: 100svh;
	overflow: hidden;
}

.home-showcase:not(.is-pinned) .home-showcase__viewport {
	position: relative;
	height: auto;
	min-height: 100svh;
}

/* DDM Video Pool canvas host: fills the section, behind the content. */
.home-showcase__stage {
	position: absolute;
	inset: 0;
	z-index: 0;
	pointer-events: none;
}

.home-showcase__stage canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	display: block;
	pointer-events: none;
}

/* Soft vignette keeps the copy legible over the cards. */
.home-showcase__stage::after {
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(ellipse 55% 45% at 50% 50%, rgba(18, 19, 15, 0.72), rgba(18, 19, 15, 0) 70%);
	pointer-events: none;
	z-index: 1;
}

.home-showcase .ddm-container__inner {
	position: relative;
	z-index: 1;
	text-align: center;
	pointer-events: none;
}

.home-showcase.is-pinned > .home-showcase__viewport > .ddm-container__inner {
	height: 100svh;
	min-height: 0;
}

.home-showcase .home-showcase__title,
.home-showcase .home-showcase__body {
	transform: translate3d(0, var(--home-showcase-shift), 0);
	will-change: transform;
}

.home-showcase .home-showcase__title {
	margin-top: 0;
	margin-inline: auto;
	text-align: center;
}

.home-showcase__body {
	max-width: 36rem;
	margin: 0.75em auto 0;
	font-family: "Manrope", sans-serif;
	font-size: clamp(1rem, 1.4vw, 1.2rem);
	line-height: 1.6;
	text-align: center;
	opacity: 0.8;
}

.home-showcase__body p {
	margin: 0;
}

.home-showcase__fps {
	position: fixed;
	left: 8px;
	bottom: 8px;
	z-index: 9999;
	padding: 6px 8px;
	border-radius: 4px;
	background: rgba(0, 0, 0, 0.6);
	color: #d9f25f;
	font: 12px/1 ui-monospace, monospace;
}

.home-showcase.is-card-hover {
	cursor: pointer;
}

/* Keyboard fallback for the canvas cards (built by home-showcase.js):
 * visually hidden until a button receives focus. */
.home-showcase__a11y {
	position: absolute;
	left: 50%;
	bottom: 24px;
	z-index: 3;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
	width: max-content;
	max-width: 90vw;
	margin: 0;
	padding: 0;
	list-style: none;
	transform: translateX(-50%);
	clip-path: inset(50%);
	pointer-events: none;
}

.home-showcase__a11y:focus-within {
	clip-path: none;
	pointer-events: auto;
}

.home-showcase__a11y-btn {
	padding: 6px 12px;
	border: 1px solid rgba(217, 242, 95, 0.5);
	border-radius: 999px;
	background: rgba(18, 19, 15, 0.85);
	color: #fff;
	font: 13px/1.2 "Manrope", sans-serif;
	cursor: pointer;
}

.home-showcase__a11y-btn:focus-visible {
	outline: 2px solid #d9f25f;
	outline-offset: 2px;
}

/* Intro copy: desktop (hover + fine pointer) gets the click hint. */
.home-showcase__intro--desktop {
	display: none;
}

@media (hover: hover) and (pointer: fine) {
	.home-showcase__intro--desktop {
		display: inline;
	}

	.home-showcase__intro--touch {
		display: none;
	}
}

/* Catch game (desktop): counter, victory message, gallery. */
.home-showcase__game-counter {
	position: absolute;
	right: clamp(16px, 3vw, 40px);
	bottom: clamp(16px, 4svh, 40px);
	z-index: 3;
	padding: 6px 14px 4px;
	border: 1px solid rgba(217, 242, 95, 0.45);
	border-radius: 999px;
	background: rgba(18, 19, 15, 0.7);
	color: #d9f25f;
	font-family: "Bebas Neue", sans-serif;
	font-size: 22px;
	letter-spacing: 0.04em;
	line-height: 1;
	pointer-events: none;
}

.home-showcase__victory {
	position: absolute;
	inset: 0;
	z-index: 4;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	background: rgba(18, 19, 15, 0.55);
	color: #d9f25f;
	font-family: "Bebas Neue", sans-serif;
	font-size: clamp(56px, 9vw, 140px);
	line-height: 1;
	text-align: center;
	pointer-events: none;
	animation: home-showcase-pop 600ms cubic-bezier(.2, .8, .2, 1);
}

.home-showcase__game-counter[hidden],
.home-showcase__victory[hidden],
.home-showcase__gallery[hidden] {
	display: none;
}

@keyframes home-showcase-pop {
	from { opacity: 0; transform: scale(0.85); }
	to { opacity: 1; transform: none; }
}

.home-showcase__gallery {
	position: absolute;
	inset: 0;
	z-index: 4;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: clamp(16px, 3svh, 32px);
	padding: clamp(72px, 10svh, 120px) clamp(16px, 4vw, 64px) clamp(24px, 5svh, 56px);
	background: rgba(18, 19, 15, 0.9);
	animation: home-showcase-pop 500ms ease-out;
}

.home-showcase__gallery-title {
	margin: 0;
	color: #fff;
	font-family: "Bebas Neue", sans-serif;
	font-size: clamp(40px, 5vw, 72px);
	line-height: 1;
}

.home-showcase__gallery-grid {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: clamp(10px, 1.4vw, 20px);
	width: min(100%, 1200px);
	margin: 0;
	padding: 0;
	list-style: none;
}

.home-showcase__gallery-item {
	display: block;
	width: 100%;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.22);
	border-radius: 10px;
	overflow: hidden;
	background: #000;
	cursor: pointer;
	transition: transform 160ms ease, border-color 160ms ease;
}

.home-showcase__gallery-item canvas {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
}

.home-showcase__gallery-item:hover,
.home-showcase__gallery-item:focus-visible {
	transform: scale(1.04);
	border-color: #d9f25f;
	outline: none;
}

.home-showcase__release {
	padding: 10px 28px 8px;
	border: 1px solid #d9f25f;
	border-radius: 999px;
	background: transparent;
	color: #d9f25f;
	font-family: "Bebas Neue", sans-serif;
	font-size: 26px;
	letter-spacing: 0.04em;
	line-height: 1;
	cursor: pointer;
	transition: background 160ms ease, color 160ms ease;
}

.home-showcase__release:hover,
.home-showcase__release:focus-visible {
	background: #d9f25f;
	color: #12130f;
	outline: none;
}

.home-showcase__zoom-backdrop {
	position: fixed;
	inset: 0;
	z-index: 9998;
	background: rgba(18, 19, 15, 0.6);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
}

.home-showcase__zoom {
	position: fixed;
	z-index: 9999;
	display: block;
	object-fit: cover;
	background: #000;
	border-radius: 12px;
	box-shadow: 0 0 0 1px rgba(217, 242, 95, 0.35), 0 30px 80px rgba(0, 0, 0, 0.6);
	transform-origin: 0 0;
	outline: none;
	cursor: default;
}

.home-showcase__zoom:focus-visible {
	box-shadow: 0 0 0 2px #d9f25f, 0 30px 80px rgba(0, 0, 0, 0.6);
}

@media (prefers-reduced-motion: reduce) {
	.home-showcase .home-showcase__title,
	.home-showcase .home-showcase__body {
		will-change: auto;
	}
}

/* Inline link in the intro copy: the content layer ignores pointer events
 * (so cards behind it stay clickable); re-enable them for the link only. */
.home-showcase .home-showcase__link {
	position: relative;
	z-index: 2;
	color: #d9f25f;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
	pointer-events: auto;
	cursor: pointer;
	transition: color 160ms ease;
}

.home-showcase .home-showcase__link:hover,
.home-showcase .home-showcase__link:focus-visible {
	color: #ffffff;
}

.home-showcase .home-showcase__link:focus-visible {
	outline: 2px solid #d9f25f;
	outline-offset: 3px;
	border-radius: 2px;
}

/* Section headings: keep 120px on desktop, scale down on phones
 * (mirrors the About page .ddm-team__heading mobile rule). */
@media (max-width: 767px) {
	.home-showcase__title {
		font-size: clamp(56px, 14vw, 100px) !important;
	}
}

/* Homepage "Latest Stories": archive cards (.blog-posts / .blog-post-card)
 * laid out 3-up on desktop, single column on mobile. */
.home-latest-stories .home-showcase__title {
	margin-inline: auto;
	text-align: center;
}

.home-latest-stories .home-latest-stories__posts {
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: clamp(32px, 4vw, 56px);
	text-align: left;
}

.home-latest-stories .blog-post-card__body {
	margin-inline: clamp(16px, 2vw, 28px);
}

@media (max-width: 820px) {
	.home-latest-stories .home-latest-stories__posts {
		grid-template-columns: minmax(0, 1fr);
		gap: clamp(64px, 10vw, 96px);
	}
}

/* Same as the archive's .blog-index link colour. */
.home-latest-stories a {
	color: inherit;
}

/* Latest Stories: compact h4 card titles. */
.home-latest-stories .blog-post-card__title {
	font-size: clamp(30px, 2.6vw, 42px) !important;
	line-height: 1;
	margin-bottom: 0.4em;
}

/* Latest Stories carousel (overrides the 3-up grid above). */
.home-latest-stories .home-latest-stories__posts {
	display: flex;
	position: relative;
	gap: clamp(20px, 3vw, 48px);
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scroll-padding-inline: 0;
	scrollbar-width: none;
	cursor: grab;
	-webkit-overflow-scrolling: touch;
}

.home-latest-stories .home-latest-stories__posts::-webkit-scrollbar {
	display: none;
}

.home-latest-stories .home-latest-stories__posts.is-dragging {
	cursor: grabbing;
	scroll-snap-type: none;
	user-select: none;
}

.home-latest-stories .home-latest-stories__posts.is-dragging a {
	pointer-events: none;
}

.home-latest-stories .blog-post-card {
	flex: 0 0 66%;
	scroll-snap-align: start;
}

.home-latest-stories .blog-post-card__thumbnail::after {
	background: linear-gradient(to bottom, transparent, rgba(23, 25, 27, 0.64) 63%, #17191b);
}

.home-latest-stories .blog-post-card__body {
	margin-inline: clamp(20px, 3vw, 48px);
}

.home-latest-stories .blog-post-card__title {
	font-size: clamp(32px, 4vw, 64px) !important;
	line-height: 0.95;
}

.home-latest-stories .blog-post-card__thumbnail img {
	-webkit-user-drag: none;
}

@media (max-width: 820px) {
	.home-latest-stories .home-latest-stories__posts {
		display: flex;
		gap: 16px;
	}

	.home-latest-stories .blog-post-card {
		flex-basis: 86%;
	}
}

/* Latest Stories: scroll-driven carousel (assets/js/home-latest-stories.js).
 * Same pattern as .home-showcase: section = one screen + pin distance, the
 * inner viewport sticks while the track translates horizontally. */
.home-latest-stories {
	--home-stories-pin: 0px;
	overflow: clip;
}

.wp-block-ddm-container.home-latest-stories.is-pinned {
	height: calc(100svh + var(--home-stories-pin));
	min-height: 0;
}

.home-latest-stories.is-pinned .home-latest-stories__viewport {
	position: sticky;
	top: 0;
	height: 100svh;
	overflow: hidden;
}

.home-latest-stories.is-pinned .home-latest-stories__viewport > .ddm-container__inner {
	display: flex;
	flex-direction: column;
	justify-content: center;
	height: 100svh;
	min-height: 0;
	padding-block: clamp(56px, 8svh, 110px) clamp(24px, 5svh, 64px);
}

.home-latest-stories.is-pinned .home-showcase__title {
	font-size: clamp(56px, min(8vw, 12svh), 120px) !important;
	margin-bottom: clamp(16px, 4svh, 48px);
}

.home-latest-stories.is-pinned .home-latest-stories__posts {
	overflow: visible;
	scroll-snap-type: none;
	cursor: auto;
	will-change: transform;
}

/* Keep the card (1.7:1 image + title) within the pinned screen. */
.home-latest-stories.is-pinned .blog-post-card {
	flex-basis: min(66%, calc(52svh * 1.7));
}

@media (max-width: 820px) {
	.home-latest-stories.is-pinned .blog-post-card {
		flex-basis: min(86%, calc(50svh * 0.8));
	}
}

/* Mobile: taller crop for Latest Stories images (homepage only). */
@media (max-width: 820px) {
	.home-latest-stories .blog-post-card__thumbnail {
		aspect-ratio: 4 / 5;
	}
}
