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

:root {
	font-size: 17px;
	--color-text: #eb5c33;
	--color-text-alt: #9b8b85;
	--color-link: #9b8b85;
	--color-link-hover: #eb5c33;
	--color-button-hover: #fff;
}

body {
	margin: 0;
	color: var(--color-text);
	background: linear-gradient(to bottom,#1F1D1C,#170703);
	font-family: widescreen,-apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	min-height: 100vh;
}

/* 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: linear-gradient(to bottom,#1F1D1C,#170703);
}

.js .loading::after {
	top: 50%;
	left: 50%;
	width: 60px;
	height: 60px;
	margin: -30px 0 0 -30px;
	border-radius: 50%;
	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);
	}
}

.oh {
	position: relative;
    overflow: hidden;
}

.oh__inner {
	will-change: transform;
    display: inline-block;
}

a {
	text-decoration: none;
	color: var(--color-link);
	outline: none;
	cursor: pointer;
}

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;
}

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

.unbutton:hover {
	color: var(--color-button-hover);
}

.unbutton:focus {
	outline: none;
}

main {
	width: 100%;
	display: grid;
	grid-template-columns: 100%;
	grid-template-rows: auto 1fr;
}

/* Grainy texture animation by Geoff Graham https://css-tricks.com/snippets/css/animated-grainy-texture/ */

main::before {
	background-image: url(../img/noise.png);
	content: '';
	height: 300%;
	left: -50%;
	opacity: 0.1;
	position: fixed;
	top: -100%;
	width: 300%;
}

.frame {
	padding: 1.5rem;
	text-align: center;
	position: relative;
	z-index: 500;
	display: grid;
	grid-template-columns: 1fr;
	justify-items: center;
	grid-gap: 0.5rem;
	grid-template-areas: 'title'
						'prev'
						'home'
						'sponsor';
}

.frame__title {
	grid-area: title;
	display: flex;
}

.frame__title-main {
	font-size: 1rem;
	color: var(--color-text-alt);
	margin: 0;
	line-height: 1;
	font-weight: normal;
}

.frame__title-back {
	position: relative;
	display: flex;
	align-items: flex-end;
	margin-bottom: 0.15rem;
}

.frame__title-back:hover,
.frame__title-back:focus {
	color: var(--color-button-hover);
}

.frame__title-back span {
	display: none;
}

.frame__title-back svg {
	fill: currentColor;
}

.frame__menu {
	cursor: not-allowed;
	grid-area: menu;
	justify-self: end;
	align-self: center;
	width: 1rem;
	height: 0.5rem;
	border-top: 1px solid var(--color-link);
	border-bottom: 1px solid var(--color-link);
}

.frame__home {
	grid-area: home;
	pointer-events: none;
	opacity: 0;
}

.frame__home--show {
	opacity: 1;
	pointer-events: auto;
}

.content {
	display: grid;
	grid-template-columns: 100%;
	grid-template-rows: 6rem 370px 1fr;
	width: 100vw;
	height: calc(100vh - 13rem);
	position: relative;
	align-items: center;
	z-index: 20;
	grid-area: 2 / 1 / 3 / 2;
}

.preview-open .content {
	pointer-events: none;
}

.content__title-wrap {
	text-align: center;
	margin: 0 0 1rem 0;
	position: relative;
	z-index: 2;
}

.content__title {
	margin: 0;
	font-weight: 400;
	font-size: 2.25rem;
}

.content__subtitle {
	margin: 0;
	font-weight: 400;
	font-size: 1rem;
}

.works {
	z-index: 10;
	display: grid;
	grid-template-columns: 100%;
	grid-template-rows: 6rem auto 500px;
	place-items: center;
	opacity: 0;
	pointer-events: none;
	padding: 0 5vw 5vw;
	position: relative;
	grid-row-gap: 2rem;
	grid-area: 2 / 1 / 3 / 2;
	grid-template-areas: '...' 'works-title' 'works-grid';
}

.works--open {
	opacity: 1;
	pointer-events: auto;
}

.grid {
	display: grid;
	position: relative;
	z-index: 1;
}

.content .grid {
	width: 100px;
	height: 370px;
	margin: 0 auto;
	grid-gap: 8px;
	grid-template-columns: repeat(2,1fr);
}

.works .grid {
	grid-gap: 1rem;
	grid-template-columns: repeat(2,1fr);
	grid-area: works-grid;
	width: 100%;
	height: 500px;
}

.grid__item,
.grid__item-img {
	display: block;
	width: 100%;
	will-change: transform;
}

.grid__item {
	overflow: hidden;
	cursor: default;
	position: relative;
	background-color: #170703;
}

.grid__item-img {
	opacity: 0.6;
}

.content .grid .grid__item {
	aspect-ratio: 1;
}

.works .grid__item {
	height: 100%;
}

.enter {
	margin-top: 1rem;
	align-self: start;
    justify-self: center;
}

.enter__link {
	position: relative;
	display: flex;
	align-items: flex-end;
	margin-bottom: 0.15rem;
}

.enter__link:hover,
.enter__link:focus {
	color: var(--color-button-hover);
}

.enter__link svg {
	transform: rotate(45deg);
	fill: currentColor;
}

.grid__item-img {
	width: 100%;
	height: 100%;
	background-size: cover;
	background-position: 50% 50%;
	pointer-events: none;
}

.works .grid__item::after {
	content: attr(data-title);
	position: absolute;
	left: 0;
	width: 100%;
	top: 0;
	color: #fff;
	font-size: 0.75rem;
	padding: 1rem;
	opacity: 0;
	transform: translateX(30px);
	transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.works .grid__item:nth-last-child(-n+7)::after {
	top: 0;
	bottom: auto;
}

.works .grid__item:hover::after {
	opacity: 1;
	transform: translateX(0);
}

.works__title {
	grid-area: works-title;
	position: relative;
	pointer-events: none;
	z-index: 100;
	width: 100%;
	text-transform: uppercase;
	font-family: kudryashev-d-excontrast-sans, sans-serif;
	font-weight: 300;
	font-size: 10vw;
	display: grid;
	grid-template-columns: 100%;
	grid-template-rows: 100%;
	margin: 0;
	align-items: start;
}

.works__title > span {
	grid-area: 1 / 1 / -1 / -1;
}

.works__title .oh {
	line-height: 0.7;
}

.works__title .oh__inner {
	line-height: 0.7;
	padding-top: 1.5vw;
}

.works__title > span:last-child {
	align-self: end;
    text-align: right;
}

@media screen and (min-width: 53em) {
	body {
		width: 100%;
		height: 100%;
		overflow: hidden;
	}
	main {
		height: 100vh;
	}
	.frame {
		grid-area: 1 / 1 / -1 / -1;
		text-align: left;
		grid-gap: 0;
		pointer-events: none;
		justify-items: start;
		grid-template-columns: 1fr 1fr 1fr;
		grid-template-rows: auto auto;
		align-content: space-between;
		grid-template-areas: 'home title title'
						'prev ... sponsor';
	}
	.frame a { 
		pointer-events: auto; 
	}
	.frame__title {
		justify-self: end;
	}
	.frame__title-main {
		opacity: 0;
	}
	.frame__home {
		justify-self: start;
	}
	.content {
		height: 100vh;
		overflow: hidden;
		justify-content: center;
		grid-template-rows: 35vh 105px 1fr;
	}
	.content .grid {
		width: 400px;
		height: 105px;
		grid-gap: 13px;
		grid-template-columns: repeat(7,1fr);
	}
	.content,
	.works {
		grid-area: 1 / 1 / -1 / -1;
	}
	.works {
		grid-template-rows: 100%;
		grid-template: none;
		grid-row-gap: 0;
		padding: 0 5rem;
	}
	.works .grid {
		grid-template-rows: 1fr 20vh 1fr;
		grid-area: 1 / 1 / -1 / -1;
		height: 100%;
		grid-row-gap: 0;
		grid-column-gap: 5vh;
		grid-template-columns: repeat(7,1fr);
	}
	.works__title {
		grid-area: 1 / 1 / -1 / -1;
		height: 20vh;
	}
	.works .grid__item:nth-child(1) { height: 55%; }
	.works .grid__item:nth-child(2) { height: 95%; }
	.works .grid__item:nth-child(3) { height: 65%; }
	.works .grid__item:nth-child(4) { height: 70%; }
	.works .grid__item:nth-child(5) { height: 100%; }
	.works .grid__item:nth-child(6) { height: 35%; }
	.works .grid__item:nth-child(7) { height: 65%; }
	.works .grid__item:nth-child(8) { height: 55%; }
	.works .grid__item:nth-child(9) { height: 65%; }
	.works .grid__item:nth-child(10) { height: 95%; }
	.works .grid__item:nth-child(11) { height: 55%; }
	.works .grid__item:nth-child(12) { height: 75%; }
	.works .grid__item:nth-child(13) { height: 55%; }
	.works .grid__item:nth-child(14) { height: 75%; }
	.works .grid__item:nth-last-child(-n+7) {
		grid-row: 3;
		align-self: end;
	}
}
