/*
 * SECTION STYLE: HERO (the big first screen with video or image).
 *
 * Built from the Figma home page (file "WEB Sites", frame "Etusivu"):
 *   - the screen is 1440 x 836 in the design
 *   - a black veil (32 %) sits on the picture
 *   - the heading is 72 px Alte Haas Grotesk Bold, centred, -3 % spacing
 *   - the subline is 14 px, centred, with a yellow part
 *   - the short text is 18 px in the bottom left corner
 */

.aitio-hero {
	--aitio-hero-h: clamp(520px, 58.06vw, 836px);

	position: relative;
	height: var(--aitio-hero-h);
	max-height: 100svh;
	display: flex;
	align-items: flex-end;
	background: var(--aitio-ink);
	overflow: hidden;
	border-radius: 0 0 var(--aitio-radius) var(--aitio-radius);
}

.home .aitio-front-section--hero .aitio-hero {
	border-radius: 0;
}

.aitio-hero__video,
.aitio-hero__media {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.aitio-hero__video,
.aitio-hero__image {
	object-fit: cover;
	width: 100%;
	height: 100%;
}

/* the veil of the design: 32 % black over the whole screen */
.aitio-hero__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.32);
}

/* the middle block: heading + subline */
.aitio-hero__content {
	position: absolute;
	top: 36.7%;
	left: 0;
	right: 0;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	color: var(--aitio-white);
}

.aitio-hero__heading {
	max-width: 1136px;
	margin: 0;
	font-family: var(--aitio-font-display);
	font-size: var(--aitio-h1);
	font-weight: 700;
	line-height: 1.1;
	letter-spacing: -0.03em;
	text-transform: uppercase;
	/* The design breaks the title after "BREAKTHROUGH", so the title is
	   wrapped the normal way and not balanced. */
	text-wrap: wrap;
	color: var(--aitio-white);
}

.aitio-hero__subline {
	margin: 36px 0 0;
	font-size: 14px;
	line-height: 1.5;
	letter-spacing: 0;
	color: var(--aitio-white);
}

.aitio-hero__accent {
	color: var(--aitio-yellow);
}

.aitio-hero__content .aitio-button {
	margin-top: 28px;
}

/* the short text in the bottom left corner */
.aitio-hero__foot {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 10.2%;
	z-index: 2;
}

.aitio-hero__intro {
	max-width: 550px;
	margin: 0;
	font-size: 18px;
	line-height: 1.5;
	color: var(--aitio-white);
}

/* the thin line at the right edge of the design */
.aitio-hero__rule {
	position: absolute;
	right: 0;
	top: 76.3%;
	z-index: 2;
	width: 1px;
	height: 60px;
	background: rgba(0, 0, 0, 0.55);
}

/* when the hero has no media, keep it light and calm instead */
.aitio-front-section--hero .aitio-hero:not(:has(.aitio-hero__video)):not(:has(.aitio-hero__media)) {
	background: var(--aitio-cream);
	height: auto;
	min-height: min(88vh, 900px);
}

.aitio-front-section--hero .aitio-hero:not(:has(.aitio-hero__video)):not(:has(.aitio-hero__media)) .aitio-hero__content {
	color: var(--aitio-ink);
	top: auto;
	bottom: auto;
	padding-top: clamp(96px, 9vw, 124px);
	padding-bottom: clamp(48px, 8vw, 100px);
}

.aitio-front-section--hero .aitio-hero:not(:has(.aitio-hero__video)):not(:has(.aitio-hero__media)) .aitio-hero__heading {
	color: var(--aitio-ink);
}

.aitio-front-section--hero .aitio-hero:not(:has(.aitio-hero__video)):not(:has(.aitio-hero__media)) .aitio-hero__subline {
	color: var(--aitio-ink-soft);
}

.aitio-front-section--hero .aitio-hero:not(:has(.aitio-hero__video)):not(:has(.aitio-hero__media)) .aitio-hero__foot {
	position: static;
	padding-bottom: clamp(48px, 8vw, 100px);
}

.aitio-front-section--hero .aitio-hero:not(:has(.aitio-hero__video)):not(:has(.aitio-hero__media)) .aitio-hero__intro {
	color: var(--aitio-ink-soft);
}

/* Home micro-animation (light batch-1 version): the headline rises line
 * by line on load. The script sets --aitio-line per word; tune or remove
 * on staging. Skipped entirely with reduce motion. */
.aitio-hero__heading.is-rise .aitio-rise__word {
	display: inline-block;
	transform: translateY(0.9em);
	opacity: 0;
}

.aitio-hero__heading.is-rise.is-in .aitio-rise__word {
	transform: none;
	opacity: 1;
	transition: transform 0.7s var(--aitio-ease), opacity 0.7s ease;
	transition-delay: calc(var(--aitio-line, 0) * 90ms);
}

@media (prefers-reduced-motion: reduce) {

	.aitio-hero__heading.is-rise .aitio-rise__word {
		transform: none;
		opacity: 1;
		transition: none;
	}
}

/* ---- small screens ------------------------------------------------ */

@media (max-width: 1023px) {

	.aitio-hero {
		--aitio-hero-h: clamp(520px, 92svh, 720px);
	}

	.aitio-hero__content {
		top: 30%;
	}

	.aitio-hero__heading {
		max-width: 100%;
	}

	.aitio-hero__subline {
		margin-top: 24px;
	}

	.aitio-hero__foot {
		bottom: 8%;
	}

	.aitio-hero__intro {
		max-width: 34ch;
		font-size: 16px;
	}

	.aitio-hero__rule {
		display: none;
	}
}
