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

html {
    scroll-behavior: smooth;
}

body {
    background: #f6f2ea;
    color: #2d2d2d;
    font-family: Arial, sans-serif;
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1180px;
    margin: 0 auto;
}

.site-frame {
    display: none;
}

.site-frame-side,
.site-frame-tile,
.site-frame-shot {
    display: none;
}

/* HEADER */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    isolation: isolate;
    background: rgba(246, 242, 234, 0.95);
    border-bottom: 1px solid #e6dfd3;
    backdrop-filter: blur(10px);
}

.header-inner {
    position: relative;
    z-index: 2;
    min-height: 86px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: Georgia, serif;
    font-size: 34px;
    letter-spacing: 6px;
    font-weight: bold;
    color: #2d2d2d;
    text-decoration: none;
}

.logo-mark {
    width: 42px;
    height: 42px;
    object-fit: contain;
    flex: 0 0 auto;
}

.logo span {
    display: inline-block;
}

.nav {
    display: flex;
    align-items: center;
    gap: 34px;
}

.nav a {
    color: #555;
    text-decoration: none;
    font-size: 16px;
}

.nav a:hover {
    color: #8b5d33;
}

/* HERO */

.hero {
    position: relative;
    min-height: 86vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    background:
        radial-gradient(circle at center, rgba(139, 93, 51, 0.08), transparent 45%);
}

.hero-inner {
    text-align: center;
    position: relative;
    z-index: 2;
}

.hero-logo-mark {
    display: block;
    width: 58px;
    height: 58px;
    object-fit: contain;
    margin: 0 auto 14px;
    opacity: 0.78;
}

.hero h1 {
    font-family: Georgia, serif;
    font-size: clamp(58px, 10vw, 110px);
    letter-spacing: 14px;
}

.author {
    margin-top: 8px;
    font-size: 22px;
    color: #8b5d33;
    font-style: italic;
}

.hero-text {
    margin: 36px auto 0;
    max-width: 680px;
    font-size: 27px;
    color: #555;
}

.floating-quote {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(270px, 21vw, 380px);
    min-height: 140px;
    max-width: none;
    padding: 42px 54px 36px;
    background-color: transparent;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    border: 0;
    color: #644832;
    font-family: "Segoe Print", "Comic Sans MS", Georgia, serif;
    font-size: clamp(16px, 1.06vw, 20px);
    line-height: 1.55;
    text-align: center;
    border-radius: 0;
    box-shadow: none;
    clip-path: none;
    filter: drop-shadow(0 18px 18px rgba(82, 51, 24, 0.16));
    z-index: 2;
    pointer-events: none;
}

.quote-1 {
    top: 7%;
    left: max(28px, calc(50% - 490px));
    width: 370px;
    min-height: 150px;
    background-image: url("../images/frames/paper-note-1.png");
    transform: rotate(-3deg);
}

.quote-2 {
    top: 9%;
    right: max(28px, calc(50% - 490px));
    width: 360px;
    min-height: 146px;
    background-image: url("../images/frames/paper-note-2.png");
    transform: rotate(4deg);
}

.quote-3 {
    left: max(28px, calc(50% - 500px));
    bottom: 12%;
    width: 350px;
    min-height: 136px;
    background-image: url("../images/frames/paper-note-3.png");
    transform: rotate(3deg);
}

.quote-4 {
    right: max(28px, calc(50% - 535px));
    bottom: 8%;
    width: 400px;
    min-height: 150px;
    background-image: url("../images/frames/paper-note-4.png");
    transform: rotate(-4deg);
}

/* BUTTONS */

.btn {
    display: inline-block;
    margin-top: 42px;
    padding: 15px 36px;
    background: #8b5d33;
    color: white;
    border-radius: 999px;
    text-decoration: none;
    transition: 0.25s;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.small-btn {
    margin-top: 30px;
}

/* SECTIONS */

.whats-new,
.start-reading,
.main-project,
.books-preview,
.blog-quote {
    padding: 90px 0;
}

.whats-new {
    border-top: 1px solid rgba(139, 93, 51, 0.12);
    border-bottom: 1px solid rgba(139, 93, 51, 0.10);
    background:
        radial-gradient(circle at top left, rgba(255, 225, 190, 0.24), transparent 34%),
        rgba(255, 247, 236, 0.72);
}

.main-project {
    border-bottom: 1px solid rgba(139, 93, 51, 0.10);
    background: rgba(244, 235, 222, 0.62);
}

.books-preview {
    border-bottom: 1px solid rgba(139, 93, 51, 0.10);
    background: rgba(255, 250, 243, 0.48);
}

.blog-quote {
    background:
        radial-gradient(circle at bottom right, rgba(139, 93, 51, 0.10), transparent 34%),
        rgba(241, 230, 214, 0.48);
}

.whats-new-grid {
    scroll-margin-top: 110px;
    display: grid;
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr) minmax(240px, 320px);
    gap: 48px;
    align-items: center;
}

.whats-new-visual {
    width: 260px;
    aspect-ratio: 0.7;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 18px;
    background: linear-gradient(135deg, #2e231c, #8b5d33);
    color: #fffaf3;
    box-shadow: 0 25px 60px rgba(75, 49, 24, 0.16);
    font-family: Georgia, serif;
    font-size: 28px;
    letter-spacing: 4px;
    line-height: 1.2;
    padding: 18px;
    text-align: center;
    justify-self: center;
}

.whats-new-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.whats-new-visual-blog {
    width: min(340px, 100%);
    aspect-ratio: 1.1;
    padding: 0;
    background: #f3e6d0;
    transform: translateX(14px);
}

.whats-new-main h2 {
    max-width: 760px;
    margin: 14px 0 16px;
    font-family: Georgia, serif;
    font-size: clamp(42px, 6vw, 62px);
    line-height: 1.05;
}

.whats-new-main > p:last-of-type {
    max-width: 760px;
    color: #4d4d4d;
    font-size: 18px;
}

.whats-new-badge {
    display: inline-flex;
    width: fit-content;
    padding: 7px 12px;
    border-radius: 999px;
    background: #f3ead7;
    color: #8b5d33;
    font-size: 13px;
    font-weight: 700;
}

.whats-new-list {
    display: grid;
    gap: 12px;
}

.whats-new-mini {
    display: grid;
    gap: 6px;
    padding: 18px;
    border: 1px solid #e7ded1;
    border-radius: 16px;
    background: rgba(255, 250, 243, 0.74);
    color: #2d2d2d;
    text-decoration: none;
}

.whats-new-mini span {
    color: #8b5d33;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.whats-new-mini strong {
    font-family: Georgia, serif;
    font-size: 22px;
    line-height: 1.12;
}

.whats-new-mini small {
    color: #777;
    line-height: 1.35;
}

.start-inner {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 80px;
    align-items: center;
}

.project-card {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 70px;
    align-items: center;
    background: rgba(255, 252, 248, 0.75);
    border: 1px solid #e7ded1;
    border-radius: 28px;
    padding: 55px;
}

/* BOOK COVERS */

.book-cover-stack {
    display: grid;
    justify-self: center;
    justify-items: center;
    gap: 14px;
    width: fit-content;
}

.book-cover {
    position: relative;
    width: 260px;
    height: 370px;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0,0,0,0.16);
    transition: 0.25s;
}

.book-cover:hover {
    transform: translateY(-8px) rotate(-1deg);
}

.book-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-status {
    width: fit-content;
    background: rgba(255, 250, 243, 0.94);
    color: #8b5d33;
    padding: 8px 14px;
    border-radius: 999px;
    box-shadow: 0 12px 28px rgba(75, 49, 24, 0.10);
    font-size: 13px;
    font-weight: bold;
}

.fantasy-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1f1a17, #8b5d33);
    color: white;
    font-family: Georgia, serif;
    font-size: 40px;
    letter-spacing: 4px;
}

/* TEXT */

.section-label {
    color: #8b5d33;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 13px;
    margin-bottom: 14px;
}

.book-info h2,
.project-card h2,
.section-head h2,
.blog-card h2 {
    font-family: Georgia, serif;
    font-size: 48px;
    line-height: 1.1;
    margin-bottom: 16px;
}

.genre {
    color: #777;
    margin-bottom: 24px;
}

.book-info p,
.project-card p,
.blog-card p {
    font-size: 18px;
    color: #4d4d4d;
}

/* PROGRESS */

.progress {
    margin-top: 32px;
}

.progress-line {
    height: 12px;
    background: #e3d8ca;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-line span {
    display: block;
    height: 100%;
    background: #8b5d33;
}

/* BOOKS GRID */

.section-head {
    text-align: center;
    margin-bottom: 45px;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 20px;
}

.book-card {
    height: 500px;
    padding: 0;
    background: #fffaf3;
    border: 1px solid #e7ded1;
    border-radius: 22px;
    text-decoration: none;
    color: #2d2d2d;
    display: grid;
    grid-template-rows: 190px minmax(0, 1fr) auto;
    overflow: hidden;
    transition: 0.25s;
}

.book-card-cover {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(135deg, #2e231c, #8b5d33);
    color: #fffaf3;
    font-family: Georgia, serif;
    font-size: 24px;
    letter-spacing: 3px;
    line-height: 1.2;
    padding: 14px;
    text-align: center;
}

.book-card-cover.has-cover {
    background:
        radial-gradient(circle at center, rgba(139, 93, 51, 0.12), transparent 58%),
        #f1e8dc;
}

.book-card-cover.no-cover {
    background: linear-gradient(135deg, #2e231c, #8b5d33);
}

.book-card-cover img {
    width: auto;
    max-width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.16);
}

.book-card-main {
    min-height: 0;
    display: grid;
    grid-template-rows: auto auto 1fr;
    gap: 10px;
    padding: 20px 24px 0;
}

.book-card:hover {
    transform: translateY(-7px);
    box-shadow: 0 18px 40px rgba(0,0,0,0.08);
}

.book-card h3 {
    font-family: Georgia, serif;
    font-size: 22px;
    line-height: 1.15;
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.book-card p {
    color: #777;
    margin-top: 0;
}

.book-card small {
    display: -webkit-box;
    overflow: hidden;
    margin-top: 0;
    color: #666;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
}

.book-card-foot {
    display: grid;
    gap: 12px;
    align-items: end;
    padding: 14px 24px 24px;
}

.book-card-meta {
    color: #8a7766;
    font-size: 13px;
}

.badge {
    width: fit-content;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 13px;
}

.badge.done {
    background: #e3f1df;
    color: #3d7238;
}

.badge.work {
    background: #f3ead7;
    color: #8b5d33;
}

/* BLOG + QUOTE */

.blog-quote-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 26px;
}

.blog-card,
.quote-card {
    background: #fffaf3;
    border: 1px solid #e7ded1;
    border-radius: 26px;
    padding: 42px;
}

.blog-card a {
    display: inline-block;
    margin-top: 28px;
    color: #8b5d33;
    text-decoration: none;
    font-weight: bold;
}

.quote-card {
    font-family: Georgia, serif;
    font-size: 30px;
    line-height: 1.35;
    color: #4c3b2c;
}

.blog-page .section-head {
    margin-bottom: 28px;
}

.blog-admin-actions {
    display: flex;
    justify-content: center;
    margin-bottom: 28px;
}

.blog-list {
    display: grid;
    gap: 18px;
    max-width: 860px;
    margin: 0 auto;
}

.blog-post-card,
.blog-empty,
.blog-post-article {
    border: 1px solid #e7ded1;
    border-radius: 22px;
    background: rgba(255, 250, 243, 0.78);
    box-shadow: 0 18px 48px rgba(75, 49, 24, 0.06);
}

.blog-post-card {
    padding: 30px;
}

.blog-post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
    color: #8b5d33;
    font-size: 13px;
    font-weight: 700;
}

.blog-post-meta span {
    border-radius: 999px;
    background: rgba(139, 93, 51, 0.08);
    padding: 5px 9px;
}

.blog-post-card h2,
.blog-empty h2 {
    font-family: Georgia, serif;
    font-size: 34px;
    line-height: 1.15;
}

.blog-post-card p,
.blog-empty p {
    margin-top: 14px;
    color: #555;
    font-size: 17px;
}

.blog-post-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 22px;
}

.blog-post-actions a,
.blog-empty a,
.blog-back {
    color: #8b5d33;
    font-weight: 700;
    text-decoration: none;
}

.blog-empty {
    max-width: 720px;
    margin: 0 auto;
    padding: 38px;
    text-align: center;
}

.blog-post-article {
    max-width: 860px;
    padding: 44px;
}

.blog-back {
    display: inline-block;
    margin-bottom: 28px;
}

.blog-post-head {
    margin-bottom: 34px;
}

.blog-post-head h1 {
    max-width: 760px;
    font-family: Georgia, serif;
    font-size: clamp(42px, 7vw, 72px);
    line-height: 1.05;
}

.blog-post-head p {
    max-width: 720px;
    margin-top: 18px;
    color: #5f554c;
    font-size: 19px;
}

.blog-post-body {
    max-width: 760px;
    color: #302a25;
    font-family: Georgia, serif;
    font-size: 22px;
    line-height: 1.75;
}

.blog-post-body p + p {
    margin-top: 24px;
}

/* FOOTER */

.site-footer {
    margin-top: 80px;
    padding: 60px 0;
    border-top: 1px solid #e6dfd3;
    text-align: center;
}

.site-footer h2 {
    font-family: Georgia, serif;
    font-size: 36px;
    letter-spacing: 6px;
}

.site-footer p {
    margin-top: 12px;
    color: #888;
}

@media (min-width: 1500px) {
    .site-frame {
        display: block;
        position: fixed;
        top: 86px;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 2;
        overflow: hidden;
        pointer-events: none;
    }

    .site-frame-side {
        display: block;
        position: absolute;
        top: 0;
        bottom: 0;
        width: calc((100vw - 1180px) / 2);
        min-width: 0;
        overflow: hidden;
        background: #efd6a7;
    }

    .site-frame-left {
        left: 0;
        border-right: 3px solid rgba(166, 104, 43, 0.54);
    }

    .site-frame-right {
        right: 0;
        border-left: 3px solid rgba(166, 104, 43, 0.54);
    }

    .site-frame-tile {
        position: relative;
        display: block;
        height: 100%;
        min-height: 0;
        overflow: hidden;
    }

    .site-frame-shot {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
        opacity: 0.96;
        filter: saturate(0.98) sepia(0.03);
    }

    .site-frame-tile-girl .site-frame-shot {
        object-position: 50% 52%;
    }

    .site-frame-tile-relationship .site-frame-shot {
        object-position: 66% 50%;
    }
}

@media (max-height: 760px) and (min-width: 1500px) {
    .site-frame-tile-girl .site-frame-shot {
        object-position: 50% 42%;
    }
}

@media (min-width: 951px) and (max-width: 1499px) {
    .floating-quote {
        width: 280px;
        min-height: 112px;
        padding: 30px 36px 26px;
        font-size: 15px;
        line-height: 1.42;
    }

    .quote-1 {
        top: 6%;
        left: 6%;
    }

    .quote-2 {
        top: 8%;
        right: 6%;
    }

    .quote-3,
    .quote-4 {
        display: none;
    }
}

/* MOBILE */

@media (max-width: 950px) {
    .hero {
        min-height: auto;
        align-items: flex-start;
        padding: 42px 0 58px;
    }

    .hero-inner {
        padding-top: 132px;
    }

    .hero-logo-mark {
        width: 50px;
        height: 50px;
        margin-bottom: 10px;
    }

    .hero h1 {
        font-size: clamp(54px, 16vw, 88px);
        letter-spacing: 9px;
    }

    .hero-text {
        margin-top: 24px;
        max-width: 360px;
        font-size: 23px;
    }

    .hero .btn {
        margin-top: 30px;
    }

    .header-inner {
        flex-direction: column;
        padding: 22px 0;
        gap: 18px;
    }

    .logo {
        gap: 10px;
    }

    .logo-mark {
        width: 38px;
        height: 38px;
    }

    .nav {
        display: grid;
        grid-template-columns: repeat(5, max-content);
        width: 100%;
        justify-content: center;
        align-items: center;
        gap: 16px 18px;
    }

    .nav .theme-toggle {
        grid-column: 1 / -1;
        justify-self: center;
        margin: 2px 0 0;
    }

    .floating-quote {
        width: 176px;
        min-height: 82px;
        max-width: none;
        padding: 18px 22px 16px;
        color: #6b5746;
        font-family: Georgia, serif;
        font-size: 13px;
        line-height: 1.35;
        background-color: transparent;
        border: 0;
        box-shadow: none;
        filter: drop-shadow(0 12px 14px rgba(105, 76, 47, 0.14));
    }

    .quote-1 {
        top: 26px;
        left: 4%;
        transform: rotate(-7deg);
    }

    .quote-2 {
        top: 34px;
        right: 4%;
        transform: rotate(6deg);
    }

    .quote-3,
    .quote-4 {
        display: none;
    }

    .whats-new-grid,
    .start-inner,
    .project-card,
    .blog-quote-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .whats-new-visual {
        order: 2;
        width: min(240px, 72vw);
        margin: 0 auto;
    }

    .whats-new-visual-blog {
        width: min(320px, 86vw);
        transform: none;
    }

    .whats-new-main {
        order: 1;
    }

    .whats-new-main > p:last-of-type {
        margin-right: auto;
        margin-left: auto;
    }

    .whats-new-list {
        order: 3;
        width: min(100%, 520px);
        margin: 0 auto;
        text-align: left;
    }

    .book-cover {
        margin: 0 auto;
    }

    .project-card {
        padding: 32px;
    }

    .books-grid {
        grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    }
}

@media (max-width: 560px) {
    .nav {
        gap: 14px 15px;
    }

    .nav a {
        font-size: 15px;
    }

    .logo {
        font-size: 30px;
        letter-spacing: 5px;
    }

    .logo-mark {
        width: 34px;
        height: 34px;
    }

    .hero {
        padding: 34px 0 54px;
    }

    .hero h1 {
        font-size: clamp(48px, 15vw, 62px);
        letter-spacing: 5px;
    }

    .hero-text {
        max-width: 320px;
        font-size: 20px;
        line-height: 1.45;
    }

    .whats-new {
        padding: 58px 0;
        background:
            linear-gradient(180deg, rgba(139, 93, 51, 0.08), transparent 18%),
            #f4e8d8;
    }

    .main-project {
        background: #fbf6ee;
    }

    .books-preview {
        background: #f1e8dc;
    }

    .blog-quote {
        background: #fbf8f2;
    }

    .whats-new-grid {
        scroll-margin-top: 230px;
        gap: 28px;
    }

    .whats-new-main h2 {
        font-size: 36px;
    }

    .whats-new-main > p:last-of-type {
        font-size: 17px;
    }

    .floating-quote {
        width: 158px;
        min-height: 76px;
        padding: 17px 19px 15px;
        font-size: 12px;
    }

    .quote-1 {
        top: 24px;
        left: 4%;
    }

    .quote-2 {
        top: 32px;
        right: 4%;
    }

    .hero-inner {
        padding-top: 122px;
    }

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

    .book-info h2,
    .project-card h2,
    .section-head h2,
    .blog-card h2 {
        font-size: 36px;
    }

    .quote-card {
        font-size: 24px;
    }
}
/* Светлый мягкий фон */
body {
    background:
        radial-gradient(circle at top left, rgba(255, 225, 190, 0.35), transparent 35%),
        radial-gradient(circle at bottom right, rgba(170, 120, 70, 0.10), transparent 35%),
        #f7f1e8;
}

/* Читалка */
.reader-page {
    min-height: calc(100vh - 80px);
    padding: 70px 20px;
}

.reader-shell {
    max-width: 760px;
    margin: 0 auto;
}

.reader-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    color: #6f5a45;
}

.reader-back {
    color: #8a5a2f;
    text-decoration: none;
    font-weight: 600;
}

.reader-title {
    font-size: 14px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.reader-book {
    background: rgba(255, 252, 246, 0.88);
    border: 1px solid rgba(120, 88, 55, 0.12);
    border-radius: 28px;
    padding: 48px 56px;
    box-shadow: 0 25px 80px rgba(85, 55, 25, 0.10);
}

.reader-book h1 {
    font-size: 34px;
    margin-bottom: 32px;
    color: #2f2f2f;
}

.reader-text {
    font-size: 21px;
    line-height: 1.9;
    color: #333;
}

.reader-text p {
    margin-bottom: 24px;
}

.reader-controls {
    margin-top: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 22px;
}

.reader-controls button {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: #9a6638;
    color: white;
    font-size: 22px;
    cursor: pointer;
}

.reader-controls span {
    color: #6f5a45;
    font-weight: 600;
}

@media (max-width: 700px) {
    .reader-page {
        padding: 35px 14px;
    }

    .reader-book {
        padding: 32px 24px;
        border-radius: 22px;
    }

    .reader-text {
        font-size: 18px;
        line-height: 1.8;
    }

    .reader-top {
        flex-direction: column;
        gap: 10px;
    }
}
.reader-page-text {
    display: none;
    min-height: 520px;
}

.reader-page-text.active {
    display: block;
}

.reader-controls button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.reader-book {
    position: relative;
    cursor: pointer;
}

.reader-page-text {
    animation: pageFade 0.25s ease;
}

@keyframes pageFade {
    from {
        opacity: 0;
        transform: translateX(8px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}
.reader-progress {
    width: 100%;
    height: 4px;
    background: rgba(120, 88, 55, 0.12);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 32px;
}

.reader-progress div {
    height: 100%;
    width: 0%;
    background: #9a6638;
    border-radius: 999px;
    transition: width 0.25s ease;
}

.reader-controls {
    margin-top: 18px;
}

.reader-controls button {
    display: none;
}
.reader-book {
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
/* Reader v2 — режим электронной книги */
body:has(.reader-page) header,
body:has(.reader-page) footer {
    display: none;
}

.reader-page {
    min-height: 100vh;
    padding: 0;
    background: #f6efe4;
}

.reader-shell {
    max-width: 820px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 28px 22px 20px;
    display: flex;
    flex-direction: column;
}

.reader-top {
    margin-bottom: 24px;
    font-size: 14px;
    opacity: 0.75;
}

.reader-book {
    flex: 1;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    cursor: pointer;
}

.reader-page-text {
    min-height: calc(100vh - 150px);
    font-size: 22px;
    line-height: 1.75;
    color: #2f2f2f;
}

.reader-page-text h1 {
    margin-top: 36px;
    margin-bottom: 34px;
    font-size: 34px;
}

.reader-page-text p {
    margin-bottom: 22px;
}

.reader-progress {
    margin-top: 16px;
}

.reader-controls {
    margin-top: 12px;
    font-size: 13px;
    opacity: 0.65;
}

@media (max-width: 700px) {
    .reader-shell {
        padding: 22px 24px 16px;
    }

    .reader-top {
        margin-bottom: 22px;
    }

    .reader-title {
        display: none;
    }

    .reader-page-text {
        min-height: calc(100vh - 145px);
        font-size: 22px;
        line-height: 1.68;
    }

    .reader-page-text h1 {
        margin-top: 18px;
        font-size: 30px;
    }
}
.reader-full-text {
    display: none;
}

#readerPages {
    flex: 1;
}

.reader-page-text {
    height: calc(100vh - 150px);
    overflow: hidden;
}

/* SIMPLE CONTENT + ADMIN */

.simple-page {
    min-height: calc(100vh - 220px);
    padding: 70px 0 90px;
}

.simple-page h1 {
    font-family: Georgia, serif;
    font-size: 54px;
    line-height: 1.05;
    color: #2d2d2d;
}

.text-page {
    max-width: 780px;
}

.text-page p {
    margin-top: 22px;
    font-size: 20px;
    color: #4d4d4d;
}

.admin-narrow {
    max-width: 520px;
}

.admin-page {
    max-width: 1040px;
}

.admin-head,
.admin-actions,
.admin-row,
.admin-row-actions,
.admin-checks {
    display: flex;
    align-items: center;
}

.admin-head {
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 34px;
}

.admin-section-head {
    margin: 34px 0 14px;
}

.admin-section-head h2 {
    font-family: Georgia, serif;
    font-size: 32px;
}

.admin-actions {
    gap: 16px;
    flex-wrap: wrap;
}

.admin-link,
.admin-row-actions a {
    color: #8b5d33;
    text-decoration: none;
    font-weight: 700;
}

.admin-actions .btn,
.admin-form .btn {
    margin-top: 0;
}

.danger-link {
    color: #a33a2f !important;
}

.admin-table {
    display: grid;
    gap: 14px;
}

.admin-row {
    justify-content: space-between;
    gap: 24px;
    padding: 24px 28px;
    background: #fffaf3;
    border: 1px solid #e7ded1;
    border-radius: 18px;
}

.admin-row h2 {
    font-family: Georgia, serif;
    font-size: 28px;
    line-height: 1.15;
}

.admin-row p {
    margin-top: 8px;
    color: #777;
}

.admin-row-actions {
    justify-content: flex-end;
    gap: 18px;
    flex-wrap: wrap;
}

.admin-form {
    display: grid;
    gap: 22px;
    margin-top: 28px;
}

.admin-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.admin-form label {
    display: grid;
    gap: 8px;
    color: #6b5a49;
    font-weight: 700;
}

.field-hint {
    color: #8a7766;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.45;
}

.admin-form input,
.admin-form select,
.admin-form textarea {
    width: 100%;
    border: 1px solid #e0d4c5;
    border-radius: 12px;
    background: #fffaf3;
    color: #2d2d2d;
    font: inherit;
    padding: 13px 15px;
}

.admin-form textarea {
    resize: vertical;
    line-height: 1.6;
}

.admin-checks {
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
}

.admin-checks label {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-checks input {
    width: auto;
}

.form-error {
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #f8ded8;
    color: #8f2f25;
    font-weight: 700;
}

.admin-note {
    margin-top: 20px;
    color: #777;
}

@media (max-width: 760px) {
    .admin-head,
    .admin-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-form-grid {
        grid-template-columns: 1fr;
    }

    .simple-page h1 {
        font-size: 40px;
    }

    .blog-post-card,
    .blog-empty,
    .blog-post-article {
        border-radius: 18px;
        padding: 24px;
    }

    .blog-post-card h2,
    .blog-empty h2 {
        font-size: 30px;
    }

    .blog-post-head h1 {
        font-size: 40px;
    }

    .blog-post-body {
        font-size: 19px;
        line-height: 1.75;
    }
}

/* BOOK DETAIL */

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 84px;
    border: 1px solid #e0d4c5;
    border-radius: 999px;
    background: #fffaf3;
    color: #6f4b2b;
    font: inherit;
    padding: 8px 14px;
    cursor: pointer;
}

.book-page {
    padding-bottom: 90px;
}

.book-hero {
    padding: 72px 0 58px;
}

.book-hero-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 74px;
    align-items: center;
}

.book-detail-cover {
    position: relative;
    width: 300px;
    aspect-ratio: 0.7;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    background: linear-gradient(135deg, #2e231c, #8b5d33);
    color: #fffaf3;
    box-shadow: 0 28px 72px rgba(75, 48, 24, 0.2);
    font-family: Georgia, serif;
    font-size: 34px;
    letter-spacing: 4px;
    text-align: center;
}

.book-detail-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-detail-info h1 {
    max-width: 820px;
    font-family: Georgia, serif;
    font-size: clamp(46px, 7vw, 82px);
    line-height: 1.02;
    color: #2d2d2d;
}

.book-detail-description {
    max-width: 760px;
    margin-top: 24px;
    color: #4d4d4d;
    font-size: 19px;
}

.book-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 34px;
}

.book-meta-grid div {
    min-height: 96px;
    padding: 18px;
    border: 1px solid #e7ded1;
    border-radius: 16px;
    background: rgba(255, 250, 243, 0.74);
}

.book-meta-grid span,
.book-progress-head span,
.chapter-number,
.chapter-search span {
    display: block;
    color: #8b5d33;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

.book-meta-grid strong {
    display: block;
    margin-top: 10px;
    color: #2d2d2d;
    font-size: 21px;
}

.book-progress {
    max-width: 640px;
    margin-top: 30px;
}

.book-progress-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 10px;
}

.book-progress-head strong {
    color: #8b5d33;
}

.book-actions {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.book-secondary-link {
    margin-top: 30px;
    color: #8b5d33;
    text-decoration: none;
    font-weight: 700;
}

.chapter-section {
    padding-top: 34px;
}

.chapter-head {
    display: grid;
    grid-template-columns: 1fr minmax(260px, 360px);
    gap: 28px;
    align-items: end;
    margin-bottom: 24px;
}

.chapter-head h2 {
    font-family: Georgia, serif;
    font-size: 44px;
    line-height: 1.1;
}

.chapter-search {
    display: grid;
    gap: 8px;
}

.chapter-search input {
    width: 100%;
    border: 1px solid #e0d4c5;
    border-radius: 14px;
    background: #fffaf3;
    color: #2d2d2d;
    font: inherit;
    padding: 14px 16px;
}

.chapter-list,
.chapter-part-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.chapter-part {
    grid-column: 1 / -1;
    display: grid;
    gap: 16px;
    margin-top: 14px;
}

.chapter-part:first-child {
    margin-top: 0;
}

.chapter-part-head {
    padding: 26px 30px;
    border: 1px solid #e7ded1;
    border-radius: 18px;
    background: rgba(255, 250, 243, 0.68);
}

.chapter-part-head span {
    display: block;
    color: #8b5d33;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.6px;
    text-transform: uppercase;
}

.chapter-part-head h3 {
    margin-top: 8px;
    font-family: Georgia, serif;
    font-size: 34px;
    line-height: 1.1;
}

.chapter-card {
    min-height: 230px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 22px;
    padding: 26px;
    border: 1px solid #e7ded1;
    border-radius: 18px;
    background: #fffaf3;
}

.chapter-block {
    grid-column: 1 / -1;
    display: grid;
    gap: 14px;
}

.chapter-card-main {
    min-height: 210px;
}

.chapter-subparts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding-left: 26px;
    border-left: 3px solid rgba(139, 93, 51, 0.18);
}

.chapter-card-part {
    min-height: 190px;
    background: rgba(255, 250, 243, 0.72);
}

.chapter-card-part h3 {
    font-size: 23px;
}

.chapter-card h3 {
    margin-top: 10px;
    font-family: Georgia, serif;
    font-size: 27px;
    line-height: 1.12;
}

.chapter-card p {
    margin-top: 14px;
    color: #666;
}

.chapter-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    color: #8b5d33;
    font-weight: 700;
}

.chapter-card-foot a {
    color: #8b5d33;
    text-decoration: none;
}

html.theme-dark body {
    background:
        radial-gradient(circle at top left, rgba(128, 84, 45, 0.18), transparent 36%),
        radial-gradient(circle at bottom right, rgba(66, 82, 62, 0.18), transparent 34%),
        #181614;
    color: #ece5dc;
}

.theme-dark .site-header {
    background: rgba(24, 22, 20, 0.92);
    border-bottom-color: rgba(255, 250, 243, 0.11);
}

.theme-dark .site-frame-side {
    background: #171310;
}

.theme-dark .site-frame-left {
    border-right-color: rgba(230, 192, 145, 0.22);
}

.theme-dark .site-frame-right {
    border-left-color: rgba(230, 192, 145, 0.22);
}

.theme-dark .site-frame-shot {
    opacity: 0.46;
    filter: saturate(0.82) sepia(0.14) brightness(0.72);
}

.theme-dark .floating-quote {
    color: #453326;
    filter: drop-shadow(0 18px 18px rgba(0, 0, 0, 0.28));
}

.theme-dark .logo-mark {
    filter: invert(1);
}

.theme-dark .hero-logo-mark {
    filter: invert(1);
    opacity: 0.86;
}

.theme-dark .book-status {
    background: rgba(43, 37, 32, 0.94);
    color: #f0d0a8;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.theme-dark .whats-new {
    border-color: rgba(255, 250, 243, 0.10);
    background:
        radial-gradient(circle at top left, rgba(128, 84, 45, 0.18), transparent 34%),
        #1d1916;
}

.theme-dark .main-project {
    border-color: rgba(255, 250, 243, 0.10);
    background: #181513;
}

.theme-dark .books-preview {
    border-color: rgba(255, 250, 243, 0.10);
    background: #211c18;
}

.theme-dark .blog-quote {
    background:
        radial-gradient(circle at bottom right, rgba(128, 84, 45, 0.16), transparent 34%),
        #181513;
}

.theme-dark .logo,
.theme-dark .nav,
.theme-dark .whats-new-main h2,
.theme-dark .whats-new-mini strong,
.theme-dark .book-card h3,
.theme-dark .blog-post-card h2,
.theme-dark .blog-empty h2,
.theme-dark .blog-post-head h1,
.theme-dark .book-detail-info h1,
.theme-dark .book-meta-grid strong,
.theme-dark .simple-page h1,
.theme-dark .chapter-head h2,
.theme-dark .chapter-card h3,
.theme-dark .site-footer h2 {
    color: #f4ede5;
}

.theme-dark .nav a,
.theme-dark .whats-new-main > p:last-of-type,
.theme-dark .book-detail-description,
.theme-dark .book-info p,
.theme-dark .project-card p,
.theme-dark .blog-card p,
.theme-dark .blog-post-card p,
.theme-dark .blog-empty p,
.theme-dark .blog-post-head p,
.theme-dark .blog-post-body,
.theme-dark .text-page p,
.theme-dark .chapter-card p {
    color: #d0c4b8;
}

.theme-dark .site-footer,
.theme-dark .project-card,
.theme-dark .whats-new-mini,
.theme-dark .book-card,
.theme-dark .blog-card,
.theme-dark .blog-post-card,
.theme-dark .blog-empty,
.theme-dark .blog-post-article,
.theme-dark .quote-card,
.theme-dark .admin-row,
.theme-dark .book-meta-grid div,
.theme-dark .chapter-part-head,
.theme-dark .chapter-card {
    border-color: rgba(255, 250, 243, 0.11);
    background: rgba(39, 34, 30, 0.82);
}

.theme-dark .chapter-subparts {
    border-left-color: rgba(217, 166, 110, 0.24);
}

.theme-dark .theme-toggle,
.theme-dark .chapter-search input,
.theme-dark .admin-form input,
.theme-dark .admin-form select,
.theme-dark .admin-form textarea {
    border-color: rgba(255, 250, 243, 0.14);
    background: #211d1a;
    color: #f4ede5;
}

.theme-dark .whats-new-visual {
    background: linear-gradient(135deg, #151210, #6f4729);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.28);
}

.theme-dark .whats-new-badge,
.theme-dark .whats-new-mini span {
    background: rgba(217, 166, 110, 0.12);
    color: #e0b47f;
}

.theme-dark .whats-new-mini small {
    color: #c8baad;
}

.theme-dark .genre,
.theme-dark .site-footer p,
.theme-dark .admin-row p,
.theme-dark .book-card p,
.theme-dark .book-card-meta,
.theme-dark .field-hint {
    color: #b4a89c;
}

.theme-dark .book-card small {
    color: #c8baad;
}

.theme-dark .blog-post-meta span {
    background: rgba(217, 166, 110, 0.12);
    color: #e0b47f;
}

.theme-dark .book-card-cover {
    background: linear-gradient(135deg, #151210, #6f4729);
}

.theme-dark .book-card-cover.has-cover {
    background:
        radial-gradient(circle at center, rgba(217, 166, 110, 0.14), transparent 58%),
        #211d1a;
}

@media (max-width: 900px) {
    .book-hero-grid,
    .chapter-head {
        grid-template-columns: 1fr;
    }

    .book-detail-cover {
        width: min(280px, 82vw);
        margin: 0 auto;
    }

    .book-detail-info {
        text-align: center;
    }

    .book-meta-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .book-actions,
    .book-progress-head {
        justify-content: center;
    }

    .book-progress {
        margin-right: auto;
        margin-left: auto;
    }
}

@media (max-width: 650px) {
    .book-hero {
        padding: 44px 0 34px;
    }

    .book-meta-grid,
    .chapter-list,
    .chapter-part-list,
    .chapter-subparts {
        grid-template-columns: 1fr;
    }

    .book-detail-description {
        font-size: 17px;
    }

    .chapter-head h2 {
        font-size: 34px;
    }

    .chapter-card {
        min-height: 0;
    }

    .chapter-subparts {
        padding-left: 14px;
    }

    .chapter-part-head {
        padding: 22px;
    }

    .chapter-part-head h3 {
        font-size: 28px;
    }
}

.hero-reading-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }
.account-logout { margin-top: 20px; }
.profile-avatar { font-size: 1.35rem; margin: 16px 0; }
.admin-actions form { margin: 0; }
