* {
	box-sizing: border-box;
}

a:link, a:visited {
	color: #bfbfbf;
	text-decoration: none;
}
a:hover, a:active {
	color: #ffa500;
}

/* Simple static gradient backdrop instead of flat black. No animation, no
   filter, no fixed attachment — just one gradient layer, painted once. */
html {
	background: #101017;
}
body {
	margin: 0;
	min-height: 100vh;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
	background-color: #101017;
	background-image: linear-gradient(160deg, #2f2657 0%, #1f4a5c 33%, #47234a 66%, #101017 100%);
}

/* Header */
.site-header {
	text-align: center;
	padding: 16px 16px 12px;
	position: sticky;
	top: 0;
	z-index: 10;
	background: transparent;
	transition: transform 0.25s ease;
}
.site-header.header-hidden {
	transform: translateY(-100%);
}
.logo {
	font-family: "Charm", cursive;
}
.logo-main {
	font-size: 34px;
	font-weight: 700;
	color: #ffffff;
}
.logo-sub {
	font-size: 20px;
	color: #bfbfbf;
	margin-left: 8px;
}

/* Gallery grid — strict row-major order (newest first, left to right, row by row) */
.gallery {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 10px;
	max-width: 1500px;
	margin: 0 auto;
	padding: 0 10px 10px;
}
@media screen and (min-width: 560px) {
	.gallery { grid-template-columns: repeat(3, 1fr); }
}
@media screen and (min-width: 820px) {
	.gallery { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
}

.photo {
	position: relative;
	display: block;
	aspect-ratio: 3 / 2;
	overflow: hidden;
	border-radius: 3px;
	cursor: zoom-in;
	background: #050505;
	box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
	transition: box-shadow 0.25s ease;
}
.photo::before {
	content: '';
	position: absolute;
	inset: 0;
	background-image: var(--bg);
	background-position: center;
	background-size: cover;
	filter: saturate(45%) brightness(0.65);
}
@media (min-width: 820px) {
	.photo::before {
		filter: saturate(45%) blur(3px) brightness(0.65);
		transform: scale(1.15);
	}
}
.photo img {
	position: relative;
	z-index: 1;
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
	transition: transform 0.35s ease;
}
@media (hover: hover) {
	.photo:hover img {
		transform: scale(1.03);
	}
	.photo:hover {
		box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3), 0 8px 24px rgba(0, 0, 0, 0.6);
	}
}

/* Footer + pager */
.site-footer {
	width: 100%;
	padding: 24px 16px;
	text-align: center;
	color: #808080;
	font-size: 14px;
	font-family: "Courier New", monospace;
}
.pager {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin-bottom: 16px;
}
.pager-arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.07);
	font-size: 16px;
	flex-shrink: 0;
}
.pager-arrow.disabled {
	opacity: 0.25;
	pointer-events: none;
}
.pager-arrow:active {
	background: rgba(255, 165, 0, 0.3);
	color: #ffa500;
}
@media (hover: hover) {
	.pager-arrow:not(.disabled):hover {
		background: rgba(255, 165, 0, 0.2);
		color: #ffa500;
	}
}
.pager-current {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 10px;
	border-radius: 8px;
	background: rgba(255, 165, 0, 0.12);
	color: #ffa500;
	font-weight: bold;
	font-size: 16px;
	flex-shrink: 0;
}
.pager-current select {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	border: none;
	cursor: pointer;
}
.copy {
	margin: 0;
}

/* Lightbox */
.lightbox {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.94);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.3s ease, visibility 0s linear 0.3s;
	z-index: 100;
	touch-action: none;
}
.lightbox.active {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transition: opacity 0.3s ease;
}

.lb-frame {
	position: fixed;
	top: 0;
	left: 0;
	width: 0;
	height: 0;
	overflow: hidden;
	background: rgba(10, 10, 12, 0.6);
	border-radius: 4px;
	box-shadow: 0 0 40px rgba(0, 0, 0, 0.9);
	transition: top 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
		left 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
		width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
		height 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
/* .lb-slide handles push/slide navigation (translateX); .lb-image inside
   it handles zoom + pan, so the two never fight over the same transform */
.lb-slide {
	position: absolute;
	inset: 0;
	overflow: hidden;
	transform: translateX(0);
	/* transition set inline in JS per-phase */
}
.lb-image {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
	opacity: 0;
	transform: translate(0px, 0px) scale(1);
	transform-origin: center center;
	user-select: none;
	-webkit-user-drag: none;
	touch-action: none;
	/* transitions are set inline in JS per-phase */
}
.lb-image.zoomed {
	cursor: grab;
}
.lb-image.zoomed.dragging {
	cursor: grabbing;
}

.lb-spinner {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 40px;
	height: 40px;
	margin: -20px 0 0 -20px;
	border: 3px solid rgba(255, 255, 255, 0.25);
	border-top-color: #ffa500;
	border-radius: 50%;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
}
.lb-spinner.active {
	opacity: 1;
	animation: lbSpin 0.8s linear infinite;
}
@keyframes lbSpin {
	to { transform: rotate(360deg); }
}

.lb-download,
.lb-share,
.lb-zoom {
	position: absolute;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	border: none;
	background: rgba(0, 0, 0, 0.55);
	color: #f2f2f2;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.lb-download {
	bottom: 10px;
	right: 10px;
}
.lb-share {
	bottom: 10px;
	right: 64px;
	font-size: 18px;
}
.lb-zoom {
	top: 10px;
	right: 10px;
	font-size: 18px;
}
.lb-download:active,
.lb-share:active,
.lb-zoom:active {
	background: rgba(255, 165, 0, 0.85);
	color: #111;
}
@media (hover: hover) {
	.lb-download:hover,
	.lb-share:hover,
	.lb-zoom:hover {
		background: rgba(255, 165, 0, 0.85);
		color: #111;
		transform: scale(1.06);
	}
}

.lb-toast {
	position: fixed;
	left: 50%;
	bottom: 30px;
	transform: translate(-50%, 10px);
	background: rgba(20, 20, 24, 0.95);
	color: #f2f2f2;
	padding: 10px 18px;
	border-radius: 20px;
	font-size: 14px;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s ease, transform 0.25s ease;
	z-index: 200;
}
.lb-toast.active {
	opacity: 1;
	transform: translate(-50%, 0);
}

.lb-close {
	position: absolute;
	border: none;
	color: #f2f2f2;
	cursor: pointer;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.35);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease, color 0.2s ease;
	top: 14px;
	right: 14px;
	width: 52px;
	height: 52px;
	font-size: 26px;
}
.lb-close:active {
	background: rgba(255, 165, 0, 0.3);
	color: #ffa500;
}
@media (hover: hover) {
	.lb-close:hover {
		background: rgba(255, 165, 0, 0.3);
		color: #ffa500;
	}
}

/* Prev/next: the tappable button is bigger than the arrow glyph inside it,
   and stays mostly transparent until pressed/hovered — only :active (real
   press) or (hover:hover) (real mouse) change its look, so touchscreens
   never get a "stuck" highlighted button after tapping. */
.lb-prev,
.lb-next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 92px;
	height: 92px;
	border: none;
	border-radius: 50%;
	background: transparent;
	color: #f2f2f2;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 26px;
	transition: background 0.2s ease, color 0.2s ease;
}
.lb-prev:active,
.lb-next:active {
	background: rgba(255, 165, 0, 0.35);
	color: #ffa500;
}
.lb-prev {
	left: 4px;
}
.lb-next {
	right: 4px;
}
.lb-counter {
	position: absolute;
	bottom: 16px;
	left: 50%;
	transform: translateX(-50%);
	color: #bfbfbf;
	font-family: "Courier New", monospace;
	font-size: 14px;
}

@media screen and (max-width: 600px) {
	.lb-prev, .lb-next {
		width: 72px;
		height: 72px;
		font-size: 22px;
	}
	.lb-close {
		width: 46px;
		height: 46px;
		font-size: 22px;
		top: 8px;
		right: 8px;
	}
	.lb-download,
	.lb-share,
	.lb-zoom {
		width: 42px;
		height: 42px;
		font-size: 16px;
	}
	.lb-share {
		right: 58px;
	}
	.lb-zoom {
		top: 8px;
		right: 8px;
	}
}
