/* /gallery — public avatar gallery.
 *
 * Standalone styles. Lives alongside the global /style.css but does not
 * depend on the .explore-* tokens; this lets us tune the page independently
 * if the discover layout drifts.
 */

html:has(body.gallery-page) {
	height: auto;
	overflow: auto;
}

body.gallery-page {
	display: block;
	width: 100%;
	min-height: calc(100vh - var(--header-h, 64px));
	height: auto;
	overflow: visible;
	background:
		radial-gradient(
			ellipse 80% 50% at 50% -10%,
			rgba(99, 102, 241, 0.18),
			transparent 60%
		),
		radial-gradient(
			ellipse 60% 40% at 90% 30%,
			rgba(236, 72, 153, 0.12),
			transparent 60%
		),
		#05050b;
	color: #fff;
	padding: 0;
}

.gallery-main {
	max-width: 1280px;
	margin: 0 auto;
	padding: var(--space-xl, 32px) var(--space-lg, 24px) var(--space-2xl, 48px);
}

/* ── Hero ───────────────────────────────────────────────────────────── */
.gallery-hero {
	text-align: center;
	padding: clamp(40px, 6vw, 96px) 0 clamp(24px, 4vw, 48px);
}
.gallery-hero-inner {
	max-width: 760px;
	margin: 0 auto;
}
.gallery-hero-chips {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: center;
	margin-bottom: 24px;
}
.gallery-hero-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 14px;
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 99px;
	color: rgba(255, 255, 255, 0.85);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}
.gallery-hero-chip--link {
	text-decoration: none;
	background: transparent;
	border-color: rgba(255, 255, 255, 0.18);
	color: rgba(255, 255, 255, 0.78);
	transition:
		border-color 0.15s ease,
		color 0.15s ease,
		background 0.15s ease;
}
.gallery-hero-chip--link:hover,
.gallery-hero-chip--link:focus-visible {
	border-color: rgba(255, 255, 255, 0.4);
	color: #fff;
	background: rgba(255, 255, 255, 0.08);
}
.gallery-hero-dot {
	width: 7px;
	height: 7px;
	border-radius: 99px;
	background: #34d399;
	box-shadow: 0 0 12px rgba(52, 211, 153, 0.7);
}

.gallery-title {
	font-family: 'Space Grotesk', system-ui, sans-serif;
	font-size: clamp(2.2rem, 5vw, 3.6rem);
	font-weight: 700;
	letter-spacing: -0.025em;
	line-height: 1.05;
	margin: 0 0 14px;
	color: #fff;
	background: linear-gradient(180deg, #fff 0%, rgba(255, 255, 255, 0.72) 100%);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
}
.gallery-sub {
	max-width: 560px;
	margin: 0 auto;
	color: rgba(255, 255, 255, 0.62);
	font-size: 15px;
	line-height: 1.6;
}

.gallery-stats {
	display: flex;
	justify-content: center;
	gap: clamp(20px, 4vw, 56px);
	margin-top: 36px;
}
.gallery-stat {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
}
.gallery-stat-value {
	font-family: 'Space Grotesk', system-ui, sans-serif;
	font-size: clamp(1.5rem, 3vw, 2.1rem);
	font-weight: 700;
	color: #fff;
	letter-spacing: -0.02em;
	font-variant-numeric: tabular-nums;
}
.gallery-stat-label {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.45);
}

/* ── Controls ────────────────────────────────────────────────────────── */
.gallery-controls {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin: 24px 0 28px;
}

.gallery-search {
	position: relative;
	display: flex;
	align-items: center;
	max-width: 560px;
	margin: 0 auto;
	width: 100%;
}
.gallery-search-icon {
	position: absolute;
	left: 16px;
	width: 18px;
	height: 18px;
	color: rgba(255, 255, 255, 0.45);
	pointer-events: none;
}
.gallery-search input[type='search'] {
	width: 100%;
	padding: 14px 44px 14px 44px;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 14px;
	color: #fff;
	font-size: 15px;
	font-family: inherit;
	outline: none;
	transition: border-color 0.15s ease, background 0.15s ease;
}
.gallery-search input[type='search']::placeholder {
	color: rgba(255, 255, 255, 0.4);
}
.gallery-search input[type='search']:focus {
	border-color: rgba(165, 180, 252, 0.55);
	background: rgba(255, 255, 255, 0.06);
}
.gallery-search input[type='search']::-webkit-search-cancel-button {
	-webkit-appearance: none;
	appearance: none;
}
.gallery-search-clear {
	position: absolute;
	right: 10px;
	width: 26px;
	height: 26px;
	border-radius: 99px;
	border: 0;
	background: rgba(255, 255, 255, 0.1);
	color: rgba(255, 255, 255, 0.75);
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s ease, color 0.15s ease;
}
.gallery-search-clear:hover {
	background: rgba(255, 255, 255, 0.18);
	color: #fff;
}

.gallery-tag-wrap {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	justify-content: center;
}
.gallery-tag-label {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.45);
}
.gallery-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	max-width: 900px;
	justify-content: center;
}
.gallery-tag {
	border: 1px solid rgba(255, 255, 255, 0.14);
	background: rgba(255, 255, 255, 0.03);
	color: rgba(255, 255, 255, 0.78);
	border-radius: 99px;
	padding: 6px 12px;
	font-size: 12.5px;
	font-weight: 500;
	cursor: pointer;
	transition:
		background 0.15s ease,
		border-color 0.15s ease,
		color 0.15s ease;
}
.gallery-tag:hover {
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
}
.gallery-tag.is-active {
	background: rgba(165, 180, 252, 0.18);
	border-color: rgba(165, 180, 252, 0.6);
	color: #fff;
}

/* ── Grid ────────────────────────────────────────────────────────────── */
.gallery-grid-wrap {
	min-height: 200px;
	position: relative;
}
.gallery-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 18px;
}

.gallery-card {
	position: relative;
	background: rgba(255, 255, 255, 0.025);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 16px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition:
		transform 0.18s ease,
		border-color 0.18s ease,
		background 0.18s ease,
		box-shadow 0.18s ease;
}
.gallery-card:hover {
	transform: translateY(-2px);
	border-color: rgba(255, 255, 255, 0.18);
	background: rgba(255, 255, 255, 0.04);
	box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.6);
}

.gallery-card-thumb {
	position: relative;
	aspect-ratio: 1 / 1;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	background:
		radial-gradient(circle at 50% 35%, rgba(99, 102, 241, 0.18), transparent 60%),
		linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.25));
	text-decoration: none;
	color: inherit;
}
.gallery-card-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease;
}
.gallery-card:hover .gallery-card-thumb img {
	transform: scale(1.04);
}
.gallery-card-ph {
	font-size: 56px;
	opacity: 0.55;
	filter: grayscale(0.2);
}
.gallery-card-3dpill {
	position: absolute;
	top: 10px;
	right: 10px;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	padding: 4px 8px;
	border-radius: 99px;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	border: 1px solid rgba(255, 255, 255, 0.18);
}
.gallery-card-play {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%) scale(0.85);
	width: 52px;
	height: 52px;
	border-radius: 99px;
	background: rgba(0, 0, 0, 0.55);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-size: 18px;
	opacity: 0;
	transition: opacity 0.18s ease, transform 0.18s ease;
	pointer-events: none;
}
.gallery-card:hover .gallery-card-play {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1);
}

.gallery-card-body {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 14px 16px 16px;
	flex: 1;
}
.gallery-card-name {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	color: #fff;
	letter-spacing: -0.005em;
	line-height: 1.25;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 1;
	-webkit-box-orient: vertical;
}
.gallery-card-name a {
	color: inherit;
	text-decoration: none;
}
.gallery-card-name a:hover {
	color: rgba(165, 180, 252, 1);
}
.gallery-card-desc {
	margin: 0;
	font-size: 13px;
	line-height: 1.5;
	color: rgba(255, 255, 255, 0.6);
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}
.gallery-card-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.gallery-card-tag {
	font-size: 11px;
	font-weight: 500;
	padding: 3px 8px;
	border-radius: 99px;
	background: rgba(255, 255, 255, 0.06);
	color: rgba(255, 255, 255, 0.7);
	border: 1px solid rgba(255, 255, 255, 0.06);
}
.gallery-card-foot {
	margin-top: auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding-top: 8px;
	border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.gallery-card-meta {
	font-size: 11px;
	color: rgba(255, 255, 255, 0.45);
	font-variant-numeric: tabular-nums;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-width: 0;
}
.gallery-card-dot {
	opacity: 0.5;
}
.gallery-card-actions {
	display: inline-flex;
	gap: 6px;
}
.gallery-card-btn {
	font-size: 12px;
	font-weight: 600;
	padding: 6px 10px;
	border-radius: 8px;
	border: 1px solid rgba(255, 255, 255, 0.12);
	background: rgba(255, 255, 255, 0.04);
	color: rgba(255, 255, 255, 0.85);
	cursor: pointer;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	transition:
		background 0.15s ease,
		border-color 0.15s ease,
		color 0.15s ease;
}
.gallery-card-btn:hover {
	background: rgba(255, 255, 255, 0.1);
	border-color: rgba(255, 255, 255, 0.24);
	color: #fff;
}
.gallery-card-btn--primary {
	background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
	border-color: transparent;
	color: #fff;
}
.gallery-card-btn--primary:hover {
	background: linear-gradient(135deg, #7c7ff5 0%, #9f7af2 100%);
	color: #fff;
}

/* ── Skeleton ────────────────────────────────────────────────────────── */
.gallery-card--skel {
	pointer-events: none;
}
.gallery-card--skel .gallery-card-thumb,
.gallery-card--skel .gallery-card-name,
.gallery-card--skel .gallery-card-desc,
.gallery-card--skel .gallery-card-tags {
	background: linear-gradient(
		90deg,
		rgba(255, 255, 255, 0.04) 0%,
		rgba(255, 255, 255, 0.08) 50%,
		rgba(255, 255, 255, 0.04) 100%
	);
	background-size: 200% 100%;
	animation: gallery-shimmer 1.4s linear infinite;
	color: transparent;
	border-radius: 6px;
}
.gallery-card--skel .gallery-card-thumb {
	aspect-ratio: 1 / 1;
	border-radius: 0;
}
.gallery-card--skel .gallery-card-name {
	height: 14px;
	width: 70%;
}
.gallery-card--skel .gallery-card-desc {
	height: 28px;
	width: 100%;
}
.gallery-card--skel .gallery-card-tags {
	height: 18px;
	width: 60%;
}
@keyframes gallery-shimmer {
	from {
		background-position: 200% 0;
	}
	to {
		background-position: -200% 0;
	}
}

/* ── Status / empty / error ─────────────────────────────────────────── */
.gallery-status {
	min-height: 24px;
	margin-top: 24px;
	text-align: center;
	color: rgba(255, 255, 255, 0.5);
	font-size: 14px;
}
.gallery-empty {
	max-width: 460px;
	margin: 48px auto 24px;
	text-align: center;
	padding: 32px;
	border: 1px dashed rgba(255, 255, 255, 0.12);
	border-radius: 16px;
	background: rgba(255, 255, 255, 0.02);
}
.gallery-empty-art {
	font-size: 36px;
	margin-bottom: 10px;
	opacity: 0.75;
}
.gallery-empty h3 {
	margin: 0 0 6px;
	font-family: 'Space Grotesk', system-ui, sans-serif;
	font-size: 18px;
	color: #fff;
}
.gallery-empty p {
	margin: 0 0 14px;
	font-size: 13.5px;
	color: rgba(255, 255, 255, 0.6);
	line-height: 1.55;
}
.gallery-clear-filters {
	display: inline-flex;
	padding: 8px 14px;
	border-radius: 10px;
	border: 1px solid rgba(255, 255, 255, 0.18);
	background: rgba(255, 255, 255, 0.05);
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	margin-right: 8px;
	transition: background 0.15s ease, border-color 0.15s ease;
}
.gallery-clear-filters:hover {
	background: rgba(255, 255, 255, 0.1);
	border-color: rgba(255, 255, 255, 0.32);
}
.gallery-empty .gallery-clear-cta {
	display: inline-flex;
	padding: 8px 14px;
	border-radius: 10px;
	border: 0;
	background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	transition: filter 0.15s ease;
}
.gallery-empty .gallery-clear-cta:hover {
	filter: brightness(1.1);
}
.gallery-error {
	color: #fca5a5;
	padding: 16px;
	border: 1px solid rgba(220, 38, 38, 0.3);
	background: rgba(220, 38, 38, 0.08);
	border-radius: 10px;
	max-width: 560px;
	margin: 16px auto;
	text-align: center;
}

/* ── Load more ──────────────────────────────────────────────────────── */
.gallery-load-more-wrap {
	display: flex;
	justify-content: center;
	margin-top: 32px;
}
.gallery-load-more {
	padding: 12px 24px;
	border-radius: 99px;
	border: 1px solid rgba(255, 255, 255, 0.18);
	background: rgba(255, 255, 255, 0.04);
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease;
}
.gallery-load-more:hover {
	background: rgba(255, 255, 255, 0.1);
	border-color: rgba(255, 255, 255, 0.34);
}

.gallery-sentinel {
	height: 1px;
	width: 100%;
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 720px) {
	.gallery-main {
		padding: 16px 14px 36px;
	}
	.gallery-hero {
		padding: 24px 0 16px;
	}
	.gallery-stats {
		gap: 24px;
	}
	.gallery-grid {
		grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
		gap: 12px;
	}
	.gallery-card-body {
		padding: 10px 12px 12px;
		gap: 6px;
	}
	.gallery-card-name {
		font-size: 14px;
	}
	.gallery-card-desc {
		display: none;
	}
	.gallery-card-foot {
		padding-top: 6px;
	}
	.gallery-card-btn {
		font-size: 11px;
		padding: 5px 8px;
	}
}
