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

:root {
	font-size: 16px;
	--color-text: #111;
	--color-bg: #EFEFEF;
	--color-link: #111;
	--color-link-hover: #111;
	--page-padding: 1.5rem;
	--color-accent: #D9D9D9;
	--color-hover: #C9C9C9;
}

body {
	margin: 0;
	color: var(--color-text);
	background-color: var(--color-bg);
	font-family: "neue-haas-grotesk-text", 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 {
	text-decoration: underline;
	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 {
	padding: var(--page-padding);
	position: relative;
	display: grid;
	z-index: 1000;
	width: 100%;
	height: 100%;
	grid-row-gap: 1rem;
	grid-column-gap: 2rem;
	pointer-events: none;
	justify-items: start;
	grid-template-columns: auto auto;
	grid-template-areas: 'title' 'archive' 'back' 'github' 'sponsor' 'demos' 'tags';
}

.frame #cdawrap {
  justify-self: start;
  font-size: 12px;
  opacity: 1;
  transition: opacity 0.3s 1s linear;
	max-width: 300px;
}

.loading .frame #cdawrap {
  opacity: 0;
}

.frame a {
  pointer-events: auto;
}

.frame__title {
  grid-area: title;
  font-size: inherit;
  margin: 0;
	font-family: "neue-haas-grotesk-display", sans-serif;
	font-weight: 600;
	font-style: normal;
}

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

.frame__archive {
  grid-area: archive;
  justify-self: start;
}

.frame__github {
  grid-area: github;
}

.frame__tags {
  grid-area: tags;
  display: flex;
  align-items: start;
  gap: 1rem;
	align-self: end;
}

.frame__tags a {
	border: 1px solid;
	border-radius: 1rem;
	padding: 1px 6px 3px;
}

.frame__tags a:hover {
	text-decoration: none;
}

.content {
	padding: var(--page-padding);
	display: flex;
	flex-direction: column;
	width: 100vw;
	position: relative;
}

@media screen and (min-width: 53em) {
	body {
		--page-padding: 2rem 3rem;
	}
	.frame {
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		grid-template-columns: auto auto auto auto 1fr;
		grid-template-rows: auto auto;
		align-content: space-between;
		grid-template-areas: 'title back github archive ...' 'tags tags sponsor sponsor sponsor';
	}
	.frame #cdawrap {
		justify-self: end;
		text-align: right;
		align-self: end;
	}
	.content {
		min-height: 100vh;
		justify-content: center;
		align-items: center;
	}
}
