:root {
	--optimal-max-width: 1200px;
	--card-bg: linear-gradient(
		180deg,
		rgba(64, 60, 78, 0.95),
		rgba(40, 38, 52, 0.95)
	);
	--card-border: rgba(255, 255, 255, 0.08);
	--card-shadow: rgba(0, 0, 0, 0.25);
	--badge-text: #e6e6e6;
	--button-bg: #f2d36b;
	--button-text: #1a1a1a;
	--muted: #cfcfd6;
}

main {
	max-width: none;
}

.page {
	padding: 2.5rem 1.5rem 4rem;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.back_button {
	width: fit-content;
	color: #f3f3f3;
	text-decoration: none;
	background-color: rgba(35, 35, 60, 0.8);
	padding: 0.4rem 0.9rem;
	border-radius: 999px;
	font-weight: 600;
	transition:
		transform 0.2s ease,
		background-color 0.2s ease;
}

.h_stack {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
}

.title,
.description,
form {
	max-width: var(--optimal-max-width);
	margin: 0 auto;
}

.title {
	font-size: clamp(2rem, 4vw, 3rem);
	letter-spacing: 1px;
}

.collection_grid,
.photo_grid {
	width: 100%;
	margin: 0 auto;
	display: grid;
	gap: 1rem;
}

.collection_grid {
	grid-template-columns: repeat(auto-fit, minmax(250px, 512px));
	justify-content: center;
}

.photo_grid {
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.card {
	background: var(--card-bg);
	border: 1px solid var(--card-border);
	border-radius: 18px;
	overflow: hidden;
	text-align: left;
	display: flex;
	flex-direction: column;
	box-shadow: 0 12px 24px var(--card-shadow);
	animation: project-rise 0.6s ease both;
}

.card:nth-child(2) {
	animation-delay: 0.08s;
}

.card:nth-child(3) {
	animation-delay: 0.16s;
}

.card:nth-child(4) {
	animation-delay: 0.24s;
}

.card__image,
.img-placeholder {
	width: 100%;
	height: auto;
	max-height: 250px;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	border-bottom: 1px solid var(--card-border);
}

.card__content {
	padding: 1rem 1.2rem 1.25rem;
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	flex: 1;
}

.card__name {
	font-size: 1.3rem;
	margin: 0;
}

.card__badge {
	width: fit-content;
	min-width: fit-content;
	font-size: 0.85rem;
	font-weight: 700;
	color: var(--badge-text);
	background: var(--picker-item-active-bg);
	border: 1px solid var(--picker-item-active-border);
	padding: 0.25rem 0.65rem 0.1rem;
	border-radius: 999px;
}

.card__description {
	color: var(--muted);
	font-size: 0.98rem;
}

.card__button {
	margin-top: auto;
	display: block;
	width: 100%;
	padding: 0.85rem 1rem;
	background: var(--button-bg);
	color: var(--button-text);
	text-decoration: none;
	font-weight: 700;
	border-radius: 12px;
	text-align: left;
	transition:
		transform 0.2s ease,
		filter 0.2s ease;
}

.card__button:hover {
	transform: translateY(-2px);
	filter: brightness(1.02);
}

form {
	display: flex;
	flex-direction: column;
	width: 100%;
	padding: var(--picker-padding);
	background-color: #1a1a1a;
	border-radius: var(--picker-border-radius);
}

@keyframes project-rise {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (max-width: 580px) {
	.page {
		padding: 2rem 1.25rem 3rem;
	}

	.card__image {
		min-height: 240px;
	}
}

.gallery {
	padding-top: 1rem;
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.gallery-collection-description {
	color: var(--muted);
	margin: 0;
	min-height: 1.4em;
}

.gallery-item {
	background: var(--card-bg);
	border: 1px solid var(--card-border);
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 8px 18px var(--card-shadow);
	display: flex;
	flex-direction: column;
	min-height: 100%;
}

.gallery-item img {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	display: block;
}

.gallery-media {
	width: 100%;
	display: block;
}

.gallery-image {
	aspect-ratio: 1 / 1;
	object-fit: cover;
	opacity: 1;
	transition: opacity 0.2s ease;
}

.gallery-image--pending {
	opacity: 0;
}

.gallery-image--loaded {
	opacity: 1;
}

.gallery-video {
	aspect-ratio: 1 / 1;
	object-fit: cover;
	background: #000;
}

.gallery-item--video .gallery-video {
	width: 100%;
	height: auto;
}

.gallery-item--pending .gallery-media {
	background: rgba(255, 255, 255, 0.06);
}

.gallery-item--video .gallery-video::cue {
	background: rgba(0, 0, 0, 0.8);
}

.gallery-caption-wrap {
	padding: 0.8rem 0.9rem 1rem;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.gallery-title {
	font-size: 1rem;
	font-weight: 700;
	margin: 0;
}

.caption {
	margin: 0;
	color: var(--muted);
	font-size: 0.92rem;
}

.gallery-empty {
	margin: 0;
	color: var(--muted);
}
