/*
 * hero.css — S1 full-bleed birch hero, matched to the client's existing one.
 *
 * Their layout: full-height section, content block LEFT-aligned and VERTICALLY
 * CENTRED (Elementor --justify-content:center, --align-items:flex-start). The
 * redesign anchored the text to the bottom-left instead, which sat it well
 * below where theirs sits. Slow ken-burns on the video and the scroll cue are
 * ours; all motion stays reduced-safe.
 */

.hero {
	position: relative;
	display: flex;
	align-items: center; /* their content is centred in the viewport, not bottom-aligned */
	min-height: 100dvh;
	overflow: hidden;
	background: var(--ink); /* fallback before the poster/video paints */
	isolation: isolate;
}

/* ---- Media ---- */
.hero__media {
	position: absolute;
	inset: 0;
	z-index: 0;
}

/*
 * The still frame sits underneath and the video plays over it. On phones no
 * video is loaded at all (see hero.js), so this image is the hero; on desktop
 * it is what shows until the video has enough data to paint.
 */
.hero__poster,
.hero__video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	animation: heroKenBurns 24s ease-in-out infinite alternate;
	transform-origin: center;
}

@keyframes heroKenBurns {
	from { transform: scale(1.05); }
	to   { transform: scale(1.14); }
}

/*
 * Dark wash — the client's exact hero overlay, taken from their live CSS:
 *   linear-gradient(180deg, #000000B2 0%, #00000066 100%)
 *
 * This is why their header reads darker than ours did. Theirs is 70% black at
 * the very top (#000000B2) easing to 40% at the bottom; ours used to start at
 * 34% and fade to 4% by a third of the way down, so the white nav sat over a
 * far brighter backdrop. Neutral black, not our green-tinted ink — a tint
 * shifts the photograph's colour, which was part of the mismatch.
 */
.hero__overlay {
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(180deg, #000000b2 0%, #00000066 100%);
}

/* ---- Content ----
 * Measured off their live hero (tools/measure-hero.js) rather than estimated:
 *   box      min-height 100dvh, padding 160px 64px 80px, content centred
 *   h1       Lato 56px / 300, line-height 61.6px (1.1)
 *   subline  Lato 32px / 300, 16px below the h1
 *   button   Lato 17.6px / 400, padding 20px 32px, 40px below the subline
 *
 * The text sits flush with the 64px page gutter — NOT inside the centred
 * container the rest of the site uses. On their site the tagline starts at
 * x=64, the same line as the header logo; ours started at x=100, which is a
 * large part of why the two did not line up.
 */
.hero__inner {
	position: relative;
	z-index: 2;
	width: 100%;
	max-width: 1440px;
	margin-inline: auto;
	padding: 160px 64px 80px;
	color: #fff;
}

.hero__title {
	color: #fff;
	font-family: var(--font-body);
	font-size: 56px;
	font-weight: 300;
	line-height: 1.1;
	letter-spacing: normal;
	/* Matches their widget cap. The two-line break itself is a hard <br> in the
	   markup, exactly as on their site — the cap alone let the line collapse to
	   one between 640px and 767px. */
	max-width: 650px;
	margin: 0 0 16px;
	/*
	 * Their heading is overflow-wrap: normal, so a long Finnish compound is
	 * never split across lines. Ours inherited break-word from the base layer,
	 * which chopped "tulevaisuudessa" mid-word on narrow screens.
	 */
	overflow-wrap: normal;
}

.hero__subline {
	font-family: var(--font-body);
	font-size: 32px;
	font-weight: 300;
	line-height: 1;
	color: #fff;
	max-width: none;
	margin: 0 0 40px;
}

.hero__cta {
	display: flex;
	flex-wrap: wrap;
	gap: var(--s-3);
}

/*
 * Their hero button is slightly larger than the header pill: 17.6px text with
 * 20px/32px padding, giving exactly 58px. Our .btn carries a 1px transparent
 * border for the ghost variant, which made it 60px — hence border: 0 here, and
 * min-height: 0 so the shared 48px floor cannot round it up either.
 */
.hero__cta .btn--primary {
	padding: 20px 32px;
	font-size: 17.6px;
	font-weight: 400;
	line-height: 1;
	min-height: 0;
	border: 0;
}

/* ---- Scroll cue ---- */
/*
 * ⚠ NOT RENDERED since 28.7.2026 — the scroll cue was removed from hero.php on
 * the client's instruction (it read as a stray vertical line over the picture,
 * and their own homepage has no scroll cue). The rules are kept so uncommenting
 * the markup restores it exactly. Delete both together if it is never coming back.
 */
.hero__scroll {
	position: absolute;
	left: 50%;
	bottom: var(--s-6);
	z-index: 2;
	transform: translateX(-50%);
	display: block;
}

.hero__scroll-line {
	display: block;
	width: 1px;
	height: 48px;
	background: rgba(255, 255, 255, 0.6);
	transform-origin: top;
	animation: heroScroll 2.4s var(--ease) infinite;
}

@keyframes heroScroll {
	0%   { transform: scaleY(0); }
	40%  { transform: scaleY(1); transform-origin: top; }
	60%  { transform: scaleY(1); transform-origin: bottom; }
	100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ---- Phone (<=767, their Elementor mobile breakpoint) ----
 * Measured off their live hero at 390: h1 32px / line-height 1.1, subline
 * 21.6px, 16px side gutter. The desktop 56px was shipping to phones and broke
 * "tulevaisuudessa" mid-word. At 768 and up their values are identical to
 * desktop, so this is the only step. */
@media (max-width: 767.98px) {
	.hero__inner {
		padding-inline: 16px;
		/*
		 * Their mobile hero sets padding top AND bottom to 0. We kept the
		 * desktop 160/80, and because the box is centred in 100dvh the uneven
		 * pair pushed the whole block down by (160-80)/2 = exactly 40px — the
		 * offset measured against their site on every element.
		 */
		padding-block: 0;
	}

	.hero__title {
		font-size: 32px;
		max-width: none;
	}

	.hero__subline {
		font-size: 21.6px;
	}
}

/* ---- Reduced motion: no video motion ----
   The hero text no longer animates at all (their tagline just sits there), so
   there is nothing left here to un-hide. */
@media (prefers-reduced-motion: reduce) {
	.hero__poster,
	.hero__video { animation: none; }
	.hero__scroll-line { animation: none; }
}
