:root {
    color-scheme: light;
    --ivory: #f7f1e9;
    --paper: #fffcf7;
    --plum: #46213e;
    --plum-dark: #30192d;
    --muted: #665661;
    --line: #dfd1d9;
    --ink: #29212a;
    --accent: #9c7352;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--ivory);
    color: var(--ink);
    font: 1rem/1.55 system-ui, sans-serif;
}
a { color: var(--link-color); text-underline-offset: .2em; }
:focus-visible { outline: 3px solid #956134; outline-offset: 4px; }
[hidden] { display: none !important; }
.skip { position: absolute; top: -6rem; left: 1rem; }
.skip:focus { top: .75rem; z-index: 2; background: white; padding: .75rem; }
.masthead { background: var(--plum-dark); color: var(--header-text); border-bottom: 3px solid var(--accent); }
.mast-inner {
    max-width: 74rem;
    margin: auto;
    padding: 1rem clamp(1rem, 4vw, 3rem);
    display: flex;
    gap: .85rem 2rem;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}
.masthead a { color: inherit; }
.masthead :focus-visible { outline-color: #f7c89f; }
.brand { display: flex; align-items: center; gap: .7rem; min-width: 0; text-decoration: none; }
.brand-logo { max-width: 4.5rem; max-height: 3rem; object-fit: contain; }
.brand-text { display: grid; min-width: 0; overflow-wrap: anywhere; }
.brand-text > span { color: var(--header-subtitle); font-size: .79rem; }
.brand strong { font: normal 1.45rem Georgia, serif; }
.masthead nav { display: flex; flex-wrap: wrap; gap: .45rem 1.2rem; font-size: .9rem; }
.shell { width: min(100% - 2rem, 66rem); margin: clamp(1.5rem, 5vw, 4rem) auto; min-height: 62vh; }
.site-foot { text-align: center; padding: 1.25rem; border-top: 1px solid var(--line); font-size: .9rem; }
h1, h2, h3 { font-family: Georgia, serif; line-height: 1.17; font-weight: normal; color: var(--heading-color); overflow-wrap: anywhere; }
h1 { font-size: clamp(2rem, 6vw, 3.4rem); margin: 0 0 .6em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 .7em; }
p { overflow-wrap: anywhere; }
.panel {
    padding: clamp(1.15rem, 4vw, 2.6rem);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 1rem;
    box-shadow: 0 .35rem 1.6rem #30202a09;
}
.intro { margin-bottom: 1.25rem; }
.intro p { max-width: 38rem; }
.breadcrumb { font-size: .9rem; }
.breadcrumb span { margin-inline: .4rem; color: var(--muted); }
.shelf, .room-grid { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.book { display: block; text-decoration: none; border-left: .35rem solid var(--plum); }
.book:hover { border-color: var(--accent); }
.book span { text-decoration: underline; }
.button, .text-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.7rem;
    padding: .55rem 1rem;
    border: 1px solid var(--plum);
    border-radius: .45rem;
    background: var(--plum);
    color: var(--button-text);
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
.button:hover { box-shadow: inset 0 0 0 2px currentColor; color: var(--button-text); }
.ghost, .text-button { background: transparent; color: var(--link-color); }
.button.ghost:hover { color: var(--link-color); }
.text-button { min-height: 2.3rem; font-size: .86rem; }
.secondary-link { display: inline-block; margin: .55rem 0 .55rem .65rem; }
.agreement {
    background: var(--agreement-surface);
    border-left: 3px solid var(--plum);
    padding: 1rem clamp(.8rem, 3vw, 1.45rem);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    margin-block: 1rem;
}
.room-form { max-width: 48rem; margin-top: 1.2rem; display: grid; gap: .55rem; }
.room-form label { font-weight: 650; }
.room-form label span { color: var(--muted); font-weight: normal; }
.room-form input:not([type=checkbox]):not([type=radio]), .room-form textarea {
    width: 100%;
    min-height: 2.7rem;
    margin-bottom: .5rem;
    padding: .65rem;
    border: 1px solid #a893a2;
    border-radius: .35rem;
    color: var(--ink);
    background: var(--input-surface);
    font: inherit;
}
.room-form textarea { resize: vertical; }
.room-form .button { justify-self: start; margin-top: .4rem; }
.checkbox { display: flex; gap: .6rem; align-items: flex-start; }
.checkbox input { margin: .35rem 0 0; }
.chapter-list { padding-left: 1.4rem; }
.chapter-list a, .chapter-list li > span { display: inline-block; padding: .45rem; overflow-wrap: anywhere; }
.chapter-list li + li { border-top: 1px solid var(--line); }
.chapter-list li > span { color: var(--muted); }
.reader { padding-bottom: 1.3rem; }
.chapter-heading { text-align: center; padding-bottom: .5rem; }
.chapter-heading p { color: var(--muted); margin: 0 0 .7rem; font-size: .9rem; }
.reading-area { position: relative; isolation: isolate; overflow: hidden; }
.prose {
    max-width: 38rem;
    margin: 0 auto;
    font: clamp(1.12rem, 2vw, 1.31rem)/1.8 var(--reading-font);
    overflow-wrap: anywhere;
}
.prose > :first-child { margin-top: 1rem; }
.prose ::selection { background: #ebd8aa; color: var(--ink); }
.watermark {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    user-select: none;
    background: repeating-linear-gradient(0deg, transparent 0 4rem, #73526b08 4rem 4.08rem);
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    color: #57364b31;
    overflow: hidden;
    font: 650 .8rem/1.3 system-ui, sans-serif;
}
.watermark-row { white-space: pre; transform: translateX(-1rem) rotate(-9deg); }
.branded-watermark {
    display: flex;
    flex: 1 1 0;
    min-height: 0;
    align-items: center;
    justify-content: center;
    gap: clamp(.4rem, 3vw, 2rem);
    transform: rotate(-9deg);
}
.branded-watermark img {
    width: clamp(2.5rem, 11vw, 6rem);
    max-height: min(3.25rem, 100%);
    object-fit: contain;
    opacity: .15;
    filter: grayscale(100%);
}
@media (max-width: 30rem) {
    .branded-watermark span:last-child { display: none; }
}
.reading-tools, .chapter-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .7rem 1rem;
    flex-wrap: wrap;
    font-size: .9rem;
    padding: .65rem 0;
    border-top: 1px solid var(--line);
}
.reading-tools { justify-content: flex-start; }
.chapter-contents {
    margin: 0 0 .85rem;
    padding: .65rem .9rem;
    border: 1px solid var(--line);
    border-radius: .55rem;
    background: var(--ivory);
}
.chapter-contents summary { font-weight: 650; }
.chapter-contents .chapter-list { margin-bottom: .25rem; }
.chapter-list .current-chapter { font-weight: 650; color: var(--ink); }
.current-chapter small { margin-inline-start: .35rem; font-weight: normal; }
.chapter-list .revision-badge {
    padding: .2rem .55rem;
    border: 1px solid var(--accent);
    border-radius: .35rem;
    color: var(--ink);
    font-size: .8rem;
    font-weight: 600;
}
.revision-notice {
    margin: 0 0 1rem;
    padding: .8rem 1rem;
    border: 1px solid var(--line);
    border-inline-start: 3px solid var(--accent);
    border-radius: .4rem;
}
.revision-notice p { margin: .4rem 0 0; }
.chapter-next { margin-inline-start: auto; }
.after-feedback { display: flex; justify-content: flex-end; margin-top: 1rem; }
.feedback-card { margin-top: 1.05rem; }
.note-entry, .discussion-entry { padding-block: .75rem; border-top: 1px solid var(--line); }
.discussion-handle { margin: 1rem 0; }
.discussion-handle summary { color: var(--link-color); cursor: pointer; font-weight: 600; }
.discussion-handle .room-form { max-width: 28rem; }
.note-entry h2 { margin-bottom: .2rem; }
.note-entry h2 + p { margin-top: 0; color: var(--muted); }
.reader-rating { padding: .75rem; border: 1px solid var(--line); border-radius: .45rem; }
.reader-rating legend span { font-weight: normal; color: var(--muted); }
.reader-rating div { display: flex; flex-wrap: wrap; gap: .5rem; }
.room-form .reader-rating label {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .35rem .55rem;
    border: 1px solid var(--line);
    border-radius: .35rem;
}
.room-form .reader-rating input { width: auto; min-height: auto; margin: 0; }
details { margin-top: 1rem; }
summary { cursor: pointer; color: var(--link-color); }
blockquote { border-left: 3px solid var(--line); margin: 1rem 0; padding-left: .85rem; color: var(--muted); }
.message { padding: .65rem 1rem; color: #29212a; background: #e6f0e1; border-radius: .45rem; }
.message.error { background: #f5dfdf; }
@media (max-width: 42rem) {
    .shelf, .room-grid { grid-template-columns: 1fr; }
    .shell { width: min(100% - 1.25rem, 66rem); }
}
