/* Fonts ------------------------------------------------------------------ */

@font-face {
	font-family: "Geist";
	src: url("../fonts/Geist-Variable.woff2") format("woff2");
	font-weight: 100 900;
	font-display: swap;
}

@font-face {
	font-family: "Geist Mono";
	src: url("../fonts/GeistMono-Variable.woff2") format("woff2");
	font-weight: 100 900;
	font-display: swap;
}

@font-face {
	font-family: "Tungsten Condensed";
	src: url("../fonts/TungstenCond-Semibold.otf") format("opentype");
	font-weight: 600;
	font-display: swap;
}

/* Tokens (mirrors the Figma variables) ----------------------------------- */

:root {
	--le-black: #000;
	--le-white: #fff;
	--le-blue: #3ae4f0;
	--le-100: #e1e3e3;
	--le-200: #c3c6c6;
	--le-300: #a5a9aa;
	--le-400: #878b8c;
	--le-500: #65696a;
	--le-600: #434647;
	--le-800: #222324;

	--le-font-display: "Tungsten Condensed", "Arial Narrow", sans-serif;
	--le-font-sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
	--le-font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

	/* Cap height of the display font as a fraction of its font size. */
	--le-display-cap: 0.7;

	--le-gutter: 1.5rem;
	/* The page grid: 12 columns between the gutters, 18px apart. See .le-grid. */
	--le-grid-columns: repeat(12, minmax(0, 1fr));
	--le-grid-gap: 1.125rem;
	--le-slide-gap: 1.125rem; /* Space between slides in a slider. */
	--le-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Mobile (Elementor's "mobile landscape" width and below): tighter gutters and a smaller display scale. */
@media (max-width: 880px) {
	:root {
		--le-gutter: 0.75rem;
		--le-slide-gap: 0.75rem;
	}
}

/*
 * The page grid. Sections lay their parts out on these twelve columns (grid-column: 8 / -1
 * is the right-hand five, and so on) so that edges line up from one section to the next.
 */
.le-grid {
	display: grid;
	grid-template-columns: var(--le-grid-columns);
	column-gap: var(--le-grid-gap);
	padding-inline: var(--le-gutter);
}

/* Reset ------------------------------------------------------------------ */

/*
 * Root size. Everything is sized in rem, so these steps scale the whole site
 * together: 16px by default, 18px from 1440px wide.
 */
html {
	font-size: 100%;
}

@media (min-width: 1440px) {
	html {
		font-size: 112.5%;
	}
}

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

body {
	margin: 0;
	font-family: var(--le-font-sans);
	font-size: 1rem;
	line-height: 1.3125rem;
	letter-spacing: -0.01em;
	color: var(--le-black);
	background: var(--le-white);
	-webkit-font-smoothing: antialiased;
}

img,
picture,
video,
svg {
	display: block;
	max-width: 100%;
	height: auto;
}

/*
 * Every Live Events component fills its Elementor container's width and never shrinks. Without
 * this, a component whose height comes from its width (the tunnel's aspect ratio) can be
 * measured as zero-height on phones, and the next section slides up over it.
 */
.elementor-widget[class*="elementor-widget-le-"] {
	flex-shrink: 0;
	width: 100%;
}

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

.le-h1,
.le-h2,
.le-h3 {
	margin: 0;
	font-family: var(--le-font-display);
	font-weight: 600;
	text-transform: uppercase;
}

.le-h1,
.le-h2,
.le-h3 {
	text-box: trim-both cap alphabetic;
}

/* The H1 size lives in variables so a component can nudge it (the page hero's title size sliders). */
:root {
	--le-h1-size: 9.0625rem;
	--le-h1-leading: 7rem;
}

.le-h1 {
	font-size: var(--le-h1-size);
	line-height: var(--le-h1-leading);
}

.le-h2 {
	font-size: 6.75rem;
	line-height: 5.375rem;
}

.le-h3 {
	font-size: 3.1875rem;
	line-height: 2.75rem;
	letter-spacing: 0.0625rem;
}

.le-p {
	margin: 0;
	font-size: 1rem;
	line-height: 1.3125rem;
	letter-spacing: -0.01rem;
}

.le-eyebrow,
.le-h7 {
	margin: 0;
	font-family: var(--le-font-mono);
	font-weight: 500;
	text-transform: uppercase;
}

.le-eyebrow {
	font-size: 0.875rem;
	line-height: 1.125rem;
	letter-spacing: 0.0437rem;
}

.le-h7 {
	font-size: 0.6875rem;
	line-height: 0.875rem;
	letter-spacing: 0.0344rem;
}

/* Bare single-entry pages (e.g. a case study, until its page is designed) ------ */

.le-single {
	min-height: 60svh;
	padding: 3rem var(--le-gutter);
}

@media (max-width: 880px) {
	:root {
		--le-h1-size: 6.75rem;
		--le-h1-leading: 5.375rem;
	}

	.le-h2 {
		font-size: 4.375rem;
		line-height: 3.5625rem;
	}

	.le-h3 {
		letter-spacing: 0.0313rem;
	}
}

/* CTA button -------------------------------------------------------------- */

.le-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.6em;
	padding: 0.375rem 0.5rem;
	border: 0;
	font-family: var(--le-font-mono);
	font-size: 0.6969rem;
	font-weight: 500;
	line-height: 1.27;
	letter-spacing: 0.0348rem;
	text-transform: uppercase;
	text-decoration: none;
	white-space: nowrap;
	color: var(--le-black);
	background: var(--le-blue);
	cursor: pointer;
	transition: background-color 0.2s, color 0.2s;
}

.le-btn:hover,
.le-btn:focus-visible {
	color: var(--le-black);
	background: var(--le-white);
}

.le-btn--outline {
	padding: 0.375rem 0.5625rem;
	border-top: 1px solid var(--le-200);
	border-left: 1px solid var(--le-200);
	color: var(--le-200);
	background: transparent;
}

.le-btn--outline:hover,
.le-btn--outline:focus-visible {
	color: var(--le-black);
	background: var(--le-200);
}

.le-btn__arrow {
	transition: transform 0.3s var(--le-ease-out);
}

.le-btn:hover .le-btn__arrow {
	transform: translateX(0.1875rem);
}

/* "Slip case" reveal: words slide up out of a clipped line ----------------- */

.le-w {
	display: inline-block;
	overflow: clip;
	/* Room for round letters (S, O, C, G) that reach past the cap line and baseline: in tight display
	   lines they spill out of the line box, and a tighter clip shaves their tops and bottoms. */
	overflow-clip-margin: 0.12em;
	vertical-align: top;
}

.le-w__i {
	display: inline-block;
}

.le-js [data-le-reveal] .le-w__i {
	/* Past the line box and its clip margin by enough that tall glyphs and tight line heights can't peek out. */
	transform: translateY(calc(100% + 0.5em));
	transition: transform 1s var(--le-ease-out);
	transition-delay: calc(var(--le-reveal-delay, 0s) + var(--i, 0) * 80ms);
}

.le-js [data-le-reveal]:not([data-le-split]) {
	visibility: hidden;
}

.le-js [data-le-reveal].is-revealed .le-w__i {
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	.le-js [data-le-reveal] .le-w__i {
		transform: none;
		transition: none;
	}
}

/* Image reveal: a cyan cover draws up off the image, as the wipe page transition opens a page (quicker) ---------
   ([data-le-image-reveal] frames; revealed by scrolling into view, like the slip case: see main.js). */

:where(.le-js [data-le-image-reveal]) {
	position: relative;
}

.le-js [data-le-image-reveal]::after {
	position: absolute;
	z-index: 5;
	inset: 0;
	background: var(--le-blue);
	transform-origin: 50% 0;
	transition: transform 0.65s cubic-bezier(0.85, 0, 0.15, 1) var(--le-cover-delay, 0s);
	pointer-events: none;
	content: "";
}

.le-js [data-le-image-reveal].is-revealed::after {
	transform: scaleY(0);
}

@media (prefers-reduced-motion: reduce) {
	.le-js [data-le-image-reveal]::after {
		content: none;
	}
}

/* ?image-reveal=none (the style is picked in inc/assets.php): no cover. */
[data-le-image-reveal-style="none"] [data-le-image-reveal]::after {
	content: none;
}

/* Sliders: see LiveEvents.slider in main.js --------------------------------- */

/* Slides run past the right edge of the page; the section holding the slider clips them. */
.le-slider {
	overflow: visible;
}

.le-slider .swiper-wrapper {
	margin: 0;
	padding: 0;
	list-style: none;
}

.le-slider .swiper-slide {
	height: auto;
}

/* Before Swiper sizes the slides (and if it can't), the row is still spaced and scrollable. */
.le-slider:not(.swiper-initialized) {
	overflow-x: auto;
}

.le-slider:not(.swiper-initialized) .swiper-slide {
	width: var(--le-slide-fallback, 15rem);
	margin-right: var(--le-slide-gap);
}

/* Previous / next buttons. */
.le-arrows {
	display: flex;
	gap: 0.3125rem;
	margin-left: auto;
}

.le-arrow {
	display: grid;
	place-items: center;
	width: 2.375rem;
	height: 2.375rem;
	padding: 0;
	border: 0;
	border-radius: 0;
	color: inherit;
	background: var(--le-100);
	cursor: pointer;
	transition: background-color 0.2s, opacity 0.2s;
}

.le-arrow:hover,
.le-arrow:focus {
	color: inherit;
	background: var(--le-200);
}

.le-arrow:disabled {
	background: var(--le-100);
	opacity: 0.4;
	cursor: default;
}

.le-arrow img {
	width: 1.1875rem;
}

.le-arrow--prev img {
	transform: scaleX(-1);
}

/* Case study card: photo, title, tags, place. Dark-background colours by default. ---- */

.le-project-card {
	display: block;
	color: inherit;
	text-decoration: none;
}

.le-project-card__media {
	aspect-ratio: 452 / 313;
	margin-bottom: 1.125rem;
	overflow: hidden;
	background: var(--le-800);
}

/* The photo always covers its frame. Specific enough to outrank Elementor's own `.elementor img { height: auto }`,
   which otherwise leaves the image at its natural height with a gap below it. */
.le-project-card .le-project-card__media img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	transition: transform 0.9s var(--le-ease-out);
}

/* The image's zoom on hover is with the linked cards' rules below (.le-project-card__link). */

.le-project-card__title {
	margin: 0 0 0.75rem;
	font-family: var(--le-font-sans);
	font-size: 1.1875rem;
	font-weight: 600;
	line-height: 1.3125rem;
	letter-spacing: -0.0119rem;
	color: inherit;
	text-box: trim-both cap alphabetic;
}

.le-project-card__tags,
.le-project-card__place {
	margin: 0;
	padding: 0;
	font-family: var(--le-font-mono);
	font-size: 0.6969rem;
	font-weight: 500;
	line-height: 1.27;
	letter-spacing: 0.0348rem;
	text-transform: uppercase;
	list-style: none;
}

.le-project-card__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.125rem;
}

.le-project-card__tags li {
	padding: 0.25rem;
	background: var(--le-600);
}

.le-project-card__place {
	margin-top: 0.625rem;
	color: var(--le-200);
}

/* On a light background: pale tags, black text. */
.le-project-card--light .le-project-card__media {
	background: var(--le-100);
}

.le-project-card--light .le-project-card__tags li {
	background: var(--le-100);
}

.le-project-card--light .le-project-card__place {
	color: inherit;
}

/* News card: a project card with the month over the photo (news grid and related news alike). */

.le-news-card .le-project-card__media {
	position: relative;
}

/* Linked cards with linked tags: the title's link covers the card, and the tags sit above it with links of their own. */
.le-project-card:has(.le-project-card__link) {
	position: relative;
}

.le-project-card__link {
	color: inherit;
	text-decoration: none;
}

.le-project-card__link::after {
	position: absolute;
	inset: 0;
	content: "";
}

.le-project-card__link:hover,
.le-project-card__link:focus-visible {
	color: inherit;
}

.le-project-card:has(.le-project-card__link):hover:not(:has(.le-tag-links a:hover)) .le-project-card__media img,
.le-project-card:has(.le-project-card__link:focus-visible) .le-project-card__media img {
	transform: scale(1.04);
}

/* Tags that link to a hub page filtered by them. */
.le-tag-links {
	position: relative;
	z-index: 1;
}

.le-project-card__tags.le-tag-links li:has(> a) {
	padding: 0;
}

.le-tag-links a {
	display: block;
	padding: 0.25rem;
	color: inherit;
	text-decoration: none;
	transition: background-color 0.2s;
}

.le-tag-links a:hover,
.le-tag-links a:focus-visible {
	color: inherit;
	background: var(--le-500);
}

.le-project-card--light .le-tag-links a:hover,
.le-project-card--light .le-tag-links a:focus-visible,
.le-news-article__chips a:hover,
.le-news-article__chips a:focus-visible {
	background: var(--le-200);
}

.le-news-card__month {
	font-family: var(--le-font-mono);
	font-size: 0.6969rem;
	font-weight: 500;
	line-height: 1.27;
	letter-spacing: 0.0348rem;
	text-transform: uppercase;
	position: absolute;
	top: 0;
	left: 0;
	padding: 0.25rem 0.375rem;
	background: var(--le-100);
}

.le-news-card__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.625rem;
}

/* Page transitions: see assets/js/transitions.js ---------------------------- */

/* Arriving by a transition, the page is covered from the first paint until the transition takes over: in the donut
   style, a still of the donut (saved by the page before, set by the head script in inc/assets.php) at rest in the
   middle of black; in the ripples style, black; in the others, cyan. */
.le-arriving::after {
	position: fixed;
	z-index: 1000;
	inset: 0;
	background: var(--le-still, none) center / var(--le-still-size, auto) no-repeat, var(--le-black);
	content: "";
}

[data-le-transition="corner"].le-arriving::after,
[data-le-transition="circle"].le-arriving::after,
[data-le-transition="wipe"].le-arriving::after {
	background: var(--le-blue);
}

/* The transition's canvas (the donut, ripples and circle styles): the donut style draws a black veil around the donut
   but for its hole. Covers the page (and its clicks). */
.le-transition {
	position: fixed;
	z-index: 1001;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
}

/* The corner and wipe styles' panel: flat cyan, scaled out of one corner or edge and back into another. */
.le-transition-panel {
	position: fixed;
	z-index: 1001;
	inset: 0;
	background: var(--le-blue);
	pointer-events: none;
	will-change: transform;
}

/* Lens on hover: see [data-le-lens] in main.js ------------------------------ */

[data-le-lens] {
	position: relative;
}

/* A lens's canvas, laid exactly over the hovered image by the script (labels on the image stay above it). */
.le-lens {
	position: absolute;
	z-index: 2;
	pointer-events: none;
}

.le-news-card__month,
.le-equipment-card__badges {
	z-index: 3;
}

.screen-reader-text {
	position: absolute;
	width: 0.0625rem;
	height: 0.0625rem;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Equipment cards (equipment slider, inventory) -------------------------------------------- */

.le-equipment-card {
	display: block;
	color: inherit;
	text-decoration: none;
}

.le-equipment-card__frame {
	position: relative;
	display: grid;
	/* A single track that can shrink, so the image never stretches the frame out of proportion. */
	grid-template: minmax(0, 1fr) / minmax(0, 1fr);
	aspect-ratio: 236 / 277;
	padding: 20% 18.9%;
	border-top: 1px solid var(--le-200);
	border-left: 1px solid var(--le-200);
}

.le-equipment-card__frame img {
	width: 100%;
	height: 100%;
	min-height: 0;
	object-fit: contain;
	transition: transform 0.6s var(--le-ease-out);
}

a.le-equipment-card:hover .le-equipment-card__frame img,
a.le-equipment-card:focus-visible .le-equipment-card__frame img {
	transform: scale(1.04);
}

/* The card's labels (a badge such as New!, then Featured) sit side by side, tucked right into the top-left corner. */
/* Featured is the brand's bright teal in every theme (the inventory's dark mode recolours other badges). */
.le-equipment-card__badge.le-equipment-card__badge--featured,
.le-inventory .le-equipment-card__badge.le-equipment-card__badge--featured {
	color: var(--le-black);
	background: var(--le-blue);
}

.le-equipment-card__badges {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.3125rem;
	pointer-events: none;
}

.le-equipment-card__badge {
	padding: 0.3125rem;
	font-family: var(--le-font-mono);
	font-size: 0.6969rem;
	font-weight: 500;
	line-height: 1.27;
	letter-spacing: 0.0348rem;
	text-transform: uppercase;
	background: var(--le-100);
}

.le-equipment-card__name {
	max-width: 12.75rem;
	margin: 0.875rem 0 0;
	font-family: var(--le-font-sans);
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.125rem;
	letter-spacing: -0.0188rem;
	color: inherit;
	text-box: trim-both cap alphabetic;
}

.le-equipment-card__details {
	margin-top: 0.875rem;
	color: var(--le-500);
}

/* Page links (Component::pager) --------------------------------------------------------------- */

.le-pager {
	display: flex;
	justify-content: center;
	gap: 0.3125rem;
	padding-inline: var(--le-gutter);
}

.le-pager__link {
	display: grid;
	place-items: center;
	width: 1.5rem;
	height: 1.5rem;
	font-family: var(--le-font-mono);
	font-size: 0.6875rem;
	font-weight: 500;
	line-height: 0.875rem;
	letter-spacing: 0.0344rem;
	color: var(--le-black);
	text-decoration: none;
	background: var(--le-100);
	transition: background-color 0.2s;
}

a.le-pager__link:hover,
a.le-pager__link:focus-visible {
	color: var(--le-black);
	background: var(--le-200);
}

.le-pager__link.is-current {
	background: var(--le-blue);
}

.le-pager__link.is-disabled img {
	opacity: 0.35;
}

.le-pager__link img {
	width: 0.75rem;
}

.le-pager__link--prev img {
	transform: scaleX(-1);
}

@media (max-width: 880px) {
	/* Easier to hit with a thumb. */
	.le-pager__link {
		width: 2.25rem;
		height: 2.25rem;
	}
}
