/* Sunny Morgan. Every page. Colors, type, spacing and motion are theme.json's. Only what JavaScript measures is set here. */

:root {
	--nav-h: 88px;
	--plus: linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat, linear-gradient(currentColor, currentColor) center / 2px 100% no-repeat; /* the accordions' plus */
}

/* Topics: --topic is the service color, --topic-fg the text that passes AA on it. */
.t-design         { --topic: var(--wp--preset--color--design);         --topic-fg: var(--wp--preset--color--ink); }
.t-development      { --topic: var(--wp--preset--color--development); --topic-fg: var(--wp--preset--color--ink); }
.t-seo              { --topic: var(--wp--preset--color--seo); --topic-fg: var(--wp--preset--color--ink); }
.t-accessibility    { --topic: var(--wp--preset--color--accessibility); --topic-fg: var(--wp--preset--color--ink); }
.t-performance      { --topic: var(--wp--preset--color--performance); --topic-fg: var(--wp--preset--color--ink); }
.t-hosting          { --topic: var(--wp--preset--color--hosting); --topic-fg: var(--wp--preset--color--ink); }
.t-support          { --topic: var(--wp--preset--color--support); --topic-fg: var(--wp--preset--color--white); }
.t-navy { --topic: var(--wp--preset--color--navy); --topic-fg: var(--wp--preset--color--white); } /* Tour Talbot's: a client color, not a layer */

/* Pantone codes per layer. Markup shows them with data-pantone (short) or data-pantone="long"; JS reads --pantone. */
.t-design, [data-theme="design"] { --pantone: "Paper"; --pantone-label: "Paper white"; }
.t-development, [data-theme="development"] { --pantone: var(--wp--custom--pantone--development); --pantone-label: "Pantone " var(--wp--custom--pantone--development); }
.t-seo, [data-theme="seo"] { --pantone: var(--wp--custom--pantone--seo); --pantone-label: "Pantone " var(--wp--custom--pantone--seo); }
.t-accessibility, [data-theme="accessibility"] { --pantone: var(--wp--custom--pantone--accessibility); --pantone-label: "Pantone " var(--wp--custom--pantone--accessibility); }
.t-performance, [data-theme="performance"] { --pantone: var(--wp--custom--pantone--performance); --pantone-label: "Pantone " var(--wp--custom--pantone--performance); }
.t-hosting, [data-theme="hosting"] { --pantone: var(--wp--custom--pantone--hosting); --pantone-label: "Pantone " var(--wp--custom--pantone--hosting); }
.t-support, [data-theme="support"] { --pantone: var(--wp--custom--pantone--support); --pantone-label: "Pantone " var(--wp--custom--pantone--support); }
[data-theme="blue"] { --pantone: "Sunny blue"; --pantone-label: "Sunny blue"; }
[data-pantone]::before { content: var(--pantone); }
[data-pantone="long"]::before { content: var(--pantone-label); }

/* Fields: one color each, with the text color that passes AA on it. */
[data-theme="blue"], .editor-styles-wrapper .has-theme-blue { --bg: var(--wp--preset--color--blue); --fg: var(--wp--preset--color--ink); }
:is([data-theme="ink"], .is-style-field-ink), .editor-styles-wrapper .has-theme-ink { --bg: var(--wp--preset--color--ink); --fg: var(--wp--preset--color--white); }
:is([data-theme="white"], .is-style-field-white), .editor-styles-wrapper .has-theme-white { --bg: var(--wp--preset--color--white); --fg: var(--wp--preset--color--ink); }
[data-theme="mist"], [data-theme="gray"], .editor-styles-wrapper .has-theme-mist, .editor-styles-wrapper .has-theme-gray { --bg: var(--wp--preset--color--gray-50); --fg: var(--wp--preset--color--ink); }
[data-theme="design"], .editor-styles-wrapper .has-theme-design { --bg: var(--wp--preset--color--design); --fg: var(--wp--preset--color--ink); }
:is([data-theme="development"], .is-style-field-development), .editor-styles-wrapper .has-theme-development { --bg: var(--wp--preset--color--development); --fg: var(--wp--preset--color--ink); }
[data-theme="seo"], .editor-styles-wrapper .has-theme-seo { --bg: var(--wp--preset--color--seo); --fg: var(--wp--preset--color--ink); }
[data-theme="accessibility"], .editor-styles-wrapper .has-theme-accessibility { --bg: var(--wp--preset--color--accessibility); --fg: var(--wp--preset--color--ink); }
[data-theme="performance"], .editor-styles-wrapper .has-theme-performance { --bg: var(--wp--preset--color--performance); --fg: var(--wp--preset--color--ink); }
[data-theme="hosting"], .editor-styles-wrapper .has-theme-hosting { --bg: var(--wp--preset--color--hosting); --fg: var(--wp--preset--color--ink); }
[data-theme="support"], .editor-styles-wrapper .has-theme-support { --bg: var(--wp--preset--color--support); --fg: var(--wp--preset--color--white); }
[class*="is-style-field-"] { --muted: var(--fg); }
[data-theme], .editor-styles-wrapper [class*="has-theme-"] { --muted: var(--fg); background-color: var(--bg); color: var(--fg); }
[data-theme="ink"], .is-style-field-ink, .editor-styles-wrapper .has-theme-ink { --muted: var(--wp--preset--color--gray-400); }
[data-theme="white"], .is-style-field-white, .editor-styles-wrapper .has-theme-white { --muted: var(--wp--preset--color--gray-600); }
[data-theme="mist"], [data-theme="gray"], .editor-styles-wrapper .has-theme-mist, .editor-styles-wrapper .has-theme-gray { --muted: var(--wp--preset--color--gray-700); } /* 7:1 on gray-50 (WCAG 1.4.6) */

*, *::before, *::after { box-sizing: border-box; }

/* theme.json's root is the reading text: pages, posts and projects inherit it. The interface has its own smaller voice. */
:where(.nav, .menu, .foot, .skip-link, .send, .faq, .talk, .hero, .field, .work, .notes, .how, .direct, .ph, .mp, .pc, .phero, .archive__head, .archive__list:not(:has(.prose)), .more, .pcta, .author, [class*="is-style-field-"]) { font-size: 16px; line-height: 1.45; letter-spacing: -.011em; }

html {
	-webkit-text-size-adjust: 100%;
	scroll-padding-top: 0; /* jumps to a section land flush; the header slides away */
	overflow-x: clip;
}

body {
	margin: 0;
	-webkit-font-smoothing: antialiased;
	overflow-x: clip;
}

img, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p, ol, ul, dl, dd { margin: 0; padding: 0; }
ol, ul { list-style: none; }
:focus-visible { outline: 2px solid var(--fg, currentColor); outline-offset: 3px; } /* the field's text color: a filled button's own color would vanish into the field */

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { padding-inline: var(--wp--custom--margin); }

/* Wordmark: SUNNYMORGAN in Montserrat 900, one SVG symbol. The M of MORGAN is the font's own M
   with its holes filled, so it stands as a mountain. SUNNY takes the field's text color;
   MORGAN is white on Sunny blue and blue on ink and white. */
/* Hover the wordmark: the Crown M grows with a springy overshoot, and SUNNY and ORGAN squeeze
   toward their outer edges to make room, so the logo never gets wider. The symbol's parts read these variables (custom properties reach inside <use>). */
a:is(:hover, :focus-visible) .logo, .logo:hover { --wm-c: 1.22; --wm-s: .973; } /* SUNNY and ORGAN squeeze from their outer edges by what the M gains */
a:active .logo, .logo:active { --wm-c: 1.36; --wm-s: .956; } /* pressed: a bigger crown and a deeper squeeze; it springs back on release */
@media (prefers-reduced-motion: reduce) { a:is(:hover, :focus-visible, :active) .logo, .logo:is(:hover, :active) { --wm-c: 1; --wm-s: 1; } }

.logo {
	display: block;
	color: var(--fg);
	.wordmark { display: block; height: var(--logo-h, 22px); width: auto; overflow: visible; }
}
[data-theme="blue"] .logo { --wm-b: var(--wp--preset--color--white); }
:is([data-theme="ink"], [data-theme="white"], [data-theme="mist"], [data-theme="gray"], [data-theme="design"]) .logo,
.menu .logo { --wm-b: var(--wp--preset--color--blue); }
.menu .logo { color: var(--wp--preset--color--white); }

/* ---------- Type ---------- */

/* Every big title on every page: one voice. Sizes are each title's own. */
.display, .mega, .contact__title, .hero__title, .ph__title, .phero__title, .archive__title, .author__name, .more__title, .send__word, .q, .done__title {
	font-weight: 900;
	text-transform: uppercase;
	letter-spacing: -.045em;
	line-height: .82;
}

.phero__title, .archive__title, .q, .done__title { line-height: .86; }

/* Small print in capitals: Pantone codes, the offices' heading. */
.field__pantone, .phero__pantone, .foot__head { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }

.display { font-size: var(--wp--custom--size--display); }

.lead {
	font-size: var(--wp--custom--size--lead);
	line-height: 1.5; /* WCAG 1.4.8 (AAA), trial: was 1.15 */
	font-weight: 500;
	letter-spacing: -.022em;
	max-width: 30ch;
	text-wrap: pretty;
}

/* ---------- Highlighted text ----------
   Always ink on yellow, like a highlighter. On the yellow field itself it turns over. */
.marker {
	position: relative;
	z-index: 0;

	/* It reaches past the words by the same amount on both sides, so they stay in line with what is above and below. */
	&::before {
		content: "";
		position: absolute;
		inset: 0 calc(var(--wp--custom--highlight-reach) * -1 * var(--reach, 1));
		z-index: -1;
		background: var(--wp--custom--highlight);
		transform-origin: 0 50%;
	}
}

@media (max-width: 900px) { .marker { --reach: .74; } } /* a phone's margin is narrow: it stays off the edge */

mark { padding: .02em .12em; background: var(--wp--custom--highlight); color: var(--wp--preset--color--ink); }
::selection { background: var(--wp--custom--highlight); color: var(--wp--preset--color--ink); }
[data-theme="accessibility"] mark, [data-theme="accessibility"] ::selection { background: var(--wp--preset--color--ink); color: var(--wp--preset--color--white); }

/* ---------- Buttons ---------- */

.pill {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0 22px;
	border: 2px solid var(--fg);
	border-radius: 999px;
	font-weight: 700;
	white-space: nowrap;
	transition: background-color .3s var(--wp--custom--ease), color .3s var(--wp--custom--ease);

	&:hover { background: var(--fg); color: var(--bg); }
}

.pill--fill {
	background: var(--fg);
	color: var(--bg);

	&:hover { background: transparent; color: var(--fg); }
}

.pill--big { min-height: 64px; padding: 0 40px; }

/* Magnetic buttons (home.js): they lean toward a nearby pointer and spring back. */
[data-magnet] {
	will-change: translate;

	/* An unseen rim, wider than the button ever moves, keeps the pointer on it. Without it the button slipped
	   out from under the pointer at its edge and back again, and its hover colors flickered. */
	&::after { content: ""; position: absolute; inset: -8px -11px; border-radius: inherit; }
}
:where([data-magnet]) { position: relative; }

/* ---------- Header ---------- */

.nav {
	position: sticky;
	top: 0;
	z-index: 50;
	display: flex;
	align-items: center;
	gap: var(--wp--preset--spacing--40);
	height: var(--nav-h);
	padding-inline: var(--wp--custom--margin);
	color: var(--fg);
	background: color-mix(in srgb, var(--bg) 92%, transparent);
	-webkit-backdrop-filter: blur(20px) saturate(1.2);
	backdrop-filter: blur(20px) saturate(1.2);
	transition: background-color .45s var(--wp--custom--ease), color .45s var(--wp--custom--ease), translate .4s var(--wp--custom--ease);

	&:is([data-theme="seo"], [data-theme="hosting"]) { background: var(--bg); } /* their text passes AA only on the solid color */
	&.is-away { translate: 0 -100%; }
	&:focus-within { translate: none; }
}

.nav__logo { margin-right: auto; --logo-h: clamp(28px, 22.4px + .71vw, 36px); } /* 1.4x */

.nav__links {
	display: flex;
	gap: 32px;
	font-weight: 600;

	a {
		position: relative;
		padding: 4px 0;

		/* A 44px target that looks no bigger (WCAG 2.5.5). Half the gap each side, so targets never overlap. */
		&::after { content: ""; position: absolute; inset: -8px calc(var(--nav-gap, 32px) / -2); }
	}
}

.nav__menu, .menu__close { min-height: 44px; padding: 0 20px; border: 2px solid currentColor; border-radius: 999px; font-weight: 700; }
.nav__menu { display: none; }

/* A link whose line draws in under it. */
:is(.nav__links, .foot__col) a {
	background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat;
	transition: background-size .3s var(--wp--custom--ease);

	&:hover { background-size: 100% 2px; }
}

/* Menu: an ink sheet with the seven services as a fan deck. */
.menu {
	position: fixed;
	inset: 0;
	z-index: 60;
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--40);
	padding: 0 var(--wp--custom--margin) var(--wp--preset--spacing--40);
	overflow-y: auto;
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--white);
	clip-path: inset(0 0 100% 0); /* it wipes down: solid color never fades */
	transition: clip-path .3s var(--wp--custom--ease);

	&.is-open { clip-path: inset(0); }
	&[hidden] { display: none; }
}

.menu__top { display: flex; align-items: center; justify-content: space-between; min-height: var(--nav-h); }
.menu__logo { --logo-h: min(26px, 4.6vw); } /* never as far as Close */

.menu__links {
	display: grid;
	gap: 4px;

	a { font-size: clamp(2.5rem, 10vw, 4rem); font-weight: 900; text-transform: uppercase; letter-spacing: -.045em; line-height: 1; }
}

/* Services as plain rows, each led by a small swatch of its color. Never full-width color bands. */
.menu__deck {
	display: grid;
	border-top: 1px solid var(--wp--preset--color--gray-800);

	a {
		display: flex;
		align-items: center;
		gap: 14px;
		min-height: 48px;
		border-bottom: 1px solid var(--wp--preset--color--gray-800);
		font-weight: 700;

		&::before { content: ""; width: 14px; height: 14px; flex: none; background: var(--topic); }
	}
}

.menu__call { font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }

/* ---------- 3D layer ----------
   One fixed canvas under the header (50). Section color and images < cubes (40) < words (41).
   Sections and cards make no stacking context, so nothing traps words under the canvas. */
.voxels { display: none; }

.has-voxels .voxels {
	display: block;
	position: fixed;
	inset: 0 auto auto 0;
	z-index: 40;
	width: 100%;
	height: 100lvh;
	pointer-events: none;
}

/* In place (voxels.js): a shape's own canvas, in its own spot. */
.voxels-here { position: absolute; z-index: 40; max-width: none; pointer-events: none; }
:is(.vx-spot, .talk__spot).is-here { pointer-events: auto; cursor: pointer; -webkit-tap-highlight-color: transparent; }

.lift { position: relative; z-index: 41; }
.vx-spot { pointer-events: none; }
html:not(.has-voxels) .vx-spot { display: none; }

main > section, .foot { position: relative; }

/* ---------- WordPress wrappers ----------
   The template parts add no box, so the header can stick to the page. Sections touch. */
.wp-site-blocks > .wp-block-template-part { display: contents; }
:root :where(.wp-site-blocks, main, .project__body, .project__body > .wp-block-post-content) > * { margin-block: 0; }
main > :is(.hero, .talk, .ph):first-child { margin-top: calc(var(--nav-h) * -1); } /* under the header; core sets a first child to 0 */
:root :where(section, .wrap, .talk__inner, .notes__grid, .work__grid, .more__grid, .mp__list, .ncard, .ncard__meta) > * { margin-block: 0; }

/* Smooth scroll (Lenis, set up in home.js). */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
/* Hero field: white at the top falling to light gray, with a soft shadow pooled under the pyramid,
   as if it stands on the page. The header turns white over it to match the top. */
:is(.hero[data-theme="mist"], :is(.talk, .talk__probe)[data-theme="design"]) {
	background-image:
		radial-gradient(38% 30% at var(--pool, 72% 66%), color-mix(in srgb, var(--wp--preset--color--gray-900) 9%, transparent), color-mix(in srgb, var(--wp--preset--color--gray-900) 3%, transparent) 55%, transparent 75%),
		linear-gradient(var(--wp--preset--color--white) 10%, var(--wp--preset--color--gray-50) 60%, var(--wp--preset--color--gray-100));
}
.talk--home { --pool: 83% 34%; } /* Let's talk, on Design, has the hero's own field */

.nav[data-theme="mist"] { --bg: var(--wp--preset--color--white); }

/* The seven colors as a row of swatches with gaps, read as a Pantone strip, never as joined bands. */
.spectrum {
	display: flex;
	gap: var(--wp--custom--tile-gap);
	height: clamp(14px, 1.5vw, 24px);

	a {
		flex: 1;
		background: var(--topic);
		transform-origin: 50% 100%;
		transition: scale .3s var(--wp--custom--ease-out);

		&:is(:hover, :focus-visible, .is-hot) { scale: 1 1.6; }
		&:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
	}
}

/* ---------- Stack ---------- */

.pyr__stage {
	position: relative;
	height: clamp(580px, 90svh, 900px);
	margin-top: var(--wp--preset--spacing--30);
	cursor: crosshair;
	touch-action: pan-y;
	-webkit-tap-highlight-color: transparent;

	&.is-over { cursor: pointer; } /* a layer is lit: a click goes to it */
	&:focus-visible { outline: 2px solid var(--fg); outline-offset: -2px; }
}

.pyr__layers {
	display: grid;
	gap: var(--wp--preset--spacing--15);

	a { display: flex; align-items: center; gap: var(--wp--preset--spacing--15); }
}

.pyr__chip { /* a small pill in the layer's color, like the color pills in Let's talk */
	flex: none;
	width: 26px;
	height: 14px;
	border-radius: 999px;
	background: var(--topic);
	outline: 2px solid transparent;
	outline-offset: 3px;
	transition: outline-color .3s var(--wp--custom--ease);
}

li.is-hot .pyr__chip { outline-color: var(--topic); }

.pyr__text { display: flex; align-items: baseline; gap: 10px; }
.pyr__name { font-size: 16px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; } /* like the accordion titles */
/* Hover subtitle: a line of detail in sentence case under a layer's uppercase name, no background, shown while that layer is hot
   (pointer on its label or on the layer itself, or keyboard focus). Mouse and wide stages only. */
.pyr__sub { display: none; }

@media (hover: hover) and (pointer: fine) {
	.has-voxels .pyr__stage:not(.is-narrow) {
		.pyr__layers a { position: relative; }

		.pyr__sub {
			display: block;
			position: absolute;
			top: calc(100% - 2px);
			left: 38px; /* under the name, past the pill */
			width: max-content;
			max-width: min(24ch, var(--room, 24ch)); /* wraps to the room left before the screen edge (voxels.js sets --room) */
			padding-top: 2px;
			color: var(--fg);
			font-size: 14px; /* sentence case under an uppercase title, like the accordions */
			font-weight: 500;
			line-height: 1.3;
			white-space: normal;
			opacity: 0;
			translate: 0 -4px;
			pointer-events: none;
			transition: opacity .2s var(--wp--custom--ease), translate .3s var(--wp--custom--ease-out);
		}

		li:is(.is-hot, :focus-within) .pyr__sub { opacity: 1; translate: none; }
		li:is(.is-hot, :focus-within) { z-index: 1; }
	}
}

.pyr__tag { font-size: var(--wp--preset--font-size--x-small); font-weight: 600; letter-spacing: .04em; color: var(--muted); font-variant-numeric: tabular-nums; }

.has-voxels .pyr__stage {
	.pyr__lines, .pyr__layers { position: absolute; inset: 0; z-index: 41; opacity: 0; pointer-events: none; }
	.pyr__lines { width: 100%; height: 100%; max-width: none; overflow: visible; }

	/* Each label fills its whole row (voxels.js sets --row), so the rows touch and the pointer moves
	   from one label straight onto the next, with no gap where nothing is hovered. */
	.pyr__layers li {
		position: absolute;
		top: 0;
		left: 0;
		min-width: min(230px, calc(var(--room, 192px) + 38px)); /* never past the screen edge */
		padding: calc((var(--row, 36px) - 20px) / 2) 8px;
		margin: calc(var(--row, 36px) / -2 - 2px) 0 0 -8px;
		white-space: nowrap;
		pointer-events: auto;
	}

	.pyr__layers.is-off li { pointer-events: none; }
	/* The link's hit area is its whole row, at least 44px (WCAG 2.5.5): voxels.js keeps every row 44px or more. */
	.pyr__layers a { position: relative; }
	.pyr__layers a::before { content: ""; position: absolute; inset: calc((100% - var(--row, 44px)) / 2) -8px; }
	.pyr-leader { fill: none; stroke: var(--wp--custom--rule-color); stroke-width: var(--wp--custom--rule); } /* same as the accordion lines, always */
	.pyr-dot { fill: var(--wp--custom--rule-color); stroke: none; } /* the line's end, in the line's color */

	&.is-narrow {
		.pyr__layers li { min-width: 0; padding: calc((var(--row, 44px) - 18px) / 2) 6px; margin: calc(var(--row, 44px) / -2 - 2px) 0 0 -6px; }
		.pyr__layers a { gap: var(--wp--preset--spacing--10); }
		.pyr__chip { width: 20px; height: 11px; }
		.pyr__name { font-size: 14px; }
	}

	&.no-tags .pyr__tag { display: none; }
}

html:not(.has-voxels) .pyr__stage { height: auto; cursor: auto; .pyr__lines { display: none; } .pyr__layers a { min-height: 44px; } }

/* Service names are fitted to the width on one line by reveal.js. */
.mega {
	grid-column: 1 / -1;
	grid-row: 1;
	font-size: clamp(3rem, 12vw, 18rem);
	white-space: nowrap;
	overflow: clip;
	padding-bottom: .04em;
	margin-left: -.055em;

	> span { display: inline-block; }
	br { display: none; }
}

/* Service lists are accordions: uppercase titles, a plus that turns to a cross,
   dividers as heavy as the type. Native details, so they work without JS. */
.field__list {
	border-top: var(--wp--custom--rule) solid var(--wp--custom--rule-color);

	details { border-bottom: var(--wp--custom--rule) solid var(--wp--custom--rule-color); }

	summary {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: var(--wp--preset--spacing--20);
		padding: 14px 0 13px;
		font-size: var(--wp--preset--font-size--medium);
		font-weight: 600;
		letter-spacing: .04em;
		text-transform: uppercase;
		list-style: none;
		cursor: pointer;

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

		&::after {
			content: "";
			flex: none;
			width: 14px;
			height: 14px;
			background: var(--plus);
			transition: rotate .3s var(--wp--custom--ease-out);
		}

		&:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
	}

	details[open] summary::after { rotate: 45deg; }

	p {
		max-width: 40ch;
		padding-bottom: var(--wp--preset--spacing--20);
		font-size: var(--wp--preset--font-size--medium);
		font-weight: 500;
		line-height: 1.4;
	}

	/* Open and close smoothly where the browser can animate to auto height. */
	@supports (interpolate-size: allow-keywords) {
		interpolate-size: allow-keywords;

		details::details-content {
			height: 0;
			overflow: clip;
			transition: height .35s var(--wp--custom--ease-out), content-visibility .35s allow-discrete;
		}

		details[open]::details-content { height: auto; }
	}
}

/* On a phone it is an accordion with the same look: closed until tapped, the words opening gently under their title. */ /* no pointing here, so the arrow always shows it is a link */

/* ---------- Contact title ---------- */

.contact__title { font-size: clamp(4rem, 1rem + 8.4vw, 10rem); line-height: .86; margin-left: -.05em; }
.contact__content { display: grid; justify-items: start; gap: var(--wp--preset--spacing--30); }
.contact__mail { font-size: var(--wp--custom--size--lead); font-weight: 700; letter-spacing: -.022em; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.contact__phones { display: flex; flex-wrap: wrap; gap: 8px 28px; font-size: var(--wp--preset--font-size--medium); font-weight: 600; }

/* ---------- Footer ----------
   The hero's pyramid again (voxels.js copies its labels), the links beside it,
   then the wordmark across the whole width, standing on the color bar. */

.foot { --foot-gap: clamp(6px, .8vw, 14px); padding-top: var(--wp--preset--spacing--60); } /* the gap between the wordmark and the color bar */

.foot__grid {
	display: grid;
	grid-template-columns: var(--wp--custom--columns);
	gap: var(--wp--preset--spacing--50) var(--wp--custom--gap);
	align-items: center;
	padding-bottom: var(--wp--preset--spacing--50);
}

.foot .pyr__stage.foot__pyr { grid-column: 1 / 8; height: clamp(440px, 40vw, 620px); margin: 0; }
html:not(.has-voxels) .foot__pyr { display: none; }

.foot__side {
	grid-column: 8 / -1;
	display: grid;
	gap: var(--wp--preset--spacing--40);
}

html:not(.has-voxels) .foot__side { grid-column: 1 / -1; }
/* Beside the pyramid, the links start level with its top label (voxels.js sets --pyr-top). */
@media (min-width: 1101px) {
	.has-voxels .foot .pyr__stage.foot__pyr { align-self: start; }
	.has-voxels .foot__side { align-self: start; margin-top: calc(var(--pyr-top, 0px) - 12px); /* the label box sits 12px above its row line */ }
}

.foot__tag { grid-column: 2 / -1; align-self: start; color: var(--muted); max-width: 26ch; font-size: var(--wp--custom--size--intro); font-weight: 500; line-height: 1.25; }

.foot__cols {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--wp--preset--spacing--40) var(--wp--custom--gap);
}

.foot__col {
	display: grid;
	align-content: start;
	gap: 16px;
	font-weight: 600;

	/* The line sits 4px under the words, as in the header. The hit area reaches 8px past it, so each row is 44px (WCAG 2.5.5). */
	a { position: relative; width: fit-content; padding-block: 4px; &::after { content: ""; position: absolute; inset: -8px 0; } }
}

.foot__offices { grid-column: 1 / -1; display: grid; gap: var(--wp--preset--spacing--20); }
.foot__head { color: var(--muted); }

/* Every office: name, then the same phone and the same email. The joke is the repetition. */
.foot__officelist {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr)); /* three columns, shared with the links and tagline above */
	gap: var(--wp--preset--spacing--30) var(--wp--custom--gap);

	li { display: grid; gap: 2px; font-size: var(--wp--preset--font-size--small); line-height: 1.4; }
	li > * { padding-block: 2px; } /* every line the same height: name, hours, phone, email */
	b { font-weight: 800; }
	a { width: fit-content; color: var(--muted); }
	a:hover { color: var(--fg); }
}
.foot__legal {
	color: var(--muted);
	font-size: 14px;

	a { display: inline-block; margin-left: 1em; padding-block: 2px; text-decoration: underline; text-underline-offset: 3px; }
	a:hover { color: var(--fg); }
}

.foot__mark {
	/* Under a grown tile this leaves the same gap as between tiles, measured from the letters' flat feet
	   (round letters dip below them, about .2vw). */
	margin-bottom: calc(var(--foot-gap) + var(--wp--custom--tile-gap) - .2vw);

	position: relative;
	pointer-events: none; /* only the letters are the link: a click in a gap or in the V makes sparks and stays here */

	.wordmark { width: 100%; height: auto; }
	.wordmark use { pointer-events: visiblePainted; }
}

/* The sparks that have piled up in the notch of the M (sparks.js). It grows with the M when the wordmark is hovered. */
.foot__cup {
	position: absolute;
	pointer-events: none;
	image-rendering: pixelated;
	transform: scale(var(--wm-c, 1));
	transform-origin: 50% 100%;
	transition: transform .7s var(--wp--custom--spring);
}

/* The footer's color row is the hero's, same height. Its tiles come from the pyramid's labels (inc/layers.php). */
.foot .spectrum {
	/* Here a tile grows only up to the wordmark's base: it eats the gap, never the letters. */
	a {
		transition: margin-top .3s var(--wp--custom--ease-out);

		&:is(:hover, :focus-visible, .is-hot) { scale: none; margin-top: calc(-1 * var(--foot-gap)); }
	}
}

/* ---------- Reveal motion ---------- */

.js .reveal {
	opacity: 0;
	translate: 0 64px;
	transition: opacity .9s var(--wp--custom--ease-out) var(--delay, 0s), translate 1.1s var(--wp--custom--ease-out) var(--delay, 0s);
}

.js .reveal.is-in { opacity: 1; translate: none; }

.line { display: block; overflow-y: clip; padding-bottom: .08em; margin-bottom: -.08em; }
.line__inner { display: block; }
.js [data-lines].is-split .line__inner { translate: 0 105%; transition: translate 1s var(--wp--custom--ease-out) calc(var(--l, 0) * .09s); }
.js [data-lines].is-in .line__inner { translate: none; }

.js [data-fit] > span { translate: 0 102%; transition: translate 1.1s var(--wp--custom--ease-out); }
.js [data-fit].is-in > span { translate: none; }
@keyframes pop { from { scale: 0; } }
@keyframes rise { to { opacity: 1; translate: none; } }

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

@media (max-width: 1100px) {
	.nav__links { --nav-gap: 22px; gap: 22px; }
	.foot .pyr__stage.foot__pyr, .foot__side { grid-column: 1 / -1; }
	.foot .pyr__stage.foot__pyr { height: clamp(460px, 60vw, 520px); }
}

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

@media (max-width: 900px) {
	:root { --nav-h: 68px; }

	.nav__links, .nav__cta { display: none; }
	.nav__menu { display: block; }
	.nav__logo { --logo-h: 26px; }
	.pill--big { min-height: 56px; width: 100%; }

	.pyr__stage { height: clamp(440px, 118vw, 520px); margin-top: var(--wp--preset--spacing--20); }
	/* The pyramid comes straight after the button, and its labels hang below it (voxels.js, `below`): --pyr-r is half its width. */
	.mega { line-height: .86; br { display: inline; } }
	.field__list summary { font-size: 16px; padding: 12px 0 11px; }

	.contact__title { font-size: clamp(4.5rem, 24vw, 8rem); }

	.foot { padding-top: var(--wp--preset--spacing--40); }
	.foot__grid { gap: var(--wp--preset--spacing--40) var(--wp--custom--gap); }
	.foot .foot__officelist { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--wp--preset--spacing--30) var(--wp--custom--gap); }
	.foot .foot__officelist a { white-space: nowrap; }
	.foot .pyr__stage.foot__pyr { height: calc(7 * 44px + 8px); } /* its seven labels, and no more */

	/* Phone spots: in the flow, full width, under the heading. */
	html.has-voxels .vx-spot {
		display: block;
		flex: none;
		align-self: stretch;
		width: auto;
		height: clamp(240px, 68vw, 340px);
		min-height: 0;
		margin: var(--wp--preset--spacing--30) 0;
	}
}

/* A phone on its side: the pyramid and its labels, to its right, fill one screen. */
@media (orientation: landscape) and (max-height: 560px) and (max-width: 1100px) {
	.foot { padding-top: var(--wp--preset--spacing--40); }
	.foot .pyr__stage.foot__pyr { height: calc(7 * 44px + 8px); }
}

/* Two columns without a mouse: each card sits half a card lower than the one before, so one at a time is in the middle of the screen. */

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; } /* no transition at all: the shortest one still makes a fitted title measure its old size */
	.js .reveal, .js [data-fit] > span { opacity: 1; translate: none; animation: none; }
	.js [data-lines].is-split .line__inner { translate: none; }
	.spectrum a:is(:hover, :focus-visible, .is-hot) { scale: none !important; margin-top: 0 !important; outline: 2px solid currentColor; outline-offset: 2px; }
	.pyr__sub { translate: none !important; }
}

/* ---------- Click spark ---------- */

.spark { position: fixed; inset: 0; z-index: 70; width: 100vw; height: 100vh; pointer-events: none; }

/* ---------- UI case (last, so it wins over the per-component sizes above) ---------- */
/* Menu and buttons speak in the same small uppercase as the site's labels: one voice for anything you press.
   A touch of tracking and a pixel smaller, so it reads crisp, not shouty. Body text and headings keep their case. */
.nav__links, .nav__menu, .menu__close, .pill, .foot__col a {
	text-transform: var(--wp--custom--ui-case);
	letter-spacing: var(--wp--custom--ui-track);
}
.nav__links, .pill:not(.pill--big), .nav__menu, .menu__close { font-size: 14px; }
.pill--big { font-size: 16px; }

/* The footer speaks in one size: the layer names, the links and the offices. */
.foot :is(.pyr__name, .foot__col a, .foot__officelist, .foot__officelist *) { font-size: 14px; }

/* Text may fade. Solid color and pictures never do: they slide into place. */
.js .reveal:is(.wcard__media, .ncard__art, figure, .bd__cell, .browser, .mp__item, .ph__intro, .ph__facts, .pc__body) { opacity: 1; transition: translate 1.1s var(--wp--custom--ease-out) var(--delay, 0s); }

/* The pyramid's labels: the words fade, the pill grows and the line draws itself (voxels.js sets --in, 0 to 1). */
.has-voxels .pyr__layers li { .pyr__text { opacity: var(--in, 1); } .pyr__chip { scale: var(--in, 1); } }
.pyr-leader { stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--in, 1)); }
.pyr-dot { scale: var(--in, 1); transform-box: fill-box; transform-origin: center; }

.skip-link.screen-reader-text:focus { background: var(--wp--preset--color--white); color: var(--wp--preset--color--ink); outline: 3px solid var(--wp--preset--color--ink); outline-offset: -5px; }
