:root {
    color-scheme: light;
    --paper: #f9f7f1;
    --ink: #333b32;
    --muted: #74766b;
    --line: #deded2;
    --accent: #53644c;
    --body-size: 1.125rem
}

* {
    box-sizing: border-box
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px
}

html[data-size=small] {
    --body-size: 1rem
}

html[data-size=large] {
    --body-size: 1.3125rem
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: Georgia, 'Times New Roman', serif;
    -webkit-font-smoothing: antialiased
}

a {
    color: inherit;
    text-underline-offset: 5px
}

button {
    font: inherit;
    color: inherit;
    cursor: pointer
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 5px
}

button:hover,
a:hover {
    color: var(--accent)
}

.header {
    height: 88px;
    margin: 0 5.4%;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    font-size: 19px
}

.brand svg {
    width: 25px;
    height: 25px
}

.controls {
    display: flex;
    align-items: center;
    gap: 22px
}

.sizes {
    display: flex;
    align-items: center;
    padding: 0;
    border: 0;
    margin: 0;
    gap: 3px
}

.sizes button {
    background: none;
    border: 0;
    border-radius: 3px;
    width: 34px;
    height: 38px
}

.sizes button:nth-of-type(1) {
    font-size: 14px
}

.sizes button:nth-of-type(2) {
    font-size: 18px
}

.sizes button:nth-of-type(3) {
    font-size: 22px
}

.sizes button[aria-pressed=true] {
    background: #e9ebdf;
    color: #354d30
}

.divider {
    width: 1px;
    height: 23px;
    background: var(--line)
}

.menu-button {
    display: flex;
    align-items: center;
    gap: 9px;
    border: 0;
    background: none;
    min-height: 44px;
    padding: 0;
    font-family: Arial, sans-serif;
    font-size: 12px
}

.reading {
    max-width: 650px;
    margin: 0 auto;
    padding: 0 24px
}

.book-title {
    text-align: center;
    padding: 76px 0 64px
}

.eyebrow {
    font-family: Arial, sans-serif;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 2.2px;
    line-height: 1.6;
    color: var(--muted);
    margin: 0 0 21px
}

h1 {
    font-size: clamp(2.65rem, 6vw, 4.1rem);
    font-weight: 400;
    line-height: 1.12;
    letter-spacing: -1.9px;
    margin: 0 0 25px
}

h1 em {
    font-weight: 400
}

.subtitle {
    font-style: italic;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.6;
    margin: 0 0 27px
}

.byline {
    font: 10px Arial, sans-serif;
    letter-spacing: 2px;
    color: var(--muted)
}

.ornament {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 40px 0 28px;
    color: #828c75;
    font-size: 21px
}

.ornament span {
    height: 1px;
    background: var(--line);
    width: 53px
}

.inline-contents {
    font-size: 12px;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    line-height: 1.7
}

.inline-contents a {
    text-decoration: none
}

.inline-contents a:hover {
    text-decoration: underline
}

.chapter {
    scroll-margin-top: 30px
}

.chapter .eyebrow {
    font-size: 9px;
    letter-spacing: 2px;
    margin-bottom: 12px
}

h2 {
    font-size: 2rem;
    font-weight: 400;
    letter-spacing: -.5px;
    line-height: 1.25;
    margin: 0 0 24px
}

h3 {
    font-size: 1.5rem;
    line-height: 1.4;
    font-weight: 400
}

h4 {
    font-size: 1.1875rem;
    line-height: 1.5;
    font-weight: 400;
    font-style: italic
}

.prose {
    font-size: var(--body-size);
    line-height: 1.9;
    margin: 0;
    text-wrap: pretty;
    text-align: justify;
}

.dropcap:first-letter {
    float: left;
    font-size: 3.9em;
    line-height: .8;
    margin: 9px 9px 0 0
}

.chapter-break {
    text-align: center;
    color: #a2a591;
    font-size: 16px;
    margin: 44px 0
}

.book-end {
    text-align: center;
    padding: 48px 0 70px
}

.end-mark {
    font-size: 32px;
    color: #819174
}

.book-end p {
    font: 9px Arial, sans-serif;
    letter-spacing: 2.4px;
    color: var(--muted);
    margin: 17px 0 27px
}

.book-end a {
    font-size: 12px;
    text-decoration: none
}

.book-end a span {
    padding-left: 6px
}

.site-footer {
    border-top: 1px solid var(--line);
    margin: 0 5.4%;
    padding: 25px 0 30px;
    display: flex;
    justify-content: space-between;
    gap: 15px;
    font-size: 11px;
    color: var(--muted)
}

.site-footer span:nth-child(2) {
    font-style: italic
}

.site-footer a {
    text-decoration: none
}

dialog {
    background: var(--paper);
    color: var(--ink);
    border: 1px solid var(--line);
    padding: 30px;
    width: min(440px, calc(100% - 32px));
    box-shadow: 0 20px 90px #20251826
}

dialog::backdrop {
    background: #22291e66;
    backdrop-filter: blur(3px)
}

.dialog-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px
}

.dialog-heading .eyebrow {
    margin: 0;
    font-size: 8px
}

.dialog-heading button {
    background: none;
    border: 0;
    font-size: 27px;
    min-width: 44px;
    min-height: 44px
}

dialog h2 {
    font-size: 32px;
    margin-bottom: 13px
}

.menu-book {
    font-size: 14px;
    color: var(--muted);
    font-style: italic;
    margin-bottom: 30px
}

dialog nav a {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 0;
    border-top: 1px solid var(--line);
    text-decoration: none;
    font-size: 15px
}

dialog nav a span:first-child {
    font-size: 12px;
    color: var(--muted);
    width: 20px
}

dialog nav a span:last-child {
    margin-left: auto
}

.overview-link {
    display: block;
    border-top: 1px solid var(--line);
    padding-top: 25px;
    margin-top: 10px;
    font: 12px Arial, sans-serif;
    text-decoration: none
}

.skip {
    position: fixed;
    left: 20px;
    top: -100px;
    padding: 12px;
    background: var(--paper);
    z-index: 10
}

.skip:focus {
    top: 10px
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%)
}

.shelf {
    max-width: 830px;
    margin: auto;
    padding: 75px 24px 100px
}

.shelf h1 {
    font-size: 52px
}

.shelf-intro {
    color: var(--muted);
    line-height: 1.8;
    font-style: italic
}

.book-card {
    margin-top: 55px;
    display: grid;
    grid-template-columns: 145px 1fr;
    gap: 32px;
    align-items: center;
    text-decoration: none;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 30px 0
}

.cover {
    height: 200px;
    background: #e8eadf;
    border: 1px solid #cdd2bf;
    box-shadow: inset 5px 0 0 #d5dbc7;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 15px;
    font-size: 23px;
    line-height: 1.2;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.cover img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: -1;
}

.cover em {
    font-size: 20px
}

.cover small {
    font: 7px Arial, sans-serif;
    letter-spacing: 2px;
    margin-top: 22px
}

.book-card h2 {
    font-size: 26px;
    margin: 0 0 12px
}

.book-card p {
    line-height: 1.7;
    color: var(--muted);
    font-size: 14px
}

.read-link {
    display: block;
    margin-top: 20px;
    font: 11px Arial, sans-serif;
    letter-spacing: .6px
}

@media(max-width:600px) {
    .header {
        height: 73px;
        margin: 0 20px
    }

    .brand {
        font-size: 16px;
        gap: 8px
    }

    .brand svg {
        width: 21px
    }

    .controls {
        gap: 10px
    }

    .sizes button {
        width: 29px;
        min-height: 44px
    }

    .menu-button span {
        display: none
    }

    .menu-button {
        min-width: 32px;
        justify-content: center
    }

    .reading {
        padding: 0 26px
    }

    .book-title {
        padding: 55px 0 51px
    }

    h1 {
        letter-spacing: -1.4px
    }

    .eyebrow {
        font-size: 8px;
        letter-spacing: 1.7px
    }

    .subtitle {
        font-size: 14px;
        max-width: 240px;
        margin-left: auto;
        margin-right: auto
    }

    .inline-contents {
        font-size: 11px;
        gap: 8px
    }

    .ornament {
        margin-top: 33px
    }

    h2 {
        font-size: 1.75rem;
        margin-bottom: 20px
    }

    .prose {
        line-height: 1.85
    }

    .chapter-break {
        margin: 34px 0
    }

    .book-end {
        padding-bottom: 48px
    }

    .site-footer {
        margin: 0 20px;
        font-size: 10px
    }

    .site-footer span:nth-child(2) {
        display: none
    }

    .shelf {
        padding-top: 55px
    }

    .shelf h1 {
        font-size: 42px
    }

    .book-card {
        grid-template-columns: 100px 1fr;
        gap: 22px
    }

    .cover {
        height: 155px;
        font-size: 18px;
        position: relative;
        overflow: hidden;
        z-index: 1;
    }

    .cover img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: contain;
        z-index: -1;
    }

    .cover em {
        font-size: 17px
    }

    .book-card h2 {
        font-size: 22px
    }
}

@media(prefers-reduced-motion:reduce) {
    html {
        scroll-behavior: auto
    }
}