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

:root {
	font-size: 17px;
	font-weight: 300;
	--color-text: #000;
	--color-text-alt: #fff;
	--color-frame-alt: #a17445;
	--color-bg: #c6c1b7;
	--color-bg-alt: #18130e;
	--color-link: #000;
	--color-link-alt: #fff;
	--color-link-hover: #000;
	--color-link-hover-alt: #a17445;
	--color-column-title: #727170;
	--color-overlay: #000;
	--color-border: #a0988a;
}

body {
	margin: 0;
	color: var(--color-text);
	background-color: var(--color-bg);
	text-transform: uppercase;
	font-family: acumin-pro, sans-serif;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

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

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

.line {
	transform-origin: 0 50%;
	white-space: nowrap;
	will-change: transform;
}

/* 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;
	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);
	}
}

a {
	text-decoration: none;
	color: var(--color-link);
	outline: none;
	white-space: nowrap;
	overflow: hidden;
	position: relative;
}

a:not(.frame__title-back):not(.item__link)::before {
	content: '';
	height: 1px;
	width: 100%;
	background: currentColor;
	position: absolute;
	top: 92%;
	transition: transform 0.3s;
	transform-origin: 0% 50%;
}

a:not(.frame__title-back):not(.item__link):hover::before {
	transform: scaleX(0);
	transform-origin: 100% 50%;
}

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

.preview-visible .frame a {
	color: var(--color-frame-alt);
}

.preview-visible a:hover {
	color: var(--color-link-hover-alt);
}

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

.unbutton:focus {
	outline: none;
}

main {
	padding: 1.5rem 2.5rem 3rem;
	height: 100vh;
	display: grid;
	grid-template-columns: 100%;
	grid-template-areas: 'frame' 'content';
	grid-template-rows: min-content 1fr;
	grid-row-gap: 8vh;
}

.frame {
	position: relative;
	grid-area: frame;
	display: grid;
	font-size: 0.85rem;
	margin-bottom: 5vh;
	grid-template-columns: 100%;
	align-items: start;
	grid-row-gap: 1rem;
	grid-template-areas: 'title' 'credits' 'sponsor';
	align-content: space-between;
	will-change: transform, opacity;
}

.preview-visible .frame {
	opacity: 0;
	z-index: 100;
	color: var(--color-frame-alt);
}

.frame__title {
	grid-area: title;
	display: flex;
	flex-wrap: wrap;
	width: 14rem;
}

.frame__title-main {
	font-size: 0.85rem;
	margin: 0;
	font-weight: 300;
}

.frame__title-back {
	position: relative;
	display: flex;
	align-items: flex-end;
}

.frame__title-back span {
	display: none;
}

.frame__title-back svg {
	fill: currentColor;
	width: 16px;
	height: 16px;
}

.content {
	grid-area: content;
	max-width: 400px;
}

.content--hidden {
	pointer-events: none;
}

.item {
	margin-bottom: 5rem;
	display: grid;
	grid-template-columns: 100%;
	grid-template-rows: 1rem auto auto 1fr auto;
}

.item__title {
	font-family: kudryashev-d-excontrast-sans, sans-serif;
	font-weight: 300;
	font-size: 2rem;
	margin-bottom: 0.5rem;
}

.item__img {
	position: relative;
	overflow: hidden;
	width: 100%;
	aspect-ratio: 500/333;
}

.item__img-inner {
	background-position: 50% 45%;
	background-size: cover;
	width: 100%;
	height: 100%;
}

.item__desc {
	margin-top: 2.5rem;
	line-height: 1.1;
}

.item__link {
	cursor: pointer;
	text-transform: lowercase;
	width: 100%;
	padding: 1rem;
	color: var(--color-text);
	border: 1px solid var(--color-border);
	border-radius: 2rem;
	text-align: center;
}

.item__link:hover {
	background: var(--color-text);
	border-color: var(--color-text);
	color: var(--color-text-alt);
}

.overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: grid;
	grid-template-columns: 100%;
	pointer-events: none;
	grid-template-rows: repeat(2,1fr);
}

.overlay__row {
	background: var(--color-overlay);
	transform: scaleY(0);
	will-change: transform;
}

.overlay__row:first-child {
	transform-origin: 50% 0%;
}

.overlay__row:last-child {
	transform-origin: 50% 100%;
}

.previews {
	position: relative;
	grid-area: content;
	pointer-events: none;
}

.preview {
	opacity: 0;
	pointer-events: none;
	position: absolute;
	width: 100%;
	height: 100%;
	top: 0;
	color: var(--color-text-alt);
}

.preview--current {
	opacity: 1;
	pointer-events: auto;
}

.preview__img {
	grid-area: 1 / 1 / 2 / -1;
	width: 100%;
    min-height: 200px;
    overflow: hidden;
    position: relative;
    transform: translateY(-101%);
    pointer-events: none;
	will-change: transform;
}

.preview__img-inner {
	background-position: 50% 35%;
	background-size: cover;
	width: 100%;
	height: 100%;
	transform: translateY(101%);
	will-change: transform;
}

.preview__title {
	margin: 2rem 0;
	line-height: 0.7;
	font-size: clamp(2rem,18vw,15rem);
	white-space: nowrap;
	font-family: kudryashev-d-excontrast-sans, sans-serif;
	font-weight: 300;
	justify-self: center;
	align-self: center;
	grid-area: 1 / 1 / 2 / -1;
}

.preview__title span {
	line-height: 0.7;
    padding-top: 3%;
}

.preview__column p {
	line-height: 1.1;
	opacity: 0;
}

.preview__column > span {
	display: block;
}

.preview__column-title {
	font-weight: 300;
	margin-top: 0;
	font-size: 1rem;
}

.preview__column-title:not(.preview__column-title--main) {
	color: var(--color-column-title);
}

.preview__column--start {
	grid-area: 2 / 1 / 3 / 3;
}

.preview__column:not(.preview__column--start) {
	grid-row: 2 / span 2;
}

.preview__back {
	margin: 2rem auto;
	stroke: var(--color-link-alt);
	cursor: pointer;
	fill: none;
	grid-area: 3 / 1 / 4 / 2;
	justify-self: start;
	align-self: end;
}

.preview__back:hover {
	stroke: var(--color-link-hover-alt);
}

@media screen and (min-width: 53em) {
	.frame {
		margin-bottom: 0;
		grid-template-columns: repeat(3,1fr);
		grid-row-gap: 0;
		grid-column-gap: 5vw;
		grid-template-rows: auto;
		grid-template-areas: 'title credits sponsor';
	}
	.content {
		max-width: none;
		display: grid;
		grid-template-columns: repeat(3,1fr);
		grid-template-rows: 100%;
		grid-column-gap: 5vw;
	}
	.item {
		margin-bottom: 0;
	}
	.item__title {
		font-size: clamp(1.25rem,3vw,2rem);
	}
	.preview {
		display: grid;
		grid-column-gap: 10vw;
		grid-row-gap: 1rem;
		grid-template-columns: repeat(4,1fr);
		grid-template-rows: 1fr auto auto;
	}
	.preview__title {
		margin: 0;
	}
	.preview__back {
		margin: 0;
	}
}

