/**
 * Wow layer — homepage cinematic treatments (2026-11-12, owner-approved).
 *
 * Ports the canada-cup block theme's homepage techniques (same brand palette)
 * onto the Softball City design system: immersive full-bleed hero, rotating
 * softball watermark, masked-word title entrance, staggered copy rise,
 * count-up-ready stats, card hover choreography, pointer-tilt frame, and
 * CTA foul-line geometry. Re-includes the three items ADR 0002's design pass
 * had excluded (rotating watermark, sponsor marquee, Ken-Burns slideshow) —
 * the marquee and Ken-Burns engines already ship in marquee.css/kenburns.css;
 * this layer applies and composes them.
 *
 * Rules of the layer:
 *   - No raw colours or font stacks (tokens.css owns those).
 *   - Every animation degrades to its end state under
 *     prefers-reduced-motion (base.css already kills transitions); without
 *     JavaScript the markup carries the final values, so nothing depends on
 *     motion.js to be correct.
 *   - Loads LAST in the chain (functions.php) so it may override the shared
 *     component layers.
 */

/* --- immersive hero (patterns/hero-homepage.php) ------------------------- */

.sbc-hero--immersive {
	display: flex;
	flex-direction: column;
	min-height: min(86vh, 42rem);
	padding-block: clamp(4.5rem, 9vw, 7rem) clamp(3.5rem, 7vw, 5.5rem);
	border-radius: 0;
}

/* --- homepage vertical rhythm ----------------------------------------------
   Sections carry --sbc-section-y padding (122px at 1440) on BOTH edges; the
   default 24px block margin between them is a second, conflicting source of
   rhythm, so the wow layer owns the pacing for the homepage stack. */
.sbc-content--full > .sbc-section,
.sbc-content--full > .sbc-hero {
	margin-block: 0;
}

/* The stat strip is the hero's companion band: half the interior top
   padding, full bottom. */
.sbc-section--companion {
	padding-block-start: clamp(1.75rem, 3.5vw, 3rem);
}

@media (max-width: 39.9375em) {
	.sbc-hero--immersive {
		min-height: min(80vh, 34rem);
	}
}

/* The Ken-Burns helper's container re-tasked as a full-bleed layer: its
   standalone radius/min-height (kenburns.css) do not apply inside the hero. */
.sbc-hero__slides {
	position: absolute;
	inset: 0;
	z-index: 0;
	min-height: 0;
	border-radius: 0;
	background: var(--sbc-ink);
}

/* Scrim above the slides (the .sbc-hero--cinematic ::before recipe), copy
   above the scrim. */
.sbc-hero--immersive.sbc-hero--cinematic::before {
	z-index: 1;
}

.sbc-hero--immersive .sbc-hero__body {
	position: relative;
	z-index: 2;
	flex: 1;
	display: flex;
	flex-direction: column;
	width: min(100% - 2 * var(--sbc-space-4), var(--sbc-container));
	margin-inline: auto;
}

/* The facts bar (SEASON / TEAMS / FIELDS) anchors to the hero's bottom edge
   instead of floating under the CTAs — the copy block reads top-weighted and
   the hero stops having a dead bottom half. auto margin in the stretched
   flex column, so it also re-pins on resize (no absolute positioning to
   escape the body's own relative context). */
.sbc-hero--immersive .sbc-hero__meta {
	margin-top: auto;
	margin-bottom: 0; /* the dl's default bottom margin would lift the bar */
	padding-top: var(--sbc-space-4);
	border-top: 1px solid rgba(255, 255, 255, 0.28);
}

/* Facts values never break mid-word ("4 di/amonds" at 320px); the row itself
   wraps between items instead. */
.sbc-hero--immersive .sbc-hero__meta-item {
	flex: 0 0 auto;
}

.sbc-hero--immersive .sbc-hero__meta-item dd {
	white-space: nowrap;
}

/* Extra bottom-up vignette: the copy sits over a moving image, so the lower
   band (meta row on desktop) gets its own convergence. */
.sbc-hero__scrim {
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0) 52%, rgba(0, 0, 0, 0.5) 100%);
}

/* Foul-line geometry, masked toward the right side of the frame. */
.sbc-hero__geometry {
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	opacity: 0.22;
	background-image:
		linear-gradient(var(--sbc-geometry-line) 1px, transparent 1px),
		linear-gradient(90deg, var(--sbc-geometry-line) 1px, transparent 1px);
	background-size: 72px 72px;
	-webkit-mask-image: radial-gradient(circle at 78% 42%, #000 0%, transparent 68%);
	mask-image: radial-gradient(circle at 78% 42%, #000 0%, transparent 68%);
}

/* Eyebrow with the live pulse dot. */
.sbc-eyebrow--pulse {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
}

.sbc-eyebrow--pulse::before {
	content: '';
	width: 0.5rem;
	height: 0.5rem;
	border-radius: var(--sbc-radius-pill);
	background: var(--sbc-red-bright);
	animation: sbc-dot-pulse 1.8s ease-out infinite;
}

@keyframes sbc-dot-pulse {
	0%,
	100% {
		box-shadow: 0 0 0 3px var(--sbc-red-glow);
	}
	50% {
		box-shadow: 0 0 0 7px var(--sbc-red-mid);
	}
}

/* Masked display title: each word rises out of its own overflow window. */
.sbc-hero__title--mask {
	/* A defined tight line-height keeps the two word-windows aligned; the
	   default heading leading leaves an uneven gap at display scale. */
	line-height: 1.04;
}

.sbc-hero__word {
	display: inline-block;
	overflow: hidden;
	padding-bottom: 0.12em; /* descender room (the "g" in "lights") */
	margin-bottom: -0.12em;
	vertical-align: bottom;
}

.sbc-hero__word > span {
	display: inline-block;
	animation: sbc-word-rise var(--sbc-rise-dur) var(--sbc-ease) both;
}

.sbc-hero__word:nth-child(2) > span {
	animation-delay: calc(var(--sbc-rise-stagger) * 2);
}

.sbc-hero__word:nth-child(3) > span {
	animation-delay: calc(var(--sbc-rise-stagger) * 3);
}

@keyframes sbc-word-rise {
	from {
		transform: translateY(112%);
	}
	to {
		transform: translateY(0);
	}
}

/* Staggered rise for the hero copy (pure CSS, no JS). Owned by its own
   modifier so interior heroes (red split, mist panel) take the entrance
   without the immersive hero's full-bleed layout. */
.sbc-hero--stagger .sbc-hero__body > * {
	animation: sbc-rise-in var(--sbc-rise-dur) var(--sbc-ease) both;
}

.sbc-hero--stagger .sbc-hero__body > *:nth-child(1) { animation-delay: 0.05s; }
.sbc-hero--stagger .sbc-hero__body > *:nth-child(2) { animation-delay: 0.12s; }
.sbc-hero--stagger .sbc-hero__body > *:nth-child(3) { animation-delay: 0.19s; }
.sbc-hero--stagger .sbc-hero__body > *:nth-child(4) { animation-delay: 0.26s; }
.sbc-hero--stagger .sbc-hero__body > *:nth-child(5) { animation-delay: 0.33s; }

@keyframes sbc-rise-in {
	from {
		opacity: 0;
		transform: translateY(16px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

/* Reduced motion: every animation this file adds stops at its end state. */
@media (prefers-reduced-motion: reduce) {
	.sbc-eyebrow--pulse::before {
		animation: none;
	}

	.sbc-hero__word > span,
	.sbc-hero--stagger .sbc-hero__body > * {
		animation: none;
	}

	.sbc-hero__word > span {
		transform: none;
	}
}

/* --- count-up-ready stat numerals -----------------------------------------
   Tabular figures keep the count-up from reflowing the strip mid-animation
   (motion.js reads data-sbc-count; the shipped text is the final value). */

.sbc-stat__value {
	font-variant-numeric: tabular-nums;
}

/* --- reveal stagger (nav.js applies .is-visible) --------------------------- */

.sbc-grid--stagger > .sbc-reveal:nth-child(2) {
	transition-delay: 0.08s;
}

.sbc-grid--stagger > .sbc-reveal:nth-child(3) {
	transition-delay: 0.16s;
}

.sbc-grid--stagger > .sbc-reveal:nth-child(4) {
	transition-delay: 0.24s;
}

.sbc-grid--stagger > .sbc-reveal:nth-child(5) {
	transition-delay: 0.32s;
}

.sbc-grid--stagger > .sbc-reveal:nth-child(6) {
	transition-delay: 0.4s;
}

/* The feature-box tile grid staggers on the same step. */
.sbc-boxes--stagger > .sbc-reveal:nth-child(2) {
	transition-delay: 0.08s;
}

.sbc-boxes--stagger > .sbc-reveal:nth-child(3) {
	transition-delay: 0.16s;
}

.sbc-boxes--stagger > .sbc-reveal:nth-child(4) {
	transition-delay: 0.24s;
}

/* --- division-card choreography -------------------------------------------- */

.sbc-card__media img {
	transition: transform var(--sbc-dur-slow) var(--sbc-ease);
}

.sbc-card--link:hover .sbc-card__media img,
.sbc-card--link:focus-within .sbc-card__media img {
	transform: scale(1.06);
}

/* Light sweep across the photo on hover — the stadium-floodlight read. */
.sbc-card__media::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.22) 50%, transparent 60%);
	transform: translateX(-100%);
	transition: transform var(--sbc-dur-slow) var(--sbc-ease);
}

.sbc-card--link:hover .sbc-card__media::after,
.sbc-card--link:focus-within .sbc-card__media::after {
	transform: translateX(100%);
}

/* --- interior-hero contrast (design gate, extension round 1) ---------------
   The gray-dark eyebrow (AA on white) is 1.07:1 on the crimson hero-red, and
   the dock links' white-on-mist is 1.08:1. Both are invisible, not faint. */
.sbc-hero--red .sbc-eyebrow {
	color: var(--sbc-paper); /* 6.84:1 on #AE2326 */
}

.sbc-hero--mist .sbc-hero__panel a {
	color: var(--sbc-ink);
	border-color: var(--sbc-line);
	background: var(--sbc-paper); /* 15.91:1 */
}

.sbc-hero--mist .sbc-hero__panel a:hover,
.sbc-hero--mist .sbc-hero__panel a:focus {
	color: var(--sbc-paper);
}

/* The hero date line (mist panel + tournament-event bands): light on the
	dark bands, gray-dark on mist. */
.sbc-hero--mist .sbc-hero__date {
	color: var(--sbc-gray-dark);
}

.sbc-hero--cinematic .sbc-hero__date {
	color: rgba(255, 255, 255, 0.85);
}

/* --- reveal + hover interplay ----------------------------------------------
   `.sbc-reveal.is-visible { transform: none }` (sections.css, loaded after
   components.css) ties specificity with `.sbc-card--link:hover` (0,2,0) and
   wins, so a revealed card lost its hover lift. Restore it here — the wow
   layer loads last and carries one more class. */
.sbc-reveal.sbc-card--link:hover,
.sbc-reveal.sbc-card--link:focus-within {
	transform: translateY(-4px);
}

/* --- hero eyebrow on the dark scrim ----------------------------------------
   Brand slate is 3.95:1 on ink too, so the immersive hero paints its eyebrow
   light (the same white-on-ink idiom the header uses). */
.sbc-hero--immersive .sbc-eyebrow {
	color: rgba(255, 255, 255, 0.85);
}

/* --- pointer-tilt about frame (motion.js sets the variables) --------------- */

.sbc-about__frame {
	/* Declared here (not only set by motion.js) so the theme owns the token's
	   rest state; the pointer-tilt ceiling stays in tokens.css. */
	--sbc-tilt-x: 0deg;
	--sbc-tilt-y: 0deg;
	transform: perspective(1000px) rotateX(var(--sbc-tilt-x, 0deg)) rotateY(var(--sbc-tilt-y, 0deg));
	will-change: transform;
}

/* --- CTA foul-line geometry ------------------------------------------------
   Reserved for the CTA hero variant (the homepage's closing band carries the
   modifier in its template; no pattern ships it today). */

.sbc-hero--geometry::after {
	content: '';
	position: absolute;
	inset: 0;
	pointer-events: none;
	opacity: 0.16;
	background-image:
		linear-gradient(var(--sbc-geometry-line-strong) 1px, transparent 1px),
		linear-gradient(90deg, var(--sbc-geometry-line-strong) 1px, transparent 1px);
	background-size: 56px 56px;
	-webkit-mask-image: radial-gradient(circle at 80% 20%, #000 0%, transparent 70%);
	mask-image: radial-gradient(circle at 80% 20%, #000 0%, transparent 70%);
}

/* Reduced motion: the choreography above lands on its rest state. */
@media (prefers-reduced-motion: reduce) {
	.sbc-about__frame {
		transform: none;
	}

	.sbc-card__media::after {
		display: none;
	}

	.sbc-grid--stagger > .sbc-reveal {
		transition-delay: 0s;
	}
}
