*,
*::after,
*::before {
	box-sizing: border-box;
}

:root {
	font-size: 12px;
	--color-text: rgba(255,255,255,0.95);
	--color-bg: #0c0b10;
	--color-link: rgb(174 142 244 / 90%);
	--color-bg-date: rgb(96 56 178 / 48%);
	--color-link-hover: rgb(220 152 237 / 75%);
	--color-border: rgba(177,177,177,0.3);
}

body {
	margin: 0;
	color: var(--color-text);
	background-color: var(--color-bg);
	font-family: "ocr-a-std", monospace;
	text-transform: uppercase;
	-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;
}

.frame {
	z-index: 1000;
	position: relative;
	width: 100%;
	display: grid;
	grid-template-columns: 100%;
	grid-template-areas: 'title' 'back' 'prev' 'sponsor';
	grid-gap: 1rem;
	justify-items: start;
	align-self: start;
	justify-self: start;
	pointer-events: none;
	align-items: center;
	padding: 2rem;
}

body #cdawrap {
    justify-self: start;
}

.frame a {
	pointer-events: auto;
}

.frame__title {
	grid-area: title;
	font-size: 1.25rem;
	margin: 0;
	font-weight: inherit;
}

.frame__back {
	grid-area: back;
}

.frame__prev {
	grid-area: prev;
}

.frame__demos {
	grid-area: demos;
	display: flex;
	gap: 1rem;
}

.title {
	font-weight: 400;
	font-size: clamp(2rem,8.5vw,8rem);
	text-align: center;
	margin: 14vh auto 5vh;
	display: flex;
	justify-content: center;
	width: min-content;
	border-bottom: 1px solid var(--color-border);
}

.title span::first-letter {
	opacity: 0.5;
}

.subtitle {
	text-align: center;
}

.card-grid {
	display: grid;
	margin: 10vh 0;
	grid-template-columns: 1fr;
	border-top: 1px solid var(--color-border);
}

.card:nth-child(3n - 1) {
	border-left: 1px solid var(--color-border);
	border-right: 1px solid var(--color-border);
}

.card {
	display: grid;
	grid-template-rows: auto 1fr auto;
	cursor: pointer;
	position: relative;
	min-height: 60vh;
	padding: 4vw;
	overflow: hidden;
	border-bottom: 1px solid var(--color-border);	
}

.card__img,
.card__img-wrap,
.card__img-inner {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}

.card__img,
.card__img-inner {
	background-size: cover;
	background-position: 50% 50%;
}

.card__img,
.card__img-wrap {
	overflow: hidden;
}

.card__img {
	z-index: -1;
	pointer-events: none;
	--columns: 0;
	--rows: 0;
}

.js .card__img {
	opacity: 0;
	background-image: none !important;
}

.card__img-inner {
	filter: brightness(0.6);
	width: calc(100% + (var(--columns) - 1) * 1px);
	height: calc(100% + (var(--rows) - 1) * 1px);
}

.card__date {
	display: flex;
	align-content: center;
	align-items: center;
	line-height: 1;
	position: relative;
}

.card__date::before {
	content: '';
	width: 15px;
	height: 15px;
	border: 1px solid var(--color-link);
	background: var(--color-bg-date);
	margin: 0 10px 4px 0;
}

.card__title {
	font-weight: 400;
	font-size: clamp(1.5rem,5vw,2.5rem);
}

.card__link {
	position: relative;
}

.card__link::before {
	content: '+';
	margin-right: 10px;
}

@media screen and (min-width: 33em) {
	.grid {
		grid-template-columns: repeat(2,1fr);
	}
}

@media screen and (min-width: 60em) {
	.frame {
		grid-template-columns: auto 1fr 1fr;
		grid-template-rows: auto auto auto;
		grid-template-areas: 'title title sponsor' 'back prev ...';
		align-content: space-between;
		justify-items: start;
		grid-row-gap: 1.5rem;
	}
	.card-grid {
		grid-template-columns: repeat(3,1fr);
	}
	body #cdawrap {
	    justify-self: end;
	}
}
