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

:root {
	font-size: 20px;
}

body {
	margin: 0;
	--color-text: #111;
	--color-bg: #f7f5f0;
	--color-link: #ccc0a2;
	--color-link-hover: #000;
	--color-menu: #000;
	--color-menu-hover: #f32015;
	color: var(--color-text);
	background-color: var(--color-bg);
	--cursor-stroke: none; 
	--cursor-fill: #e0530e; 
	--cursor-stroke-width: 1px; 
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	font-family: roc-grotesk, sans-serif;
}

body, main {
	height: 100vh;
	overflow: hidden;
}

/* Page Loader */
.js .loading::before,
.js .loading::after {
	content: '';
	position: fixed;
	z-index: 1000;
}

.js .loading::before {
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: var(--color-bg);
}

.js .loading::after {
	top: 50%;
	left: 50%;
	width: 60px;
	height: 60px;
	margin: -30px 0 0 -30px;
	opacity: 0.4;
	background: var(--color-link);
	animation: loaderAnim 0.7s linear infinite alternate forwards;

}

@keyframes loaderAnim {
	to {
		opacity: 1;
		transform: scale3d(0.5,0.5,1);
	}
}

a {
	text-decoration: none;
	color: var(--color-link);
	outline: none;
	position: relative;
}

a:hover {
	color: var(--color-link-hover);
	outline: none;
}

/* Better focus styles from https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible */
a:focus {
	/* Provide a fallback style for browsers
	 that don't support :focus-visible */
	outline: none;
	background: lightgrey;
}

a:focus:not(:focus-visible) {
	/* Remove the focus indicator on mouse-focus for browsers
	 that do support :focus-visible */
	background: transparent;
}

a:focus-visible {
	/* Draw a very noticeable focus style for
	 keyboard-focus on browsers that do support
	 :focus-visible */
	outline: 2px solid red;
	background: transparent;
}

.cursor { 
	display: none; 
}

.unbutton {
	background: none;
	border: 0;
	padding: 0;
	margin: 0;
	font: inherit;
}

.unbutton:focus {
	outline: none;
}

.frame {
	padding: 1rem;
	text-align: center;
	position: relative;
	z-index: 1000;
	font-weight: 500;
}

.frame a:not(.noline)::after {
	content: '';
	height: 1px;
	width: 100%;
	background: currentColor;
	position: absolute;
	left: 0;
	bottom: 0.15rem;
}

.frame__title {
	font-size: 1rem;
	margin: 0 0 1rem;
	font-weight: 500;
}

.frame__links {
	display: inline;
}

.frame__links a:not(:last-child) {
	margin-right: 1rem;
}

.frame__author {
	margin: 0 1rem ;
	display: inline-block;
}

.frame__related {
	white-space: nowrap;
}

.menu {
	padding: 2rem 1rem 3rem;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
	counter-reset: menucounter;
	z-index: 100;
}

.menu__item {
	margin-bottom: 1rem;
	font-family: kudryashev-d-contrast-sans, sans-serif;
	text-transform: uppercase;
	cursor: pointer;
	color: var(--color-menu);
	will-change: transform;
}

.menu__item::before {
	counter-increment: menucounter;
	content: counters(menucounter, ".", decimal-leading-zero);
	position: absolute;
	left: 0;
	top: 0;
	color: var(--color-link);
	z-index: -1;
	line-height: 1;
}

.menu__item-text {
	pointer-events: none;
	display: block;
	line-height: 1;
	position: relative;
	z-index: -1;
	font-size: 2rem;
}

.menu__item-text .word {
	padding: 0 1.25rem;
	overflow: hidden;
	perspective: 1000px;
	perspective-origin: -150% 50%;
}

.menu__item-text .word--clone {
	position: absolute;
	width: 100%;
	height: 100%;
	top: 0;
	left: 0;
}

.menu__item-text .word--clone .char {
	opacity: 0;
}

.menu__item-text .char {
	transform-origin: 0% 0%;
	will-change: transform;
}

.hover-reveal {
	position: absolute;
	z-index: -1;
	width: 350px;
	height: 450px;
	top: 0;
	left: 0;
	pointer-events: none;
	opacity: 0;
	will-change: transform, filter;
}

.hover-reveal__inner {
	overflow: hidden;
	will-change: transform, opacity;
}

.hover-reveal__inner,
.hover-reveal__img {
	width: 100%;
	height: 100%;
	position: relative;
}

.hover-reveal__img {
	background-size: cover;
	background-position: 50% 50%;
	will-change: transform;
}

.content {
	max-width: 30ch;
	margin: 0 auto;
	z-index: -1;
	position: relative;
}

.content::after {
	content: '';
	position: fixed;
	pointer-events: none;
	z-index: 500;
	width: 100%;
	height: 100%;
	top: 0;
	left: 0;
	z-index: 1;
	background: linear-gradient(transparent 0%,transparent 70%,var(--color-bg) 100%);
}

@media screen and (min-width: 53em) {
	.frame {
		pointer-events: none;
		position: fixed;
		display: grid;
		height: 100vh;
		width: 100%;
		align-content: space-between;
		grid-template-columns: 30% 40% 30%;
		grid-template-rows: auto auto;
		grid-template-areas: 'title links ...' 'author ... related';
		padding: 1.5rem 2rem;
	}
	.frame a {
		pointer-events: auto;
	}
	.frame__title {
		justify-self: start;
	}
	.frame__author {
		margin: 0;
		grid-area: author;
		justify-self: start;
	}
	.frame__related {
		grid-area: related;
		justify-self: end;
	}
	.menu {
		padding: 21vh 1rem 3rem;
	}
	.menu__item::before {
		left: 1vw;
		top: 0.25vw;
	}
	.menu__item-text {
		font-size: 7.5vw;
	}
	.menu__item-text .word {
    	padding: 0 3vw;
    }
}

@media (any-pointer:fine) {
	.cursor {
		position: fixed;
		top: 0;
		left: 0;
		display: block;
		pointer-events: none;
		z-index: 1001;
	}

	.cursor__inner {
		fill: var(--cursor-fill);
		stroke: var(--cursor-stroke);
		stroke-width: var(--cursor-stroke-width);
		opacity: 0.7;
	}

	.no-js .cursor {
		display: none;
	}

}
