/* Two-column page hero (§3, §5) */

.hero {
	background: var(--mist);
	overflow: hidden;
}

.hero__inner {
	display: grid;
	grid-template-columns: minmax(0, 1.3fr) minmax(320px, 520px);
	align-items: center;
	gap: 48px;
	padding-block: 72px;
}

/* Compact hero: text only, for section hubs that have no illustration. */
.hero--compact .hero__inner {
	grid-template-columns: minmax(0, 1fr);
	padding-block: 56px 64px;
}

.hero--compact .hero__title {
	margin-bottom: 0.3em;
}

.hero--compact .hero__description {
	margin-bottom: 0;
	max-width: 62ch;
}

/* On a hub page the card grid follows the compact hero directly, so the
   section's full top padding would leave an empty band. */
.hero--compact ~ .related-grid {
	padding-block-start: 56px;
}

/* Grid items default to min-width:auto, which refuses to shrink below the
   content's natural width — without this, long text/buttons force the
   track wider than its column and the page overflows horizontally. */
.hero__text,
.hero__figure {
	min-width: 0;
}

.hero__title {
	margin-top: 0.4em;
}

.hero__description {
	color: var(--slate);
	/* Hero taglines are full sentences, so they are set at 16–18px rather than
	   the larger --lead-size (18–22px) that .u-lead gives them. ch scales with
	   font size, so the measure is widened to keep the paragraph about the same
	   width and the line count low. */
	font-size: clamp(1rem, 0.94rem + 0.25vw, 1.125rem);
	line-height: 1.6;
	max-width: 56ch;
}

.pill {
	display: inline-flex;
	align-items: center;
	padding: 0.4em 1em;
	border-radius: 999px;
	font-size: 0.8125rem;
	font-weight: 600;
}

.pill--tint {
	background: var(--cyan-tint);
	color: var(--navy);
}

.hero__highlights {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	list-style: none;
	margin: 0 0 1.75em;
	padding: 0;
}

.hero__highlights li {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 0.5em 1em;
	border: 1px solid var(--line);
	border-radius: 999px;
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--ink);
	background: var(--paper);
}

.hero__highlight-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--cyan);
	flex-shrink: 0;
}

.hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
}

.hero__tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.hero__tab {
	padding: 0.6em 1.25em;
	border-radius: 999px;
	border: 1.5px solid var(--line);
	background: var(--paper);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: 0.9375rem;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 150ms ease-out, color 150ms ease-out, border-color 150ms ease-out;
}

.hero__tab:hover {
	border-color: var(--navy);
}

.hero__tab.is-active {
	background: var(--navy);
	border-color: var(--navy);
	color: var(--paper);
}

/* ---- Illustration ---------------------------------------------------- */

.hero__figure {
	display: flex;
	justify-content: center;
}

.hero-illustration {
	position: relative;
	width: 100%;
	max-width: 520px;
	aspect-ratio: 1 / 1;
}

.hero-illustration__rings,
.hero-illustration__base {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.hero-illustration__base {
	position: relative; /* establishes stacking above the SVG rings */
	object-fit: contain;
}

.hero-illustration__ring {
	transform-box: fill-box;
	transform-origin: 50% 50%;
	transform: rotate(var(--ring-base, 0deg));
}

.hero-illustration__chip-wrap,
.hero-illustration__node,
.hero-illustration__lock {
	position: absolute;
}

.hero-illustration__chip {
	display: block;
	width: 100%;
}

.hero-illustration__node {
	transform-origin: center;
}

.hero-illustration__lock {
	transform-origin: 50% 15%; /* pivot near the shackle, like it's swinging from a hinge */
}

/* Equalizer-style bars in the "Transactions" chip (§5.2: animate the bars,
   not the rings, per feedback) — anchored to the chip's own bottom edge, so
   they grow/shrink in place rather than from the chip's top. */
.hero-illustration__bar {
	position: absolute;
	bottom: 12.5%;
	border-radius: 2px 2px 0 0;
	transform-origin: 50% 100%;
}

.hero-illustration__bar--navy {
	background: var(--navy);
}

.hero-illustration__bar--cyan {
	background: var(--cyan);
}

.hero-illustration__dot {
	position: absolute;
	border-radius: 50%;
	background: var(--slate-light);
	opacity: 0.65;
	transform: translate(-50%, -50%);
}

/* Idle motion (§5.2) — continuous, independent of scroll, and only when
   the visitor hasn't asked for reduced motion. Pure CSS: no JS needed to
   drive it, only to gate the entrance state below.
   The ring arcs are deliberately NOT animated here (feedback: it read as
   too busy) — they render at their static angle via .hero-illustration__ring
   above and nothing in this block touches them. */
@media (prefers-reduced-motion: no-preference) {
	.hero-illustration__chip-wrap {
		animation: unlock-chip-float 3s ease-in-out infinite alternate;
	}

	.hero-illustration__bar {
		animation: unlock-bar-grow 2.4s ease-in-out infinite alternate;
	}

	.hero-illustration__dot {
		animation: unlock-dot-drift 4.5s ease-in-out infinite alternate, unlock-dot-pulse 3.2s ease-in-out infinite;
	}

	.hero-illustration__node {
		animation: unlock-node-pulse 2s ease-in-out infinite;
	}

	.hero-illustration__lock {
		animation: unlock-lock-swing 3.4s ease-in-out infinite;
	}
}

@keyframes unlock-chip-float {
	from { transform: translateY(-4px); }
	to   { transform: translateY(4px); }
}

@keyframes unlock-bar-grow {
	from { transform: scaleY(0.75); }
	to   { transform: scaleY(1); }
}

@keyframes unlock-dot-pulse {
	0%, 100% { opacity: 0.35; }
	50%      { opacity: 1; }
}

/* Small, per-dot-varied drift — actual distance/direction comes from each
   dot's own --drift-x/--drift-y custom property (set inline), so all dots
   share this one keyframe but don't move in lockstep. */
@keyframes unlock-dot-drift {
	from { transform: translate(-50%, -50%); }
	to   { transform: translate(calc(-50% + var(--drift-x, 6px)), calc(-50% + var(--drift-y, -6px))); }
}

@keyframes unlock-node-pulse {
	0%, 100% { transform: scale(1); }
	50%      { transform: scale(1.03); }
}

@keyframes unlock-lock-swing {
	0%, 100% { transform: rotate(-4deg); }
	50%      { transform: rotate(4deg); }
}

/* ---- Entrance (§5.1) --------------------------------------------------
   Hidden only once JS confirms it can animate them back in (`.js` set in
   <head>, `.no-motion` added synchronously alongside it when the visitor
   prefers reduced motion) — otherwise this content is just visible. */
.js:not(.no-motion):not(.is-loaded) .hero-entrance {
	opacity: 0;
	transform: translateY(16px);
}

.js:not(.no-motion):not(.is-loaded) .hero-illustration {
	opacity: 0;
	transform: scale(0.96);
}

.hero-entrance,
.hero-illustration {
	transition: opacity 500ms cubic-bezier(0.16, 1, 0.3, 1), transform 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-illustration {
	transition-duration: 600ms;
}

.is-loaded .hero-entrance,
.is-loaded .hero-illustration {
	opacity: 1;
	transform: none;
}

/* Stagger applied via inline transition-delay from animations.js */

/* ---- Responsive (§6) --------------------------------------------------- */
@media (max-width: 1024px) {
	.hero__inner {
		grid-template-columns: 1fr;
		padding-block: 48px;
	}

	.hero--compact .hero__inner {
		padding-block: 36px 44px;
	}

	.hero__figure {
		order: 2;
	}

	.hero-illustration {
		max-width: 360px;
		margin-inline: auto;
	}
}
