.projects-list {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
	margin: 0 auto;
	max-width: 1200px;
}

.project-segment {
	border: 1px solid var(--color-surface);
	border-radius: 14px;
	padding: 1.5em 1.5em;
	text-align: center;
	cursor: pointer;
}

.project-title {
	text-align: left;
}

.project-segment img {
	margin-bottom: 2rem;
	padding: 1rem;
	transition: transform 0.18s;
}

.project-segment:hover img {
	transform: translateY(-6px) scale(1.05);
}
.project-mockup {
	width: 100%;
	max-width: 350px;
	margin-bottom: 0.7em;
	margin: 0 auto;
}
.project-title {
	font-size: 1.18em;
	color: var(--color-text-headings);
}

@media (max-width: 800px) {
	.projects-list {
		grid-template-columns: 1fr;
	}
}

/* === MODAL / POPUP === */

.modal {
	display: none; /* domyślnie ukryty */
	position: fixed;
	z-index: 999;
	left: 0;
	top: 0;
	width: 100vw;
	height: 100vh;
	background: rgba(22, 25, 34, 0.8); /* ciemny overlay */
	align-items: center;
	justify-content: center;
	/* dodaje flex, żeby .modal-content wyśrodkować */
}

.modal-content {
	margin: 0 auto;
	background: var(--color-surface);
	border-radius: 18px;
	padding: 2rem;
	max-width: 1200px;
	width: 90vw;
	max-height: calc(100dvh - 12dvh - 2rem);
	position: relative;
	text-align: left;
	overflow-y: auto;
	animation: popIn 0.22s;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	justify-content: center;
	scrollbar-width: thin; /* Firefox: cienki pasek */
	scrollbar-color: var(--color-accent-blue) var(--color-background);
}
.modal-content::-webkit-scrollbar {
	width: 0; /* ukryty domyślnie */
	background: transparent;
	transition: width 0.22s;
}
.modal-content:hover::-webkit-scrollbar {
	width: 6px; /* pojawia się cienki pasek */
}
.modal-content::-webkit-scrollbar-thumb {
	background: var(--color-background);
	border-radius: 12px;
}

.modal-body-flex {
	display: flex;
	flex-direction: row; /* kluczowe! */
	gap: 1.5rem;
	max-height: 65vh; /* dopasuj, by nie wychodziło poza ekran */
	min-height: 0;
	overflow: hidden;
}

#modal-img {
	display: block;
	width: 100%;
	max-width: 340px;
	height: auto;
	max-height: 35vh;
	margin: auto;
	border-radius: 18px;
	object-fit: contain;
	flex-shrink: 0;
}

.modal-texts {
	flex: 1 1 0;
	min-width: 0;
	min-height: 0;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
}

#modal-title {
	margin: 10px 0 7px 0;
	font-size: 1.22em;
	font-weight: 700;
	color: var(--color-text-headings);
	text-align: left;
}

#modal-desc {
	font-size: 1.05em;
	line-height: 1.6;
	margin-top: 6px;
	text-align: left;
}

.modal-tech {
	text-align: left;
	margin-top: 22px;
	font-size: 1em;
	color: var(--color-text-secondary);
}
.tech-list {
	margin: 8px 0 0 0;
	padding-left: 20px;
}
.tech-list li {
	list-style: disc;
	margin-bottom: 2px;
	font-size: 1em;
}

.close-btn {
	position: absolute;
	top: 0px;
	right: 10px;
	font-size: 2rem;
	color: var(--color-text-primary);
	cursor: pointer;
	background: none;
	border: none;
	line-height: 1;
	z-index: 1;
	transition: color 0.16s;
}
.close-btn:hover {
	color: var(--color-accent-blue);
}

.project-title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.6em;
}

.project-title-arrow {
	font-size: 1em; /* dopasuj wielkość */
	transition: transform 0.2s;
}

.project-segment:hover .project-title-arrow {
	transform: translateX(5px);
}

@keyframes popIn {
	from {
		transform: scale(0.95) translateY(32px);
		opacity: 0;
	}
	to {
		transform: scale(1) translateY(0);
		opacity: 1;
	}
}

.zoom-overlay {
	display: none;
	position: fixed;
	z-index: 10000;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background: rgba(0, 0, 0, 0.6);
	justify-content: center;
	align-items: center;
	padding: 20px;
}

.zoom-overlay img {
	max-width: 80%;
	max-height: 80%;
	object-fit: contain;
}

.zoom-close-btn {
	position: absolute;
	top: 10vh;
	right: 10vh;
	font-size: 2rem;
	color: var(--color-text-primary);
	cursor: pointer;
	z-index: 10001;
	transition: color 0.16s;
}

.zoom-close-btn:hover {
	color: var(--color-accent-blue);
}

/* Responsywność: na telefonach wszystko pod sobą */
@media (max-width: 900px) {
	.modal-body-flex {
		display: block;
		max-height: 73vh;
		min-height: 0;
		overflow: auto;
	}
	.modal-content {
		padding: 2rem 0.5rem;
	}
	.modal-texts {
		padding: 1rem;
	}
	#modal-img {
		margin: 0 auto;
	}
}
