/* =========================================================================
   HNZ Constructions — alternate homepage V2
   ========================================================================= */

.home-v2-hero {
	position: relative;
	height: 100dvh;
	min-height: 100dvh;
	overflow: hidden;
	background: var(--c-ink);
}

.home-v2-hero__image,
.home-v2-hero__video,
.home-v2-hero__overlay {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.home-v2-hero__image {
	object-fit: cover;
	object-position: center;
}

.home-v2-hero__video {
	pointer-events: none;
}

.home-v2-hero__video iframe {
	position: absolute;
	top: 50%;
	left: 50%;
	width: max(100%, 177.778dvh);
	height: max(100%, 56.25vw);
	border: 0;
	transform: translate(-50%, -50%);
}

.home-v2-hero__overlay {
	background: rgb(15 16 21 / 56%);
}

.home-v2-about {
	padding-block: clamp(5rem, 10vw, 9rem);
	/* No background: --c-surface-muted is the same value as the body's
	   --c-surface, and painting it here would hide the site watermark. */
	text-align: center;
	/* The header is sticky, so anchor links must stop clear of it. */
	scroll-margin-top: calc(var(--header-height) + var(--sp-3));
}

.home-v2-about__heading,
.home-v2-projects__heading {
	font-size: var(--fs-600);
	line-height: var(--lh-tight);
}

.home-v2-about__heading {
	margin-bottom: var(--sp-7);
}

.home-v2-about__copy {
	font-size: 16px;
	line-height: 1.59;
	letter-spacing: 0;
	color: var(--c-ink-muted);
}

.home-v2-projects {
	padding-block: clamp(4rem, 8vw, 7.5rem);
	/* No background: --c-surface-muted is the same value as the body's
	   --c-surface, and painting it here would hide the site watermark. */
	/* The header is sticky, so anchor links must stop clear of it. */
	scroll-margin-top: calc(var(--header-height) + var(--sp-3));
}

/* Heading left, category row right, one rule under the pair. */
.home-v2-projects__header {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--sp-3) var(--sp-6);
	margin-bottom: clamp(3rem, 6vw, 5.25rem);
	padding-inline: max(0px, calc((100% - var(--inner-container)) / 2));
	padding-bottom: var(--sp-6);
	border-bottom: 1px solid var(--c-divider);
}

.home-v2-projects__heading {
	margin: 0;
	text-align: left;
	line-height: 1.2;
}

/* Figma: one right-aligned run of Sofia Pro Medium 20/100% at -3%, in
   #333132, with the slashes the same weight and colour as the labels. */
.home-v2-projects .filters__list {
	justify-content: flex-end;
	gap: var(--sp-2);
	margin-bottom: 0;
}

.home-v2-projects .filters__item + .filters__item::before {
	margin-right: var(--sp-2);
	color: inherit;
}

.home-v2-projects .filters__link {
	padding-bottom: 0;
	border-bottom: 0;
	font-size: 1.25rem; /* 20px — between --fs-400 and --fs-500. */
	font-weight: var(--fw-medium);
	line-height: var(--lh-tight);
	letter-spacing: var(--ls-tight);
	color: var(--c-ink);
	transition: opacity var(--transition);
}

/* The design underlines nothing, so the selected category is the one at full
   strength and the rest recede. */
.home-v2-projects .filters__link:not(.is-active) {
	opacity: 0.45;
}

.home-v2-projects .filters__link:hover,
.home-v2-projects .filters__link:focus-visible {
	opacity: 1;
}

.home-v2-projects__empty {
	margin: 0;
	font-size: 16px;
	line-height: 1.59;
	text-align: center;
	color: var(--c-ink-muted);
}

/* width: 100% is load-bearing, not redundant. This grid is itself a grid item
   of .home-v2-projects__batches, and the auto inline margins that centre it
   suppress the stretch alignment that would otherwise give it the column
   width. WebKit then falls back to the max-content width — which collapses to
   zero below 700px, where .home-v2-projects__column is display: contents and
   the hoisted tiles contribute no intrinsic width — so the whole mosaic
   disappeared in Safari. */
.home-v2-projects__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	column-gap: 3.25rem;
	width: 100%;
	max-width: var(--inner-container);
	margin-inline: auto;
	justify-content: center;
}

.home-v2-projects__column {
	display: flex;
	flex-direction: column;
	gap: 2.5rem;
}

.home-v2-projects__batches {
	display: grid;
	gap: clamp(2.5rem, 6vw, 5rem);
}

.home-v2-projects__item {
	overflow: hidden;
}

.home-v2-projects__item--1,
.home-v2-projects__item--4 {
	aspect-ratio: 3 / 4;
}

.home-v2-projects__item .tile {
	display: block;
	height: 100%;
}

.home-v2-projects__item .tile__image,
.home-v2-projects__item .tile__placeholder {
	height: 100%;
	aspect-ratio: auto;
}

.home-v2-projects__item .tile__image {
	object-fit: cover;
	object-position: center center;
}

.home-v2-projects__item--2,
.home-v2-projects__item--3 {
	aspect-ratio: 4 / 3;
}

.home-v2-projects .tile__info {
	position: absolute;
	top: 42%;
	left: 50%;
	display: flex;
	width: calc(100% - (2 * var(--sp-4)));
	flex-direction: column;
	align-items: center;
	gap: 18px;
	transform: translate(-50%, -50%);
}

.home-v2-projects .tile__title {
	padding-top: 0;
	font-family: var(--font-display);
	font-size: 25px;
	font-weight: var(--fw-display);
	line-height: 1;
	letter-spacing: -0.03em;
}

.home-v2-projects .tile__title::before {
	display: none;
}

.home-v2-projects .tile__location {
	padding-bottom: 0;
	font-family: var(--font-display);
	font-size: 16px;
	font-weight: var(--fw-display);
	line-height: 1;
	letter-spacing: 0.17em;
}

.home-v2-projects .tile__location::after {
	display: none;
}

.home-v2-projects .tile__view-project {
	display: inline-flex;
	position: absolute;
	bottom: 13%;
	left: 50%;
	width: 47%;
	max-width: 20.75rem;
	align-items: center;
	justify-content: center;
	min-width: 11.25rem;
	min-height: 2.75rem;
	padding: var(--sp-2) var(--sp-4);
	border: 1px solid currentcolor;
	font-family: var(--font-display);
	font-size: 14px;
	font-weight: var(--fw-display);
	line-height: 1;
	letter-spacing: 0.17em;
	text-transform: uppercase;
	background: linear-gradient(#fff, #fff) bottom / 100% 0 no-repeat;
	transform: translateX(-50%);
	transition:
		background-size 460ms cubic-bezier(0.22, 1, 0.36, 1),
		color 280ms ease,
		box-shadow 280ms ease,
		transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.home-v2-projects .tile__view-project:hover,
.home-v2-projects .tile:focus-visible .tile__view-project {
	background-size: 100% 100%;
	color: var(--c-ink);
	box-shadow: 0 0 1.5rem rgb(255 255 255 / 22%);
	transform: translate(-50%, -2px);
}

.home-v2-projects .tile:active .tile__view-project {
	transform: translate(-50%, 0) scale(0.98);
}

.home-v2-projects__footer {
	display: flex;
	justify-content: center;
	margin-top: clamp(3rem, 6vw, 5rem);
}

/* A filtered view can run out of pages, so the CTA is hidden rather than
   removed — collapse its margin with it. */
.home-v2-projects__footer:has(> [hidden]) {
	display: none;
}

.home-v2-projects__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 10.5rem;
	min-height: 2.75rem;
	padding: 18px 26px;
	border: 1px solid currentcolor;
	font-family: var(--font-display);
	font-size: 14px;
	font-weight: var(--fw-display);
	line-height: 1;
	letter-spacing: 0.17em;
	text-transform: uppercase;
	background: linear-gradient(var(--c-ink), var(--c-ink)) bottom / 100% 0 no-repeat;
	transition:
		background-size 460ms cubic-bezier(0.22, 1, 0.36, 1),
		color 280ms ease,
		transform 280ms cubic-bezier(0.22, 1, 0.36, 1),
		box-shadow 280ms ease;
}

.home-v2-projects__cta:hover,
.home-v2-projects__cta:focus-visible {
	background-size: 100% 100%;
	color: #fff;
	box-shadow: 0 0.75rem 1.75rem rgb(51 49 50 / 14%);
	transform: translateY(-2px);
}

.home-v2-projects__cta:active {
	box-shadow: none;
	transform: translateY(0) scale(0.98);
}

#contact {
	.section__heading--framed {
		text-align: left;
	}
}

/* The V2 opening composition keeps the navigation inside the video frame,
   with an inverse logo and controls until the user starts scrolling. */
body:has(.site-main > .home-v2-hero:first-child) .site-header:not(.is-stuck) .logo__image {
	filter: brightness(0) invert(1);
}

body:has(.site-main > .home-v2-hero:first-child) .site-header.is-stuck {
	background: var(--c-surface);
	color: var(--c-ink);
}

@media (min-width: 1300px) {
	/* Match the reference: the first visual is continuous from the utility
	   bar through the navigation and into the hero. */
	body:has(.site-main > .home-v2-hero:first-child) .site-header {
		background: transparent;
	}

	body:has(.site-main > .home-v2-hero:first-child) .site-header:not(.is-stuck) .site-nav__list a {
		color: #e6e7e8;
		font-family: var(--font-display);
		font-size: 12px;
		font-weight: 500;
		line-height: 1;
		letter-spacing: 0.07em;
	}

}

@media (max-width: 1299px) {
	body:has(.site-main > .home-v2-hero:first-child) .site-header {
		position: fixed;
		top: 0;
		background: transparent;
		color: #fff;
	}

	body:has(.site-main > .home-v2-hero:first-child) .site-header.is-stuck {
		background: var(--c-surface);
		color: var(--c-ink);
	}

	body.nav-is-open:has(.site-main > .home-v2-hero:first-child) .site-header {
		color: var(--c-ink);
	}

	body.nav-is-open:has(.site-main > .home-v2-hero:first-child) .site-header .logo__image {
		filter: none;
	}
}

@media (max-width: 699px) {
	.home-v2-projects__header {
		flex-direction: column;
		align-items: flex-start;
		gap: var(--sp-4);
	}

	.home-v2-projects .filters__list {
		justify-content: flex-start;
	}

	.home-v2-projects__grid {
		grid-template-columns: 1fr;
		row-gap: 2.5rem;
	}

	.home-v2-projects__column {
		display: contents;
	}

	.home-v2-projects__item--1,
	.home-v2-projects__item--2,
	.home-v2-projects__item--3,
	.home-v2-projects__item--4 {
		grid-row: auto;
		aspect-ratio: 4 / 3;
	}

	.home-v2-projects__item--1 {
		order: 1;
	}

	.home-v2-projects__item--2 {
		order: 2;
	}

	.home-v2-projects__item--3 {
		order: 3;
	}

	.home-v2-projects__item--4 {
		order: 4;
	}

	.home-v2-projects__item .tile {
		aspect-ratio: inherit;
	}
}
