/**
 * Hero + stats bar.
 *
 * Under 768px the text sits above a cropped photo. From 768px up the
 * layout follows the 2000 × 430 artboard exactly, scaled by --hm-u.
 */

/* ---------------------------------------------------------------------
 * Hero – phones & tablets (stacked)
 * ------------------------------------------------------------------ */

.hm-hero {
	--hm-hero-focus: 66%;
	--hm-hero-overlay: 0;
	--hm-hero-tagline-color: #0a3d9c;

	position: relative;
	overflow: hidden;
	background: linear-gradient(180deg, #e4f1fc 0%, #f4f9fe 100%);
}

/* Slides share one grid cell and cross-fade. */
.hm-hero__slides {
	display: grid;
}

.hm-hero__slide {
	position: relative;
	display: flex;
	flex-direction: column;
	grid-area: 1 / 1;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.8s ease, visibility 0s linear 0.8s;
}

.hm-hero__slide.is-active {
	z-index: 1;
	opacity: 1;
	visibility: visible;
	transition: opacity 0.8s ease, visibility 0s;
}

.hm-hero__slide.is-active .hm-hero__content > * {
	animation: hm-hero-rise 0.8s ease both;
}

.hm-hero__slide.is-active .hm-hero__content > :nth-child(2) { animation-delay: 0.08s; }
.hm-hero__slide.is-active .hm-hero__content > :nth-child(3) { animation-delay: 0.16s; }
.hm-hero__slide.is-active .hm-hero__content > :nth-child(4) { animation-delay: 0.24s; }

@keyframes hm-hero-rise {
	from {
		opacity: 0;
		transform: translateY(14px);
	}
}

/* Controls: dots with prev/next arrows. */
.hm-hero__controls {
	position: relative;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	padding: 14px 0 18px;
}

.hm-hero__arrow {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1.5px solid rgb(3 78 157 / 0.25);
	border-radius: 50%;
	background: rgb(255 255 255 / 0.85);
	color: var(--hm-color-primary);
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.hm-hero__arrow:hover {
	background: var(--hm-color-primary);
	color: var(--hm-color-white);
}

.hm-hero__arrow svg {
	width: 16px;
	height: auto;
}

.hm-hero__arrow--prev svg {
	transform: rotate(180deg);
}

.hm-hero__dots {
	display: flex;
	gap: 8px;
}

.hm-hero__dot {
	width: 10px;
	height: 10px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: rgb(3 78 157 / 0.25);
	cursor: pointer;
	transition: width 0.3s ease, background-color 0.3s ease;
}

.hm-hero__dot.is-active {
	width: 28px;
	background: var(--hm-color-primary);
}

.hm-hero__arrow:focus-visible,
.hm-hero__dot:focus-visible {
	outline: 2px solid var(--hm-color-highlight);
	outline-offset: 3px;
}

.hm-hero__media {
	position: relative;
	order: 2;
	display: block;
	aspect-ratio: 4 / 3;
}

.hm-hero__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: var(--hm-hero-focus) 50%;
}

.hm-hero__media::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: linear-gradient(90deg, rgb(255 255 255 / var(--hm-hero-overlay)) 0%, rgb(255 255 255 / calc(var(--hm-hero-overlay) * 0.75)) 35%, rgb(255 255 255 / 0) 62%);
}

.hm-hero__inner {
	position: relative;
	order: 1;
	padding-top: 40px;
	padding-bottom: 32px;
}

.hm-hero__eyebrow {
	margin: 0 0 10px;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.3;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--hm-color-text);
}

.hm-hero__title {
	margin: 0;
	font-family: var(--hm-font-heading);
	font-size: clamp(34px, 4.2vw + 18px, 58px);
	font-weight: 700;
	line-height: 1.08;
	letter-spacing: -0.005em;
	color: var(--hm-color-primary);
}

.hm-hero__title-line {
	display: block;
}

.hm-hero__title-line--accent {
	font-size: 0.94em;
	color: var(--hm-color-accent);
}

.hm-hero__text {
	max-width: 30em;
	margin: 14px 0 0;
	font-size: clamp(16px, 0.5vw + 14px, 20px);
	line-height: 1.5;
	color: var(--hm-color-text);
}

.hm-hero__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px;
	margin-top: 26px;
}

/* Buttons */

.hm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 52px;
	padding: 0 26px;
	border: 2px solid transparent;
	border-radius: var(--hm-radius-pill);
	font-family: var(--hm-font-heading);
	font-size: 17px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.hm-btn:focus-visible,
.hm-hero__link:focus-visible {
	outline: none;
	box-shadow: var(--hm-focus-ring);
}

.hm-btn__icon {
	flex: none;
	width: 22px;
	height: auto;
}

.hm-btn__icon.hm-icon--users {
	width: 28px;
}

.hm-btn__arrow,
.hm-hero__link-arrow {
	flex: none;
	width: 16px;
	height: auto;
	transition: transform 0.2s ease;
}

.hm-btn:hover .hm-btn__arrow,
.hm-hero__link:hover .hm-hero__link-arrow {
	transform: translateX(3px);
}

.hm-btn--primary {
	background: var(--hm-color-primary);
	color: var(--hm-color-white);
	box-shadow: 0 0 0 2px rgb(255 255 255 / 0.6), 0 8px 18px -8px rgb(0 40 90 / 0.45);
}

.hm-btn--primary:hover {
	background: var(--hm-color-primary-dark);
	color: var(--hm-color-white);
	transform: translateY(-1px);
}

.hm-btn--outline {
	border-color: var(--hm-color-primary);
	background: var(--hm-color-white);
	color: var(--hm-color-primary);
}

.hm-btn--outline:hover {
	background: var(--hm-color-primary);
	color: var(--hm-color-white);
	transform: translateY(-1px);
}

.hm-hero__link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 2px;
	border-radius: 4px;
	font-family: var(--hm-font-heading);
	font-size: 16px;
	font-weight: 500;
	color: var(--hm-color-primary);
	text-decoration: none;
}

.hm-hero__link:hover span {
	text-decoration: underline;
	text-underline-offset: 4px;
}

/* Handwritten tagline: large screens only. */
.hm-hero__tagline {
	display: none;
}

/* Phones: photo first with the dots on it, then compact text. */
@media (max-width: 767px) {
	.hm-hero__media {
		order: 1;
		aspect-ratio: 16 / 10;
	}

	.hm-hero__inner {
		order: 2;
		padding-top: 22px;
		padding-bottom: 30px;
	}

	.hm-hero__eyebrow {
		margin-bottom: 6px;
		font-size: 12px;
	}

	.hm-hero__title {
		font-size: clamp(28px, 7.4vw, 40px);
		line-height: 1.12;
	}

	.hm-hero__text {
		margin-top: 10px;
		font-size: 15.5px;
	}

	.hm-hero__actions {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 10px;
		margin-top: 20px;
	}

	.hm-btn {
		min-height: 48px;
		padding: 0 12px;
		gap: 8px;
		font-size: 15px;
	}

	.hm-btn__arrow {
		display: none;
	}

	.hm-btn__icon {
		width: 18px;
	}

	.hm-btn__icon.hm-icon--users {
		width: 22px;
	}

	.hm-hero__link {
		grid-column: 1 / -1;
		justify-self: center;
		font-size: 15px;
	}

	.hm-hero__controls {
		position: absolute;
		top: calc(62.5vw - 52px);
		right: 0;
		left: 0;
		padding: 0;
		gap: 10px;
	}

	.hm-hero__arrow {
		width: 34px;
		height: 34px;
	}

	.hm-hero__dot {
		background: rgb(255 255 255 / 0.8);
		box-shadow: 0 1px 4px rgb(0 0 0 / 0.3);
	}

	.hm-hero__dot.is-active {
		background: var(--hm-color-primary);
	}
}

@media (max-width: 359px) {
	.hm-hero__actions {
		grid-template-columns: 1fr;
	}
}

@media (min-width: 768px) {
	.hm-hero__media {
		aspect-ratio: 12 / 5;
	}

	.hm-hero__inner {
		padding-top: 56px;
		padding-bottom: 44px;
	}

	.hm-hero__eyebrow {
		font-size: 14px;
	}
}

/* ---------------------------------------------------------------------
 * Hero – desktop (artboard layout)
 * ------------------------------------------------------------------ */

@media (min-width: 768px) {
	.hm-hero {
		background: #d6e9f8;
	}

	.hm-hero__slide {
		display: block;
	}

	.hm-hero__controls {
		position: absolute;
		right: 0;
		bottom: calc(28 * var(--hm-u));
		left: 0;
		padding: 0;
	}

	.hm-hero__dot {
		background: rgb(255 255 255 / 0.75);
		box-shadow: 0 1px 4px rgb(0 0 0 / 0.25);
	}

	.hm-hero__dot.is-active {
		background: var(--hm-color-primary);
	}

	.hm-hero__media {
		position: absolute;
		inset: 0;
		aspect-ratio: auto;
	}

	.hm-hero__image {
		object-position: var(--hm-hero-focus) 50%;
	}

	.hm-hero__inner {
		display: flex;
		flex-direction: column;
		justify-content: center;
		min-height: calc(700 * var(--hm-u));
		padding-top: calc(40 * var(--hm-u));
		padding-bottom: calc(90 * var(--hm-u));
	}

	.hm-hero__content {
		position: relative;
		z-index: 1;
		max-width: calc(1100 * var(--hm-u));
	}

	.hm-hero__eyebrow {
		margin-bottom: calc(7.6 * var(--hm-u));
		font-size: max(12px, calc(19 * var(--hm-u)));
		line-height: calc(24 * var(--hm-u));
		letter-spacing: 0.1em;
	}

	/* Narrow enough that the second line wraps: three lines in total. */
	.hm-hero__title {
		max-width: calc(640 * var(--hm-u));
		font-size: calc(69 * var(--hm-u));
		line-height: calc(71 * var(--hm-u));
		letter-spacing: 0;
	}

	.hm-hero__title-line--accent {
		font-size: calc(64.3 * var(--hm-u));
	}

	.hm-hero__text {
		margin-top: calc(10 * var(--hm-u));
		font-size: max(15px, calc(24.4 * var(--hm-u)));
		line-height: calc(33 * var(--hm-u));
	}

	.hm-hero__actions {
		gap: calc(23 * var(--hm-u));
		margin-top: calc(23.5 * var(--hm-u));
	}

	.hm-btn {
		gap: calc(11 * var(--hm-u));
		min-width: calc(270 * var(--hm-u));
		min-height: max(40px, calc(62 * var(--hm-u)));
		padding-inline: max(16px, calc(30 * var(--hm-u)));
		border-width: max(1.5px, calc(2 * var(--hm-u)));
		font-size: max(14px, calc(20 * var(--hm-u)));
	}

	.hm-btn__icon {
		width: max(16px, calc(27 * var(--hm-u)));
	}

	.hm-btn__icon.hm-icon--users {
		width: max(20px, calc(33 * var(--hm-u)));
	}

	.hm-btn__arrow {
		width: max(12px, calc(18 * var(--hm-u)));
	}

	.hm-hero__link {
		gap: calc(9 * var(--hm-u));
		margin-left: calc(11 * var(--hm-u));
		font-size: max(13px, calc(17.5 * var(--hm-u)));
	}

	.hm-hero__link-arrow {
		width: max(12px, calc(15 * var(--hm-u)));
	}

	/*
	 * skewY tilts the baselines while keeping letters upright, skewX adds
	 * the handwritten lean, and each line steps right like the artwork.
	 */
	.hm-hero__tagline {
		position: absolute;
		top: calc(170 * var(--hm-u));
		left: calc(1682 * var(--hm-u));
		display: block;
		color: var(--hm-hero-tagline-color);
		transform: skewY(-16.5deg) skewX(-10deg);
		transform-origin: 0 0;
		pointer-events: none;
		z-index: 2;
	}

	.hm-hero__tagline-text {
		margin: 0;
		font-family: var(--hm-font-script);
		font-size: calc(42 * var(--hm-u));
		font-weight: 400;
		line-height: calc(53.5 * var(--hm-u));
		white-space: nowrap;
		-webkit-text-stroke: calc(0.7 * var(--hm-u)) currentColor;
	}

	.hm-hero__tagline-line {
		display: block;
		margin-left: calc(var(--hm-line, 0) * 26.4 * var(--hm-u));
	}

	.hm-hero__flourish {
		display: block;
		width: calc(220 * var(--hm-u));
		height: auto;
		margin-top: calc(-17 * var(--hm-u));
		margin-left: calc(((var(--hm-lines, 1) - 1) * 26.4 + 16) * var(--hm-u));
		overflow: visible;
	}

	.hm-hero__swoosh,
	.hm-hero__heart {
		fill: none;
		stroke: currentColor;
		stroke-width: 3;
		stroke-linecap: round;
		stroke-linejoin: round;
	}

	.hm-hero__swoosh {
		stroke-width: 4;
	}
}

/* Tablets & small laptops: keep the desktop overlay and shift the photo so
 * the children sit right of the text. */
@media (min-width: 768px) and (max-width: 1199px) {
	.hm-hero__image {
		object-position: var(--hm-hero-focus-tablet, 42%) 50%;
	}

	.hm-hero__media::after {
		background: linear-gradient(90deg, rgb(255 255 255 / 0.7) 0%, rgb(255 255 255 / 0.45) 38%, rgb(255 255 255 / 0) 62%);
	}

	.hm-hero__content {
		max-width: 66%;
	}

	/* No room beside the children's faces at these widths. */
	.hm-hero__tagline {
		display: none;
	}
}

/* ---------------------------------------------------------------------
 * Stats bar
 * ------------------------------------------------------------------ */

.hm-stats {
	background: var(--hm-color-primary-dark);
	color: var(--hm-color-white);
}

.hm-stats__list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	row-gap: 24px;
	margin: 0;
	padding: 28px 0;
	list-style: none;
}

.hm-stats__item {
	display: flex;
	justify-content: center;
	flex: 0 0 50%;
	padding-inline: 2px;
}

.hm-stat {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.hm-stat__icon {
	flex: none;
	width: 40px;
	height: 40px;
	object-fit: contain;
}

.hm-stat__text {
	display: flex;
	flex-direction: column;
	margin: 0;
	min-width: 0;
}

.hm-stat__number {
	font-family: var(--hm-font-heading);
	font-size: 22px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.01em;
}

.hm-stat__label {
	font-size: 14px;
	font-weight: 400;
	line-height: 1.4;
	color: #d6ebfd;
}

@media (min-width: 768px) {
	.hm-stats__item {
		flex-basis: 33.333%;
	}

	.hm-stat {
		gap: 14px;
	}

	.hm-stat__icon {
		width: 52px;
		height: 52px;
	}

	.hm-stat__number {
		font-size: 26px;
	}

	.hm-stat__label {
		font-size: 16px;
	}
}

@media (min-width: 992px) {
	.hm-stats__list {
		flex-wrap: nowrap;
		justify-content: flex-start;
		align-items: center;
		min-height: max(80px, calc(113 * var(--hm-u)));
		padding: 0 calc(44 * var(--hm-u));
	}

	/*
	 * Items share the free space equally; the ::before spacer in front of
	 * every item after the first carries the divider, so dividers always
	 * sit halfway between neighbouring stats.
	 */
	.hm-stats__item {
		flex: 0 0 auto;
		padding: 0;
	}

	.hm-stats__item + .hm-stats__item {
		flex: 1 1 auto;
	}

	.hm-stats__item + .hm-stats__item::before {
		content: "";
		flex: 1 1 auto;
		align-self: center;
		height: max(48px, calc(68 * var(--hm-u)));
		background: linear-gradient(rgb(255 255 255 / 0.16), rgb(255 255 255 / 0.16)) center / max(1px, calc(2 * var(--hm-u))) 100% no-repeat;
	}

	.hm-stat {
		gap: calc(31 * var(--hm-u));
	}

	.hm-stat__icon {
		width: max(44px, calc(72 * var(--hm-u)));
		height: max(44px, calc(72 * var(--hm-u)));
	}

	.hm-stat__number {
		font-size: max(20px, calc(29 * var(--hm-u)));
		line-height: 1.2;
	}

	.hm-stat__label {
		font-size: max(14px, calc(20 * var(--hm-u)));
		line-height: 1.4;
	}
}
