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

:root {
	font-size: 14px;
	--color-text: #fff;
	--color-bg: #000;
	--color-link: #fff;
	--color-link-hover: #fff;
	--page-padding: 1.5rem;
}

html, body {
	height: 100%;
}

body {
	margin: 0;
	color: var(--color-text);
	background-color: var(--color-bg);
	font-family: "area-normal", -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

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

.unbutton:focus {
	outline: none;
}

.js main {
	display: grid;
	width: 100%;
	height: 100vh;
	grid-template-columns: 100%;
	grid-template-rows: auto 1fr;
	grid-template-areas: 'frame' 'main';
}

.frame {
	grid-area: frame;
	z-index: 1000;
	position: relative;
	display: grid;
	grid-template-columns: 100%;
	grid-template-areas: 'title' 'sponsor' 'prev';
	gap: 1rem;
	justify-items: start;
	align-self: start;
	justify-self: start;
	pointer-events: none;
	padding: var(--page-padding);
}

.js .frame {
	opacity: 0;
}

body #cdawrap {
    justify-self: start;
}

.frame a {
	pointer-events: auto;
}

.frame a:not(.frame__title-back) {
	white-space: nowrap;
	overflow: hidden;
	position: relative;
}

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

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

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

.frame__title-main {
	font-size: inherit;
	margin: 0;
	font-weight: inherit;
}

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

.frame__title-back span {
	display: none;
}

.frame__title-back svg {
	fill: currentColor;
}

.frame__prev {
	grid-area: prev;
}

.gallery {
	display: grid;
	grid-template-columns: repeat(3,1fr);
	gap: 2vw;
	width: 100%;
	height: calc(100% - 120px);
	justify-items: center;
	grid-area: main;
	padding: var(--page-padding);
}

.js .gallery {
	opacity: 0;
	pointer-events: none;
}

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

.gallery__item {
	background-position: 50% 50%;
	background-size: cover;	
	position: relative;
	overflow: hidden;
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	will-change: transform;
}

.gallery__item-inner {
	width: 100%; 
	height: 100%;
	background-position: 50% 50%;
	background-size: cover;	
	background-repeat: no-repeat;
	transform: scale(1.6);
	will-change: transform;
}

.loader {
	display: grid;
	grid-template-areas: 'loader-img loader-progress';
	grid-template-columns: 75px 1fr;
	grid-area: main;
	padding: var(--page-padding);
	position: relative;
	pointer-events: none;
	gap: 2rem;
	align-self: end;
	overflow: hidden;
	z-index: 100;
}

.loader__img {
	grid-area: loader-img;
	width: 75px;
	height: 95px;
	position: relative;
	display: grid;
	place-items: center;
}

.loader__img .gallery__item {
	width: 100%;
	height: 100%;
	grid-area: 1 / 1 / 2 / 2;
}

.loader__progress {
	position: relative;
	grid-area: loader-progress;
	font-size: clamp(2rem, 8vw, 6rem);
	line-height: 1;
	padding-bottom: 0.2em;
	align-self: center;
	display: flex;
}	

.nav {
	display: grid;
	grid-template-columns: auto auto;
	grid-template-rows: auto;
	grid-template-areas: 'prev next';
	grid-area: main;
	justify-content: space-between;
	padding: var(--page-padding);
	position: relative;
	z-index: 50;
	pointer-events: none;
}

.nav__item {
	display: grid;
	gap: 10px;
	grid-template-rows: 95px;
	pointer-events: auto;
	cursor: pointer;
	align-self: end;
}

.nav__item .gallery__item {
	grid-area: img;
}

.nav__item--prev {
	grid-area: prev;
	grid-template-areas: 'img arrow';
	grid-template-columns: 75px 40px;
}

.nav__item--next {
	grid-area: next;
	grid-template-areas: 'arrow img';
	grid-template-columns: 40px 75px;
}

.nav__item-arrow {
	position: relative;
	grid-area: arrow;
	opacity: 0;
	fill: none;
	stroke: var(--color-link);
	stroke-width: 1.5px;
}

@media screen and (min-width: 53em) {
	main {
		grid-template-rows: 100%;
		grid-template-areas: 'main';
	}
	.frame {
		position: absolute;
		top: 0;
		left: 10%;
	}
	.frame__demos {
		justify-self: end;
	}
	.gallery {
		height: 100%;
		gap: var(--page-padding);
		grid-template-columns: repeat(10,1fr);
		grid-template-rows: repeat(4,1fr);
	}
	.gallery .gallery__item {
		aspect-ratio: auto;
		grid-area: var(--row) / var(--col);
	}

	.nav__item--next {
		align-self: start;
	}

}



.gallery__item {
  aspect-ratio: 1 / 1 !important;
  height: auto !important;
}


