/* -------------------------
   Root Variables & Base Reset
   ------------------------- */
:root {
	--accent-1: #8fbcbb;
	--accent-2: #88c0d0;
	--accent-3: #81a1c1;

	--bg: #0e0e0e;
	--muted: #c7c9cc;
	--glass: rgba(255, 255, 255, 0.04);
	--card-shadow: rgba(0, 0, 0, 0.45);

	--max-width: 1200px;
}

* {
	box-sizing: border-box;
}

html,
body {
	height: 100%;
}

body {
	font-family: "JetBrainsMono Nerd Font", "FiraCode Nerd Font", monospace;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	-webkit-text-size-adjust: 100%;
	background: var(--bg);
	color: #eee;
	margin-top: 0%;
}

*:focus {
	outline: none;
}

/* When keyboard navigation activates (Tab pressed) */
.show-focus :focus {
	outline: 2px solid var(--accent-2);
	outline-offset: 3px;
	box-shadow: 0 0 10px color-mix(in srgb, var(--accent-2) 40%, transparent);
	border-radius: 6px;
	transition: outline-color 0.15s ease, box-shadow 0.15s ease;
}


/* -------------------------
   Navigation Bar
   ------------------------- */
nav {
	display: flex;
	justify-content: space-between;
	align-items: center;
	width: 100%;
	padding: 8px 10px;
	background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.05));
}

.brand {
	display: flex;
	align-items: center;
	gap: 12px;
}

.title {
	margin: 6px 0;
	font-size: 20px;
	font-weight: 900;
	background: linear-gradient(90deg, var(--accent-1), var(--accent-2), var(--accent-3));
	-webkit-background-clip: text;
	color: transparent;
	animation: glow 3s ease-in-out infinite alternate;
}

@keyframes glow {
	from {
		text-shadow: 0 0 10px var(--accent-2);
	}

	to {
		text-shadow: 0 0 22px var(--accent-3);
	}
}

.nav-link {
	padding: 8px 16px;
	font-size: 14px;
	font-weight: 500;
	border-radius: 6px;

	cursor: pointer;
	color: var(--accent-2);
	text-shadow: 0 0 8px var(--accent-2);

	border: 1px solid color-mix(in srgb, var(--accent-2) 30%, transparent);
	background: color-mix(in srgb, var(--accent-2) 5%, transparent);
	backdrop-filter: blur(8px);
	transition: 0.3s ease;
}

.nav-link:hover {
	color: white;
	background: color-mix(in srgb, var(--accent-2) 15%, transparent);
	box-shadow: 0 0 12px var(--accent-2);
	border-color: color-mix(in srgb, var(--accent-2) 70%, transparent);
}


/* -------------------------
   About dialog
   ------------------------- */
.about-dialog {
	width: min(420px, 90vw);
	padding: 0;
	border: none;
	border-radius: 16px;

	background: rgba(20, 22, 25, 0.55);
	backdrop-filter: blur(18px);
	box-shadow: 0 0 25px rgba(0, 0, 0, 0.6);
}

.about-inner {
	padding: 26px 32px;
	color: #eee;
	font-family: Inter, system-ui, sans-serif;
}

.about-title {
	margin-bottom: 14px;
	font-size: 22px;
	font-weight: 800;
	background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
	-webkit-background-clip: text;
	color: transparent;
}

.about-text {
	font-size: 15px;
	line-height: 1.55;
	margin-bottom: 16px;
	color: var(--muted);
}

.about-repo {
	font-size: 14px;
	margin-bottom: 24px;
	color: #ccc;
}

.about-close {
	padding: 8px 16px;
	font-size: 14px;
	color: white;
	cursor: pointer;

	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.07);
	backdrop-filter: blur(4px);
	transition: 0.25s;
}

.about-close:hover {
	background: rgba(255, 255, 255, 0.15);
	border-color: rgba(255, 255, 255, 0.2);
}

.about-dialog::backdrop {
	background: rgba(0, 0, 0, 0.7);
	backdrop-filter: blur(8px);
}


/* -------------------------
   Header and controls
   ------------------------- */
.container {
	max-width: var(--max-width);
	margin: 0 auto;
	padding: 0 20px;
}

.header {
	text-align: center;
	margin-top: 20px;
}

.subtitle {
	margin-top: 6px;
	font-size: 14px;
	color: var(--muted);
	font-family: Arial, Helvetica, sans-serif;
}

.controls {
	display: flex;
	gap: 14px;
	justify-content: center;
	margin: 16px 0;
	flex-wrap: wrap;
}

.search {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.05);
}

.search input {
	width: 350px;
	font-size: 14px;
	color: white;

	border: none;
	outline: none;
	background: transparent;
}

.btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;

	font-size: 13px;
	color: var(--muted);
	border-radius: 10px;
	cursor: pointer;

	border: 1px solid rgba(255, 255, 255, 0.02);
	background: rgba(255, 255, 255, 0.02);
}

.btn:hover {
	color: white;
	background: rgba(255, 255, 255, 0.03);
}

.btn:disabled,
.modal-action-btn:disabled {
	opacity: 0.35;
	cursor: not-allowed;
	pointer-events: none;
	filter: grayscale(0.5);
}


/* -------------------------
   Featured Section
   ------------------------- */
.featured {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 10px;

	margin: 20px auto 30px;
	padding: 14px;
	max-width: var(--max-width);

	overflow: hidden;
	border-radius: 14px;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.featured .hero img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 12px;
}

.featured .meta {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 10px;
	padding: 14px;

	min-width: 250px;
	max-width: 250px;
}

.meta .file-name {
	font-size: 16px;
	font-weight: 700;
	word-break: break-word;
}

.meta .meta-row {
	font-size: 13px;
	color: var(--muted);
}

.meta .meta-actions {
	display: flex;
	gap: 8px;
	margin-top: 6px;
}


/* -------------------------
   Loading / empty states
   ------------------------- */
.loader {
	width: 46px;
	height: 46px;

	margin: 30px auto;

	border-radius: 50%;
	border: 4px solid rgba(255, 255, 255, 0.06);
	border-top-color: var(--accent-2);

	animation: spin 1s linear infinite;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

.empty {
	padding: 48px 10px;
	text-align: center;
	color: var(--muted);
}


/* -------------------------
   Gallery grid
   ------------------------- */
.grid {
	display: grid;
	gap: 18px;
	margin-top: 20px;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.item {
	position: relative;
	overflow: hidden;
	aspect-ratio: 16 / 9;

	border-radius: 12px;
	cursor: pointer;

	backdrop-filter: blur(6px);
	box-shadow: 0 6px 18px var(--card-shadow);
	transition: 0.25s;
}

.item:hover {
	transform: translateY(-6px) scale(1.02);
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.6);
}

.item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.label {
	position: absolute;
	bottom: 0;
	width: 100%;
	padding: 8px;
	font-size: 13px;

	background: linear-gradient(180deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.75));
	transform: translateY(100%);
	opacity: 0;
	transition: 0.25s;
}

.item:hover .label {
	transform: translateY(0);
	opacity: 1;
}


/* -------------------------
   Modal - Image viewer
   ------------------------- */
.modal-bg {
	position: fixed;
	inset: 0;

	display: flex;
	justify-content: center;
	align-items: center;

	background: rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(12px);

	opacity: 0;
	pointer-events: none;
	transition: 0.25s;

	z-index: 1000;
}

.modal-bg.show {
	opacity: 1;
	pointer-events: auto;
}

.modal {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
	max-width: 100%;
}

.modal-img-wrap {
	position: relative;
	display: flex;
	justify-content: center;
	align-items: center;
	width: 75%;
	height: 75%;
	margin: auto;
}

.modal-img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;

	border: 3px solid var(--accent-2);
	border-radius: 14px;

	box-shadow:
		0 0 20px color-mix(in srgb, var(--accent-2) 35%, transparent),
		0 0 40px color-mix(in srgb, var(--accent-3) 25%, transparent);

	transition: 0.25s ease;
}

/* Modal navigation arrows */
.modal-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);

	font-size: 34px;
	font-family: "JetBrainsMono Nerd Font";
	color: white;

	padding: 14px 18px;
	border: none;
	border-radius: 50%;
	background: transparent;

	opacity: 0.45;
	cursor: pointer;
	transition: 0.25s;
	z-index: 10;
}

.modal-nav:hover {
	opacity: 0.9;
}

.modal-prev {
	left: 10px;
}

.modal-next {
	right: 10px;
}

/* Close button */
.modal-close {
	position: absolute;
	top: 12px;
	right: 12px;

	font-size: 20px;
	color: white;

	padding: 10px 13px;
	border: none;
	border-radius: 50%;
	cursor: pointer;

	background: rgba(0, 0, 0, 0.55);
	opacity: 0.5;
	transition: 0.25s;
}

.modal-close:hover {
	opacity: 1;
}

/* Bottom bar */
.modal-bottom {
	display: flex;
	justify-content: space-between;
	align-items: center;

	width: 100%;
	max-width: 900px;

	margin-top: 16px;
	padding: 14px 20px;

	background: rgba(0, 0, 0, 0.25);
	backdrop-filter: blur(10px);
	border-radius: 12px;
}

.modal-title {
	font-size: 20px;
	font-weight: 600;
}

.modal-meta {
	font-size: 14px;
	color: var(--muted);
}

.modal-actions {
	display: flex;
	gap: 12px;
}

.modal-action-btn {
	padding: 8px 14px;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	color: white;

	background: rgba(255, 255, 255, 0.08);
	transition: 0.3s;
}

.modal-action-btn:hover {
	background: rgba(255, 255, 255, 0.15);
}


/* -------------------------
   Footer
   ------------------------- */
footer {
	padding: 20px;
	margin-top: 40px;

	text-align: center;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 13px;
	color: var(--muted);
}


/* -------------------------
   Responsive tweaks
   ------------------------- */
@media (max-width: 720px) {
	.featured {
		grid-template-columns: 1fr;
	}

	.nav-right {
		display: flex;
		gap: 10px;
	}

	.nav-link {
		padding: 6px 10px;
		font-size: 12px;
	}

	.modal-img-wrap {
		width: 95vw;
		height: 60vh;
	}

	.modal-img {
		border-width: 2px;
	}
}


/* -------------------------
   Standard accessibility
   ------------------------- */
.sr-only {
	position: absolute;
	left: -9999px;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
}
