/* базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: rgb(252, 248, 242);
    color: rgb(30, 30, 30);
    line-height: 1.6;
}

/* лёгкое затемнение */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(245, 235, 225, 0.85);
    z-index: -1;
}

/* шапка моё фото на всю ширину */
header {
    background-image: url("images/me.jpg");
    background-size: cover;
    background-position: center 30%;
    color: white;
    padding: 120px 20px 180px 20px;
    text-align: center;
    position: relative;
    border-bottom: 3px solid rgba(0, 0, 0, 0.35);
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* затемнение поверх фото, чтобы белый текст читался норм */
header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 0;
}

/* текст в шапке — поверх затемнения */
header h1,
header p,
header nav {
    position: relative;
    z-index: 1;
}

/* моё имя  */
header h1 {
    font-size: 72px;
    margin-top: 60px;
    margin-bottom: 15px;
}

/* подпись под именем */
header p {
    font-size: 24px;
    margin-bottom: 20px;
}

/* навигация - чуть ниже, чтобы не сливалось */
nav {
    margin-top: 40px;
}

/* ссылки в навигации - белые, без подчёркивания, с плавным эффектом */
nav a {
    color: white;
    text-decoration: none;
    margin: 0 15px;
    font-size: 20px;
    transition: 0.3s;
}

/* при наведении на ссылку -появляется подчёркивание и лёгкая прозрачность */
nav a:hover {
    text-decoration: underline;
    opacity: 0.7;
}

/* приветственный блок - нежный, чтобы встретить гостя */
.hero {
    background-color: rgb(250, 242, 235);
    text-align: center;
    padding: 60px 20px;
    margin-bottom: 40px;
}

/* заголовок в приветствии - тёплого оттенка, как кофе с молоком */
.hero h2 {
    font-size: 36px;
    color: rgb(160, 100, 60);
    margin-bottom: 15px;
}

/* текст приветствия -не слишком широкий, чтобы удобно читалось */
.hero p {
    font-size: 18px;
    max-width: 600px;
    margin: 0 auto;
}

/* галерея -основное место для моих работ */
.gallery {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    margin-bottom: 40px;
}

/* заголовки галереи-такие же тёплые, как в приветствии */
.gallery h2 {
    text-align: center;
    color: rgb(160, 100, 60);
    margin-bottom: 30px;
    font-size: 32px;
}

/* сетка для картинок-сама подстраивается под ширину экрана */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

/* сами картинки - одинаковой высоты, с закруглёнными углами */
.gallery-grid img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
}

/* при наведении картинка увеличивается и показывается целиком, как лупа */
.gallery-grid img:hover {
    transform: scale(1.2);
    object-fit: contain;
    background-color: rgb(193, 153, 109);
    z-index: 10;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* блок контактов - тёплый, чтобы хотелось написать */
.contacts {
    background-color: rgb(193, 153, 109);
    color: white;
    text-align: center;
    padding: 40px 20px;
}

.contacts h2 {
    font-size: 32px;
    margin-bottom: 20px;
}

.contacts p {
    font-size: 18px;
    margin: 10px 0;
}

/* подвал - тёмный, спокойный, не отвлекает */
footer {
    background-color: rgb(30, 30, 30);
    color: white;
    text-align: center;
    padding: 20px;
    font-size: 14px;
}

/* блок с книгами -отдельная гордость, поэтому фон чуть отличается */
.books {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    margin-bottom: 40px;
    background-color: rgb(250, 242, 235);
    border-radius: 20px;
}

.books h2 {
    text-align: center;
    color: rgb(160, 100, 60);
    margin-bottom: 30px;
    font-size: 32px;
}

/* сетка для карточек книг- тоже адаптивная */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
}

/* карточка книги - белая, с тенью, приятная на вид */
.book-card {
    background-color: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgb(190, 130, 90);
    cursor: pointer;
    transition: 0.3s;
    text-align: center;
    padding-bottom: 15px;
}

/* при наведении на книгу - приподнимается, будто её можно взять */
.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(156, 98, 59, 0.2);
}

/* обложка книги- ровно вписывается в карточку */
.book-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

/* название книги -мягкого тёплого оттенка */
.book-card h3 {
    margin: 15px 0 5px;
    color: rgb(116, 81, 67);
    font-size: 18px;
}

/* модальное окно для картинок - затемняет всё, фокус на картинке */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* белое окошко для картинки почти невидимое, главное - сама картинка */
.modal-content {
    position: relative;
    background-color: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 15px;
    max-width: 90%;
    max-height: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* картинка внутри модального окна- большая, но влезает */
.modal-content img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 10px;
    display: block;
    margin: 0 auto;
}

/* крестик закрытия- заметный, но не кричащий */
.close {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    color: #ccc;
}

/* при наведении на крестик--становится тёплым */
.close:hover {
    color: rgb(192, 130, 89);
}

/* модальное окно для книг-похоже на галерейное, но своё */
.book-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 1001;
}

/* контент внутри книжного окошка - белый, читабельный */
.book-modal-content {
    background-color: white;
    border-radius: 20px;
    max-width: 900px;
    width: 90%;
    max-height: 90%;
    overflow-y: auto;
    padding: 20px;
    position: relative;
}

/* крестик для книжного окошка */
.book-close {
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
    z-index: 10;
}

.book-close:hover {
    color: rgb(200, 120, 150);
}

/* внутри книжного окошка -бложка слева, текст справа */
.book-modal-body {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

/* обложка в окошке -аккуратного размера */
.book-modal-body>img:first-child {
    width: 200px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* текстовая часть в окошке */
.book-info {
    flex: 1;
}

/* заголовок книги в окошке- тёплый, как и везде */
.book-info h2 {
    color: rgb(215, 154, 113);
    margin-bottom: 15px;
}

/* описание книги */
.book-info p {
    margin-bottom: 20px;
    line-height: 1.6;
}

/* миниатюры иллюстраций-рядком, чтобы было видно, что внутри */
.book-illustrations {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

/* каждая миниатюра-квадратная, с закруглениями */
.book-illustrations img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
}

/* при наведении на миниатюру -чуть увеличивается */
.book-illustrations img:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

/* СТРАНИЦА -ПРОЦЕСС СОЗДАНИЯ РАБОТЫ-  */

.process-intro {
    text-align: center;
    padding: 60px 20px 20px;
    max-width: 800px;
    margin: 0 auto;
}

.process-intro h2 {
    font-size: 36px;
    color: rgb(160, 100, 60);
    margin-bottom: 20px;
}

.process-intro p {
    font-size: 18px;
    color: rgb(60, 50, 45);
}

.process-steps {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.step {
    display: flex;
    gap: 30px;
    background-color: rgb(250, 242, 235);
    margin-bottom: 40px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.step-number {
    background-color: rgb(193, 153, 109);
    color: white;
    font-size: 48px;
    font-weight: bold;
    padding: 30px 25px;
    text-align: center;
    min-width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-content {
    padding: 25px 25px 25px 0;
    flex: 1;
}

.step-content h3 {
    font-size: 24px;
    color: rgb(160, 100, 60);
    margin-bottom: 15px;
}

.step-content p {
    font-size: 16px;
    line-height: 1.5;
    color: rgb(50, 45, 40);
    margin-bottom: 20px;
}

.step-content img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.1);
}

.back-link {
    text-align: center;
    margin: 40px 0 60px;
}

.back-link a {
    background-color: rgb(193, 153, 109);
    color: white;
    text-decoration: none;
    padding: 12px 30px;
    border-radius: 30px;
    transition: 0.3s;
    display: inline-block;
}

.back-link a:hover {
    background-color: rgb(160, 100, 60);
    transform: scale(1.02);
}

/* -АДАПТИВНОСТЬ-- */
@media (max-width: 768px) {
    header h1 {
        font-size: 32px;
    }

    .hero h2 {
        font-size: 28px;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    nav a {
        display: inline-block;
        margin: 5px 10px;
    }

    .book-modal-body {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .book-modal-body>img:first-child {
        width: 150px;
    }

    .book-illustrations {
        justify-content: center;
    }

    /* адаптив для страницы процесса */
    .step {
        flex-direction: column;
    }

    .step-number {
        padding: 15px;
        min-width: auto;
    }

    .step-content {
        padding: 20px;
    }

    .process-intro h2 {
        font-size: 28px;
    }
}