:root {
    color-scheme: light;
    --paper: #fcf9f2;
    --ink: #203141;
    --muted: #516271;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
a { color: #175377; text-underline-offset: .18em; }
a:focus-visible { outline: 3px solid #a65810; outline-offset: 4px; }
.reader-chrome { background: var(--paper); border-bottom: 1px solid #ded5c6; }
.reader-nav {
    display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
    gap: .5rem 1rem; max-width: 57rem; margin: auto; padding: .9rem 1.25rem;
    font: 650 .88rem/1.4 system-ui, sans-serif;
}
.reader-brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--ink); }
.reader-logo { display: block; flex: none; border: 1px solid #ded5c6; border-radius: .35rem; }
.reader-page {
    --edition-ink: #214b61;
    --edition-tint: #edf4f5;
    --edition-line: #c9dce0;
    --edition-pattern: repeating-radial-gradient(ellipse at 100% 70%, transparent 0 23px, var(--edition-line) 24px 25px, transparent 26px 34px);
}
.reader-page[data-theme="nature"] {
    --edition-ink: #345c48;
    --edition-tint: #eff4eb;
    --edition-line: #cfdcc9;
    --edition-pattern: repeating-radial-gradient(ellipse at 96% 100%, transparent 0 20px, var(--edition-line) 21px 22px, transparent 23px 37px);
}
.reader-page[data-theme="memoir"] {
    --edition-ink: #684c38;
    --edition-tint: #f5efe5;
    --edition-line: #e4d7c4;
    --edition-pattern: repeating-linear-gradient(0deg, transparent 0 18px, var(--edition-line) 19px 20px);
}
.reader-page[data-theme="ideas"] {
    --edition-ink: #3f4e6c;
    --edition-tint: #f0f1f7;
    --edition-line: #d5daea;
    --edition-pattern: radial-gradient(circle, var(--edition-line) 1px, transparent 1.5px) 0 0 / 16px 16px;
}
.reader-page[data-theme="poetry"] {
    --edition-ink: #604364;
    --edition-tint: #f5eef4;
    --edition-line: #e2d4e2;
    --edition-pattern: repeating-linear-gradient(135deg, transparent 0 19px, var(--edition-line) 20px 21px, transparent 22px 28px);
}
.reader-hero {
    isolation: isolate;
    position: relative;
    overflow: hidden;
    background: var(--edition-tint);
    border-bottom: 1px solid var(--edition-line);
}
.reader-hero::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0 0 0 35%;
    background: var(--edition-pattern);
    mask-image: linear-gradient(90deg, transparent 0%, #000 78%);
    pointer-events: none;
}
.reader-hero-inner {
    max-width: 57rem;
    margin: auto;
    padding: clamp(1.8rem, 4.5vw, 3.3rem) 1.25rem;
}
.reader-kicker, .reader-byline-label {
    color: var(--edition-ink);
    font: 750 .72rem/1.45 system-ui, sans-serif;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.reader-kicker { margin: 0 0 .7rem; }
.reader-hero h1 {
    max-width: 31ch;
    font: 700 clamp(2rem, 5.1vw, 3.3rem)/1.15 Georgia, "Nirmala UI", serif;
    margin: 0;
    overflow-wrap: anywhere;
}
.reader-author-block {
    margin-top: 1.3rem;
    padding-left: .75rem;
    border-left: 2px solid var(--edition-line);
}
.reader-byline-label { margin: 0 0 .38rem; }
.reader-byline {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem 1.3rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.reader-author {
    display: flex;
    align-items: center;
    gap: .5rem;
    font: 700 .97rem/1.35 system-ui, sans-serif;
}
.reader-monogram {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    flex: 0 0 2rem;
    color: var(--edition-ink);
    background: var(--paper);
    border: 1px solid var(--edition-line);
    border-radius: 50%;
    font: 700 .73rem/1 Georgia, serif;
}
.reader-page[lang="as"] h1, .reader-page[lang="as"] .reader-copy {
    font-family: "Noto Serif Bengali", "Nirmala UI", "Vrinda", serif;
    line-height: 1.65;
}
.reader-copy {
    font-family: "Noto Serif Bengali", "Nirmala UI", "Vrinda", serif;
    line-height: 1.65;
}
.reader-page[data-theme="field"] { --banner: #12384b; }
.reader-page[data-theme="nature"] { --banner: #243e32; }
.reader-page[data-theme="memoir"] { --banner: #494035; }
.reader-page[data-theme="ideas"] { --banner: #303649; }
.reader-page[data-theme="poetry"] { --banner: #403348; }
.reader-copy {
    max-width: 45rem; margin: auto; padding: clamp(1.7rem, 4vw, 3.4rem) 1.25rem 4rem;
    font: 1.1rem/1.75 Georgia, "Nirmala UI", serif;
    overflow-wrap: anywhere;
}
.reader-copy p { margin: 0 0 1em; }
.reader-copy h2, .reader-copy h3 { line-height: 1.3; margin: 1.6em 0 .5em; }
.reader-copy > :first-child { margin-top: 0; }
.reader-copy :is(ul, ol) { padding-left: 1.35em; }
.reader-copy li { margin: .25em 0; }
.reader-copy img { max-width: 100%; height: auto; display: block; }
.reader-copy figure { margin: 1.35rem 0; }
.reader-copy figcaption { color: var(--muted); font: .85rem/1.4 system-ui, sans-serif; margin-top: .3rem; }
.reader-copy table { width: 100%; border-collapse: collapse; font-size: .94em; }
.reader-table { overflow-x: auto; margin: 1.25em 0; }
.reader-copy :is(td, th) { border: 1px solid #d3cbba; padding: .4rem .55rem; vertical-align: top; }
.reader-copy td p:last-child { margin-bottom: 0; }
.reader-verse { line-height: 1.9; }
.reader-facsimile { max-width: 55rem; }
.reader-facsimile figure { padding: .35rem; background: #fff; border: 1px solid #ded5c6; }
.reader-facsimile img { width: 100%; }
.reader-facsimile .reader-note { color: var(--muted); font: .9rem/1.5 system-ui, sans-serif; }
.reader-footnotes { margin-top: 2rem; border-top: 1px solid #d3cbba; font-size: .9em; }
.reader-footnotes h2 { font-size: 1.15em; }
.reader-footer { border-top: 1px solid #ded5c6; border-bottom: 0; }
.reader-folio { max-width: 64rem; }
.reader-folio .edition-artist + .edition-artist { margin-top: 2rem; }
.reader-folio .edition-artist h3 { margin: 0 0 .75rem; }
.reader-folio .edition-art-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(min(10rem, 100%), 1fr));
    gap: .75rem;
}
.reader-folio .edition-art-grid figure {
    margin: 0; padding: .5rem;
    background: #f4eee1; border: 1px solid #ded5c6; border-radius: .35rem;
}
.reader-folio .edition-art-grid img {
    width: 100%; aspect-ratio: 4 / 5; object-fit: contain;
}
.reader-comic { max-width: 66rem; }
.comic-layout { display: grid; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); }
.comic-rail { position: sticky; top: 1.25rem; align-self: start; }
.comic-intro { font-size: 1.1rem; line-height: 1.55; }
.comic-format { color: var(--muted); font: .85rem/1.6 system-ui, sans-serif; }
.comic-contents { display: grid; gap: .4rem; }
.comic-contents a {
    display: flex; align-items: baseline; gap: .45rem; padding: .55rem .65rem;
    background: var(--edition-tint); border: 1px solid var(--edition-line); border-radius: .35rem;
    color: var(--ink); text-decoration: none; font: 650 .83rem/1.35 system-ui, sans-serif;
}
.comic-contents a span { flex-shrink: 0; white-space: nowrap; }
.comic-contents a:hover { text-decoration: underline; }
.comic-contents a span, .comic-number { color: var(--edition-ink); font-variant-numeric: tabular-nums; font-weight: 750; }
.comic-act { scroll-margin-top: 1rem; }
.comic-act + .comic-act { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--edition-line); }
.comic-act .reader-kicker { margin: 0 0 .35rem; }
.comic-act h2 { margin: 0 0 .5rem; font-size: clamp(1.55rem, 4vw, 2.35rem); }
.comic-lead { max-width: 54ch; color: var(--muted); line-height: 1.6; }
.comic-panel a { display: block; cursor: zoom-in; }
.comic-panel img { width: 100%; border: 1px solid var(--edition-line); border-radius: .35rem; }
.comic-panel figcaption { margin-top: .45rem; }
.comic-number { margin-right: .4rem; }
.comic-extras { margin-top: 2rem; border-top: 1px solid var(--edition-line); padding-top: 1rem; }
.comic-extras summary { cursor: pointer; color: var(--edition-ink); font: 700 .95rem/1.4 system-ui, sans-serif; }
.comic-extras summary:focus-visible { outline: 3px solid #a65810; outline-offset: 4px; }
@media (max-width: 740px) {
    .comic-layout { grid-template-columns: minmax(0, 1fr); }
    .comic-rail { position: static; }
    .comic-rail p { margin-bottom: .65rem; }
    .comic-contents { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .reader-comic { padding-inline: .85rem; }
}
.comic-viewer {
    width: min(96vw, 75rem); max-width: none; max-height: 94vh;
    padding: 0; border: 1px solid var(--edition-line); border-radius: .45rem;
    background: var(--paper); color: var(--ink);
}
.comic-viewer::backdrop { background: #0d2338e0; }
.comic-viewer-bar {
    display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .65rem;
    padding: .6rem .75rem; font: 650 .85rem/1.4 system-ui, sans-serif;
}
.comic-viewer-title { flex: 1 1 12rem; }
.comic-viewer-bar button {
    padding: .35rem .65rem; border: 1px solid var(--edition-line); border-radius: .25rem;
    background: var(--edition-tint); color: var(--ink); font: inherit; cursor: pointer;
}
.comic-viewer-bar button[aria-pressed="true"] { background: var(--edition-ink); color: #fff; }
.comic-viewer-bar button:focus-visible { outline: 3px solid #a65810; outline-offset: 2px; }
.comic-viewer-frame { max-height: 78vh; overflow: auto; background: #0d2338; }
.comic-viewer-frame img { max-width: 100%; max-height: 78vh; margin: auto; }
.comic-actual-size img { max-width: none; max-height: none; }

.reader-folio :is(section, figure)[id], .reader-copy figure[id^="photo-"] { scroll-margin-top: 1rem; }
.reader-folio figure:target, .reader-copy figure[id^="photo-"]:target { outline: 2px solid var(--edition-ink); outline-offset: 3px; }

.reader-credit-role { display: block; color: var(--muted); font-size: .75rem; font-weight: 600; }
.reader-folio [data-kind="photos"] img { aspect-ratio: auto; max-height: 21rem; }
