.sp-footer {
	--sp-footer-watermark-render-width: calc(var(--sp-footer-watermark-width) * var(--sp-footer-watermark-scale, 1));

	position: relative;
	z-index: 2;
	overflow: hidden;
	width: 100%;
	padding: var(--sp-footer-pad-top) 0 0;
	background: #0A0A0A;
	color: var(--spaciefy-white);
}

.sp-footer__inner {
	display: flex;
	flex-direction: column;
	min-height: var(--sp-footer-artboard-height);
}

.sp-footer__top {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
	align-items: start;
	column-gap: var(--sp-section-gap);
}

.sp-footer__nav {
	justify-self: start;
	min-width: 0;
}

.sp-footer__nav-list,
.sp-footer__nav-list .menu-item {
	margin: 0;
	padding: 0;
	list-style: none;
}

.sp-footer__nav-list {
	display: flex;
	flex-direction: column;
	gap: var(--sp-footer-nav-gap);
}

.sp-footer__nav-link {
	position: relative;
	display: inline-block;
	font-family: var(--spaciefy-font-manrope);
	font-size: var(--sp-footer-nav-size);
	font-weight: 500;
	line-height: var(--sp-footer-nav-lh, 1.62);
	color: var(--spaciefy-white);
	transition: opacity 0.2s ease;
}

/*
 * Hit area claims this link's share of the list gap and no more, so stacked
 * links never steal taps from each other.
 */
.sp-footer__nav-link::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: 50%;
	height: calc(100% + var(--sp-footer-nav-gap));
	transform: translateY(-50%);
}

.sp-footer__nav-link:hover,
.sp-footer__nav-link:focus-visible {
	opacity: 0.7;
}

.sp-footer__logo {
	position: relative;
	justify-self: center;
	align-self: start;
}

.sp-footer__logo::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: 50%;
	height: var(--sp-tap-min);
	transform: translateY(-50%);
}

.sp-footer__logo-image {
	display: block;
	width: auto;
	max-width: var(--sp-logo-width);
	height: auto;
	max-height: var(--sp-logo-height);
}

.sp-footer__logo-text {
	display: inline-block;
	font-size: var(--sp-font-logo);
	font-weight: 700;
	line-height: 1;
	letter-spacing: -0.02em;
	color: var(--spaciefy-white);
	text-transform: lowercase;
}

.sp-footer__logo-i {
	position: relative;
	display: inline-block;
}

.sp-footer__logo-i::before {
	content: "";
	position: absolute;
	top: 0.05em;
	left: 50%;
	width: 0.22em;
	height: 0.22em;
	border-radius: 50%;
	background-color: var(--spaciefy-yellow);
	transform: translateX(-50%);
}

.sp-footer__contact {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	justify-self: end;
	gap: 0;
	min-width: 0;
	text-align: right;
}

.sp-footer__copyright {
	margin: 0 0 var(--sp-footer-contact-gap-md, var(--sp-stack-gap-md));
	font-family: var(--spaciefy-font-helvetica);
	font-size: var(--sp-footer-copyright-size);
	font-weight: 400;
	line-height: normal;
	color: var(--spaciefy-white);
	opacity: 0.5;
}

.sp-footer__cta {
	display: inline-flex;
	align-items: center;
	justify-content: flex-end;
	gap: var(--sp-cta-gap);
	min-height: var(--sp-tap-min);
	max-width: 100%;
	margin-bottom: var(--sp-footer-contact-gap-sm, var(--sp-stack-gap-sm));
	color: var(--spaciefy-white);
	transition: opacity 0.2s ease;
}

.sp-footer__cta:hover,
.sp-footer__cta:focus-visible {
	opacity: 0.85;
}

.sp-footer__cta-label {
	font-family: var(--spaciefy-font-manrope);
	font-size: var(--sp-footer-cta-size);
	font-weight: 500;
	line-height: var(--sp-footer-cta-lh, 1.14);
	min-width: 0;
}

.sp-footer__cta-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: var(--sp-cta-icon-size);
	height: var(--sp-cta-icon-size);
	border-radius: var(--sp-cta-icon-radius);
	color: var(--spaciefy-black);
	background-color: var(--spaciefy-yellow);
}

.sp-footer__cta-icon svg {
	width: calc(var(--sp-cta-icon-svg) * 0.65);
	height: calc(var(--sp-cta-icon-svg) * 0.65);
}

.sp-footer__email {
	position: relative;
	display: inline-block;
	font-family: var(--spaciefy-font-helvetica);
	font-size: var(--sp-footer-email-size);
	font-weight: 300;
	line-height: normal;
	letter-spacing: var(--sp-footer-email-tracking);
	color: var(--spaciefy-white);
	text-align: right;
	transition: opacity 0.2s ease;
}

.sp-footer__email::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: 50%;
	height: var(--sp-tap-min);
	transform: translateY(-50%);
}

.sp-footer__email:hover,
.sp-footer__email:focus-visible {
	opacity: 0.7;
}

.sp-footer__main {
	position: relative;
	flex: 1;
	width: 100%;
	min-height: var(--sp-footer-watermark-height);
	margin-top: var(--sp-footer-main-gap);
}

.sp-footer__watermark {
	position: absolute;
	top: 0;
	left: 50%;
	z-index: 1;
	width: min(100%, var(--sp-footer-watermark-render-width));
	height: var(--sp-footer-watermark-height);
	transform: translateX(-50%) translateY(var(--sp-footer-watermark-offset, 0));
	pointer-events: none;
	user-select: none;
}

.sp-footer__watermark--image {
	background: none;
}

.sp-footer__watermark-image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: center bottom;
}

.sp-footer__bottom {
	position: absolute;
	right: 0;
	bottom: var(--sp-footer-bottom-space);
	left: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: clamp(1rem, 2vw, 1.5rem);
	width: 100%;
}

.sp-footer__social,
.sp-footer__legal {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sp-footer__social-link,
.sp-footer__legal-link {
	position: relative;
	display: inline-block;
	transition: opacity 0.2s ease;
}

/* These sit in a single horizontal row, so the target can grow vertically to
   the full 44px without colliding with anything. */
.sp-footer__social-link::after,
.sp-footer__legal-link::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: 50%;
	height: var(--sp-tap-min);
	transform: translateY(-50%);
}

.sp-footer__social-link {
	font-family: var(--spaciefy-font-manrope);
	font-size: var(--sp-footer-social-size);
	font-weight: 500;
	line-height: var(--sp-footer-social-lh, 1.62);
	color: var(--spaciefy-white);
}

.sp-footer__legal-link {
	font-family: var(--spaciefy-font-helvetica);
	font-size: var(--sp-footer-legal-size);
	font-weight: 400;
	line-height: normal;
	color: var(--spaciefy-white);
	opacity: 0.5;
}

.sp-footer__social-link:hover,
.sp-footer__social-link:focus-visible,
.sp-footer__legal-link:hover,
.sp-footer__legal-link:focus-visible {
	opacity: 0.7;
}

.sp-footer__divider {
	margin: 0 clamp(0.375rem, 0.8vw, 0.5rem);
	font-size: var(--sp-footer-social-size);
	line-height: 1;
	color: rgba(255, 255, 255, 0.45);
}

.sp-footer__divider--muted {
	color: rgba(255, 255, 255, 0.35);
}

.sp-footer__social-item,
.sp-footer__legal-item {
	display: inline-flex;
	align-items: center;
}

.sp-footer__legal {
	justify-content: flex-end;
}

@media (max-width: 1440px) {
	:root {
		--sp-footer-main-gap: clamp(60px, calc(70 / 1440 * 100vw), 70px);
		--sp-footer-bottom-space: clamp(50px, calc(60 / 1440 * 100vw), 60px);
		--sp-footer-contact-gap-md: 16px;
		--sp-footer-contact-gap-sm: 14px;
	}
}

@media (max-width: 1366px) {
	:root {
		--sp-footer-main-gap: clamp(23px, calc(60 / 1366 * 100vw), 60px);
		--sp-footer-bottom-space: clamp(21px, calc(50 / 1366 * 100vw), 50px);
		--sp-footer-watermark-offset: -10px;
		--sp-footer-contact-gap-md: 14px;
		--sp-footer-contact-gap-sm: 12px;
	}
}

@media (max-width: 1280px) {
	:root {
		--sp-footer-contact-gap-md: 12px;
		--sp-footer-contact-gap-sm: 10px;
	}
}

/* Tablet — 992px to 769px */
@media (max-width: 992px) {
	:root {
		--sp-footer-contact-gap-md: 10px;
		--sp-footer-contact-gap-sm: 8px;
	}

	.sp-footer__top {
		column-gap: clamp(1rem, 3vw, var(--sp-section-gap));
	}

	.sp-footer__contact {
		min-width: 0;
	}

	.sp-footer__cta-label {
		white-space: normal;
	}
}

/* ---------------------------------------------------------------------------
 * Mobile — 768px and below.
 *
 * Desktop is a three-column top row above a full-bleed watermark, with the
 * social and legal rows overlaid on the watermark's baseline. Neither the
 * columns nor the overlay survive a phone width, so mobile rebuilds the same
 * reading order as one flow column — brand, navigation, contact, watermark,
 * closing legal row — and lets height follow content instead of the artboard.
 * ------------------------------------------------------------------------- */
@media (max-width: 768px) {
	.sp-footer {
		padding-bottom: clamp(24px, 7vw, 34px);
	}

	/*
	 * 729px is the desktop artboard height. Mobile content runs ~300px shorter
	 * than that, and the remainder rendered as dead black space below the legal
	 * links, so the floor is dropped and the column just ends where it ends.
	 */
	.sp-footer__inner {
		min-height: 0;
	}

	.sp-footer__top {
		grid-template-columns: 1fr;
		grid-template-areas:
			"logo"
			"nav"
			"contact";
		row-gap: clamp(22px, 6.5vw, 32px);
	}

	.sp-footer__logo {
		grid-area: logo;
		justify-self: start;
	}

	.sp-footer__nav {
		grid-area: nav;
		width: 100%;
	}

	/*
	 * Three short labels read as a group in a row, and the row saves the ~60px
	 * of height a stack costs — height the watermark below needs. Wrapping
	 * covers menus with more items than the three-link default.
	 */
	.sp-footer__nav-list {
		flex-flow: row wrap;
		align-items: center;
		column-gap: clamp(22px, 7vw, 36px);
		row-gap: 8px;
	}

	/* Row neighbours no longer share a vertical gap, so the hit area can claim
	   the full minimum target height without stealing adjacent taps. */
	.sp-footer__nav-link::after {
		height: var(--sp-tap-min);
	}

	.sp-footer__contact {
		grid-area: contact;
		align-items: flex-start;
		justify-self: start;
		gap: clamp(10px, 3vw, 14px);
		width: 100%;
		text-align: left;
	}

	/*
	 * The CTA is the footer's only real action, so it leads the contact block
	 * here rather than sitting under the copyright as it does on desktop. Order
	 * replaces the stacked margins, which would otherwise fall between the
	 * wrong pairs once the sequence changes.
	 */
	.sp-footer__cta {
		order: 1;
		margin-bottom: 0;
	}

	.sp-footer__email {
		order: 2;
		text-align: left;
	}

	.sp-footer__copyright {
		order: 3;
		margin: 0;
	}

	/*
	 * The watermark leaves absolute positioning: on desktop it is a backdrop
	 * the social row sits on top of, but at this width that overlap put the
	 * wordmark straight through the social links. It becomes a flow band the
	 * closing row follows instead, sized by its own ratio so it keeps the
	 * container gutter — the glyphs reach the edges of the asset itself, so a
	 * full-viewport bleed would leave them touching the screen.
	 */
	.sp-footer__main {
		display: flex;
		flex-direction: column;
		min-height: 0;
		margin-top: clamp(26px, 8vw, 40px);
	}

	.sp-footer__watermark {
		position: relative;
		top: auto;
		left: auto;
		height: auto;
		max-height: none;
		aspect-ratio: var(--sp-footer-watermark-ratio);
		transform: none;
	}

	/*
	 * Social and legal keep their desktop pairing — one row, split left and
	 * right — and wrap to two rows only when the labels genuinely stop fitting,
	 * below roughly 350px. The rule separates them from the watermark now that
	 * nothing overlaps.
	 *
	 * The row gap is flat rather than fluid because it is set by tap geometry,
	 * not by scale: the two lists' hit areas each reach 15px past their own text
	 * box, so anything under ~27px lets the legal row (later in the DOM, and so
	 * painted on top) swallow the bottom of the social row's target. The gap is
	 * only ever used in the wrapped case, so wider phones pay nothing for it.
	 */
	.sp-footer__bottom {
		position: relative;
		right: auto;
		bottom: auto;
		left: auto;
		flex-wrap: wrap;
		gap: 28px clamp(12px, 4vw, 24px);
		margin-top: clamp(18px, 5vw, 28px);
		padding-top: clamp(16px, 4.5vw, 24px);
		border-top: 1px solid rgba(255, 255, 255, 0.12);
	}
}
