/* 1. Сброс стилей и переменные */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-color: #0d0e12;
    --surface-color: #16181f;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --accent-color: #6366f1;
    --accent-hover: #4f46e5;
    --font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --transition: all 0.3s ease;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-family);
    line-height: 1.6;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

html {
    scroll-behavior: smooth; /* Включает плавную прокрутку */
    scroll-padding-top: 80px; /* Защищает заголовки от перекрытия фиксированным меню */
}


/* Общий контейнер */
.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 2. Навигация (Шапка) */
.navbar {
    background-color: rgba(13, 14, 18, 0.8);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.navbar__items {
    display: flex;
    justify-content: center;
    gap: 40px;
    list-style: none;
    padding: 20px 0;
}

.navbar__items a {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
    position: relative;
    padding: 5px 0;
}

.navbar__items a:hover {
    color: var(--text-primary);
}

/* Эффект линии при наведении */
.navbar__items a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: var(--transition);
}

.navbar__items a:hover::after {
    width: 100%;
}

/* 3. Секция Hero (Главная) */
.main {
    padding-top: 80px; /* Отступ под фиксированное меню */
}

.hero__section {
    padding: 80px 0;
    min-height: 80vh;
    display: flex;
    align-items: center;
}

.hero__container {
    display: flex;
    align-items: center;
    gap: 60px;
}

.hero__img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--accent-color);
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.3);
    background-color: var(--surface-color);
}

.hero__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero__content {
    flex: 1;
}

.hero__title {
    font-size: 3.5rem;
    line-height: 1.1;
    font-weight: 800;
    margin-bottom: 20px;
    background: linear-gradient(to right, #fff, var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero__about {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 500px;
}

/* 4. Общие стили для заголовков секций */
.projects__section {
    padding: 100px 0;
}

.projects__title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 60px;
    position: relative;
}

.projects__title::after {
    content: '';
    display: block;
    width: 50px;
    height: 4px;
    background-color: var(--accent-color);
    margin: 15px auto 0;
    border-radius: 2px;
}


/* 6. Секция "Проекты" */
.projects__items {
    display: grid;
    grid-template-columns: 1fr; 
    gap: 50px; /* Увеличили зазор для больших описаний */
    max-width: 1000px; 
    margin: 0 auto; 
    padding: 0 20px; 
}

.projects__item {
    display: flex;
    gap: 35px; 
    align-items: stretch;
    width: 100%; 
}

/* Контейнер-обертка для эффектов над картинкой */
.projects__item-img-wrapper {
    position: relative;
    width: 350px; 
    min-width: 350px; 
    height: 260px; /* Задали фиксированную высоту для контейнера */
    overflow: hidden; /* Чтобы увеличивающаяся картинка не вылезала за края */
}

/* Базовое состояние картинки */
.projects__item-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    /* Плавный переход для трансформации (зума) и фильтра (затемнения) */
    transition: transform 0.4s ease, filter 0.4s ease; 
}

/* Эффект при наведении на контейнер картинки: зум и затемнение */
.projects__item-img-wrapper:hover .projects__item-img {
    transform: scale(1.1); /* Увеличение изображения на 10% */
    filter: brightness(0.4); /* Затемнение картинки на 60% */
}

/* Кнопка "Перейти на сайт" */
.projects__item-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9); /* Центрирование и легкое уменьшение */
    background-color: #fff; /* Цвет кнопки (можно заменить на var(--accent-color)) */
    color: #000; /* Цвет текста на кнопке */
    padding: 12px 24px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
    opacity: 0; /* Изначально скрыта */
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    white-space: nowrap;
    z-index: 2;
}

/* Появление кнопки при наведении на контейнер картинки */
.projects__item-img-wrapper:hover .projects__item-btn {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1); /* Возвращаем к нормальному размеру */
}

/* Стилизация кнопки при наведении на неё саму */
.projects__item-btn:hover {
    background-color: rgba(255, 255, 255, 0.9); /* Эффект при наведении на саму кнопку */
}

/* Контейнер для текста */
.projects__item-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: center; 
    text-align: left; 
}

.projects__item-title {
    font-size: 1.5rem; 
    padding: 0;
    margin: 0;
}

.projects__item-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    padding: 0;
    margin: 0;
    line-height: 1.6; 
}



/* 7. Адаптивность для мобильных устройств (Респонсив) */
@media (max-width: 992px) {
    .projects__item {
        flex-direction: column; /* Картинка встает над текстом */
        gap: 20px;
    }

    .projects__item-img-wrapper {
        width: 100%; /* Картинка занимает всю ширину экрана */
        min-width: 100%;
        height: 280px; 
    }

    /* Мобильные настройки для картинки: делаем её ПОСТОЯННО слегка затемненной */
    .projects__item-img-wrapper .projects__item-img {
        filter: brightness(0.6); 
        transform: scale(1) !important; /* Отключаем авто-зум на смартфонах */
    }

    /* Мобильные настройки для кнопки: делаем её ПОСТОЯННО видимой */
    .projects__item-img-wrapper .projects__item-btn {
        opacity: 1;
        visibility: visible;
        transform: translate(-50%, -50%) scale(1); /* Кнопка сразу по центру */
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); /* Добавляем тень для лучшей читаемости на мобильных */
    }

    .projects__item-content {
        text-align: left; /* Переключаем выравнивание текста на левый край */
        margin-left: 0;   
    }
}

@media (max-width: 768px) {
    .hero__container {
        flex-direction: column;
        text-align: center;
        gap: 30px;
    }
    
    .hero__title {
        font-size: 2.5rem;
    }
    
    .hero__about {
        margin: 0 auto;
    }
    
    .navbar__items {
        gap: 20px;
    }
}


/* 8. Подвал сайта (Footer) */
.footer {
    background-color: var(--surface-color);
    padding: 40px 0;
    margin-top: 60px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer__container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
}

.footer__copy {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
}

.footer__subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Меню в подвале */
.footer__menu {
    display: flex;
    gap: 30px;
    list-style: none;
}

.footer__link {
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.footer__link:hover {
    color: var(--accent-color);
}

/* Иконки/Ссылки на соцсети */
.footer__socials {
    display: flex;
    gap: 15px;
}

.footer__social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: bold;
    color: var(--text-secondary);
    transition: var(--transition);
}

.footer__social-link:hover {
    color: var(--text-primary);
    background-color: var(--accent-color);
    border-color: var(--accent-hover);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3);
}

/* Адаптивность футера для мобильных устройств */
@media (max-width: 768px) {
    .footer__container {
        flex-direction: column;
        text-align: center;
        gap: 25px;
    }

    .footer__menu {
        flex-direction: column;
        gap: 15px;
    }
}
