* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: #f7f5f0;
    color: #292929;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.75;
}

.book {
    width: min(100% - 48px, 820px);
    margin: 0 auto;
    padding: 80px 0 100px;
}

.book-header {
    text-align: center;
    padding: 0 0 70px;
    border-bottom: 1px solid #d8d4cc;
}

.book-kicker {
    margin-bottom: 20px;
    color: #756f65;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.18em;
}

.book-header h1 {
    margin: 0;
    color: #1f1f1f;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(64px, 12vw, 110px);
    font-weight: 400;
    line-height: 1;
}

.subtitle {
    margin: 18px 0 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 25px;
}

.description {
    max-width: 560px;
    margin: 18px auto 0;
    color: #6b675f;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 16px;
}

.contents {
    padding: 55px 0 65px;
    border-bottom: 1px solid #d8d4cc;
}

.contents h2,
.chapter h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 400;
}

.contents h2 {
    margin-bottom: 25px;
    font-size: 28px;
}

.contents ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

.contents li {
    margin: 0;
}

.contents a {
    display: flex;
    gap: 14px;
    padding: 8px 0;
    color: #292929;
    font-family: Georgia, "Times New Roman", serif;
    text-decoration: none;
    border-bottom: 1px dotted #d2cec6;
}

.contents a:hover {
    color: #756f65;
}

.contents a span {
    width: 25px;
    color: #8a847a;
}

.chapter {
    padding-top: 70px;
}

.chapter-label {
    margin-bottom: 12px;
    color: #756f65;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.chapter h2 {
    margin-bottom: 35px;
    font-size: clamp(34px, 6vw, 48px);
    line-height: 1.2;
}

.chapter p {
    margin: 0 0 25px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 18px;
    font-variant-numeric: lining-nums tabular-nums;
}

.chapter .lead {
    font-size: 21px;
}

.chapter-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 0 45px;
    padding-bottom: 20px;
    border-bottom: 1px solid #d8d4cc;
}

.chapter-nav a {
    color: #756f65;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-decoration: none;
    text-transform: uppercase;
}

.chapter-nav a:hover {
    color: #292929;
}

.chapter-nav-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 65px;
    padding-top: 20px;
    border-top: 1px solid #d8d4cc;
}

.chapter-nav-bottom a {
    color: #756f65;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 16px;
    text-decoration: none;
}

.chapter-nav-bottom a:hover {
    color: #292929;
}

.chapter-nav-bottom .next {
    margin-left: auto;
}

.book-navigation {
    display: flex;
    margin-top: 30px;
}

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

.book-navigation a {
    color: #756f65;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 15px;
    text-decoration: none;
}

.book-navigation a:hover {
    color: #292929;
}

.note {
    margin: 40px 0;
    padding: 25px 30px;
    background: #efede8;
    border-left: 3px solid #9b958b;
}

.note-title {
    margin-bottom: 8px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 18px;
    font-weight: 700;
}

.note p {
    margin: 0;
}

pre {
    margin: 35px 0;
    padding: 25px;
    overflow-x: auto;
    background: #f1f0ed;
    color: #292929;
    border: 1px solid #ddd9d0;
    border-radius: 6px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 14px;
    line-height: 1.65;
}

code {
    padding: 2px 5px;
    background: #e9e6df;
    border-radius: 3px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.9em;
}

pre code {
    padding: 0;
    background: transparent;
}

@media (max-width: 600px) {
    .book {
        width: min(100% - 30px, 820px);
        padding: 50px 0 70px;
    }

    .book-header {
        padding-bottom: 50px;
    }

    .contents {
        padding: 40px 0 50px;
    }

    .chapter {
        padding-top: 50px;
    }

    .chapter p {
        font-size: 17px;
    }

    .chapter .lead {
        font-size: 19px;
    }

    .chapter-nav {
        margin-bottom: 35px;
    }

    .chapter-nav-bottom {
        margin-top: 50px;
    }

    .note {
        padding: 20px;
    }

    pre {
        margin: 25px -5px;
        padding: 18px;
        font-size: 12px;
    }
}