.datajoint-hero {
	position: relative;
	min-height: 100vh;
	background: var(--wp--preset--color--bg-dark, #0a1628);
	color: #fff;
	overflow: hidden;
}

/* Subtle full-background grid */
.datajoint-hero__grid {
	position: absolute;
	inset: 0;
	pointer-events: none;
	background-image:
		linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
		linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
	background-size: 80px 80px;
}

.datajoint-hero__inner {
	position: relative;
	max-width: 1500px;
	margin: 0 auto;
	min-height: 100vh;
	padding: 8rem var(--dj-gutter, 48px) 5rem;
	display: grid;
	grid-template-columns: 1fr;
	align-items: center;
	gap: 4rem;
}

@media (min-width: 1280px) {
	.datajoint-hero__inner {
		grid-template-columns: minmax(0, 1fr) 490px;
		gap: 3.5rem;
		padding-top: 10rem;
	}
}

/*
 * Stacked layout (below the 1280px two-column breakpoint): the diagram sits
 * BETWEEN the heading and the lede. `display: contents` lifts the content
 * children up to be siblings of the diagram so CSS `order` can interleave them.
 */
@media (max-width: 1279.98px) {
	.datajoint-hero__inner {
		display: flex;
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		/* Clear the fixed nav (+ banner when shown) so the eyebrow isn't tucked
		   right under the top of the page on tablet/mobile (client feedback). */
		padding-top: calc(var(--dj-nav-height, 73px) + 72px);
	}
	body.has-dj-banner .datajoint-hero__inner {
		padding-top: calc(var(--dj-nav-height, 73px) + var(--dj-banner-height, 44px) + 72px);
	}
	.datajoint-hero__content {
		display: contents;
	}
	.datajoint-hero__eyebrow { order: 1; }
	.datajoint-hero__heading { order: 2; }
	/* More breathing room between the headline and the animation below it. */
	.datajoint-hero__diagram { order: 3; margin: 4rem 0 3rem; }
	.datajoint-hero__lede { order: 4; }
	.datajoint-hero__actions { order: 5; }
}

.datajoint-hero__eyebrow {
	margin: 0 0 1.5rem;
	font-family: var(--wp--preset--font-family--sans, "Roboto", sans-serif);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--brand-blue, #00a0df);
}

.datajoint-hero__heading {
	margin: 0;
	max-width: 820px;
	font-family: var(--wp--preset--font-family--sans, "Roboto", sans-serif);
	font-weight: 700;
	font-size: clamp(38px, 5vw, 64px);
	line-height: 1.1;
	letter-spacing: -0.01em;
	color: #fff;
}

.datajoint-hero__accent {
	color: var(--wp--preset--color--brand-orange, #ff5113);
}

.datajoint-hero__lede {
	margin: 2rem 0 0;
	max-width: 704px;
	font-family: var(--wp--preset--font-family--serif, "Roboto Slab", serif);
	font-weight: 300;
	font-size: clamp(17px, 2vw, 20px);
	line-height: 1.6;
	color: rgba(255, 255, 255, 0.75);
}

.datajoint-hero__actions {
	margin-top: 2.5rem;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1.5rem;
}

.datajoint-hero__cta {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-family: var(--wp--preset--font-family--sans, "Roboto", sans-serif);
	font-size: 15px;
	font-weight: 700;
	color: #fff;
	transition: transform 150ms ease;
}

.datajoint-hero__cta--primary {
	background: var(--wp--preset--color--brand-blue, #00a0df);
	padding: 0.875rem 1.5rem;
	border-radius: 9999px;
}

.datajoint-hero__cta--primary:hover {
	transform: scale(1.02);
}

.datajoint-hero__cta--secondary .datajoint-hero__cta-arrow {
	transition: transform 150ms ease;
}

.datajoint-hero__cta--secondary:hover .datajoint-hero__cta-arrow {
	transform: translateX(4px);
}

.datajoint-hero__diagram {
	/* Query container: descendants read its width via cqw. (A container
	   cannot consume its own cq units, so the scaling lives on the inner
	   wrapper below.) */
	container-type: inline-size;
	width: 100%;
}

/* Scale wrapper. Resolves the shrink factor against the container width and
   reserves the post-scale height so the layout hugs the diagram (no gap). */
.datajoint-hero__diagram-scale {
	/* Unitless ratio: length / length. Never exceeds 1 (no upscaling). */
	--dj-diagram-scale: min(1, 100cqw / 490px);
	height: calc(var(--dj-total-h, 296px) * var(--dj-diagram-scale));
}

/* PlatformHeroDiagram layout. The grid is intrinsically 490px wide; the wrapper
   above scales it down proportionally on narrow containers (no distortion).
   translateX(-50%) keeps it centred even when wider than the container. */
.datajoint-hero__diagram-grid {
	display: grid;
	grid-template-columns:
		var(--dj-bucket-w, 110px)
		var(--dj-connector-w, 60px)
		var(--dj-center-w, 150px)
		var(--dj-connector-w, 60px)
		var(--dj-bucket-w, 110px);
	align-items: stretch;
	width: 490px;
	height: var(--dj-total-h, 296px);
	position: relative;
	left: 50%;
	transform-origin: top center;
	transform: translateX(-50%) scale(var(--dj-diagram-scale, 1));
}

.datajoint-hero__flank {
	display: flex;
	align-items: center;
	justify-content: center;
}

.datajoint-hero__flank--mirror {
	transform: scaleX(-1);
}

.datajoint-hero__center {
	display: flex;
	flex-direction: column;
	align-items: center;
}

.datajoint-hero__bucket {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 16px;
	border-radius: 12px;
}

.datajoint-hero__bucket.is-highlight {
	border-radius: 14px;
}

.datajoint-hero__halo {
	position: absolute;
	pointer-events: none;
	border-radius: 22px;
	transform-origin: center;
	animation: dj-hero-halo 4s ease-in-out infinite;
}

.datajoint-hero__halo--outer {
	inset: -16px;
	background: rgba(0, 160, 223, 0.1);
}

.datajoint-hero__halo--inner {
	inset: -4px;
	border-radius: 14px;
	background: rgba(0, 160, 223, 0.3);
}

@keyframes dj-hero-halo {
	0%, 100% { transform: scale(1); opacity: 1; }
	50% { transform: scale(1.04); opacity: 0.85; }
}

.datajoint-hero__bucket-icon {
	position: relative;
	display: flex;
	flex: 1;
	align-items: center;
	justify-content: center;
}

.datajoint-hero__bucket-label {
	position: relative;
	margin-top: 8px;
	font-family: var(--wp--preset--font-family--sans, "Roboto", sans-serif);
	font-weight: 700;
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-align: center;
	line-height: 1.25;
}

.datajoint-hero__connector {
	display: block;
	width: var(--dj-connector-w, 60px);
	height: 100%;
	overflow: visible;
}

.datajoint-hero__vconnector {
	display: block;
	overflow: visible;
}

/* Scroll-down affordance */
.datajoint-hero__scroll {
	position: absolute;
	bottom: 2rem;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	border: 1px solid rgba(255, 255, 255, 0.3);
	border-radius: 9999px;
	color: rgba(255, 255, 255, 0.7);
	transition: color 200ms ease, border-color 200ms ease;
}

.datajoint-hero__scroll:hover {
	color: #fff;
	border-color: rgba(255, 255, 255, 0.7);
}

/* The scroll-down affordance is irrelevant on the stacked mobile hero. */
@media (max-width: 1279.98px) {
	.datajoint-hero__scroll { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.datajoint-hero__flow {
		display: none;
	}
	.datajoint-hero__halo {
		animation: none;
	}
}
