/* Hero layouts (wave 2): split, rsplit, dark, offset, frame, center, darkc.
   Markup: parts/sections/hero/*.php (every section carries .hl). Geometry from kit3x
   heroBase + PATCH2; desktop from 1024px (1440 frames), phone below 768px (390 frames).
   Shared hero basics (.hero padding, .hero__copy, .hero__sub, .imgcard, .ftag, .facts)
   come from sections.css and components.css. Motion per 03-MOTION-SPEC.md 4.2 and 4.4. */

/* ================================================================ Shared */
/* Kit note(): fills the copy width on phones and on side layouts; hugs when centered. */
.hl .hl-note { align-self: stretch; }
.hl .hl-note .ico { flex: none; }
.hl-d-only { display: none !important; }
@media (min-width: 768px) {
	.hl .hl-note:not(.hl-note--fill) { align-self: auto; text-align: left; }
	/* Kit bal2(): body text of 18px and up wraps balanced (two or three lines). */
	.hl .hero__sub { text-wrap: balance; }
}
@media (min-width: 1024px) {
	.hl-d-only { display: inline-flex !important; }
	.hl-m-only { display: none !important; }
}

/* ================================================================ split / rsplit / dark */
@media (min-width: 1024px) {
	.hl.hero--split .hero__inner, .hl.hero--rsplit .hero__inner, .hl.hero--dark .hero__inner {
		display: grid; grid-template-columns: minmax(0, 556fr) minmax(0, 580fr); column-gap: 64px; align-items: center;
	}
	.hl.hero--rsplit .hero__inner { grid-template-columns: minmax(0, 580fr) minmax(0, 556fr); }
	.hl.hero--rsplit .hero__visual { order: -1; }
	.hl.hero--split .imgcard--hero, .hl.hero--rsplit .imgcard--hero, .hl.hero--dark .imgcard--hero { aspect-ratio: 580 / 424; }
}

/* ================================================================ center / darkc */
@media (min-width: 1024px) {
	/* Kit: copy items, visual and facts are direct children of one stack with gap 32. */
	.hl.hero--centered .hero__inner { align-items: center; gap: 32px; }
	.hl.hero--centered .hero__copy { gap: 32px; }
	.hl.hero--centered .h1 { max-width: 980px; }
	.hl.hero--centered .hero__sub { max-width: 680px; }
	.hl.hero--centered .hero__visual, .hl.hero--centered .hero__facts { width: 920px; max-width: 100%; }
	.hl.hero--center .imgcard--hero { aspect-ratio: 920 / 580; }
	.hl.hero--darkc .imgcard--hero { aspect-ratio: 920 / 540; }
}

/* ================================================================ frame */
.hl.hero--frame .hl-card { background: none; box-shadow: none; padding: 0; border-radius: 0; }
@media (min-width: 1024px) {
	.hl.hero--frame { padding-top: 48px; }
	/* Stage 1200: image card 780x540 at x 420; copy card 520 at x 0; both centered. */
	.hl-stage { display: grid; grid-template-columns: 420fr 100fr 680fr; align-items: center; min-height: 540px; }
	.hl.hero--frame .hl-card {
		grid-area: 1 / 1 / 2 / 3; position: relative; z-index: 2; margin: 20px 0;
		gap: 18px; padding: 40px; border-radius: 28px;
		background: var(--c-mist); box-shadow: var(--ring-card), var(--sh-big);
	}
	.hl-frame { grid-area: 1 / 2 / 2 / 4; height: 540px; max-width: none; }
	.hl-frame .imgcard--hero { height: 100%; aspect-ratio: auto; }
	.hl-frame .hl-ftag--tr { right: 28px; top: 28px; }
	.hl-frame .hl-ftag--br { right: 28px; bottom: 28px; }
}

/* ================================================================ offset */
.hl-float { display: none; }
@media (min-width: 1024px) {
	.hl.hero--offset .hero__inner {
		display: grid; grid-template-columns: minmax(0, 520fr) minmax(0, 620fr); column-gap: 60px; align-items: center;
	}
	/* Visual 620x452: image card 540x392 at x 80, float card 264 at x 36, bottom. */
	.hl-offset { aspect-ratio: 620 / 452; max-width: none; }
	.hl-offset__img { position: absolute; left: 12.903%; top: 0; width: 87.097%; height: 86.726%; }
	.hl-offset__img .imgcard--hero { height: 100%; aspect-ratio: auto; }
	.hl-offset--checks .hl-offset__img .ftag, .hl-offset--facts .hl-offset__img .ftag--mr { display: none; }
	.hl-offset--facts .hl-offset__img .ftag--tl { left: auto; right: 28px; }

	.hl-float {
		display: flex; flex-direction: column; gap: 10px;
		position: absolute; left: 36px; bottom: 0; z-index: 3;
		width: 264px; margin: 0; padding: 22px; border-radius: 20px;
	}
	.hl-float__fact { display: flex; flex-direction: column; gap: 10px; }
	.hl-float__v { font: var(--fw-medium) 26px/32px var(--f-head); letter-spacing: -.5px; color: var(--c-ink); }
	.hl-float__v.is-long { font-size: 18px; }
	.hl-float__l { margin: 0; font-size: 13px; line-height: 18px; color: var(--ink-62); }
	.hl-float__hr { width: 100%; }
	.hl-float--checks li { display: flex; gap: 12px; font-size: 16px; line-height: 24px; color: rgba(10, 13, 49, .9); }
	.hl-float__tick { display: grid; place-items: center; flex: none; width: 16px; height: 24px; color: var(--c-blue); }
	.hl-float__tick .ico { width: 14px; height: 11px; stroke-width: 1.8; }
}

/* ================================================================ Motion (4.2, 4.4) */
/* Facts strip and mini facts: 320ms + 40ms per item, opacity 0 and y 8px, 600ms. */
.hero.hl .facts[data-hero-item], .hero.hl .minifacts[data-hero-item] { animation: none; }
.hero.hl .facts__item, .hero.hl .minifacts__item {
	animation: sth-hero-fade8 600ms var(--ease-out-quart) both;
	animation-delay: calc(320ms + var(--n, 0) * 40ms);
}
.hero.hl :is(.facts__item, .minifacts__item):nth-child(2) { --n: 1; }
.hero.hl :is(.facts__item, .minifacts__item):nth-child(3) { --n: 2; }
.hero.hl :is(.facts__item, .minifacts__item):nth-child(4) { --n: 3; }
.hero.hl :is(.facts__item, .minifacts__item):nth-child(n+5) { --n: 4; }

/* frame: the frame rises y 24px to 0 at 200ms (copy card text runs the 4.2 sequence). */
.hero.hl.hero--frame [data-hero-item="visual"] { --d: 200ms; --vx: 0px; --vy: 24px; }

/* offset: image card x 24px to 0 (default visual); the float card fades up 12px at 360ms. */
.hero.hl [data-hero-item="float"] {
	animation: sth-hero-rise12 var(--dur-hero) var(--ease-spring) 360ms both;
}

/* center, darkc: visual rises y 24px; its tags pop from 0.92 with a 40ms stagger. */
.hero.hl.hero--centered [data-hero-item="visual"] { --vx: 0px; --vy: 24px; }
.hero.hl.hero--centered .imgcard .ftag {
	animation: hl-tag-pop 500ms var(--ease-spring-ui) both;
	animation-delay: calc(400ms + var(--n, 0) * 40ms);
}
.hero.hl.hero--centered .imgcard .ftag--mr { --n: 1; }
.hero.hl.hero--centered .imgcard .ftag--bl { --n: 2; }
@keyframes hl-tag-pop { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
	.hero.hl .facts__item, .hero.hl .minifacts__item, .hero.hl [data-hero-item], .hero.hl .ftag { animation: none !important; }
}
