/* --- 1. GLOBAL SETTINGS --- */
:root {
	--bg: #0f0f0f;
	--surface: #1a1a1a;
	--surface-light: #252525;
	--accent: #2ed8c3;
	--text-main: #f1f1f1;
	--text-dim: #bdbdbd;
	--transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	/* utility tokens */
	--radius: 12px;
	--gap: 1rem;
	--btn-padding: 0.6rem 1.2rem;
	--btn-radius: 12px;
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	font-family:
		'Inter',
		-apple-system,
		BlinkMacSystemFont,
		sans-serif;
}

body {
	background-color: var(--bg);
	color: var(--text-main);
	min-height: 100vh;
	line-height: 1.6;
}

/* Accessibility: visible focus for keyboard users */
button:focus-visible,
a:focus-visible {
	outline: 3px solid var(--accent);
	outline-offset: 2px;
	border-radius: var(--btn-radius);
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
	:root { --transition: none; }
	* { transition: none !important; animation: none !important; }
}

/* --- 2. TOP BAR & NAV --- */
.top-bar {
	height: 70px;
	padding: 0 60px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	background-color: rgba(20, 20, 20, 0.8);
	backdrop-filter: blur(12px);
	position: sticky;
	top: 0;
	z-index: 1000;
	border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo {
	font-size: 20px;
	font-weight: 700;
	letter-spacing: -0.5px;
}

nav {
	display: flex;
	gap: 12px;
}

nav button,
.project-info button {
	padding: 10px 24px;
	font-size: 14px;
	font-weight: 600;
	border-radius: 12px;
	border: none;
	cursor: pointer;
	transition: var(--transition);
}

.btn-secondary {
	background: var(--surface);
	color: var(--text-main);
}
.btn-secondary:hover {
	background: var(--surface-light);
	transform: translateY(-2px);
}

.active {
	background-color: var(--accent) !important;
	color: #0f0f0f !important;
	box-shadow: 0 4px 15px rgba(46, 216, 195, 0.2);
}

/* --- 3. MAIN CONTENT & WRAPPERS --- */
main {
	display: flex;
	justify-content: center;
	flex-direction: row;
	flex-wrap: wrap;
	margin-top: 60px;
}

.projects-wrapper,
.about-wrapper {
	width: 90%;
	max-width: 1200px;
	margin: 40px auto;
}

/* Generic page content wrapper used by Contact/About pages */
.page-content {
	width: 90%;
	max-width: 800px;
	margin: 40px auto;
	padding: 20px;
	background: transparent;
	color: var(--text-main);
	text-align: center; /* center content for contact text */
}

.page-content p {
	color: var(--text-dim);
	margin-bottom: 1rem;
}

.page-content ul {
	list-style: none;
	padding: 0;
	margin: 10px 0 20px 0;
	display: inline-block;
	text-align: left; /* keep list items left-aligned inside center block */
}

.page-content li {
	padding: 6px 0;
	color: var(--text-main);
}

.page-content a {
	color: var(--accent);
	text-decoration: underline;
}

/* ensure long links wrap nicely */
.page-content a, .page-content p { word-wrap: break-word; }


/* --- 4. PROJECT GRID (Portfolio Startseite) --- */
.project-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 24px;
}

.project-thumb {
	aspect-ratio: 1/1;
	background-color: var(--surface);
	border-radius: 16px;
	position: relative;
	cursor: pointer;
	overflow: hidden;
	border: 1px solid rgba(255, 255, 255, 0.03);
}

.project-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s ease;
}

.project-thumb:hover img {
	transform: scale(1.05);
}

.project-title {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.7);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	text-align: center;
	opacity: 0;
	transition: var(--transition);
}

.project-thumb:hover .project-title {
	opacity: 1;
}

/* --- 5. OVERLAY & LIGHTBOX (Die Details) --- */

/* Project page layout and content styles */
.project-content {
	width: 90%;
	max-width: 1100px;
	margin: 40px auto;
	padding: 24px;
	display: flex;
	flex-direction: column;
	gap: 24px;
	align-items: stretch;
}

.project-content h1 {
	font-size: 2.2rem;
	margin-bottom: 0.25rem;
	color: var(--text-main);
}
.project-content h2 { font-size: 1.4rem; margin-top: 8px; color: var(--text-main); }

/* lead paragraph / description */
.project-content > p:first-of-type {
	color: var(--text-dim);
	font-size: 1.05rem;
	line-height: 1.6;
	margin-bottom: 0.5rem;
}

/* make inline lists and meta nicer */
.project-content ul, .project-content ol {
	margin-left: 1rem;
	color: var(--text-main);
}

/* project header */
.project-header { margin-bottom: 12px; }
.project-header-inner { display: flex; gap: 20px; align-items: center; }
.project-thumbnail { flex: 0 0 280px; border-radius: 14px; overflow: hidden; }
.project-thumbnail img { width: 100%; height: auto; display: block; }
.project-meta { flex: 1; }
.project-meta .lead { margin-top: 6px; color: var(--text-dim); }
.project-meta .meta-date { color: var(--text-dim); font-size: 0.9rem; margin-top: 6px; }
.project-meta .meta-tags { margin-top: 10px; }
.project-actions { margin-top: 12px; }
.project-actions .btn-secondary { text-decoration: none; display: inline-block; }

/* gallery override for project pages */
.project-content .gallery {
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 20px;
}

.project-content .gallery img, .project-content img.lightbox-img {
	width: 100%;
	height: auto;
	border-radius: var(--radius);
	box-shadow: 0 6px 30px rgba(0,0,0,0.4);
	transition: transform 0.35s ease, filter 0.25s ease;
}
.project-content .gallery img:hover, .project-content img.lightbox-img:hover { transform: translateY(-6px) scale(1.02); filter: brightness(1.05); }

/* make embeds stand out */
.project-content .embed { margin: 8px 0 16px 0; border-radius: 12px; box-shadow: 0 6px 30px rgba(0,0,0,0.4); }

/* code blocks, pre, blockquote */
.project-content pre { background: #0e0e0e; padding: 12px; border-radius: 8px; overflow: auto; color: var(--text-main); }
.project-content code { background: rgba(255,255,255,0.03); padding: 2px 6px; border-radius: 6px; }
.project-content blockquote { border-left: 4px solid var(--surface); padding-left: 12px; color: var(--text-dim); margin: 12px 0; }

/* Rows: if content author uses a two-column layout helper class */
.row { display: flex; gap: 20px; align-items: flex-start; }
.row > * { flex: 1; }

/* lightbox overlay tweaks */
.lightbox-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.9); display: none; align-items: center; justify-content: center; z-index: 3000; }
.lightbox-overlay .lightbox-inner { max-width: 95%; max-height: 95%; display: flex; align-items: center; justify-content: center; }
.lightbox-overlay img { max-width: 100%; max-height: 100%; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,0.6); }

/* responsive tweaks for large screens */
@media (min-width: 1100px) {
	.project-content { gap: 28px; }
}

/* small device adjustments specifically for project pages */
@media (max-width: 900px) {
	.project-content { padding: 16px; width: 95%; }
	.project-content h1 { font-size: 1.6rem; }
	.project-content .gallery { grid-template-columns: 1fr 1fr; }
	.project-header-inner { flex-direction: column; align-items: flex-start; }
	.project-thumbnail { width: 100%; flex: none; }
}

@media (max-width: 480px) {
	.project-content { padding: 12px; }
	.project-content h1 { font-size: 1.4rem; }
	.project-content .gallery { grid-template-columns: 1fr; }
}

/* end project content styles */

.project-overlay,
.lightbox-overlay {
	position: fixed;
	inset: 0;
	background-color: rgba(0, 0, 0, 0.9);
	display: none; /* JS Toggle */
	align-items: center;
	justify-content: center;
	z-index: 2000;
}

.overlay-content {
	width: 95%;
	max-width: 1200px;
	/* allow content to grow but keep within viewport on small devices */
	max-height: 85vh;
	height: auto;
	background-color: #141414;
	border-radius: 24px;
	padding: 40px;
	display: flex;
	gap: 40px;
	position: relative;
	overflow: hidden;
	border: 1px solid rgba(255, 255, 255, 0.05);
}

.overlay-media {
	flex: 2;
	border-radius: 12px;
	overflow: hidden;
}
.overlay-info {
	flex: 1;
	overflow-y: auto;
	padding-right: 15px;
}

.close-btn {
	position: absolute;
	top: 20px;
	right: 20px;
	background: none;
	border: none;
	color: white;
	font-size: 28px;
	cursor: pointer;
	z-index: 10;
}

/* --- 6. GALLERY & TAGS --- */
.gallery {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 12px;
	margin-top: 20px;
}

.gallery img {
	width: 100%;
	border-radius: 8px;
	cursor: zoom-in;
	transition: var(--transition);
}

.gallery img:hover {
	filter: brightness(1.2);
}

.tag-filters {
	margin-bottom: 20px;
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}
.tag {
	padding: 6px 14px;
	border-radius: 20px;
	border: 1px solid #333;
	background: #1a1a1a;
	color: var(--text-dim);
	cursor: pointer;
	font-size: 13px;
}

.tag.active {
	background: var(--accent);
	color: #000;
	border-color: var(--accent);
}

/* --- 7. EMBEDS & VIDEO --- */
.embed {
	position: relative;
	padding-bottom: 56.25%;
	height: 0;
	border-radius: 12px;
	overflow: hidden;
}
.embed iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* --- 8. ABOUT PAGE --- */
.about-wrapper {
	text-align: center;
	padding-top: 60px;
	display: none;
} /* JS Toggle */
.about-content p {
	font-size: 1.1rem;
	margin-bottom: 40px;
	color: var(--text-dim);
}

.about-tools {
	display: flex;
	justify-content: center;
	gap: 30px;
	flex-wrap: wrap;
}

.about-tools img {
	width: 40px;
	height: 40px;
	filter: grayscale(1) opacity(0.6);
	transition: var(--transition);
}

.about-tools img:hover {
	filter: grayscale(0) opacity(1);
	transform: translateY(-5px);
}

/* --- 9. RESPONSIVE --- */
@media (max-width: 900px) {
	.top-bar {
		padding: 0 20px;
		height: 60px;
	}
	.overlay-content {
		flex-direction: column;
		padding: 20px;
		max-height: 95vh;
		overflow-y: auto;
	}
	.overlay-media {
		flex: none;
		height: 300px;
	}
	.project-grid {
		grid-template-columns: 1fr 1fr;
	}
}

/* smaller devices */
@media (max-width: 600px) {
	.top-bar {
		height: 56px;
		padding: 0 12px;
	}
	.logo { font-size: 1rem; }
	.project-grid { grid-template-columns: 1fr; gap: 16px; }
	.projects-wrapper, .about-wrapper { width: 95%; margin: 20px auto; }
	.overlay-media { height: 220px; }
}

@media (max-width: 480px) {
	.top-bar { height: 52px; padding: 0 8px; }
	nav { gap: 8px; }
	nav button, .project-info button { padding: 8px 10px; font-size: 13px; }
	.overlay-content { padding: 12px; gap: 12px; border-radius: 12px; }
}
