/* ==========================================
   Главная страница - Стили
   ========================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #F7F4E5;
    background-image:
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 1px,
            rgba(74, 66, 55, 0.18) 1px,
            rgba(74, 66, 55, 0.18) 2px
        ),
        repeating-linear-gradient(
            -45deg,
            transparent,
            transparent 1px,
            rgba(74, 66, 55, 0.15) 1px,
            rgba(74, 66, 55, 0.15) 2px
        ),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 1px,
            rgba(74, 66, 55, 0.08) 1px,
            rgba(74, 66, 55, 0.08) 2px
        );
    /* background-size: 3px 3px; */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    /* padding: 30px 20px; */
    /* gap: 47px; */
}

/* ==========================================
   Header (Статичный на всех страницах)
   ========================================== */
header {
    max-width: 630px;
    width: 100%;
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

/* Header как изображение */
.header-image {
    max-width: 800px;
    width: 100%;
    display: block;
}

.header-image img {
    width: 100%;
    height: auto;
    display: block;
}

.header-img {
    animation: headerInvert 9s steps(1, jump-end) infinite;
}

@keyframes headerInvert {
    0% {
        filter: invert(0);
    }
    66.67% {
        filter: invert(1);
    }
    100% {
        filter: invert(0);
    }
}

/* Колонка с фото */
.photo-column {
    flex: 0 0 175px;
}

.photo-column img {
    width: 100%;
    height: auto;
    display: block;
}

/* ==========================================
   Content Wrapper - фон той же ширины что header/footer
   ========================================== */
.content-wrapper {
    max-width: 800px;
    width: 100%;
    background: #F7F4E5;
    display: flex;
    justify-content: center;
    /* padding: 30px 0; */
}

/* ==========================================
   Секция контента
   ========================================== */
.content-section {
    width: fit-content;
    font-family: Courier, monospace;
    color: #000000;
    font-size: 14px;
    font-weight: 400;
    /* padding-left: 20px; */
    /* line-height: 1.5; */
}

/* .content-section a {
    color: #000000;
    text-decoration: none;
} */

.content-section a:hover {
    text-decoration: underline;
}

/* Средняя колонка с информацией */
.info-column {
    flex: 1;
    color: #000000;
}

.info-column p {
    font-family: 'Times New Roman', Times, serif;
    font-size: 28px;
    line-height: 1;
    margin: 0;
    letter-spacing: -0.8px;
}

.info-column p.spacer {
    height: 19px;
}

/* Правая колонка с рукописным текстом */
.handwritten-column {
    flex: 1;
    color: #000000;
    font-size: 18px;
}

.handwritten-column p {
    margin-bottom: 15px;
}

.description-text {
    font-size: 14px;
    /* line-height: 1.4; */
    margin-top: 17px;
    /* margin-left: 105px; */
    /* text-align: justify; */
}

.description-text {
    font-size: 14px;
}

.description {
    /* max-width: 630px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start; */
    margin-left: 58px;
    letter-spacing: -0.2px;
    font-size: 14px;
}

.links {
    margin-top: 42px;
    margin-left: 190px;
    font-size: 14px;
}

.links p {
    margin-bottom: 16px;
    font-weight: bold;
}

.links a {
    font-weight: normal;
    text-decoration: none;
    color:#000000
}

.links a:hover {
    /* color: #33FF33; */
    background: #000000;
    color: #00FF00;
}

.dot {
    background: transparent;
    color: #000000;
    display: block;
    margin-bottom: 4px;
    width: fit-content;
    animation: snakeDot 4s infinite;
}

.dot-1 {
    animation-delay: 0s;
}

.dot-2 {
    animation-delay: 0.5s;
}

.dot-3 {
    animation-delay: 1s;
}

.dot-4 {
    animation-delay: 1.5s;
}

.dot-5 {
    animation-delay: 2s;
}

.dot-6 {
    animation-delay: 2.5s;
}

@keyframes snakeDot {
    0% {
        background: transparent;
        color: #000000;
    }
    10% {
        background: #000000;
        color: #00FF00;
    }
    20% {
        background: #000000;
        color: #00FF00;
    }
    30% {
        background: transparent;
        color: #000000;
    }
    100% {
        background: transparent;
        color: #000000;
    }
}

/* Typewriter мигающая точка */
.typewriter-dot {
    display: inline;
    background: transparent;
    color: #000000;
    transition: background-color 0.1s, color 0.1s;
}

.typewriter-dot.blink {
    background: #000000;
    color: #00FF00;
}

/* Typewriter highlight эффект */
.highlight-char {
    display: inline;
    background: transparent;
    color: #000000;
    transition: background-color 0.15s, color 0.15s;
}

.highlight-char.highlight-active {
    background: #000000;
    color: #00FF00;
}

.lastword {
    margin-top: 130px;
    position: relative;
}

.lastword p {
    font-size: 13px;
}

.logo {
    width: 270px;
    height: auto;
    position: relative;
    float: right;
    margin-top: 30px;
    margin-right: -20px;
    margin-left: 20px;
    margin-bottom: 30px;
    filter: url(#inkEffect);
    transition: filter 0.3s ease;
}
/* ==========================================
   Адаптивность
   ========================================== */

/* Планшеты */
@media (max-width: 768px) {
    /* body {
        padding: 40px 20px;
        gap: 35px;
    } */

    header {
        gap: 15px;
    }

    .photo-column {
        flex: 0 0 150px;
    }

    .info-column p {
        font-size: 24px;
    }

    .content-section {
        max-width: 100%;
        font-size: 12px;
    }

    .logo {
        width: 200px;
        margin-top: 30px;
        margin-right: 35px;
        margin-bottom: 20px;
    }

    .lastword {
        margin-top: 80px;
    }
}

/* Узкие экраны - header переходит в вертикальный режим */
@media (max-width: 600px) {
    header {
        flex-direction: column;
        gap: 25px;
        align-items: center;
    }

    .photo-column {
        flex: 0 0 auto;
        max-width: 420px;
    }

    .info-column {
        text-align: left;
        align-self: flex-start;
    }

    .info-column p {
    font-size: 32px;
    letter-spacing: -0.5px;
   }
    .handwritten-column {
        text-align: center;
    }
}

/* Мобильные устройства */
@media (max-width: 480px) {
    /* body {
        padding: 30px 15px;
        gap: 30px;
    } */

    header {
        gap: 20px;
    }

    .photo-column {
        max-width: 400px;
    }

    .info-column p {
        font-size: 32px;
        letter-spacing: -0.5px;
    }

    .content-section {
        font-size: 12px;
    }

    .description {
        margin-left: 16px;
    }

    .handwritten-column {
        font-size: 14px;
    }

    .logo {
        width: 160px;
        margin-top: 20px;
        margin-right: 10px;
        margin-bottom: 15px;
    }

    .lastword {
        margin-top: 60px;
    }

    .links {
        margin-top: 30px;
        margin-left: 70px;
    }
}

/* ==========================================
   Секция с главами
   ========================================== */

.chapters-section {
    max-width: 630px;
    width: 100%;
    display: flex;
    gap: 30px;
    justify-content: center;
    align-items: flex-start;
}

.chapter-link {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: opacity 0.3s ease;
}

.chapter-link:hover {
    opacity: 0.7;
}

.chapter-link h3 {
    font-size: 18px;
    font-weight: normal;
    margin: 0;
    text-align: center;
}

.chapter-link img {
    width: 100%;
    height: auto;
    display: block;
}

/* Адаптивность секции глав для планшетов */
@media (max-width: 768px) {
    .chapters-section {
        gap: 20px;
    }

    .chapter-link h3 {
        font-size: 16px;
    }
}

/* Адаптивность секции глав для мобильных */
@media (max-width: 480px) {
    .chapters-section {
        flex-direction: column;
        gap: 30px;
    }

    .chapter-link {
        max-width: 300px;
        margin: 0 auto;
    }
}

/* ==========================================
   Footer (На будущее)
   ========================================== */
footer {
    max-width: 630px;
    width: 100%;
    text-align: center;
    /* padding-top: 40px; */
}

/* ==========================================
   Mockup Overlay (для верстки)
   ========================================== */
.mockup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    pointer-events: none;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mockup-overlay.active {
    opacity: 0.5;
}

.mockup-overlay img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: top center;
}

/* ==========================================
   Footer
   ========================================== */
.footer-image {
    max-width: 800px;
    width: 100%;
    display: block;
    margin-top: auto;
}

.footer-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* ==========================================
   Mobile vs Desktop Header/Footer Images
   ========================================== */
/* Show desktop images by default, hide mobile */
.header-image .header-mobile,
.footer-image .footer-mobile {
    display: none !important;
}

.header-image .header-desktop,
.footer-image .footer-desktop {
    display: block !important;
}

/* On mobile devices (max-width: 768px), show mobile images and hide desktop */
@media (max-width: 768px) {
    .header-image .header-mobile,
    .footer-image .footer-mobile {
        display: block !important;
    }

    .header-image .header-desktop,
    .footer-image .footer-desktop {
        display: none !important;
    }
}
