html {
    scroll-behavior: smooth;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #0d1117;
    background-image: radial-gradient(ellipse 70% 400px at 50% 0%, rgb(255 255 255 / 12%), #c4c4c405);
    background-repeat: no-repeat;
    color: #d5dbd2;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 18px;
    line-height: 1.8;
    padding-bottom: 120px;
}

.top-lang-switch {
    position: absolute;
    top: 24px;
    right: 32px;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: rgb(51 60 71 / 70%); 
    border: 1px solid #8e3e3e;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 16px rgb(0 0 0 / 69%);
}

.lang-btn {
    color: #8b949e;
    text-decoration: none;
    transition: color 0.15s ease;
}

.lang-btn:hover {
    color: #f0f6fc;
}

.lang-btn.active {
    color: #f0f6fc;
    cursor: default;
}

.lang-divider {
    color: #30363d;
    user-select: none;
}




header {
    text-align: center;
    padding: 60px 20px 50px;
    max-width: 800px;
    margin: 0 auto;
}

header h1 {
    font-size: 3.2rem;
    letter-spacing: 0.05em;
    color: #ffffff;
    margin-bottom: 24px;
    text-transform: uppercase;
}


.epigraph {
    max-width: 600px;
    margin: 0 auto;
    font-style: italic;
    color: #bfb0b0;
}

.epigraph-text {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.epigraph-author {
    display: block;
    font-size: 1rem;
    font-style: normal;
    color: #bfb0b0;
}



.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 30px;
}

.chapter-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    margin: 60px 0 40px;
    border: 1px solid rgba(212, 176, 150, 0.15);
    box-shadow: 0 20px 40px -10px rgb(0 0 0 / 81%), 0 0 0 1px rgb(255 255 255 / 0%);
}

.chapter h2 {
    font-size: 2.2rem;
    color: #8b6a52;
    margin-bottom: 28px;
    letter-spacing: -0.01em;
}

.chapter p {
    font-size: 20px;
    line-height: 1.8;
    color: #d5dbd2;
    margin-bottom: 24px;
}

.chapter p.highlight {
    color: #d4b096;
    font-size: 22px;
    font-weight: 500;
    margin: 36px 0;
    letter-spacing: -0.01em;
}

.chapter blockquote.manifesto {
    margin: 50px 0 90px;
    padding: 28px 32px;
    background-color: rgb(50 35 35 / 43%);
    border-left: 4px solid #ffae7399;
    border-radius: 8px;
    
    box-shadow: 0 8px 24px rgb(0 0 0 / 64%);
}

.chapter blockquote.manifesto p {
    color: #fcf8f0;
    font-size: 22px;
    line-height: 1.6;
    font-style: italic;
    margin-bottom: 0;
}


#progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0%;
    background-color: #ffae73;
    box-shadow: 0 0 10px rgba(255, 174, 115, 0.5);
    z-index: 10000;
    transition: width 0.05s ease-out;
}



.rhythm-block {
    margin: 36px 0;
    padding-left: 20px;
    border-left: 2px solid #8b6a52;
}

.rhythm-block p {
    font-size: 21px;
    color: #f0f6fc;
    margin-bottom: 10px;
}

.rhythm-block p:last-child {
    margin-bottom: 0;
}




.site-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 80px;
    padding: 20px 28px;
    background-color: rgba(22, 27, 34, 0.6);
    border: 1px solid rgba(212, 176, 150, 0.2);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.footer-tg {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #f0f6fc;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: color 0.2s ease, transform 0.2s ease;
}

.footer-tg svg {
    color: #24A1DE;
    transition: transform 0.2s ease;
}

.footer-tg:hover {
    color: #ffae73;
}

.footer-tg:hover svg {
    transform: scale(1.1);
}

.back-to-top {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #8b949e;
    text-decoration: none;
    font-size: 15px;
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.back-to-top:hover {
    color: #f0f6fc;
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.back-to-top .arrow {
    transition: transform 0.2s ease;
}

.back-to-top:hover .arrow {
    transform: translateY(-2px);
}







.menu-toggle-btn {
    position: fixed;
    top: 24px;
    left: 32px;
    z-index: 998;
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: rgba(22, 27, 34, 0.75);
    border: 1px solid rgba(212, 176, 150, 0.25);
    padding: 6px 14px;
    border-radius: 6px;
    color: #f0f6fc;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
    transition: all 0.2s ease;
}

.menu-toggle-btn:hover {
    border-color: #d4b096;
    color: #ffae73;
}

.sidebar-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}


.sidebar-card {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 320px;
    max-height: calc(100vh - 40px);
    z-index: 1001;
    
    background-color: rgba(13, 17, 23, 0.94);
    border: 1px solid rgba(212, 176, 150, 0.25);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(12px);

    /* Спрятан слева за экран */
    transform: translateX(-120%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-card.active {
    transform: translateX(0);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #8b6a52;
}

.sidebar-close-btn {
    background: none;
    border: none;
    color: #8b949e;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.15s ease;
}

.sidebar-close-btn:hover {
    color: #f0f6fc;
}


.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 6px;
    color: #c9d1d9;
    text-decoration: none;
    font-size: 16px;
    transition: all 0.2s ease;
}

.sidebar-link .ch-num {
    font-size: 13px;
    color: #8b6a52;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.sidebar-link:hover {
    background-color: rgba(255, 255, 255, 0.04);
    color: #f0f6fc;
    transform: translateX(4px);
}

.sidebar-link:hover .ch-num {
    color: #ffae73;
}
