/*
 * Hero V2: Pixellot × Basketball Australia (HoopsTV).
 * Everything is scoped to #hero-v2. Desktop reproduces the 1440 × 806.4 Figma frame
 * ("BA-Launch", node 131:2462) scaled as one artboard; below 992px the hero stacks.
 */

#hero-v2 {
	--pxh2-navy: #0a1631;
	--pxh2-ink: #02131d;
	--pxh2-cyan: #00d6fe;
	--pxh2-white: #fff;
	--pxh2-font: "Red Hat Display", "Ubuntu", system-ui, sans-serif;
	--pxh2-header: 100px; /* clearance for the fixed site header */
	/* One Figma pixel: the artboard fits the viewport's width and height, capped at 135%. */
	--u: min(calc(100vw / 1440), calc(100vh / 806.4), 1.35px);

	position: relative;
	z-index: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	overflow: hidden;
	container-type: inline-size;
	background: var(--pxh2-navy);
	color: var(--pxh2-white);
	font-family: var(--pxh2-font);
	text-align: left;
	-webkit-font-smoothing: antialiased;
}

@supports (width: 1cqw) and (height: 1svh) {
	#hero-v2 {
		--u: min(calc(100cqw / 1440), calc(100svh / 806.4), 1.35px);
	}
}

#hero-v2 *,
#hero-v2 *::before,
#hero-v2 *::after {
	box-sizing: border-box;
}

#hero-v2 .pxh2-hook {
	display: none !important;
}

/* Background photo and the navy fade behind the copy */
#hero-v2 .pxh2-bg {
	position: absolute;
	z-index: 0;
	/* 82.8px above the artboard, 972px tall; centred with it, and never shorter than the section */
	top: min(0px, calc(50% - 486 * var(--u)));
	left: calc(50% - 732 * var(--u));
	width: max(calc(1708.8 * var(--u)), calc(50% + 732 * var(--u)));
	height: max(calc(972 * var(--u)), 100%);
	margin: 0;
}

#hero-v2 .pxh2-bg img {
	display: block;
	width: 100%;
	max-width: none;
	height: 100%;
	object-fit: cover;
	object-position: left bottom;
}

#hero-v2 .pxh2-shade {
	position: absolute;
	z-index: 1;
	inset: 0;
	background:
		/* light fade behind the fixed site menu */
		linear-gradient(180deg, rgba(2, 18, 29, 0.5) 0, rgba(2, 18, 29, 0) 130px),
		linear-gradient(90deg, var(--pxh2-navy) calc(50% - 713.63 * var(--u)), rgba(10, 22, 49, 0) calc(50% + 292.8 * var(--u)));
	pointer-events: none;
}

/* Artboard */
#hero-v2 .pxh2-art {
	position: relative;
	z-index: 2;
	flex: none;
	width: calc(1440 * var(--u));
	height: calc(806.4 * var(--u));
	margin: 0 auto;
}

#hero-v2 .pxh2-copy {
	position: absolute;
	top: max(calc(115.2 * var(--u)), var(--pxh2-header));
	left: calc(96 * var(--u));
	width: calc(640 * var(--u));
}

#hero-v2 .pxh2-eyebrow {
	margin: 0 0 calc(30 * var(--u));
	padding: 0;
	color: var(--pxh2-cyan);
	font-family: "Montserrat", var(--pxh2-font);
	font-size: calc(24 * var(--u));
	font-weight: 700;
	line-height: 1.55;
	letter-spacing: 0.08em;
	text-transform: none;
	white-space: nowrap;
}

#hero-v2 .pxh2-lockup {
	display: flex;
	align-items: center;
	gap: calc(16.77 * var(--u));
	height: calc(76 * var(--u));
	margin: 0;
	padding: 0;
}

#hero-v2 .pxh2-lockup img {
	display: block;
	max-width: none;
	height: auto;
}

#hero-v2 .pxh2-logo-px {
	width: calc(203.98 * var(--u));
}

#hero-v2 .pxh2-logo-ba {
	width: calc(208.7 * var(--u));
}

#hero-v2 .pxh2-x {
	color: var(--pxh2-cyan);
	font-family: var(--pxh2-font);
	font-size: calc(43.51 * var(--u));
	font-weight: 400;
	line-height: 1;
}

#hero-v2 .pxh2-title {
	max-width: calc(539 * var(--u));
	margin: 0 0 calc(64 * var(--u));
	padding: 0;
	color: var(--pxh2-white);
	font-family: var(--pxh2-font);
	font-size: calc(50 * var(--u));
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: 0;
	text-align: left;
	text-transform: none;
}

#hero-v2 .pxh2-summary p {
	max-width: calc(640 * var(--u));
	margin: 0 0 calc(30 * var(--u));
	padding: 0;
	color: var(--pxh2-white);
	font-family: var(--pxh2-font);
	font-size: calc(28 * var(--u));
	font-weight: 400;
	line-height: 1.15;
}

#hero-v2 .pxh2-actions {
	display: flex;
	margin: 0;
}

#hero-v2 .pxh2-cta {
	display: inline-flex;
	align-items: center;
	padding: calc(14.4 * var(--u)) calc(33.6 * var(--u));
	border: 0;
	border-radius: calc(48 * var(--u));
	background: var(--pxh2-cyan);
	color: var(--pxh2-ink);
	font-family: var(--pxh2-font);
	font-size: calc(24 * var(--u));
	font-weight: 500;
	line-height: 1.55;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

#hero-v2 .pxh2-cta:hover,
#hero-v2 .pxh2-cta:focus-visible {
	background: var(--pxh2-white);
	color: var(--pxh2-ink);
	text-decoration: none;
	box-shadow: 0 0 0 4px rgba(0, 214, 254, 0.35);
}

#hero-v2 .pxh2-cta:focus-visible {
	outline: 2px solid var(--pxh2-white);
	outline-offset: 3px;
}

/* Phone visual and stat cards. Card sizes are relative to the stage (cqw = 1% of its width). */
#hero-v2 .pxh2-stage {
	--k: 1;
	position: absolute;
	top: calc(18 * var(--u));
	left: calc(776 * var(--u));
	width: calc(432 * var(--u));
	aspect-ratio: 432 / 748;
	container-type: inline-size;
}

#hero-v2 .pxh2-visual {
	display: block;
	width: 100%;
	max-width: none;
	height: auto;
}

#hero-v2 .pxh2-stat {
	position: absolute;
	display: flex;
	flex-direction: column;
	align-items: center;
	margin: 0;
	padding: calc(3.827cqw * var(--k));
	border-radius: calc(3.827cqw * var(--k));
	background: var(--pxh2-white);
	color: var(--pxh2-ink);
	filter: drop-shadow(calc(1.914cqw * var(--k)) calc(1.914cqw * var(--k)) calc(1.435cqw * var(--k)) rgba(0, 0, 0, 0.25));
	font-family: var(--pxh2-font);
	text-align: center;
	white-space: nowrap;
}

#hero-v2 .pxh2-stat strong {
	color: var(--pxh2-cyan);
	font-size: calc(11.543cqw * var(--k));
	font-weight: 900;
	line-height: calc(10.525cqw * var(--k));
	letter-spacing: -0.03em;
}

#hero-v2 .pxh2-stat span {
	font-size: calc(6.944cqw * var(--k));
	font-weight: 400;
	line-height: calc(10.525cqw * var(--k));
	letter-spacing: -0.03em;
}

#hero-v2 .pxh2-stat--1 {
	top: 28.904%;
	left: 90.972%;
}

#hero-v2 .pxh2-stat--2 {
	top: 73.422%;
	left: 1.852%;
	padding: calc(3.827cqw * var(--k)) calc(5.787cqw * var(--k));
}

#hero-v2 .pxh2-stat--2 span {
	font-size: calc(9.259cqw * var(--k));
}

/* The theme fades the copy in with GSAP; the visual follows with CSS. */
@media (prefers-reduced-motion: no-preference) {
	#hero-v2 .pxh2-visual {
		animation: pxh2-rise 1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.6s both;
	}

	#hero-v2 .pxh2-stat {
		animation: pxh2-pop 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
	}

	#hero-v2 .pxh2-stat--1 {
		animation-delay: 1.2s;
	}

	#hero-v2 .pxh2-stat--2 {
		animation-delay: 1.4s;
	}
}

@keyframes pxh2-rise {
	from {
		opacity: 0;
		transform: translateY(40px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

@keyframes pxh2-pop {
	from {
		opacity: 0;
		transform: translateY(16px) scale(0.94);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

/* Slider: Hero V2 and the original hero share one grid cell and crossfade; the cell takes the
   height of the taller hero, so the page does not jump between slides. */
.pxh2-slider {
	position: relative;
	overflow: hidden;
}

.pxh2-slides {
	display: grid;
}

.pxh2-slide {
	display: flex;
	flex-direction: column;
	grid-area: 1 / 1;
	min-width: 0;
	opacity: 0;
	z-index: 0;
	pointer-events: none;
	transition: opacity 0.9s ease;
}

.pxh2-slide.is-active {
	opacity: 1;
	z-index: 1;
	pointer-events: auto;
}

.pxh2-slide > section {
	flex: 1 0 auto;
}

.pxh2-controls {
	position: absolute;
	z-index: 3;
	bottom: 20px;
	left: 50%;
	display: flex;
	align-items: center;
	gap: 2px;
	padding: 2px 4px 2px 8px;
	border-radius: 999px;
	background: rgba(2, 19, 29, 0.55);
	transform: translateX(-50%);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
}

.pxh2-controls button {
	appearance: none;
	-webkit-appearance: none;
	position: relative;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: none;
	color: #fff;
	cursor: pointer;
	line-height: 0;
}

.pxh2-controls button:focus-visible {
	outline: 2px solid #00d6fe;
	outline-offset: 1px;
}

.pxh2-dot {
	width: 44px;
	height: 32px;
}

.pxh2-dot::before,
.pxh2-dot-fill {
	content: "";
	position: absolute;
	top: 50%;
	right: 6px;
	left: 6px;
	height: 4px;
	margin-top: -2px;
	border-radius: 2px;
}

.pxh2-dot::before {
	background: rgba(255, 255, 255, 0.35);
	transition: background-color 0.2s ease;
}

.pxh2-dot:hover::before {
	background: rgba(255, 255, 255, 0.6);
}

.pxh2-dot-fill {
	background: #00d6fe;
	transform: scaleX(0);
	transform-origin: left center;
}

.pxh2-dot[aria-current="true"] .pxh2-dot-fill {
	transform: scaleX(1);
	animation: pxh2-progress var(--pxh2-interval, 8s) linear both;
}

.pxh2-slider.is-paused .pxh2-dot-fill {
	animation-play-state: paused;
}

.pxh2-slider.is-user-paused .pxh2-dot[aria-current="true"] .pxh2-dot-fill {
	animation: none;
}

.pxh2-toggle {
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
}

.pxh2-toggle svg {
	width: 12px;
	height: 12px;
	fill: currentColor;
}

.pxh2-toggle .pxh2-icon-play,
.pxh2-slider.is-user-paused .pxh2-toggle .pxh2-icon-pause {
	display: none;
}

.pxh2-slider.is-user-paused .pxh2-toggle .pxh2-icon-play {
	display: block;
}

/* Entrance each time a slide comes back round (the first load uses the theme's own fade-in). */
@media (prefers-reduced-motion: no-preference) {
	.pxh2-slide.is-entering #hero-v2 .pxh2-head,
	.pxh2-slide.is-entering #hero-v2 .pxh2-summary,
	.pxh2-slide.is-entering #hero-v2 .pxh2-actions,
	.pxh2-slide.is-entering #hero .hero-title,
	.pxh2-slide.is-entering #hero .hero-summary,
	.pxh2-slide.is-entering #hero .hero-bottom {
		animation: pxh2-enter 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.1s both;
	}

	.pxh2-slide.is-entering #hero-v2 .pxh2-summary,
	.pxh2-slide.is-entering #hero .hero-summary {
		animation-delay: 0.25s;
	}

	.pxh2-slide.is-entering #hero-v2 .pxh2-actions,
	.pxh2-slide.is-entering #hero .hero-bottom {
		animation-delay: 0.4s;
	}

	.pxh2-slide.is-entering #hero-v2 .pxh2-visual {
		animation: pxh2-enter 1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.2s both;
	}

	.pxh2-slide.is-entering #hero-v2 .pxh2-stat {
		animation: pxh2-enter-pop 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) 0.7s both;
	}

	.pxh2-slide.is-entering #hero-v2 .pxh2-stat--2 {
		animation-delay: 0.85s;
	}
}

@keyframes pxh2-progress {
	from {
		transform: scaleX(0);
	}
	to {
		transform: scaleX(1);
	}
}

@keyframes pxh2-enter {
	from {
		opacity: 0;
		transform: translateY(30px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

@keyframes pxh2-enter-pop {
	from {
		opacity: 0;
		transform: translateY(16px) scale(0.94);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

/* Tablet and mobile: copy first, then the phone visual */
@media (max-width: 991.98px) {
	#hero-v2 {
		--pxh2-header: 88px;
		display: block;
		padding: var(--pxh2-header) 0 56px;
	}

	#hero-v2 .pxh2-bg {
		inset: 0;
		width: 100%;
		height: 100%;
	}

	#hero-v2 .pxh2-bg img {
		object-position: 50% 100%;
	}

	#hero-v2 .pxh2-shade {
		background: linear-gradient(180deg, var(--pxh2-navy) 0%, rgba(10, 22, 49, 0.93) 42%, rgba(10, 22, 49, 0.45) 72%, rgba(10, 22, 49, 0.75) 100%);
	}

	#hero-v2 .pxh2-art {
		width: auto;
		max-width: 640px;
		height: auto;
		padding: 0 24px;
	}

	#hero-v2 .pxh2-copy {
		position: static;
		width: auto;
		padding-top: 12px;
	}

	#hero-v2 .pxh2-eyebrow {
		margin-bottom: 18px;
		font-size: clamp(12px, 3.3vw, 17px);
		white-space: normal;
	}

	#hero-v2 .pxh2-lockup {
		gap: clamp(10px, 2.8vw, 14px);
		height: auto;
		margin-bottom: 18px;
	}

	#hero-v2 .pxh2-logo-px {
		width: clamp(120px, 33vw, 176px);
	}

	#hero-v2 .pxh2-logo-ba {
		width: clamp(123px, 33.8vw, 180px);
	}

	#hero-v2 .pxh2-x {
		font-size: clamp(24px, 7vw, 36px);
	}

	#hero-v2 .pxh2-title {
		max-width: 13em;
		margin-bottom: 16px;
		font-size: clamp(30px, 8.2vw, 48px);
		line-height: 1.12;
	}

	#hero-v2 .pxh2-summary p {
		max-width: 30em;
		margin-bottom: 26px;
		font-size: clamp(17px, 4.7vw, 22px);
		line-height: 1.35;
	}

	#hero-v2 .pxh2-cta {
		padding: 12px 28px;
		border-radius: 48px;
		font-size: clamp(17px, 2.6vw, 20px);
	}

	/* Cards are scaled to 85% so the phone and both cards fit side by side; the group
	   (stage + right card overhang = 1.388 × stage width) is centred. */
	#hero-v2 .pxh2-stage {
		--k: 0.85;
		position: relative;
		top: auto;
		left: auto;
		width: min(calc(100% / 1.388), 380px);
		margin: 44px 0 0 calc((100% - 1.388 * min(calc(100% / 1.388), 380px)) / 2);
	}

	.pxh2-controls {
		bottom: 12px;
	}
}
