/* =========================================================================
   HNZ Constructions — error pages

   Shared 404 and fatal-error composition, in the V2 language: a centred stack
   on the muted surface, display numeral, tracked caption, and the outlined
   uppercase call to action.

   The WordPress fatal-error drop-in loads this file directly and does not load
   home-v2.css, so the button styles are restated here rather than shared — the
   file must stand on its own and must not depend on page-builder markup.
   ========================================================================= */

.section--error {
	display: grid;
	align-items: center;
	min-height: clamp(580px, 67vh, 790px);
	padding-block: clamp(4rem, 8vw, 7.5rem);
	background: var(--c-surface-muted);
	overflow: hidden;
}

.error-page {
	position: relative;
	display: grid;
	justify-items: center;
	text-align: center;
}

/* Visual ---------------------------------------------------------------- */

.error-page__visual {
	position: relative;
	display: flex;
	justify-content: center;
	min-width: 0;
}

.error-page__code {
	position: relative;
	z-index: 1;
	font-family: var(--font-display);
	font-size: clamp(7rem, 30vw, 13rem); /* 112px–208px */
	font-weight: var(--fw-display);
	line-height: var(--lh-tight);
	letter-spacing: -0.03em;
	color: var(--c-ink);
}

/* Copy ------------------------------------------------------------------ */

.error-page__eyebrow {
	margin-top: var(--sp-5);
	font-family: var(--font-display);
	font-size: 16px;
	font-weight: var(--fw-display);
	line-height: var(--lh-tight);
	letter-spacing: 0.17em;
	text-transform: uppercase;
	color: var(--c-ink-muted);
}

.error-page__title {
	max-width: 16ch;
	margin-top: var(--sp-5);
	font-size: var(--fs-600); /* 24px–40px */
	line-height: var(--lh-tight);
	letter-spacing: -0.03em;
}

.error-page__text {
	max-width: 54ch;
	margin-top: var(--sp-5);
	font-size: 16px;
	line-height: 1.59;
	letter-spacing: 0;
	color: var(--c-ink-muted);
}

/* Actions --------------------------------------------------------------- */

.error-page__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: var(--sp-5) var(--sp-7);
	margin-top: clamp(2.5rem, 5vw, 3.75rem);
}

/* Matches .home-v2-projects__cta: outlined, filling upwards on hover. */
.error-page__button {
	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;
}

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

.error-page__button:active {
	box-shadow: none;
	transform: translateY(0) scale(0.98);
}

.error-page__secondary {
	font-family: var(--font-display);
	font-size: 14px;
	font-weight: var(--fw-display);
	line-height: 1;
	letter-spacing: 0.17em;
	text-transform: uppercase;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.5em;
	transition: color 280ms ease;
}

.error-page__secondary:hover,
.error-page__secondary:focus-visible {
	color: var(--c-ink-muted);
}

@media (min-width: 1300px) {
	.error-page__code {
		font-size: clamp(13rem, 18vw, 17rem); /* 208px–272px */
	}

	.error-page__visual::before {
		background-size: 280px auto;
	}
}

@media (max-width: 30em) {
	.error-page__actions {
		align-items: stretch;
		flex-direction: column;
		width: 100%;
	}

	.error-page__title {
		max-width: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.error-page__button:hover,
	.error-page__button:focus-visible,
	.error-page__button:active {
		transform: none;
	}
}
