/* === ПЕРЕМЕННЫЕ И БАЗА === */
:root {
	--index: calc(1vw + 1.2vh);
	--transition: 1.5s cubic-bezier(.05, .5, 0, 1);
	--glass-bg: rgba(0, 0, 0, 0.55);
	--glass-border: rgba(255, 255, 255, 0.15);
	--text-color: #ffffff;
	--accent: #a5d8ff;
	--accent2: #4dabf7;
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

@font-face {
	font-family: 'kamerik-3d';
	src: url('../fonts/kamerik205-heavy.woff2') format('woff2');
	font-weight: 900;
}
@font-face {
	font-family: 'merriweather-italic';
	src: url('../fonts/merriweather-regular-italic.woff2') format('woff2');
}

body {
	background-color: #000;
	color: var(--text-color);
	font-family: 'merriweather-italic', serif;
	overflow-x: hidden;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
	font-size: calc(var(--index) * 0.7);
}

/* === 3D СЦЕНА (ФОН) === */
.layers {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: -1;
	perspective: 1000px;
	overflow: hidden;
}
.layers__container {
	height: 100vh;
	min-height: 500px;
	transform-style: preserve-3d;
	transform: rotateX(var(--move-y, 0deg)) rotateY(var(--move-x, 0deg));
	will-change: transform;
	transition: transform var(--transition);
}
.layers__item {
	position: absolute;
	inset: -5vw;
	background-size: cover;
	background-position: center;
	display: flex;
	align-items: center;
	justify-content: center;
}
.layer-1 { transform: translateZ(-55px) scale(1.06); }
.layer-2 { transform: translateZ(80px) scale(0.88); }
.layer-4 { transform: translateZ(190px) scale(0.9); }
.layer-5 { transform: translateZ(300px) scale(0.9); }
.layer-6 { transform: translateZ(380px); }

canvas.rain {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}

/* === ОСНОВНОЙ КОНТЕЙНЕР === */
.main-content {
	position: relative;
	z-index: 1;
	padding: calc(var(--index) * 3) 5vw;
}
.container {
	max-width: 1200px;
	margin: 0 auto;
}

/* === СТЕКЛЯННАЯ КАРТОЧКА === */
.glass-card {
	background: var(--glass-bg);
	backdrop-filter: blur(12px);
	border-radius: calc(var(--index) * 1.8);
	border: 1px solid var(--glass-border);
	padding: calc(var(--index) * 2.2);
	margin-bottom: calc(var(--index) * 2.5);
	box-shadow: 0 20px 40px rgba(0,0,0,0.5);
	transition: transform 0.3s ease;
}
.glass-card:hover {
	transform: translateY(-4px);
}

/* === ЗАГОЛОВОК СТРАНИЦЫ === */
.projects-header {
	text-align: center;
	margin-bottom: calc(var(--index) * 2.5);
}
.projects-header h1 {
	font-family: 'kamerik-3d', sans-serif;
	font-size: calc(var(--index) * 3);
	color: var(--accent);
	margin-bottom: 0.5rem;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
}
.projects-header p {
	font-size: calc(var(--index) * 0.9);
	opacity: 0.9;
}

/* === СЕТКА ПРОЕКТОВ === */
.projects-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: calc(var(--index) * 2);
	margin-bottom: calc(var(--index) * 2.5);
}

.project-card {
	text-align: center;
}
.project-icon {
	font-size: calc(var(--index) * 4);
	margin-bottom: 1rem;
}
.project-card h2 {
	font-family: 'kamerik-3d', sans-serif;
	font-size: calc(var(--index) * 1.6);
	margin-bottom: 1rem;
	color: white;
}
.project-description {
	font-size: calc(var(--index) * 0.7);
	margin-bottom: 1.5rem;
	opacity: 0.9;
}
.project-tech {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	justify-content: center;
	margin-bottom: 1.8rem;
}
.tech-badge {
	background: rgba(255,255,255,0.15);
	padding: 0.3rem 0.8rem;
	border-radius: 16px;
	font-size: calc(var(--index) * 0.55);
	color: var(--accent);
}

/* === КНОПКИ === */
.project-btn {
    background: rgba(165, 216, 255, 0.2);
    backdrop-filter: blur(5px);
    border: 1px solid var(--accent);
    color: white;
    padding: 0.7rem 2rem;
    border-radius: 30px;
    font-weight: bold;
    font-size: calc(var(--index) * 0.7);
    transition: 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}
.project-btn:hover {
    background: var(--accent);
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
}

.back-link {
	text-align: center;
	margin-top: 1rem;
}
.back-btn {
	background: rgba(0, 0, 0, 0.5);
	color: white;
	text-decoration: none;
	padding: 0.7rem 2rem;
	border-radius: 30px;
	font-weight: bold;
	font-size: calc(var(--index) * 0.7);
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	transition: 0.3s;
	border: 1px solid rgba(255,255,255,0.2);
}
.back-btn:hover {
	background: rgba(0, 0, 0, 0.7);
}

/* ========== АДАПТИВНОСТЬ ========== */
@media (max-width: 768px) {
    :root {
        --index: calc(0.75vw + 0.75vh);
    }
    body {
        padding: 0.4rem;
        font-size: clamp(12px, calc(var(--index) * 0.7), 16px);
    }
    .main-content {
        padding: calc(var(--index) * 1.5) 4vw;
    }
    .glass-card {
        padding: calc(var(--index) * 1.8);
        margin-bottom: calc(var(--index) * 1.8);
        border-radius: calc(var(--index) * 1.4);
    }
    .projects-header h1 {
        font-size: clamp(18px, calc(var(--index) * 2.8), 32px);
    }
    .projects-header p {
        font-size: clamp(12px, calc(var(--index) * 0.8), 18px);
    }
    .projects-grid {
        grid-template-columns: 1fr;
        gap: calc(var(--index) * 1.8);
    }
    .project-icon {
        font-size: calc(var(--index) * 4.5);
    }
    .project-card h2 {
        font-size: clamp(14px, calc(var(--index) * 1.4), 22px);
    }
    .project-description {
        font-size: clamp(12px, calc(var(--index) * 0.6), 16px);
    }
    .tech-badge {
        font-size: clamp(11px, calc(var(--index) * 0.5), 14px);
        padding: 0.2rem 0.6rem;
    }
    .project-btn {
        width: 100%;
        padding: 0.6rem;
        font-size: clamp(12px, calc(var(--index) * 0.65), 16px);
        justify-content: center;
    }
    .back-btn {
        width: 100%;
        justify-content: center;
        font-size: clamp(12px, calc(var(--index) * 0.65), 16px);
        padding: 0.6rem;
    }
}

@media (max-width: 480px) {
    :root {
        --index: calc(1vw + 1.5vh);
    }
    .glass-card {
        padding: calc(var(--index) * 1.8);
    }
    .tech-badge {
        font-size: calc(var(--index) * 0.55);
    }
}