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

:root {
	font-size: 12px;
	--color-year: #fffcfa;
	--img-ratio: 1.5;
	--s: 1;
}

/* Ensure proper font rendering on all devices including iOS */
html, body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	-webkit-text-size-adjust: 100%;
}

/* Assuming you're using a class .grid-container for your grid */
.grid {
    padding: 0rem;
    /* Adjust values as needed */
}


h1 {
	color: #f0f0f0;
	padding-top: 15%;
}

.demo-3 {
	--s: 4;
	--color-text: #ffffff;
    --color-bg: #101010;
    --color-title: #ffffff;
    --color-year: hsla(0, 0%, 100%, 0.443);
}

/* 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;
	opacity: 0.4;
	animation: loaderAnim 0.7s linear infinite alternate forwards;

}

@keyframes loaderAnim {
	to {
		opacity: 1;
		transform: scale3d(0.7,0.7,1);
	}
}

a {
	outline: none;
	cursor: pointer;
}

a: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;
}

a:focus-visible {
	/* Draw a very noticeable focus style for
	 keyboard-focus on browsers that do support
	 :focus-visible */
	outline: 2px solid red;
}

.unbutton {
	background: none;
	border: 0;
	padding: 0;
	margin: 0;
	font: inherit;
	cursor: pointer;
}

.unbutton:focus {
	outline: none;
}

.frame {
	position: relative;
	display: grid;
	min-height: 0px;
	width: 100%;
	grid-template-columns: auto auto 1fr 1fr;
	grid-template-areas: 'prev back ... sponsor' 'title title title title' 'demos demos demos demos' ;
	grid-row-gap: 1rem;
	grid-column-gap: 2rem;
	pointer-events: none;
	justify-items: start;
	margin-top: 2rem;
}

.frame a {
	pointer-events: auto;
	font-family: var(--font-2), sans-serif; /* Changed to MonumentExtended */
	letter-spacing: 2px;
	text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.frame__title {
	grid-area: title;
	font-size: clamp(1.5rem, 10vw,5rem);
	margin: 0px 0 0 50px;
	font-weight: 300;
	max-width: 600px;
	line-height: 1;
    font-family: var(--font-2), sans-serif; /* Changed to MonumentExtended */
    text-align: left;
	position: relative;
	margin-top: 6rem;
	margin-bottom: 3rem; /* Added margin-bottom to create more space above the grid */
}

.title-arrow-icon {
	width: 1.2em;
	height: 1.2em;
	vertical-align: middle;
	margin-left: 0.5em;
	color: white;
	display: inline-block;
}

.frame__back {
	grid-area: back;
	justify-self: start;
	font-family: var(--font-2), sans-serif; /* Changed to MonumentExtended */
	letter-spacing: 2px;
	text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.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;
	aspect-ratio: 1;
	display: grid;
	place-items: center;
}

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

.grid {
    padding: 2rem 4rem; /* Increased side margins */
    width: 100%;
    grid-template-columns: 100%;
    grid-auto-rows: auto;
    display: grid;
    grid-gap: 4rem;
    position: relative;
    margin: 7vh auto 25vh; /* Reduced top margin by 30% from 10vh to 7vh */
}

.grid__item {
    position: relative;
    margin: 0;
}

.grid__item-img {
	position: relative;
	overflow: hidden;
	display: grid;
	place-items: center;
	width: 100%;
	height: auto;
	aspect-ratio: var(--img-ratio);
	border-radius: 12px; /* Added rounded edges */
}

.grid__item-img-inner {
	width: 100%;
	height: 100%;
	background-position: center center;
	background-size: cover;
	background-repeat: no-repeat;
	position: relative;
	border-radius: 12px; /* Added rounded corners to thumbnails */
	overflow: hidden; /* Ensure content doesn't overflow rounded corners */
}

/* Grid item caption styling */
.grid__item-caption {
	position: static;
	padding: 1rem 0 0 0;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.1rem;
	font-weight: 400;
	margin: 0;
	color: var(--color-text);
	font-family: var(--font-1);
	letter-spacing: -0.025em;
	text-shadow: 0 0 0 transparent;
	font-size: 1rem;
}



.grid__item-caption span {
	font-weight: normal;
	color: var(--color-year);
	font-family: var(--font-2), sans-serif; /* Changed to MonumentExtended */
	letter-spacing: 1px;
	font-size: 0.8rem; /* Adjust as needed */
}

.grid__item-caption h3 {
	font-family: var(--font-2), sans-serif; /* Monument Extended */
	font-weight: normal;
	letter-spacing: -0.025em;
}

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


.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;
	background-size: cover;
	background-position: 50% 50%;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	filter: contrast(0.95);
}

.card__title {
	font-weight: 300;
}

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

@media screen and (min-width: 53em) {
	.card-wrap {
		grid-template-columns: repeat(2,300px);
	}

	.grid {
		grid-template-columns: repeat(8,1fr);
		
	}

	.grid__item {
	    grid-column: var(--c) / span var(--s);
	    grid-row: var(--r);
	}

	.frame__title {
			position: absolute;
	}
}

@font-face {
  font-display: swap;
  font-family: MonumentExtended-light;
  src: url(../fonts/monumentextended-ultralight.woff) format("woff");
}
@font-face {
  font-display: swap;
  font-family: GT-Alpine;
  src: url(../fonts/GT-Alpina-Light-Italic.woff) format("woff");
}
@font-face {
  font-display: swap;
  font-family: sohne-light;
  src: url(../fonts/sohne-light.woff2) format("woff2");
}
@font-face {
  font-display: swap;
  font-family: Blind-Krystal;
  src: url(../fonts/Blind-Krystal.woff) format("woff");
}
@font-face {
  font-display: block;
  font-family: MonumentExtended;
  src: url(../fonts/MonumentExtended-Regular.woff) format("woff");
}

/* Mobile font size fixes to prevent text from becoming too small */
