/* ─────────────────────────────────────────────────────────────────────────────
 * marketing-hero-animated.css
 *
 * Hero variant .mk-hero--wave — full-bleed background with an animated navy
 * wave (Canvas 2D). DS2-strict: only #141c52 / #3f4775 / #eae9ef gradients.
 * Text content overlays the canvas via an absolute-positioned wrapper.
 *
 * Progressive enhancement:
 *   - <picture> fallback PNG is visible by default.
 *   - Canvas element is hidden (opacity 0) until the JS module sets
 *     data-initialized="true" on the wrapper (avoids flash of empty canvas).
 *   - prefers-reduced-motion or absent JS → canvas stays hidden, PNG remains.
 *
 * No glassmorphism, no dark theme default, no palette outside DS2.
 * ──────────────────────────────────────────────────────────────────────────── */

.mk-hero--wave {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	padding-block: clamp(4rem, 8vw, 8rem);
	background: linear-gradient(180deg, #f8fafc 0%, #eae9ef 60%, #f8fafc 100%);
}

.mk-hero--wave__backdrop {
	position: absolute;
	inset: 0;
	z-index: 0;
	pointer-events: none;
}

.mk-hero--wave__canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	transition: opacity 400ms ease;
}

.mk-hero--wave__backdrop[data-initialized="true"] .mk-hero--wave__canvas {
	opacity: 1;
}

.mk-hero--wave__fallback {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	opacity: 1;
	transition: opacity 400ms ease;
	/* Default gradient when no PNG <picture> is supplied yet. Replace by a
   * <picture srcset> child as soon as generated hero-wave-*.png assets land. */
	background: linear-gradient(180deg, #f8fafc 0%, #eae9ef 60%, #f8fafc 100%);
}

/* When canvas initialises successfully, fade out the PNG. */
.mk-hero--wave__backdrop[data-initialized="true"] .mk-hero--wave__fallback {
	opacity: 0;
}

/* Subtle horizontal gridlines echoing Stripe's hero section. */
.mk-hero--wave__line {
	position: absolute;
	left: 0;
	right: 0;
	height: 1px;
	background: linear-gradient(
		90deg,
		transparent 0%,
		rgba(20, 28, 82, 0.12) 50%,
		transparent 100%
	);
	pointer-events: none;
	z-index: 1;
}

.mk-hero--wave__line--top {
	top: 0;
}

.mk-hero--wave__line--bottom {
	bottom: 0;
}

/* Content sits above the backdrop. */
.mk-hero--wave__content {
	position: relative;
	z-index: 2;
	max-width: 72rem;
	margin-inline: auto;
	padding-inline: 1.5rem;
	display: grid;
	gap: 1.5rem;
	text-align: center;
}

.mk-hero--wave__eyebrow {
	font-size: 0.875rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #3f4775;
	margin: 0;
}

.mk-hero--wave__title {
	/* Consumes DS2+ display-xl tokens (56-96px fluid clamp). Fallback to
     the original 32-56px range if extensions/1-tokens.css isn't loaded
     (e.g. another portail reusing this composition in the future). */
	font-size: var(--display-xl, clamp(2rem, 5vw, 3.5rem));
	line-height: var(--lh-display, 1.1);
	font-weight: var(--fw-bold, 700);
	color: var(--color-brand, #141c52);
	margin: 0;
	letter-spacing: var(--tracking-tighter, -0.02em);
}

.mk-hero--wave__subtitle {
	font-size: clamp(1rem, 2vw, 1.25rem);
	line-height: 1.6;
	color: #1e293b;
	margin: 0;
	max-width: 44rem;
	margin-inline: auto;
}

.mk-hero--wave__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	justify-content: center;
	margin-top: 0.5rem;
}

.mk-hero--wave__trust {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	justify-content: center;
	margin-top: 1rem;
	font-size: 0.8125rem;
	color: #5b6b7e;
}

.mk-hero--wave__trust-pill {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	padding: 0.25rem 0.75rem;
	border: 1px solid rgba(20, 28, 82, 0.12);
	border-radius: 9999px;
	background: rgba(255, 255, 255, 0.8);
	backdrop-filter: none; /* no glassmorphism — DS2 strict */
}

/* Reduced motion: canvas never initialises, keep PNG fully visible. */
@media (prefers-reduced-motion: reduce) {
	.mk-hero--wave__canvas {
		display: none !important;
	}
	.mk-hero--wave__backdrop[data-initialized="true"] .mk-hero--wave__fallback {
		opacity: 1;
	}
}

/* Mobile: hide canvas entirely (perf on low-end devices), rely on PNG. */
@media (max-width: 640px) {
	.mk-hero--wave__canvas {
		display: none;
	}
	.mk-hero--wave__backdrop[data-initialized="true"] .mk-hero--wave__fallback {
		opacity: 1;
	}
}
