/* RESET & GLOBAL */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
    color: #ffffff;
    line-height: 1.5;
    min-height: 100vh;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
}

/* Фоновое видео на весь экран */
.video-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
}

.video-background video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Полупрозрачный слой поверх видео */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1;
}

/* Основной контент — flex для прижатия футера к низу */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
    position: relative;
    z-index: 2;
}

.container {
    max-width: 1200px;
    margin: 2rem 1rem 0 2rem;
    padding: 0;
    width: auto;
}

/* Header — выравнивание по левому краю */
.header {
    margin-bottom: 3rem;
    text-align: left;
}

.header h1 {
    font-size: 3rem;
    font-weight: 700;
    text-shadow: 0 2px 5px rgba(0,0,0,0.3);
    margin-bottom: 0.5rem;
}

.header p {
    font-size: 1.2rem;
    color: #f0f0f0;
    max-width: 600px;
}

/* Сетка проектов */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0 3rem;
}

/* Карточка проекта — плавное появление за 3 секунды */
.project-card {
    background: rgba(20, 30, 45, 0.75);
    backdrop-filter: blur(8px);
    border-radius: 2rem;
    padding: 1.8rem;
    transition: transform 0.25s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 3s ease, transform 3s ease;
}

.project-card.animate-in {
    opacity: 1;
    transform: scale(1);
}

.project-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.3);
    background: rgba(30, 45, 65, 0.85);
}

/* Иконка-изображение */
.project-icon {
    width: 64px;
    height: 64px;
    object-fit: contain;
    margin-bottom: 1rem;
}

.project-title {
    font-size: 1.7rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #ffffff;
}

.project-description {
    color: #e0e0e0;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.project-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: #ffffff;
    color: #1e2a3a;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 3rem;
    font-weight: 600;
    transition: background 0.2s, transform 0.1s;
    align-self: flex-start;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.project-link:hover {
    background: #e0e7ff;
    transform: scale(1.02);
}

.project-link:active {
    transform: scale(0.98);
}

/* Футер прижат к низу */
footer {
    text-align: center;
    margin-top: 1rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: #ccc;
}

/* Блок управления звуком */
.sound-control {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    padding: 8px 16px 8px 12px;
    border-radius: 60px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: background 0.2s;
}

.sound-control:hover {
    background: rgba(0, 0, 0, 0.8);
}

.sound-toggle {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    transition: transform 0.1s;
}

.sound-toggle:hover {
    transform: scale(1.1);
}

.volume-slider {
    -webkit-appearance: none;
    width: 100px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 0 2px rgba(0,0,0,0.5);
}

.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    border: none;
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        margin: 1rem 1rem 0 1rem;
    }
    .header h1 {
        font-size: 2.2rem;
    }
    .project-card {
        padding: 1.4rem;
    }
    .sound-control {
        bottom: 15px;
        right: 15px;
        padding: 6px 12px 6px 8px;
    }
    .volume-slider {
        width: 70px;
    }
}

@media (max-width: 480px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
}