:root {
	--hsl-orange: 23.93, 67.2%, 50.98%;
	--hsl-white: 0, 0%, 100%;
	--hsl-off-white: 30, 16.67%, 97.65%;
	--hsl-light-grey: 30, 19.23%, 89.8%;
	--hsl-medium-grey: 32, 10.49%, 71.96%;
	--hsl-dark-grey: 30, 7.14%, 43.92%;
	--hsl-medium-brown: 28.57, 24.71%, 16.67%;
	--hsl-dark-brown: 30, 26.92%, 10.2%;
	--hsl-black: 0, 0%, 0%;
	--fontsize: 0.75rem;
	--header: calc(var(--fontsize) * 2.3 * 0.725 + 2 * var(--margin-double));
	--margin: var(--fontsize);
	--margin-half: calc(var(--margin) / 2);
	--margin-double: calc(var(--margin) * 2);
}

@keyframes in {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

@keyframes out {
	from {
		opacity: 1;
	}
	to {
		opacity: 0;
	}
}

@keyframes in-out {
	0% {
		opacity: 0;
	}
	0.005%,
	99.005% {
		opacity: 1;
	}
	100% {
		opacity: 0;
	}
}

@keyframes slide-in {
	from {
		-webkit-mask-position-x: 100%;
		mask-position-x: 100%;
	}
	to {
		-webkit-mask-position-x: 0%;
		mask-position-x: 0%;
	}
}

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

html {
	/* scroll-snap-type: y proximity; */
	scroll-behavior: smooth;
}

body {
	--background: var(--hsl-white);
	--foreground: var(--hsl-black);
	color: hsl(var(--foreground));
	background-color: hsl(var(--background));
	font-family: "Suisse Intl";
	font-size: var(--fontsize);
	letter-spacing: 0.04em;
	line-height: 1.2;
	text-size-adjust: none;
	-moz-osx-font-smoothing: grayscale;
	-webkit-font-smoothing: antialiased;
	transition: all 1s;
}

body.invert {
	--background: var(--hsl-black);
	--foreground: var(--hsl-off-white);
}

a {
	color: inherit;
	text-decoration: none;
}

a[href]:hover,
a[href]:focus-visible {
	outline: none;
	color: hsl(var(--hsl-orange));
}

p + p {
	margin-top: 1.2em;
}

.invert {
	--foreground: var(--hsl-white);
	--background: var(--hsl-black);
	--hsl-medium-grey: var(--hsl-dark-grey);
	background-color: hsl(var(--background));
	color: hsl(var(--foreground));
}

.invert + .invert {
	margin-top: -33vh;
	margin-top: -33svh;
}

.nav {
	position: fixed;
	top: calc(var(--margin-double) - 0.1rem);
	z-index: 11;
	color: transparent;
	font-family: "Suisse Intl Mono";
	line-height: 1;
	text-transform: uppercase;
}

.nav--metrica {
	margin-left: -0.09em;
	left: var(--margin-double);
	line-height: 0.8;
}

.nav--about {
	/* padding-left: 0.18em; */
	left: calc(50% + var(--margin));
}

.nav--metrica:hover ~ nav > ul > li:first-child,
.nav--about:hover ~ nav > ul > li:nth-child(2) {
	visibility: hidden;
}

nav {
	height: var(--header);
	margin-bottom: calc(-1 * var(--header));
	padding: calc(var(--margin-double) - 0.1rem) var(--margin-double) var(--margin-double);
	position: sticky;
	top: 0;
	z-index: 10;
	color: white;
	font-family: "Suisse Intl Mono";
	line-height: 1;
	text-transform: uppercase;
	mix-blend-mode: difference;
}

nav > ul {
	list-style: none;
	display: flex;
	gap: var(--margin-double);
}

nav > ul > li:first-child {
	flex: 0 0 calc(50% - var(--margin));
	line-height: 0.8;
	text-indent: -0.18em;
}

nav > ul > li:nth-child(2) {
	flex: 1 0 auto;
	/* text-indent: 0.18em; */
}

nav > ul > li:last-child {
	height: 1.1em;
	overflow: hidden;
	text-align: right;
}

section {
	position: relative;
}

section > h2 {
	display: flex;
	align-items: baseline;
	font-family: "Suisse Intl Mono";
	font-size: inherit;
	font-weight: normal;
	text-transform: uppercase;
}

section > h2::before {
	content: "";
	width: 0.725em;
	height: 0.725em;
	margin-right: 1ch;
	background-color: currentColor;
}

footer {
	/* scroll-snap-align: start; */
	display: grid;
	grid-template-rows: auto 1fr;
	max-width: 100%;
	min-height: 100vh;
	min-height: 100svh;
	padding: var(--margin-double);
	overflow: hidden;
	position: relative;
	z-index: 100;
	background-color: white;
}

footer > .logo {
	grid-column: 1 / -1;
	width: calc(100% + 2 * var(--margin-double));
	margin: calc(-1 * var(--margin-double)) calc(-1 * var(--margin-double)) auto;
	background-color: inherit;
	text-transform: none;
}

footer > div:not(.logo) {
	display: grid;
	align-items: end;
	grid-template-columns: repeat(4, 1fr);
	min-height: calc(5 * 1.2em + 2 * var(--margin-double));
	background-image: repeating-linear-gradient(
		to right,
		hsl(var(--hsl-medium-grey)),
		hsl(var(--hsl-medium-grey)) 1px,
		transparent 1px,
		transparent 25%
	), repeating-linear-gradient(
		to right,
		hsl(var(--hsl-medium-grey)),
		hsl(var(--hsl-medium-grey)) 1px,
		transparent 1px,
		transparent 12.5%
	), repeating-linear-gradient(
		to right,
		hsl(var(--hsl-medium-grey)),
		hsl(var(--hsl-medium-grey)) 1px,
		transparent 1px,
		transparent 2.5%
	);
	background-repeat: repeat-x;
	background-size: calc(100% - 1px) 100%,
		calc(100% - 1px) calc(3 * var(--margin)),
		calc(100% - 1px) var(--margin);
	font-family: "Suisse Intl Mono";
	text-transform: uppercase;
}

footer > div:not(.logo) > div {
	padding-left: var(--margin);
	padding-right: var(--margin);
}

footer > div:not(.logo) > div:first-child {
	max-width: 60ch;
	text-wrap: balance;
}

/* FORM */

.hidden {
	width: 1px;
	height: 1px;
	overflow: hidden;
	position: absolute;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

.subscribe {
	max-width: 100%;
	/* padding: var(--margin-double); */
	overflow: hidden;
	/* color: hsl(var(--hsl-medium-grey)); */
}

.subscribe > div {
	width: 100%;
	font-family: "Suisse Intl Mono";
	font-size: inherit;
	line-height: 0.725;
	text-transform: uppercase;
	user-select: none;
}

.subscribe > form {
	display: flex;
	overflow: hidden;
	margin-top: var(--margin-half);
	animation: slide-in 1s cubic-bezier(.3, 0, .15, 1) forwards;
	-webkit-mask: linear-gradient(to right, black 50%, transparent 50%) no-repeat 100% 0% / 200% 100%;
	mask: linear-gradient(to right, black 50%, transparent 50%) no-repeat 100% 0% / 200% 100%;
}

.subscribe > form > :is(button, input) {
	appearance: none;
	min-height: 0;
	height: calc(0.725em + var(--margin-double));
	padding: var(--margin);
	border: none;
	border-radius: 0;
	font-family: "Suisse Intl Mono";
	font-size: inherit;
	line-height: 0.725;
	text-transform: uppercase;
}

.subscribe > form > input {
	flex: 1;
	min-width: 0;
	width: 20em;
	max-width: 100%;
	background-color: hsl(var(--hsl-light-grey));
}

.subscribe > form > button {
	background-color: hsl(var(--foreground));
	color: hsl(var(--background));
	cursor: pointer;
}

.subscribe > form > button:hover,
.subscribe > form > button:focus-visible {
	outline: none;
	background-color: hsl(var(--hsl-orange));
}

/* ANIMATION */

.animate > span {
	opacity: 0;
	animation: var(--name) var(--duration) var(--delay) forwards;
}

.animate--delayed > span {
	--name: none !important;
}

/* LOGO */

.logo {
	user-select: none;
	font-family: "Suisse Intl";
	font-weight: bold;
	letter-spacing: 0;
}

.logo--big {
	width: 100%;
	overflow: hidden;
	font-size: calc(29.5vw - var(--fontsize));
	line-height: 0.725;
}

.logo > :is(div, span) {
	transform: scaleX(0.99);
	transform-origin: left;
}

.logo > span {
	display: inline-block;
}

.logo--big > :is(div, span) {
	margin-left: -0.08em;
	padding: var(--margin-double);
}

.logo > :is(div, span) > span:nth-child(2),
.logo > :is(div, span) > span:nth-child(3) {
	margin-left: -0.095em;
}

.logo > :is(div, span) > span:nth-child(4),
.logo > :is(div, span) > span:nth-child(6) {
	margin-left: -0.07em;
}

.logo > :is(div, span) > span:nth-child(5) {
	margin-left: -0.065em;
}

.logo > :is(div, span) > span:nth-child(7) {
	margin-left: -0.055em;
}

.logo > :is(div, span) > span:nth-child(8) {
	margin-left: -0.1em;
	position: relative;
	top: -0.01em;
}

.metrica {
	font-family: "Suisse Intl";
	font-size: 2.3em;
	font-weight: bold;
	letter-spacing: -0.03em;
	text-transform: none;
}

.metrica > span {
	visibility: hidden;
}

/* RESPONSIVE */

@media (orientation: portrait) {
	.nav--about {
		display: none;
	}

	nav > ul > li:nth-of-type(2) {
		display: none;
	}

	nav > ul > li:last-of-type {
		/* grid-column: span 2; */
		/* justify-self: start; */
		flex: 0 0 calc(50% - var(--margin));
		white-space: nowrap;
	}

	footer > div:not(.logo)::before {
		content: "";
		height: 100%;
		overflow: hidden;
		background-image:
			repeating-linear-gradient(
				to bottom,
				hsl(var(--hsl-medium-grey)),
				hsl(var(--hsl-medium-grey)) 1px,
				transparent 1px,
				transparent 25%
			),
			repeating-linear-gradient(
				to bottom,
				hsl(var(--hsl-medium-grey)),
				hsl(var(--hsl-medium-grey)) 1px,
				transparent 1px,
				transparent 12.5%
			),
			repeating-linear-gradient(
				to bottom,
				hsl(var(--hsl-medium-grey)),
				hsl(var(--hsl-medium-grey)) 1px,
				transparent 1px,
				transparent 2.5%
			);
		background-repeat: repeat-y;
		background-size: 
			100% calc(100% - 1px),
			calc(3 * var(--margin)) calc(100% - 1px),
			var(--margin) calc(100% - 1px);
	}

	footer > div:not(.logo) {
		gap: var(--margin);
		grid-template-columns: 1fr;
		grid-template-rows: 1fr repeat(4, auto);
		background-image: none;
	}

	footer > div:not(.logo) > div {
		padding-right: 0;
		padding-left: 0;
	}

	footer > div:not(.logo) > div:first-child {
		display: none;
	}

	footer > div:not(.logo) > div:not(:nth-child(2)) {
		padding-top: var(--margin);
		border-top: 1px solid hsl(var(--hsl-medium-grey));
	}
}

@media (min-width: 2560px) {
	:root {
		--fontsize: 1rem;
	}
}

@media (min-width: 1920px) {
	:root {
		--fontsize: 0.875rem;
	}
}

@media (max-width: 480px) {
	:root {
		--fontsize: 0.625rem;
	}
}
