/* === Общие стили === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f2f5;
    color: #333;
}

/* === Шапка === */
.header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 15px 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.header-container {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo img {
    height: 50px;
    width: auto;
}

.site-title {
    color: #ffffff;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: 1px;
}

/* === Карусель === */
.carousel-section {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.slide-link {
    text-decoration: none;
    min-width: 100%;
    display: block;
}

.carousel-slide {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    cursor: pointer;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Контейнер для текста и фона - прижат к низу */
.slide-text-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px 40px;
    pointer-events: none;
}

/* Анимированный текст */
.slide-caption {
    font-size: 36px;
    font-weight: 700;
    color: #ffffff;
    text-align: center;
    opacity: 0;
    transform: translateX(-100%);
    position: relative;
    z-index: 2;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Фон под текстом (градиентный, тёмно-прозрачный) */
.slide-caption::before {
    content: '';
    position: absolute;
    top: -15px;
    left: -20px;
    right: -20px;
    bottom: -15px;
    background: linear-gradient(to top, 
        rgba(0, 0, 0, 0.9) 0%, 
        rgba(0, 0, 0, 0.7) 60%, 
        transparent 100%);
    border-radius: 8px 8px 0 0;
    opacity: 0;
    z-index: -1;
}

/* Анимация появления текста на активном слайде */
.carousel-slide.active .slide-caption {
    animation: slideTextIn 1.2s ease-out forwards;
}

.carousel-slide.active .slide-caption::before {
    animation: fadeInBackground 0.8s ease-out 0.6s forwards;
}

@keyframes slideTextIn {
    0% {
        opacity: 0;
        transform: translateX(-100%);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInBackground {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* Кнопки карусели */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: #ffffff;
    border: none;
    font-size: 24px;
    padding: 15px 20px;
    cursor: pointer;
    transition: background-color 0.3s;
    z-index: 10;
}

.carousel-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.prev-btn {
    left: 10px;
}

.next-btn {
    right: 10px;
}

/* Индикаторы */
.carousel-indicators {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background-color 0.3s;
}

.indicator.active {
    background-color: #ffffff;
}

/* === Секция проектов === */
.projects-section {
    max-width: 1200px;
    margin: 50px auto;
    padding: 0 20px;
}

.projects-section h2 {
    font-size: 32px;
    margin-bottom: 30px;
    text-align: center;
    color: #1a1a2e;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.project-card {
    background-color: #ffffff;
    padding: 25px;
    border-radius: 10px;
    border: 2px solid #e0e0e0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    border-color: #4fc3f7;
}

.project-card h3 {
    font-size: 22px;
    margin-bottom: 15px;
    color: #1a1a2e;
    border-bottom: 2px solid #4fc3f7;
    padding-bottom: 10px;
}

.project-card p {
    font-size: 16px;
    color: #555;
    line-height: 1.7;
}

/* === Подвал === */
.footer {
    background: linear-gradient(135deg, #0f0f1e 0%, #1a1a2e 100%);
    color: #ffffff;
    padding: 40px 20px;
    margin-top: 60px;
    border-top: 4px solid #4fc3f7;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

.contact-info h3 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #ffffff;
}

.contact-info p {
    font-size: 16px;
    margin-bottom: 10px;
}

.contact-info a {
    color: #4fc3f7;
    text-decoration: none;
    transition: color 0.3s;
}

.contact-info a:hover {
    color: #81d4fa;
    text-decoration: underline;
}

/* === Адаптивность === */
@media (max-width: 768px) {
    .site-title {
        font-size: 22px;
    }

    .slide-caption {
        font-size: 24px;
    }

    .slide-text-container {
        padding: 20px;
    }

    .carousel-btn {
        padding: 10px 15px;
        font-size: 20px;
    }

    .projects-section h2 {
        font-size: 26px;
    }

    .project-card h3 {
        font-size: 20px;
    }

    .footer {
        padding: 25px 15px;
    }

    .contact-info h3 {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .slide-caption {
        font-size: 20px;
    }
}