// =====================================================================
// HOME PAGE — MANUAL LESS SOURCE
// Palette and spacing can be changed from this block.
// =====================================================================
@import "_variables.less";

@home-ink: #161a1d;
@home-ink-soft: #24292d;
@home-paper: #f1eee7;
@home-paper-light: #f8f6f1;
@home-copper: #d66a32;
@home-muted: #77736d;
@home-line: rgba(22, 26, 29, .16);
@home-space: clamp(6rem, 11vw, 10rem);

.display-type() {
	font-family: @font-display;
	font-weight: 500;
	letter-spacing: -.025em;
	text-transform: uppercase;
}

.cover(@position: center) {
	background-position: @position;
	background-repeat: no-repeat;
	background-size: cover;
}

.home {
	background: @home-paper;

	.con-home {
		overflow: clip;
		background: @home-paper;
		color: @home-ink;

		h1,
		h2,
		h3,
		p {
			margin: 0;
		}

		h1,
		h2,
		.scrub-scene__title {
			.display-type();
		}

		h2 {
			font-size: clamp(3.25rem, 7vw, 6.8rem);
			line-height: .92;

			em {
				color: @home-copper;
				font-style: normal;
			}
		}

		h1 span,
		.scrub-scene__title span {
			color: @home-copper;
			font-style: normal;
		}
	}

	.con-section {
		padding: @home-space 0;
	}

	.eyebrow {
		display: flex;
		align-items: center;
		gap: .75rem;
		color: @home-copper;
		font-size: .72rem;
		font-weight: 700;
		letter-spacing: .2em;
		text-transform: uppercase;

		&::before {
			width: 2.5rem;
			height: 1px;
			background: currentColor;
			content: "";
			flex: 0 0 auto;
		}

		&--dark {
			color: #8e451f;
		}
	}

	.con-button {
		display: inline-flex;
		align-items: center;
		justify-content: space-between;
		gap: 2.5rem;
		padding: 1rem 1.25rem;
		border: 1px solid currentColor;
		font-size: .75rem;
		font-weight: 700;
		letter-spacing: .14em;
		line-height: 1;
		text-transform: uppercase;
		transition: background .25s ease, border-color .25s ease, color .25s ease;

		span {
			font-size: 1.2rem;
		}

		&--light {
			color: #fff;
		}

		&:hover {
			border-color: @home-copper;
			background: @home-copper;
			color: #fff;
		}
	}

	a,
	summary {
		&:focus-visible {
			outline: 3px solid #f4a273;
			outline-offset: 4px;
		}
	}

	.text-link {
		display: inline-flex;
		gap: 1rem;
		padding-bottom: .45rem;
		border-bottom: 1px solid currentColor;
		font-size: .78rem;
		font-weight: 700;
		letter-spacing: .1em;
		text-transform: uppercase;
	}

	// -----------------------------------------------------------------
	// Video hero
	// -----------------------------------------------------------------
	.scrub-hero {
		position: relative;
		height: 500vh;
		background: #111619;

		&__sticky {
			position: sticky;
			top: 0;
			height: 100vh;
			min-height: 42rem;
			overflow: hidden;
			color: #fff;
		}

		&__poster,
		&__video,
		&__shade,
		&__grid {
			position: absolute;
			inset: 0;
			width: 100%;
			height: 100%;
		}

		&__poster {
			background-color: #151a1e;
			background-image: url("../construction-hero.png");
			.cover(center);
			transform: scale(1.03);
			animation: poster-breathe 12s ease-in-out infinite alternate;
		}

		&__video {
			z-index: 1;
			object-fit: cover;
		}

		&__shade {
			z-index: 2;
			background:
				linear-gradient(90deg, rgba(8, 11, 13, .94) 0%, rgba(8, 11, 13, .65) 42%, rgba(8, 11, 13, .16) 78%),
				linear-gradient(0deg, rgba(6, 8, 9, .65), transparent 45%);
		}

		&__grid {
			z-index: 3;
			opacity: .18;
			background-image:
				linear-gradient(rgba(255,255,255,.12) 1px, transparent 1px),
				linear-gradient(90deg, rgba(255,255,255,.1) 1px, transparent 1px);
			background-size: 80px 80px;
			mask-image: linear-gradient(90deg, #000, transparent 70%);
		}

		&__copy {
			position: relative;
			z-index: 4;
			display: grid;
			grid-template-rows: auto minmax(0, 1fr) auto;
			align-items: start;
			height: 100%;
			padding-top: clamp(7rem, 13vh, 9rem);
			padding-bottom: clamp(3rem, 7vh, 5rem);

			> .eyebrow {
				align-self: start;
			}

			> .con-button {
				align-self: end;
				justify-self: start;
			}
		}

		&__progress {
			position: absolute;
			z-index: 5;
			top: 50%;
			right: clamp(1.5rem, 4vw, 4.5rem);
			display: flex;
			flex-direction: column;
			align-items: center;
			gap: .75rem;
			height: clamp(10rem, 24vh, 14rem);
			font-size: .65rem;
			letter-spacing: .1em;
			transform: translateY(-50%);

			i {
				position: relative;
				flex: 1 1 auto;
				display: block;
				width: 2px;
				min-height: 0;
				overflow: hidden;
				background: rgba(255,255,255,.25);
			}

			b {
				position: absolute;
				top: 0;
				right: 0;
				left: 0;
				display: block;
				background: @home-copper;
				height: 0;
				box-shadow: 0 0 8px rgba(214,106,50,.7);
				will-change: height;
			}
		}

		&__scroll {
			position: absolute;
			z-index: 5;
			bottom: 2rem;
			left: 2rem;
			color: rgba(255,255,255,.6);
			font-size: .62rem;
			letter-spacing: .16em;
			text-transform: uppercase;
			writing-mode: vertical-rl;

			span {
				margin-top: .8rem;
				color: @home-copper;
			}
		}

		&.video-unavailable {
			.scrub-hero__video {
				display: none;
			}
		}
	}

	.scrub-scenes {
		position: relative;
		align-self: stretch;
		width: min(980px, calc(100vw - 9rem));
		min-height: 0;
	}

	.scrub-scene {
		position: absolute;
		inset: 0;
		display: flex;
		flex-direction: column;
		justify-content: center;
		opacity: 0;
		pointer-events: none;
		transform: translateY(2rem) scale(.985);
		transition: opacity .65s ease, transform .65s ease;

		h1,
		&__title {
			max-width: 100%;
			font-size: clamp(3.2rem, 7.2vw, 7.6rem);
			line-height: .86;
		}

		> p:last-child {
			max-width: 38rem;
			margin-top: clamp(1rem, 2.5vh, 2rem);
			color: rgba(255,255,255,.68);
			font-size: clamp(.85rem, 1.15vw, 1rem);
			line-height: 1.65;
		}

		&.is-active {
			opacity: 1;
			pointer-events: auto;
			transform: translateY(0) scale(1);
		}
	}

	// -----------------------------------------------------------------
	// Introduction and figures
	// -----------------------------------------------------------------
	.intro {
		background: @home-paper-light;

		&__grid {
			display: grid;
			grid-template-columns: 1.05fr .75fr;
			gap: 10vw;

			h2 {
				margin-top: 2rem;
			}
		}

		&__content {
			padding-top: 5rem;
			color: #64615c;
			font-size: .95rem;
			line-height: 1.85;

			.intro__lead {
				margin-bottom: 2rem;
				color: @home-ink;
				font-family: Georgia, serif;
				font-size: 1.45rem;
				line-height: 1.55;
			}

			.text-link {
				margin-top: 2.5rem;
				color: @home-ink;
			}
		}
	}

	.stats {
		display: grid;
		grid-template-columns: repeat(4, 1fr);
		margin-top: 8rem;
		border-top: 1px solid @home-line;
		border-bottom: 1px solid @home-line;

		> div {
			display: flex;
			flex-direction: column;
			justify-content: center;
			min-height: 11rem;
			padding: 2rem;
			border-right: 1px solid @home-line;

			&:last-child {
				border-right: 0;
			}

			> span {
				margin-top: .8rem;
				color: @home-muted;
				font-size: .68rem;
				letter-spacing: .13em;
				text-transform: uppercase;
			}
		}

		strong {
			font-family: @font-display;
			font-size: clamp(2.8rem, 5vw, 5rem);
			font-weight: 500;
			line-height: 1;
		}

		sup {
			color: @home-copper;
			font-size: .35em;
		}
	}

	// -----------------------------------------------------------------
	// Services
	// -----------------------------------------------------------------
	.section-heading {
		display: flex;
		align-items: flex-end;
		justify-content: space-between;
		gap: 4rem;
		margin-bottom: 5rem;

		h2 {
			margin-top: 2rem;
		}

		> p {
			max-width: 26rem;
			color: @home-muted;
			line-height: 1.8;
		}

		&--light {
			.text-link {
				border-color: rgba(255,255,255,.5);
			}
		}
	}

	.services {
		background: @home-ink;
		color: #fff;

		.section-heading > p {
			color: rgba(255,255,255,.5);
		}
	}

	.service-list {
		border-top: 1px solid rgba(255,255,255,.18);

		article {
			display: grid;
			grid-template-columns: 5rem 1fr auto;
			align-items: center;
			gap: 2rem;
			min-height: 14rem;
			border-bottom: 1px solid rgba(255,255,255,.18);
			transition: background .3s ease, padding .3s ease;

			&:hover {
				padding-right: 2rem;
				padding-left: 2rem;
				background: @home-ink-soft;
			}

			> span {
				align-self: start;
				padding-top: 2rem;
				color: @home-copper;
				font-size: .7rem;
			}

			> div {
				display: grid;
				grid-template-columns: 7rem 1fr 1fr;
				align-items: center;
				gap: 2rem;

				> p:last-child {
					color: rgba(255,255,255,.5);
					font-size: .9rem;
					line-height: 1.7;
				}
			}

			> a {
				font-size: 1.5rem;
			}
		}

		&__icon {
			color: @home-copper;
			font-family: Georgia, serif;
			font-size: 3.5rem;
			font-weight: 300;
			line-height: 1;
		}

		h3 {
			font-size: clamp(1.8rem, 3vw, 3.1rem);
			font-weight: 500;
			text-transform: uppercase;
		}
	}

	// -----------------------------------------------------------------
	// Projects
	// -----------------------------------------------------------------
	.projects {
		background: #252a2d;
		color: #fff;

		.sample-note {
			color: rgba(255,255,255,.38);
		}
	}

	.project-grid {
		display: grid;
		grid-template-columns: 1.5fr 1fr;
		gap: 2rem;
	}

	.project-card {
		min-width: 0;

		&__image {
			position: relative;
			overflow: hidden;
			aspect-ratio: 4 / 3;
			background-image: url("../construction-hero.png");
			filter: saturate(.7);
			.cover(center);
		}

		&__meta {
			display: flex;
			justify-content: space-between;
			padding: 1.2rem 0;
			border-bottom: 1px solid rgba(255,255,255,.18);

			span,
			strong {
				color: rgba(255,255,255,.45);
				font-size: .65rem;
				letter-spacing: .12em;
				text-transform: uppercase;
			}

			h3 {
				margin-top: .4rem;
				font-size: 1.35rem;
				font-weight: 500;
				text-transform: uppercase;
			}
		}

		&--main {
			grid-row: span 2;

			.project-card__image {
				height: calc(100% - 5rem);
				aspect-ratio: auto;
			}
		}

		&--alt .project-card__image {
			background-position: 70% 48%;
		}

		&--line .project-card__image {
			background-position: 82% 20%;
			filter: grayscale(.5) brightness(.72);
		}
	}

	.sample-note {
		margin-top: 1.5rem;
		color: @home-muted;
		font-size: .65rem;
	}

	// -----------------------------------------------------------------
	// Process
	// -----------------------------------------------------------------
	.process {
		background: @home-paper;

		&-list {
			display: flex;
			border-top: 1px solid @home-line;

			li {
				display: flex;
				flex-direction: column;
				justify-content: space-between;
				flex: 1 1 0;
				min-height: 22rem;
				padding: 2rem;
				border-right: 1px solid @home-line;
				transition:
					flex-grow .45s cubic-bezier(.22, 1, .36, 1),
					background-color .3s ease;

				&:hover {
					flex-grow: 1.45;
					background: @home-paper-light;
				}

				&:last-child {
					border-right: 0;
				}

				> span {
					color: @home-copper;
					font-size: .7rem;
				}
			}

			h3 {
				margin-bottom: 1.3rem;
				font-size: 1.6rem;
				line-height: 1.15;
				text-transform: uppercase;
			}

			p {
				color: @home-muted;
				font-size: .85rem;
				line-height: 1.7;
			}
		}
	}

	// -----------------------------------------------------------------
	// Values
	// -----------------------------------------------------------------
	.values {
		background: #1c2023;
		color: #fff;

		&__grid {
			display: grid;
			grid-template-columns: .9fr 1.1fr;
			align-items: stretch;
			gap: 8vw;
		}

		&__visual {
			display: flex;
			align-items: flex-end;
			min-height: 43rem;
			padding: 3rem;
			background-image:
				linear-gradient(160deg, transparent, rgba(214,106,50,.18)),
				url("../construction-hero.png");
			background-position: center, 74% center;
			background-repeat: no-repeat;
			background-size: cover, auto 100%;

			span {
				padding: 1rem;
				border: 1px solid rgba(255,255,255,.5);
				font-family: @font-display;
				font-size: 1.2rem;
				font-weight: 500;
				line-height: 1.05;
			}
		}

		&__content h2 {
			margin: 2rem 0 4rem;
			font-size: clamp(3rem, 5vw, 5.5rem);
		}
	}

	.value-items {
		border-top: 1px solid rgba(255,255,255,.15);

		> div {
			display: grid;
			grid-template-columns: 3rem 10rem 1fr;
			align-items: center;
			gap: 1rem;
			padding: 1.6rem 0;
			border-bottom: 1px solid rgba(255,255,255,.15);

			> span {
				color: @home-copper;
				font-size: 1.5rem;
			}
		}

		h3 {
			font-size: 1.1rem;
			text-transform: uppercase;
		}

		p {
			color: rgba(255,255,255,.5);
			font-size: .8rem;
			line-height: 1.6;
		}
	}

	// -----------------------------------------------------------------
	// Testimonial, FAQ and CTA
	// -----------------------------------------------------------------
	.testimonial {
		background: @home-paper-light;
		text-align: center;

		&__inner {
			max-width: 980px;

			> div {
				display: flex;
				align-items: center;
				justify-content: center;
				gap: 1rem;
				color: @home-muted;
				font-size: .75rem;
				line-height: 1.7;

				> span {
					width: 2.5rem;
					height: 2.5rem;
					border-radius: 50%;
					background: @home-copper;
				}
			}
		}

		.eyebrow {
			justify-content: center;
		}

		blockquote {
			margin: 3rem 0;
			font-family: Georgia, serif;
			font-size: clamp(2rem, 4vw, 4rem);
			font-weight: 400;
			line-height: 1.25;
		}

		strong {
			color: @home-ink;
			letter-spacing: .08em;
			text-transform: uppercase;
		}
	}

	.faq {
		background: linear-gradient(to bottom, @home-paper-light 0, @home-paper 8rem);

		&__grid {
			display: grid;
			grid-template-columns: .7fr 1.3fr;
			gap: 8vw;
		}

		&.is-reveal-ready {
			.faq__grid > div:first-child,
			.faq-list details {
				opacity: 0;
				transform: translateY(2rem);
				transition: opacity .95s ease, transform .95s cubic-bezier(.22, 1, .36, 1);
			}

			.faq-list details {
				&:nth-child(2) { transition-delay: .12s; }
				&:nth-child(3) { transition-delay: .24s; }
				&:nth-child(4) { transition-delay: .36s; }
			}

			&.is-visible {
				.faq__grid > div:first-child,
				.faq-list details {
					opacity: 1;
					transform: translateY(0);
				}
			}
		}

		h2 {
			margin-top: 2rem;
			font-size: clamp(3rem, 5vw, 5.5rem);
		}

		&-list {
			border-top: 1px solid @home-line;
		}

		details {
			border-bottom: 1px solid @home-line;

			&[open] summary span {
				transform: rotate(45deg);
			}

			p {
				max-width: 38rem;
				padding: 0 3rem 1.8rem 0;
				color: @home-muted;
				font-size: .88rem;
				line-height: 1.75;
			}
		}

		summary {
			display: flex;
			justify-content: space-between;
			gap: 1rem;
			padding: 1.8rem 0;
			font-family: @font-display;
			font-size: 1.15rem;
			font-weight: 500;
			list-style: none;
			text-transform: uppercase;
			cursor: pointer;

			&::-webkit-details-marker {
				display: none;
			}

			span {
				color: @home-copper;
				transition: transform .2s ease;
			}
		}
	}

	.contact-cta {
		position: relative;
		padding: clamp(7rem, 13vw, 13rem) 0;
		color: #fff;
		background-image:
			linear-gradient(90deg, rgba(8,11,13,.95), rgba(8,11,13,.5)),
			url("../construction-hero.png");
		.cover(center);

		h2 {
			max-width: 900px;
			margin: 2rem 0 3rem;
			font-size: clamp(4rem, 9vw, 9rem);
		}

		.sample-note {
			max-width: 35rem;
			color: rgba(255,255,255,.45);
		}
	}

	// -----------------------------------------------------------------
	// Tablet
	// -----------------------------------------------------------------
	@media (max-width: 900px) {
		.scrub-hero {
			height: 420vh;

			&__copy {
				padding-top: 7rem;
			}

			&__progress {
				right: max(1rem, env(safe-area-inset-right));
				height: clamp(9rem, 22vh, 12rem);
			}
		}

		.scrub-scenes {
			width: calc(100vw - 5rem);
		}

		.intro__grid,
		.values__grid,
		.faq__grid {
			grid-template-columns: 1fr;
		}

		.intro__content {
			padding-top: 0;
		}

		.stats {
			grid-template-columns: repeat(2, 1fr);

			> div {
				&:nth-child(2) {
					border-right: 0;
				}

				&:nth-child(-n+2) {
					border-bottom: 1px solid @home-line;
				}
			}
		}

		.service-list article > div {
			grid-template-columns: 5rem 1fr;

			> p:last-child {
				grid-column: 2;
			}
		}

		.process-list {
			display: grid;
			grid-template-columns: repeat(2, 1fr);

			li {
				&:nth-child(2) {
					border-right: 0;
				}

				&:nth-child(-n+2) {
					border-bottom: 1px solid @home-line;
				}
			}
		}
	}

	// -----------------------------------------------------------------
	// Mobile
	// -----------------------------------------------------------------
	@media (max-width: 640px) {
		.con-home {
			h2 {
				font-size: clamp(2.65rem, 13vw, 3.6rem);
				line-height: .94;
			}
		}

		.con-section {
			padding: 4.25rem 0;
		}

		.scrub-hero {
			height: 300vh;

			&__sticky {
				height: calc(100svh - 5rem);
				min-height: 34rem;
			}

			&__copy {
				grid-template-rows: auto minmax(0, 1fr) auto;
				padding: 3rem 2.25rem 1.5rem 1.125rem;
			}

			&__progress {
				top: 52%;
				right: max(.65rem, env(safe-area-inset-right));
				gap: .45rem;
				height: clamp(7.5rem, 24vh, 10rem);
				padding: .45rem .35rem;
				font-size: .55rem;
				background: rgba(8,11,13,.28);
				border-radius: 999px;
				backdrop-filter: blur(3px);
			}

			&__scroll {
				display: none;
			}
		}

		.scrub-scenes {
			width: 100%;
		}

		.scrub-scene {
			h1,
			&__title {
				font-size: clamp(2.65rem, 13vw, 4rem);
				line-height: .92;
			}

			> p:last-child {
				max-width: calc(100% - 1rem);
				font-size: .86rem;
				line-height: 1.6;
			}
		}

		.section-heading {
			flex-direction: column;
			align-items: flex-start;
			gap: 1.5rem;
			margin-bottom: 2.5rem;

			h2 {
				margin-top: 1.25rem;
			}

			> p {
				font-size: .9rem;
				line-height: 1.65;
			}
		}

		.stats {
			margin-top: 3rem;

			> div {
				min-height: 8rem;
				padding: 1.1rem .75rem;

				strong {
					font-size: 2.5rem;
				}
			}
		}

		.intro__content {
			font-size: .9rem;
			line-height: 1.75;

			.intro__lead {
				margin-bottom: 1.5rem;
				font-size: 1.2rem;
				line-height: 1.5;
			}
		}

		.service-list {
			article {
				grid-template-columns: 1.5rem minmax(0, 1fr) 1.25rem;
				gap: .75rem;
				min-height: 0;
				padding: 1.75rem 0;

				&:hover {
					padding: 1.75rem 0;
				}

				> div {
					grid-template-columns: 1fr;
					gap: 1rem;

					> p:last-child {
						grid-column: auto;
						font-size: .82rem;
						line-height: 1.6;
					}
				}
			}

			&__icon {
				display: none;
			}

			h3 {
				font-size: 1.65rem;
				line-height: 1.05;
			}
		}

		.project-grid,
		.process-list {
			display: grid;
			grid-template-columns: 1fr;
		}

		.project-grid {
			gap: 2.5rem;
		}

		.project-card__meta {
			padding: 1rem 0;

			h3 {
				font-size: 1.2rem;
			}
		}

		.project-card--main {
			grid-row: auto;

			.project-card__image {
				height: auto;
				aspect-ratio: 4 / 3;
			}
		}

		.process-list li {
			min-height: 12rem;
			padding: 1.5rem 0;
			border-right: 0;
			border-bottom: 1px solid @home-line;
		}

		.values__visual {
			min-height: 21rem;
			padding: 1.25rem;
			background-size: cover;
		}

		.values__grid {
			gap: 3rem;
		}

		.values__content h2 {
			margin: 1.25rem 0 2.5rem;
		}

		.value-items {
			> div {
				grid-template-columns: 2.5rem 1fr;
				padding: 1.35rem 0;
			}

			p {
				grid-column: 2;
			}
		}

		.testimonial {
			blockquote {
				margin: 2rem 0;
				font-size: 1.75rem;
				line-height: 1.3;
			}

			&__inner > div {
				align-items: flex-start;
				text-align: left;
			}
		}

		.faq {
			&__grid {
				gap: 2.5rem;
			}

			h2 {
				margin-top: 1.25rem;
			}

			summary {
				padding: 1.4rem 0;
				font-size: 1rem;
				line-height: 1.35;
			}

			details p {
				padding: 0 1rem 1.4rem 0;
			}
		}

		.contact-cta {
			padding: 5rem 0;
			background-position: 62% center;

			h2 {
				margin: 1.5rem 0 2rem;
				font-size: clamp(3rem, 14vw, 4.3rem);
			}
		}

		.con-button {
			width: 100%;
			gap: 1rem;
		}
	}

	@media (prefers-reduced-motion: reduce) {
		.faq.is-reveal-ready {
			.faq__grid > div:first-child,
			.faq-list details {
				opacity: 1;
				transform: none;
				transition: none;
			}
		}

		.scrub-hero {
			height: 100vh;

			&__poster {
				animation: none;
			}
		}

		.scrub-scene {
			display: none;
			transition: none;

			&:first-child {
				display: flex;
				opacity: 1;
				transform: none;
			}
		}
	}
}

@keyframes poster-breathe {
	to {
		filter: brightness(1.08);
		transform: scale(1.08);
	}
}
