:root {
	--gap: 30px;
	--cols: 3;
}

body {
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial;
	padding-top: 50px;
	margin: 0;
	background: rgb(30, 30, 30);
	scroll-behavior: smooth;
}

@media (max-width: 1200px) {
	.grid {
		margin-block: 40px;
		gap: 0;
	}
}

@media (min-width: 1200px) {
	.grid {
		gap: var(--gap);
	}
}

.grid {
	display: grid;
	grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
	position: relative;
	padding: 8px;
	max-width: 1600px;
	margin: 50px auto;
}

.item {
	background-color: #121212;
	aspect-ratio: 16/9;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 600;
	color: #112;
	user-select: none;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	outline: none;
	position: relative;
	overflow: hidden;
	border-radius: 20px;
	background-position: center;
	scroll-margin: 50px;
	border: solid 2px rgb(30, 30, 30);
}

@media (max-width: 1200px) {
	.item {
		margin: 20px;
	}
}

.item:focus {
	transform: scale(1.01);
	transform: translate(0, -2px);
	box-shadow: 0 0 10px 5px rgb(4, 159, 248);
}

@media (max-width: 1200px) {
	:root {
		--cols: 2;
	}
}

@media (max-width: 900px) {
	:root {
		--cols: 1;
	}
}

.carousel {
	width: 100%;
	overflow: hidden;
	position: relative;
	padding: 20px 0;
}

.carousel-container {
	display: flex;
	min-height: min(60vh, 500px);
	gap: 10px;
	will-change: transform;
}

.padding {
	position: relative;
}

.padding::after {
	pointer-events: none;
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	width: 12%;
	height: 100%;
	background: linear-gradient(to left, rgba(0, 0, 0, 0.5), transparent);
	z-index: 1;
}

.padding::before {
	pointer-events: none;
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 12%;
	height: 100%;
	background: linear-gradient(to right, rgba(0, 0, 0, 0.5), transparent);
	z-index: 1;
}

@media (max-width: 900px) {
	.padding::before,
	.padding::after {
		width: 2%;
	}
}

.carousel-item {
	display: flex;
	flex-shrink: 0;
	width: 60vw;
	aspect-ratio: 16/9;
	border-radius: 12px;
	overflow: hidden;
	cursor: pointer;
	transition: transform 0.5s ease-in-out, box-shadow 0.5s ease-in-out;
	position: relative;
	z-index: 1;
	transform: scale(1);
	transform-origin: center center;
	backface-visibility: hidden;
	will-change: transform, opacity, filter;
}

@media (max-width: 900px) {
	.carousel-item {
		width: 85vw;
	}
}

.carousel-item.carousel-active {
	transform: scale(1.02);
	box-shadow: 0 0 15px 5px rgba(0, 0, 0, 0.3);
	z-index: 5;
}

.carousel-item img {
	transition: transform 0.3s ease;
	width: 100%;
	height: 100%;
	object-fit: cover;
	-webkit-user-drag: none;
	-khtml-user-drag: none;
	-moz-user-drag: none;
	-o-user-drag: none;
	user-select: none;
}
