* {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	height: 100%;
	overflow-x: hidden;
	overflow-y: hidden;
}

body {
	font-family: "Manrope", "Segoe UI", sans-serif;
	background: radial-gradient(circle at top left, #000000 0, #000000 32%, #000000 100%);
	color: #ffffff;
}

.page-shell {
	height: 100vh;
	height: 100svh;
	display: grid;
	grid-template-columns: 240px minmax(0, 1fr);
	grid-template-rows: calc(100svh / 6) calc((100svh * 29) / 42) calc(100svh / 7);
	grid-template-areas:
		"hero hero"
		"sidebar feature"
		"intro intro";
	background: #ffffff;
	overflow: hidden;
}

.sidebar {
	grid-area: sidebar;
	color: #ffffff;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 0;
	padding: 0.85rem 1.4rem;
	margin-left: 2vw;
	background: #000000;
	position: relative;
	overflow: hidden;
}

.sidebar::before,
.sidebar::after {
	content: "";
	position: absolute;
	top: 0.45rem;
	bottom: 0.45rem;
	width: 0.7rem;
	background: repeating-linear-gradient(
		to bottom,
		rgba(240, 236, 228, 0.95) 0 0.8rem,
		transparent 0.8rem 1.42rem
	);
	border-radius: 0.15rem;
}

.sidebar::before {
	left: 0.32rem;
}

.sidebar::after {
	right: 0.32rem;
}

.sidebar-nav {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	align-items: center;
	justify-content: stretch;
	width: 100%;
	height: 100%;
	min-height: 0;
	flex: 1 1 auto;
	position: relative;
	z-index: 1;
	overflow-y: hidden;
	overflow-x: hidden;
}

.sidebar-nav a {
	color: #000000;
	text-decoration: none;
	text-transform: uppercase;
	letter-spacing: 0.14rem;
	font-size: 0.75rem;
	font-weight: 700;
	transition: transform 0.2s ease, background-color 0.2s ease;
	background: #ffffff;
	border-radius: 0.8rem;
	min-height: clamp(54px, 8vh, 84px);
	padding: 1rem 0.75rem;
	width: 100%;
	max-width: 152px;
	flex: 1 1 0;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.sidebar-nav a:hover,
.sidebar-nav a:focus-visible,
.sidebar-nav a.active {
	background: #d8d8d8;
	transform: scale(1.02);
}

.hero-header,
.intro-panel {
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 1.5rem;
}

.hero-header {
	grid-area: hero;
	background: #000000;
}

.hero-header h1 {
	margin: 0;
	font-size: clamp(2.4rem, 4vw, 4rem);
	font-weight: 500;
	letter-spacing: 0.04em;
}

.feature-panel {
	grid-area: feature;
	background:
		radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.85) 0, rgba(255, 255, 255, 0) 24%),
		linear-gradient(135deg, #ffffff 0%, #ffffff 100%);
	display: flex;
	align-items: stretch;
	justify-content: center;
	overflow-y: auto;
	overflow-x: hidden;
	width: 100%;
	height: 100%;
	padding: 0.9rem;
	position: relative;
}

.gallery-shell {
	width: min(100%, 980px);
	display: flex;
	flex-direction: column;
	gap: 1rem;
	align-self: flex-start;
}

.gallery-topbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	flex-wrap: wrap;
}

.gallery-topbar h2 {
	margin: 0;
	color: #000000;
	font-size: clamp(1.2rem, 0.95rem + 1.2vw, 2rem);
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.category-toolbar {
	display: flex;
	gap: 0.55rem;
	flex-wrap: wrap;
}

.category-toolbar a {
	text-decoration: none;
	background: #efefef;
	color: #000000;
	padding: 0.45rem 0.8rem;
	border-radius: 999px;
	font-size: 0.85rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	transition: background-color 0.2s ease;
}

.category-toolbar a:hover,
.category-toolbar a:focus-visible,
.category-toolbar a.active {
	background: #cfcfcf;
}

.category-grid {
	width: min(100%, 980px);
	margin: auto;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1.2rem;
	align-content: center;
}

.category-card {
	text-decoration: none;
	color: #000000;
	position: relative;
	border-radius: 1rem;
	overflow: hidden;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.14);
	aspect-ratio: 4 / 3;
	background: #000000;
}

.category-card img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.3s ease;
}

.category-card span {
	position: absolute;
	left: 0.75rem;
	bottom: 0.75rem;
	background: rgba(255, 255, 255, 0.9);
	padding: 0.4rem 0.75rem;
	border-radius: 0.6rem;
	font-weight: 800;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.category-card:hover img,
.category-card:focus-visible img {
	transform: scale(1.06);
}

.photo-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0.9rem;
	padding-bottom: 1.2rem;
}

.feature-panel.modal-open {
	overflow: hidden;
}

.photo-modal {
	position: fixed;
	top: calc(100svh / 6);
	bottom: calc(100svh / 7);
	left: 240px;
	right: 0;
	display: none;
	align-items: center;
	justify-content: center;
	padding: clamp(1rem, 2.6vw, 2rem);
	z-index: 10;
}

.photo-modal.is-open {
	display: flex;
}

.photo-modal.is-open .photo-modal-card {
	transform: translateY(0) scale(1);
	opacity: 1;
}

.photo-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(12, 12, 12, 0.55);
	backdrop-filter: blur(2px);
}

.photo-modal-card {
	position: relative;
	z-index: 1;
	width: min(90%, 980px);
	max-height: calc(100% - clamp(1.2rem, 3vh, 2.6rem));
	background: #000000;
	border-radius: 1.2rem;
	box-shadow:
		0 24px 60px rgba(0, 0, 0, 0.32),
		inset 0 0 0 1px rgba(255, 255, 255, 0.08);
	display: grid;
	grid-template-rows: minmax(0, 1fr) auto;
	overflow: hidden;
	transform: translateY(12px) scale(0.98);
	opacity: 0;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.photo-modal-card::before,
.photo-modal-card::after {
	content: "";
	position: absolute;
	top: 0.45rem;
	bottom: 0.45rem;
	width: 0.7rem;
	background: repeating-linear-gradient(
		to bottom,
		rgba(240, 236, 228, 0.95) 0 0.8rem,
		transparent 0.8rem 1.42rem
	);
	border-radius: 0.15rem;
	opacity: 0.95;
	z-index: 2;
	pointer-events: none;
}

.photo-modal-card::before {
	left: 0.32rem;
}

.photo-modal-card::after {
	right: 0.32rem;
}

.photo-modal-close {
	position: absolute;
	top: 0.75rem;
	right: 0.75rem;
	border: 0;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.7);
	color: #ffffff;
	font-size: 1.4rem;
	line-height: 1;
	cursor: pointer;
}

.photo-modal-media {
	background: #000000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: clamp(0.8rem, 2vw, 1.4rem) clamp(2.2rem, 3.6vw, 2.9rem);
}

.photo-modal-media img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 0.75rem;
}


.photo-card {
	border-radius: 0.8rem;
	overflow: hidden;
	background: #f2f2f2;
	aspect-ratio: 4 / 3;
	cursor: pointer;
}

.photo-card img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.intro-panel {
	grid-area: intro;
	background: #000000;
	color: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: clamp(0.45rem, 1.2vh, 0.9rem) 1rem;
}

.intro-panel p {
	margin: 0;
	max-width: min(78vw, 46rem);
	padding: 0 0.75rem;
	text-align: center;
	font-size: clamp(0.95rem, 0.6rem + 1.5vw, 1.8rem);
	font-weight: 400;
	line-height: 1.15;
}

@media (max-width: 900px) {
	.photo-modal {
		left: 0;
	}

	.page-shell {
		grid-template-columns: 1fr;
		grid-template-rows: calc(100svh / 6) auto minmax(0, 1fr) calc(100svh / 7);
		grid-template-areas:
			"hero"
			"sidebar"
			"feature"
			"intro";
		height: 100vh;
		height: 100svh;
		overflow: hidden;
	}

	.sidebar {
		flex-direction: row;
		justify-content: space-between;
		gap: 1.5rem;
		padding: 1.25rem 1rem;
		margin-left: 0;
		min-height: auto;
	}

	.sidebar-nav {
		flex-direction: row;
		flex-wrap: wrap;
		justify-content: flex-end;
		height: auto;
		gap: 0.75rem;
		overflow-y: hidden;
	}

	.sidebar-nav a {
		min-width: 120px;
		max-width: none;
		flex: 0 1 auto;
		padding: 0.9rem 0.75rem;
		min-height: 54px;
	}

	.sidebar::before,
	.sidebar::after {
		display: none;
	}

	.category-grid {
		grid-template-columns: 1fr;
	}

	.photo-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 560px) {
	.sidebar {
		flex-direction: column;
		justify-content: center;
	}

	.sidebar-nav {
		justify-content: center;
		width: 100%;
	}

	.hero-header h1 {
		font-size: 2rem;
	}

	.feature-panel {
		padding: 0.5rem;
	}

	.photo-grid {
		grid-template-columns: 1fr;
	}
}
