/* ===== ОБЩИЕ СТИЛИ ===== */
*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html{
    scroll-behavior: smooth;
}

body{
    font-family: 'Inter', sans-serif;
    background: #f8fafc;
    color: #1f2937;
    overflow-x: hidden; /* Защита от горизонтальной прокрутки всей страницы */
}

/* ===== NAVBAR ===== */
.navbar{
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 8%;
    backdrop-filter: blur(15px);
    background: rgba(255, 255, 255, .75);
    border-bottom: 1px solid rgba(0, 0, 0, .05);
}

.navbar ul{
    display: flex;
    list-style: none;
    gap: 25px;
}

.navbar a{
    text-decoration: none;
    color: #111;
    font-weight: 500;
}

/* ===== HERO ===== */
.hero{
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    padding: 0 20px;
}

.hero img{
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, .15);
}

.hero h1{
    font-size: 3rem;
    margin-bottom: 10px;
}

.hero p{
    font-size: 1.2rem;
    color: #6b7280;
}

.btn{
    margin-top: 25px;
    background: #4f8ef7;
    color: white;
    text-decoration: none;
    padding: 14px 32px;
    border-radius: 12px;
    transition: .3s;
}

.btn:hover{
    transform: translateY(-3px);
}

/* ===== BLUR BACKGROUND ===== */
.blur{
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
}

.blur1{
    background: #4f8ef7;
    top: -100px;
    left: -100px;
    opacity: .25;
}

.blur2{
    background: #6fcf97;
    right: -100px;
    bottom: -100px;
    opacity: .25;
}

/* ===== SECTIONS ===== */
.section{
    padding: 110px 10%;
}

.section h2{
    text-align: center;
    margin-bottom: 50px;
    font-size: 2rem;
}

/* ===== CARDS & GRID ===== */
.grid{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.card{
    background: white;
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .08);
}

/* ===== СОВРЕМЕННАЯ КАРУСЕЛЬ ДЛЯ СЕРТИФИКАТОВ ===== */
.carousel-container {
    position: relative;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 60px; /* Отступы для стрелочек */
}

.carousel-track-container {
    overflow: hidden; /* Прячет элементы, которые не поместились в экран */
    width: 100%;
}

.carousel-track {
    display: flex;
    transition: transform 0.4s ease-in-out;
    gap: 20px;
    width: 100%;
}

.carousel-item {
    /* Жестко делим экран на 3 части с учетом gap: (100% - 40px) / 3 */
    flex: 0 0 calc((100% - 40px) / 3);
    max-width: calc((100% - 40px) / 3);
    min-width: calc((100% - 40px) / 3); /* Защита от сжатия картинок в 0 */
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, .06);
    cursor: pointer;
    transition: transform .3s;
}

.carousel-item:hover {
    transform: translateY(-5px);
}

.carousel-item img {
    width: 100%;
    height: 360px; /* Оптимальная высота для документов */
    object-fit: contain; /* Картинка не обрезается и сохраняет пропорции */
    background: #ffffff;
    display: block;
    padding: 12px;
}

/* Кнопки управления (Стрелки) */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.08);
    width: 46px;
    height: 46px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 10;
    transition: all 0.2s ease;
}

.carousel-btn:hover {
    background: #4f8ef7;
    color: white;
    border-color: #4f8ef7;
}

.prev-btn { left: 5px; }
.next-btn { right: 5px; }

/* Индикаторы (Точки под слайдером) */
.carousel-nav {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 25px;
}

.carousel-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #cbd5e1;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-indicator.active {
    background: #4f8ef7;
    transform: scale(1.2);
}

/* ===== СТИЛИ ДЛЯ КАРУСЕЛИ РАЗРАБОТОК ===== */
.dev-item {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 280px; /* Фиксированная высота для карточек с текстом */
    cursor: default; /* Обычный курсор, так как карточка не увеличивается */
}

.dev-card-content {
    padding: 30px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    width: 100%;
}

.dev-icon {
    font-size: 3rem;
    margin-bottom: 5px;
}

.dev-ext {
    font-size: 0.8rem;
    background: #e2e8f0;
    color: #475569;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 600;
    margin-bottom: 15px;
}

.dev-card-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 20px;
    flex-grow: 1; /* Выталкивает кнопку скачивания строго вниз */
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Ограничивает слишком длинные названия тремя строками */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dev-btn-download {
    margin-top: auto;
    width: 100%;
    padding: 10px 20px;
    font-size: 0.95rem;
    border-radius: 8px;
    text-align: center;
}

/* ===== CONTACTS & FOOTER ===== */
footer{
    text-align: center;
    padding: 30px;
    color: #6b7280;
}

/* ===== REVEAL ANIMATION ===== */
.reveal{
    opacity: 0;
    transform: translateY(50px);
    transition: .8s;
}

.reveal.active{
    opacity: 1;
    transform: none;
}

/* ===== СТИЛИ ДЛЯ МОДАЛЬНОГО ОКНА (ПОЛНОЭКРАННЫЙ ПРОСМОТР) ===== */
.modal {
    display: none; /* Скрыто по умолчанию */
    position: fixed;
    z-index: 2000; /* Выше навбара и всего остального */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9); /* Темный полупрозрачный фон */
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal-content {
    max-width: 90%;
    max-height: 85vh;
    object-fit: contain; /* Картинка сохраняет пропорции и не обрезается */
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    animation: zoomIn 0.3s ease; /* Плавное появление */
}

.close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    user-select: none;
}

.close:hover {
    color: #4f8ef7;
}

@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}


/* ===== ГЛОБАЛЬНЫЙ БЛОК АДАПТИВНОСТИ (RESPONSIVE) ===== */
@media (max-width: 900px) {
    /* По 2 элемента в каруселях на планшетах */
    .carousel-item, .dev-item {
        flex: 0 0 calc((100% - 20px) / 2) !important;
        max-width: calc((100% - 20px) / 2) !important;
        min-width: calc((100% - 20px) / 2) !important;
    }
}

@media (max-width: 768px) {
    .section {
        padding: 80px 5%;
    }
    
    .grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .hero h1 {
        font-size: 2.2rem;
        word-wrap: break-word;
    }
    
    .navbar {
        flex-direction: column;
        gap: 10px;
        padding: 15px 5%;
    }
    
    .navbar ul {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .carousel-container {
        padding: 0; /* Убираем боковые падинги на смартфонах */
    }
    
    .carousel-btn {
        display: none !important; /* Скрываем стрелочки на смартфонах */
    }

    /* По 1 элементу в каруселях во всю ширину экрана на смартфонах */
    .carousel-item, .dev-item {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
    }
    
    .carousel-item img {
        height: 300px; /* Оптимальное уменьшение высоты сертификатов на мобильных */
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.8rem;
    }
    .section h2 {
        font-size: 1.5rem;
        margin-bottom: 30px;
    }
    .btn {
        width: 100%;
        max-width: 280px;
        display: inline-block;
    }
}