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

:root {
	font-size: 18px;
	--color-text: black;
	--color-bg: whitesmoke;
	--color-link: #fff;
	--color-link-hover: #a2a2a2;
	--perspective: 0px;
	--grid-item-translate: 0px;
	--grid-item-ratio: 0.75;
	--grid-item-radius: 7px;
	--grid-gap: 4vw;
	--grid-columns: 3;
	--grid-width: 100%;
	--grid-max-width: 1200px;
}

.demo-4 {
	--grid-item-ratio: 0.7;
	--grid-item-radius: 0;
	--grid-gap: 1.5vw;
	--grid-columns: 7;
}

body {
	margin: 0;
	color: var(--color-text);
	background-color: var(--color-bg);
	font-family: "marlide-display-variable", sans-serif;
	font-variation-settings: "wght" 300;
	overflow-x: hidden;
}

main {
	display: grid;
	place-items: center;
	width: 100%;
	position: relative;
	padding-bottom: 10em;
}

.outro {
	display: grid;
	place-items: center;
	margin: 40vh 0;
}

.outro__title {
	font-weight: 300;
	font-size: clamp(1.5rem,10vw,2rem);
}

.card-wrap {
	margin-top: 5vh;
	display: grid;
	grid-gap: 2rem;
	grid-auto-flow: row;
	grid-template-columns: 250px;
	text-align: center;
}

.card__image {
	display: block;
	border-radius: 7px;
	background-size: cover;
	background-position: 50% 50%;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	filter: contrast(0.8);
}

.card__title {
	font-weight: 300;
}

.credits {
	font-size: 1.5rem;
	text-align: center;
	margin: 50vh auto 0;
	padding-bottom: 50vh;
}

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

.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:not(.card__image):focus {
	/* Provide a fallback style for browsers
	 that don't support :focus-visible */
	outline: none;
	background: lightgrey;
}

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

a:not(.card__image):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;
}

.frame {
	z-index: 1000;
	position: relative;
	padding: 1.5rem;
	display: grid;
	min-height: 10em;
	width: 100%;
	grid-template-columns: auto auto 1fr 1fr;
	grid-template-areas: 'prev back ... sponsor' 'title title title title' 'demos demos demos demos' ;
	grid-gap: 1rem;
	pointer-events: none;
	justify-items: start;
}

.frame a {
	pointer-events: auto;
}

.frame__title {
	grid-area: title;
	font-size: clamp(1.5rem, 10vw,5rem);
	margin: 0;
	font-weight: inherit;
}

.frame__back {
	grid-area: back;
	justify-self: start;
}

.frame__prev {
	grid-area: prev;
	justify-self: start;
}

.frame__demos {
	grid-area: demos;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	align-self: start;
	flex-wrap: wrap;
}

.frame__demos-item:not(:first-child) {
	width: 2rem;
	display: block;
	flex: none;
	border-radius: 10px;
	aspect-ratio: 1;
	border: 1px solid var(--color-link-hover);
	display: grid;
	place-items: center;
}

span.frame__demos-item:not(:first-child) {
	border-color: #fff;
}

.columns {
	width: var(--grid-width);
	max-width: var(--grid-max-width);
	position: relative;
	display: grid;
	place-items: center;
    grid-template-columns: repeat(var(--grid-columns),1fr);
    gap: var(--grid-gap);
}

.column {
	width: 100%;
	position: relative;
	display: grid;
	gap: var(--grid-gap);
	grid-template-columns: 100%;
	will-change: transform;
}

.column__item {
	margin: 0;
	position: relative;
	z-index: 1;
}

.column__item-imgwrap {
	width: 100%;
	aspect-ratio: var(--grid-item-ratio);
	height: auto;
	position: relative;
	overflow: hidden;
	border-radius: var(--grid-item-radius);
}

.column__item-img {
	position: absolute;
	top: calc(-1 * var(--grid-item-translate));
	left: calc(-1 * var(--grid-item-translate));
	height: calc(100% + var(--grid-item-translate) * 2);
	width: calc(100% + var(--grid-item-translate) * 2);
	background-size: cover;
	background-position: 50% 20%;
	backface-visibility: hidden;
}

footer {
	padding: 1em;
	background-color: black;
}

footer a {
	padding-right: 0.5em;
}

@media screen and (min-width: 53em) {
	.frame {
		text-align: center; 
		justify-items: center;
	}
	.card-wrap {
		grid-template-columns: repeat(2,300px);
	}
	.frame #cdawrap {
		max-width: 300px;
		text-align: right;
	}
}
