* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

:root {
	--index: calc(1vw + 1svh);
	--color-header: #f4efec;
	--color-text: #cdc6c3;

	/* 1. РЕГУЛИРУЙ ТУТ ИНТЕРВАЛ МЕЖДУ КАРТИНКАМИ */
	/* Чем меньше число, тем плотнее картинки друг к другу */
	--gallery-gap: calc(var(--index) * 15);
}

@font-face {
	font-family: raleway-c;
	src: url(../fonts/raleway-regular.woff2);
}

@font-face {
	font-family: outfit-c;
	src: url(../fonts/outfit-regular.woff2);
}

h1,
h2,
h3,
h4,
h5,
h6 {
	font-family: outfit-c;
}

.content,
.hero,
.main-header {
	will-change: transform;
}

body {
	background-image: url(../img/bg.jpg);
	background-size: 50px;
	color: #fafafa;
	font-family: raleway-c;
	overflow-x: hidden;
}

.hero {
	width: calc(var(--index) * 36);
	position: absolute;
	left: 37vw;
	top: 22vh;
	z-index: -1;
}

.main-header {
	height: 100vh;
}

.container {
	padding: 0 7vw;
}

.main-title {
	font-size: calc(var(--index) * 8);
	position: absolute;
	width: min-content;
	bottom: 12vh;
	line-height: .9;
}

/* ГАЛЕРЕЯ */
.gallery {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 0;
	/* Убрал лишние отступы самой галереи */
}

/* Элементы галереи */
.gallery__item {
	/* 2. РЕГУЛИРУЙ ТУТ МАКСИМАЛЬНУЮ ШИРИНУ И ВЫСОТУ */
	max-width: 80vw;
	max-height: 85vh;
	/* Чтобы картинка точно влезала в экран по высоте */

	/* 3. ОЧЕНЬ ВАЖНО: АВТО-ВЫСОТА (убирает пустоту под картинкой) */
	width: auto;
	height: auto;

	object-fit: contain;
	display: block;

	/* Центрирование и твой интервал */
	margin: 0 auto var(--gallery-gap) auto;
	border-radius: 8px;
}

/* Текст */
.text-block {
	max-width: calc(var(--index) * 25);
	margin: 0 auto var(--gallery-gap) auto;
	text-align: center;
	color: var(--color-text);
}

.text-block__h {
	font-size: 2rem;
	line-height: 2.4rem;
	color: var(--color-header);
	margin-bottom: 1rem;
}

.text-block__p {
	line-height: 1.75;
}

/* АНИМАЦИЯ */
.reveal-item {
	opacity: 0;
	will-change: opacity;
}

/* АДАПТИВ ПОД ТЕЛЕФОНЫ */
/* --- ПОЛНОСТЬЮ ИСПРАВЛЕННЫЙ АДАПТИВ ПОД ТЕЛЕФОН (max-width: 500px) --- */
@media (max-width: 500px) {

	/* Фикс №1: Шапка. Убрали 100vw, оставили 100% */
	.main-header {
		height: auto;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		width: 100%;
		box-sizing: border-box;
		padding: 15vh 0 10vh;
	}

	/* Фикс №2: Центрируем фото */
	.hero {
		position: relative;
		left: auto;
		top: auto;
		margin: 0 auto;
		max-width: 80vw;
		height: auto;
		width: auto;
		z-index: 1;
		display: block;
	}

	/* Фикс №3: Текст Portfolio */
	.main-title {
		position: relative;
		bottom: auto;
		left: auto;
		width: 100%;
		max-width: 90vw;
		text-align: center;
		font-size: calc(var(--index) * 8);
		line-height: .9;
		margin: -5vh auto 0;
		padding: 0;
	}

	/* Фикс №4: Галерея. Убрали 100vw, оставили 100% */
	.gallery {
		width: 100%;
		box-sizing: border-box;
		padding: 0;
	}

	/* Фикс №5: Элементы галереи */
	.gallery__item {
		max-width: 95vw;
		height: auto;
		max-height: 70vh;
		margin: 0 auto calc(var(--index) * 10);
		display: block;
	}

	/* Фикс №6: Контейнер */
	.container {
		padding: 0 5vw;
		width: 100%;
		box-sizing: border-box;
	}
}