/**
 * Home page sections (patterns/home/, patterns/shared/) and the footer (patterns/parts/footer.php).
 *
 * Direction: the place carries it. The studio's own rooms shown large,
 * on warm paper, with walnut text, tan fields and one walnut close.
 * Five type steps, 8px corners on pictures and tiles, pill buttons,
 * no rules and no shadows.
 */

:root {
	--g: var(--wp--custom--gutter, clamp(1rem, 5vw, 5rem));
	--gap: clamp(0.75rem, 1.4vw, 1.25rem);
	--sec: clamp(5rem, 9vw, 9rem);
	--r: 8px;
	--ease: cubic-bezier(0.2, 0.7, 0.2, 1);

	--paper: var(--wp--preset--color--base);
	--sand: var(--wp--preset--color--surface);
	--tan: var(--wp--preset--color--surface-2);
	--walnut: var(--wp--preset--color--contrast);
	--soft: var(--wp--preset--color--muted);
	--bone: var(--wp--preset--color--bone, #efeeeb);
	--ink-on-tan: #1c150d;

	/* The five sizes the page uses. */
	--s-sm: 0.875rem;
	--s-body: var(--wp--preset--font-size--medium, 1.125rem);
	--s-lead: clamp(1.375rem, 1.1rem + 0.9vw, 2rem);
	--s-head: clamp(2.5rem, 1.6rem + 3vw, 4.25rem);
	--s-disp: clamp(3.5rem, 1rem + 8.4vw, 9.5rem);
}

/* Reset flow-layout gaps inside the home sections; spacing is set below. */
.itw-home > .wp-block-post-content > *,
.itw-home :is(.h-hero, .h-sec, .h-quote, .h-stats, .h-cta) *,
.site-footer * {
	margin-block: 0;
}

.itw-home figure {
	margin: 0;
}

.itw-home :is(.h-hero, .h-sec, .h-quote, .h-stats, .h-cta) img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: var(--r);
}

.itw-home :is(.h-sec, .h-cta) ul,
.itw-home .h-row {
	list-style: none;
	padding: 0;
}

.itw-home :is(.h-sec, .h-stats, .h-cta) a:not(.wp-element-button),
.site-footer a:not(.wp-element-button) {
	color: inherit;
	text-underline-offset: 0.2em;
	text-decoration-thickness: 1px;
	transition: color var(--wp--custom--transition), opacity var(--wp--custom--transition);
}

.itw-home :is(.h-sec, .h-stats) a:not(.wp-element-button):hover {
	color: var(--soft);
}

.h-sec {
	padding: var(--sec) var(--g);
	font-size: var(--s-body);
}

.h-sec :where(h2, h3) {
	text-wrap: balance;
}

/* Headings take the colour of the field they sit on. */
.itw-home :is(.h-work, .h-quote, .h-stats, .h-cta, .h-m--com, .h-m--res, .h-m--fig, .h-m--fur) :is(h2, h3) {
	color: inherit;
}

.h-card .h-card__title {
	color: var(--walnut);
}

/* ---------------------------------------------------------------------
 * Header on paper.
 * ------------------------------------------------------------------ */

.site-header {
	padding: 0.9rem var(--g);
}

.site-header .wp-block-navigation {
	font-size: 1rem;
}

.site-header__cta .wp-block-button__link {
	padding: 0.65rem 1.2rem;
	font-size: 1rem;
}

@media (max-width: 600px) {
	.site-header .site-header__cta {
		display: none;
	}
}

/* ---------------------------------------------------------------------
 * Hero: one line, a room standing in for a word.
 * ------------------------------------------------------------------ */

.h-hero {
	display: flex;
	flex-direction: column;
	min-height: calc(100svh - 4.5rem);
	padding: clamp(1.5rem, 3vw, 2.5rem) var(--g) clamp(2rem, 3.5vw, 3rem);
}

.h-hero__line {
	display: flex;
	align-items: center;
	margin-block: auto !important;
	padding-block: clamp(3rem, 8vh, 6rem);
	gap: clamp(0.75rem, 1.6vw, 1.75rem);
}

.h-hero__title {
	display: contents;
}

.h-hero__w1,
.h-hero__w2 {
	flex: none;
	font-size: var(--s-disp);
	font-weight: 300;
	line-height: 1;
	letter-spacing: -0.035em;
	white-space: nowrap;
}

.h-hero__w1 {
	order: 1;
}

.h-hero__strip {
	order: 2;
	flex: 1 1 0;
	min-width: 0;
	height: calc(var(--s-disp) * 0.82);
	overflow: hidden;
	border-radius: var(--r);
}

.h-hero__strip img {
	object-position: 50% 62%;
}

.h-hero__w2 {
	order: 3;
}

.h-hero__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1.25rem 3rem;
}

.h-hero__lead {
	max-width: 30ch;
	color: var(--soft);
	font-size: var(--s-body);
	line-height: 1.5;
}

.h-hero__actions {
	gap: 0.75rem 1.75rem;
}

/* ---------------------------------------------------------------------
 * One team: heading, four promises, a room full width.
 * ------------------------------------------------------------------ */

.h-intro {
	padding-top: 0;
	padding-bottom: 0;
}

.h-intro__head {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	column-gap: var(--gap);
	row-gap: 2rem;
	align-items: end;
	padding-block: clamp(3rem, 7vw, 7rem) clamp(2.5rem, 5vw, 4.5rem);
}

.h-intro__title {
	grid-column: 1 / 6;
	max-width: 9em;
	font-size: var(--s-head);
	line-height: 1.02;
}

.h-intro__list {
	grid-column: 8 / 13;
	display: grid;
	gap: 0.6rem;
}

.h-intro__list p {
	color: var(--soft);
	font-size: var(--s-body);
	line-height: 1.4;
}

.h-intro__pano {
	margin-inline: calc(-1 * var(--g)) !important;
	overflow: hidden;
}

.h-intro__pano img {
	aspect-ratio: 21 / 9;
	border-radius: 0 !important;
	object-position: 50% 60%;
	transform: translateY(var(--drift, 0)) scale(1.08);
}

/* ---------------------------------------------------------------------
 * Rooms: an uneven wall on a tan field.
 * ------------------------------------------------------------------ */

.h-work {
	background: var(--tan);
	color: var(--ink-on-tan);
}

.h-work__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
}

.h-work__title {
	font-size: var(--s-head);
	line-height: 0.95;
}

.h-work__all {
	font-size: 1rem;
}

/* ---------------------------------------------------------------------
 * Services: a mosaic of unlike tiles.
 * ------------------------------------------------------------------ */

.h-mosaic {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	grid-auto-rows: clamp(72px, 7vw, 104px);
	gap: 0.75rem;
}

.h-m {
	padding: clamp(1.25rem, 2.4vw, 2.25rem);
	border-radius: var(--r);
	overflow: hidden;
}

figure.h-m {
	padding: 0;
}

.h-m h3 {
	font-size: var(--s-lead);
	font-weight: 400;
	line-height: 1.15;
}

.h-m h3 a {
	text-decoration: none;
}

.h-m h3 a::after {
	content: " →";
	display: inline-block;
	transition: transform var(--wp--custom--transition);
}

.h-m h3 a:hover::after {
	transform: translateX(4px);
}

.h-m p,
.h-m li {
	font-size: 1rem;
	line-height: 1.45;
}

.h-m h3 + * {
	margin-top: 0.75rem !important;
	opacity: 0.85;
}

.h-m--head {
	grid-column: 1 / 7;
	grid-row: 1 / 4;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	background: var(--sand);
}

.h-services__title {
	font-size: var(--s-head);
	line-height: 1;
}

.h-m--head p {
	max-width: 44ch;
	font-size: var(--s-body);
}

.h-m--photo {
	grid-column: 7 / 13;
	grid-row: 1 / 6;
}

.h-m--res {
	grid-column: 1 / 4;
	grid-row: 4 / 7;
	background: var(--tan);
	color: var(--ink-on-tan);
}

.h-m--com {
	grid-column: 4 / 7;
	grid-row: 4 / 7;
	background: var(--walnut);
	color: var(--bone);
}

.h-m--com a:hover {
	color: var(--tan) !important;
}

.h-m--ren {
	grid-column: 7 / 10;
	grid-row: 6 / 9;
	background: var(--sand);
}

.h-m--ren li {
	font-size: var(--s-body);
	line-height: 1.4;
}

.h-m--fig {
	grid-column: 10 / 13;
	grid-row: 6 / 9;
	background: var(--tan);
	color: var(--ink-on-tan);
}

.h-m__figure {
	font-size: var(--s-head) !important;
	font-weight: 300;
	line-height: 0.9 !important;
	letter-spacing: -0.03em;
}

.h-m--fig .h-m__figure + p {
	margin-top: 0.75rem !important;
	max-width: 22ch;
}

.h-m--photo2 {
	grid-column: 1 / 4;
	grid-row: 7 / 9;
}

.h-m--fur {
	grid-column: 4 / 7;
	grid-row: 7 / 9;
	background: var(--tan);
	color: var(--ink-on-tan);
}

/* ---------------------------------------------------------------------
 * Process: a row of moments that scrolls sideways.
 * ------------------------------------------------------------------ */

.h-process {
	background: var(--sand);
	padding-inline: 0;
}

.h-process__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1rem 2rem;
	padding-inline: var(--g);
}

.h-process__title {
	font-size: var(--s-head);
	line-height: 1;
	margin-right: auto !important;
}

.h-process__more {
	font-size: 1rem;
}

.h-nav {
	display: flex;
	gap: 0.5rem;
}

.h-nav button {
	width: 48px;
	height: 48px;
	border: 0;
	border-radius: 999px;
	background: var(--walnut);
	color: var(--paper);
	font: inherit;
	font-size: 1.25rem;
	line-height: 1;
	cursor: pointer;
	transition: background-color var(--wp--custom--transition), color var(--wp--custom--transition), transform 160ms var(--ease);
}

.h-nav button:hover {
	background: var(--tan);
	color: var(--walnut);
}

.h-nav button:active {
	transform: scale(0.96);
}

.h-progress {
	height: 6px;
	margin: 2rem var(--g) 2.5rem !important;
	border-radius: 999px;
	background: rgb(43 34 22 / 0.12);
	overflow: hidden;
}

.h-progress span {
	display: block;
	height: 100%;
	border-radius: inherit;
	background: var(--walnut);
	transform-origin: left;
	transform: scaleX(var(--p, 0.15));
	transition: transform 200ms linear;
}

.h-row {
	display: flex;
	gap: clamp(1.25rem, 2.5vw, 2.5rem);
	margin: 0 !important;
	padding: 0 var(--g) 0.5rem !important;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-padding-inline: var(--g);
	scrollbar-width: none;
}

.h-row::-webkit-scrollbar {
	display: none;
}

.h-row li {
	flex: 0 0 clamp(240px, 22vw, 320px);
	display: flex;
	flex-direction: column;
	scroll-snap-align: start;
}

.h-row strong {
	font-size: var(--s-body);
	font-weight: 500;
	line-height: 1.3;
}

.h-row span {
	margin-top: 0.4rem;
	color: var(--soft);
	font-size: 1rem;
	line-height: 1.45;
}

.h-row li > img {
	height: auto !important;
	aspect-ratio: 4 / 5;
	margin-top: 1.25rem;
}

/* Varying space above the pictures so their tops rise and fall. */
.h-row li:nth-child(3n + 2) > img { margin-top: 3.5rem; }
.h-row li:nth-child(3n) > img { margin-top: 2.25rem; }

/* ---------------------------------------------------------------------
 * Testimonial: a quotation on a room.
 * ------------------------------------------------------------------ */

.h-quote {
	position: relative;
	display: grid;
	align-items: end;
	min-height: clamp(26rem, 72svh, 46rem);
	padding: 0 var(--g) clamp(2rem, 4.5vw, 4rem);
	color: var(--paper);
	isolation: isolate;
}

.h-quote__photo {
	position: absolute;
	inset: 0;
	z-index: -1;
}

.h-quote__photo img {
	border-radius: 0 !important;
	filter: brightness(0.62);
}

.h-quote__text {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	column-gap: var(--gap);
	align-items: end;
	margin: 0 !important;
	padding: 0;
	border: 0;
}

.h-quote__text p {
	grid-column: 1 / 9;
	max-width: 24ch;
	font-size: var(--s-lead);
	font-weight: 300;
	line-height: 1.22;
}

.h-quote__text cite {
	grid-column: 10 / 13;
	font-size: 1rem;
	font-style: normal;
	text-align: right;
}

/* ---------------------------------------------------------------------
 * Figures: the number on the photograph's edge.
 * ------------------------------------------------------------------ */

.h-stats {
	padding: var(--sec) var(--g) 0;
}

.h-stats__say {
	opacity: 0.9;
}

.h-stats__frame {
	position: relative;
	display: grid;
	grid-template-columns: 1fr auto;
	grid-template-rows: auto 1fr auto;
	min-height: clamp(24rem, 66svh, 42rem);
	padding: clamp(1.25rem, 2.5vw, 2rem);
	border-radius: var(--r);
	overflow: hidden;
	color: var(--paper);
	isolation: isolate;
}

.h-stats__photo {
	position: absolute;
	inset: 0;
	z-index: -1;
}

.h-stats__photo img {
	border-radius: 0 !important;
}

/* Neutral scrims under the heading and the figure only. */
.h-stats__photo::before,
.h-stats__photo::after {
	content: "";
	position: absolute;
	inset-inline: 0;
}

.h-stats__photo::before {
	top: 0;
	height: 30%;
	background: linear-gradient(0deg, rgb(0 0 0 / 0), rgb(0 0 0 / 0.4)); /* taste-skill-ignore: neutral scrim over a photograph */
}

.h-stats__photo::after {
	bottom: 0;
	height: 50%;
	background: linear-gradient(180deg, rgb(0 0 0 / 0), rgb(0 0 0 / 0.6)); /* taste-skill-ignore: neutral scrim over a photograph */
}

.h-stats__title {
	grid-column: 1 / -1;
	grid-row: 1;
	font-size: var(--s-lead);
	font-weight: 400;
}

.h-stats__big {
	grid-column: 1;
	grid-row: 3;
	font-size: var(--s-disp);
	font-weight: 300;
	line-height: 0.78;
	letter-spacing: -0.04em;
}

.h-stats__say {
	grid-column: 2;
	grid-row: 3;
	align-self: end;
	max-width: 26ch;
	font-size: var(--s-body);
	line-height: 1.4;
	text-align: right;
}


/* ---------------------------------------------------------------------
 * Latest articles: a room left, the list right.
 * ------------------------------------------------------------------ */

.h-journal {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	column-gap: var(--gap);
	align-items: stretch;
}

.h-journal__photo {
	grid-column: 1 / 6;
	min-height: 22rem;
}

.h-journal__body {
	grid-column: 7 / 13;
	display: flex;
	flex-direction: column;
	padding-block: 0.5rem;
}

.h-journal__title {
	font-size: var(--s-head);
	line-height: 1.04;
	margin-bottom: clamp(2rem, 4vw, 3.5rem) !important;
}

.h-journal__rows {
	padding: 0;
}

.h-journal__rows > li {
	display: grid;
	grid-template-columns: 7.5rem minmax(0, 1fr);
	column-gap: 1.25rem;
	align-items: baseline;
	padding-block: 1rem;
}

.h-journal__rows .wp-block-post-date {
	color: var(--soft);
	font-size: 1rem;
}

.h-journal__rows .wp-block-post-title {
	font-size: var(--s-lead);
	font-weight: 300;
	line-height: 1.2;
	letter-spacing: 0;
}

.h-journal__rows .wp-block-post-title a {
	text-decoration: none;
}

.h-journal__rows .wp-block-post-title a::after {
	content: " →";
}

.h-journal__all {
	margin-top: auto !important;
	padding-top: 1.5rem;
	font-size: 1rem;
}

/* ---------------------------------------------------------------------
 * Reply card on a walnut field.
 * ------------------------------------------------------------------ */

.h-cta {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	column-gap: var(--gap);
	align-items: end;
	overflow: hidden;
	padding: clamp(4.5rem, 8vw, 7rem) var(--g) 0;
	background: var(--walnut);
	color: var(--bone);
}

.h-cta__aside {
	grid-column: 1 / 6;
	align-self: end;
	padding-bottom: clamp(2.5rem, 5vw, 4rem);
	font-size: var(--s-lead);
	font-weight: 300;
	line-height: 1.3;
}

.h-card {
	grid-column: 7 / 12;
	display: grid;
	justify-items: center;
	gap: 1.25rem;
	margin-bottom: -2.5rem !important;
	padding: clamp(2rem, 3.5vw, 3rem) clamp(1.5rem, 3vw, 3rem) clamp(4rem, 6vw, 5rem);
	border-radius: var(--r);
	background: var(--paper);
	color: var(--walnut);
	text-align: center;
	transform: rotate(-2deg);
	transform-origin: 50% 100%;
	transition: transform 500ms var(--ease);
}

.h-card:hover {
	transform: rotate(-1deg) translateY(-4px);
}

.h-card__title {
	font-size: var(--s-lead);
	font-weight: 400;
}

.h-card p {
	max-width: 36ch;
	font-size: 1rem;
	line-height: 1.5;
}

.h-card__actions {
	width: 100%;
	margin-top: 0.5rem !important;
}

.h-card__actions .wp-block-button__link {
	min-height: 56px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.h-card__alt a {
	color: var(--walnut);
}

/* ---------------------------------------------------------------------
 * Footer: the address is the headline, on a tan field.
 * ------------------------------------------------------------------ */

.site-footer {
	display: flex;
	flex-direction: column;
	gap: clamp(2.5rem, 6vw, 5rem);
	padding: clamp(2.5rem, 4vw, 3.5rem) var(--g) 1.5rem;
	background: var(--tan);
	color: var(--ink-on-tan);
}

.site-footer__top {
	display: grid;
	grid-template-columns: 1fr 2fr 1fr;
	gap: 1.5rem var(--gap);
	font-size: 1rem;
	line-height: 1.5;
}

.site-footer__top .wp-block-site-title a {
	color: inherit;
}

.site-footer__up {
	text-align: right;
}

.site-footer__mail {
	font-size: var(--s-disp);
	font-weight: 300;
	line-height: 0.95;
	letter-spacing: -0.035em;
}

.site-footer__mail a {
	text-decoration: none;
}

.site-footer__mail a:hover {
	opacity: 0.7;
}

.site-footer__meta {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0.75rem 2rem;
	font-size: var(--s-sm);
}

.site-footer__meta p:first-child {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1.25rem;
}

/* ---------------------------------------------------------------------
 * Tablet.
 * ------------------------------------------------------------------ */

@media (max-width: 1024px) {
	.h-intro__title,
	.h-intro__list {
		grid-column: 1 / -1;
	}

	.h-mosaic {
		grid-auto-rows: clamp(64px, 9vw, 96px);
	}

	.h-journal__body {
		grid-column: 6 / 13;
	}

	.site-footer__top {
		grid-template-columns: 1fr 1fr;
	}

	.site-footer__up {
		text-align: left;
	}
}

/* ---------------------------------------------------------------------
 * Phone.
 * ------------------------------------------------------------------ */

@media (max-width: 781px) {
	.h-hero__line {
		flex-wrap: wrap;
		gap: 0.75rem;
	}

	.h-hero__w1,
	.h-hero__w2 {
		font-size: clamp(3.5rem, 19vw, 5rem);
	}

	.h-hero__strip {
		flex: 1 1 100%;
		height: auto;
		aspect-ratio: 2 / 1;
	}

	.h-hero__w2 {
		width: 100%;
		text-align: right;
	}

	.h-hero__line {
		padding-block: 2rem;
	}

	.h-hero__foot {
		flex-direction: column;
		align-items: flex-start;
	}

	.h-hero__actions {
		order: -1;
	}

	.h-intro__list {
		grid-template-columns: 1fr;
	}

	.h-intro__pano img {
		aspect-ratio: 4 / 3;
	}

	.h-mosaic {
		grid-template-columns: 1fr 1fr;
		grid-auto-rows: auto;
		gap: 0.375rem;
	}

	.h-mosaic > * {
		grid-column: 1 / -1 !important;
		grid-row: auto !important;
	}

	.h-mosaic > .h-m--ren,
	.h-mosaic > .h-m--fig {
		grid-column: auto !important;
		min-height: 11rem;
	}

	/* Phone order: words and pictures alternate; the figure pair sits after a photograph. */
	.h-m--photo2 { order: 1; }
	.h-m--ren,
	.h-m--fig { order: 2; }
	.h-m--fur { order: 3; }

	.h-m--photo img,
	.h-m--photo2 img {
		aspect-ratio: 16 / 10;
	}

	.h-m--head {
		gap: 1rem;
	}

	.h-m--ren li {
		font-size: 1rem;
	}

	.h-row li {
		flex-basis: 72vw;
	}

	.h-row li:nth-child(3n + 2) > img { margin-top: 2rem; }
	.h-row li:nth-child(3n) > img { margin-top: 1.5rem; }

	.h-nav {
		display: none;
	}

	.h-quote__text {
		display: block;
	}

	.h-quote__text p {
		font-size: 1.5rem;
	}

	.h-quote__text cite {
		display: block;
		margin-top: 1rem !important;
		text-align: left;
	}

	.h-stats__frame {
		grid-template-columns: 1fr;
		grid-template-rows: auto 1fr auto auto;
		min-height: 80svh;
	}

	.h-stats__big {
		grid-row: 3;
	}

	.h-stats__say {
		grid-column: 1;
		grid-row: 4;
		text-align: left;
		margin-top: 1rem !important;
	}

	.h-journal {
		display: flex;
		flex-direction: column-reverse;
		gap: 2rem;
	}

	.h-journal__photo {
		min-height: 0;
	}

	.h-journal__photo img {
		aspect-ratio: 4 / 3;
	}

	.h-journal__rows > li {
		grid-template-columns: 1fr;
	}

	.h-cta {
		display: block;
	}

	.h-cta__aside {
		padding-bottom: 2rem;
	}

	.h-card {
		width: 92%;
		margin-inline: auto;
		transform: rotate(-1deg);
	}

	.site-footer__top {
		grid-template-columns: 1fr;
	}

	.site-footer__mail {
		font-size: 12.5vw;
	}

	.site-footer__meta {
		flex-direction: column;
	}
}

/* ---------------------------------------------------------------------
 * Motion: entrances (added by theme.js) and the hero shutter.
 * ------------------------------------------------------------------ */

.rv {
	opacity: 0;
	transform: translateY(20px);
	transition: opacity 800ms var(--ease), transform 800ms var(--ease);
	transition-delay: var(--rv-delay, 0ms);
}

.rv.is-in {
	opacity: 1;
	transform: none;
}

.h-hero.is-live .h-hero__strip {
	animation: h-shutter 1.1s var(--ease) 0.15s both;
}

.h-hero.is-live .h-hero__strip img {
	animation: h-settle 1.6s var(--ease) 0.15s both;
}

@keyframes h-shutter {
	from { clip-path: inset(0 100% 0 0 round var(--r)); }
	to { clip-path: inset(0 0 0 0 round var(--r)); }
}

@keyframes h-settle {
	from { transform: scale(1.12); }
	to { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
	.rv {
		transform: none;
		transition: opacity 400ms linear;
	}

	.h-hero.is-live .h-hero__strip,
	.h-hero.is-live .h-hero__strip img {
		animation: none;
	}

	.h-intro__pano img {
		transform: none;
	}

}
