@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:wght@400;500;600&family=Archivo:wght@400;500;600&display=swap');
*{box-sizing:border-box}body{--paper:#fbf9f0;--ink:#33291d;--edge:#ddd2b4;margin:0;background:var(--paper);color:var(--ink);font-family:Archivo,system-ui,sans-serif}body[data-theme=light]{--paper:#f4f3ef;--ink:#2f2e2b;--edge:#d5d3cd}body[data-theme=dark]{--paper:#1a1917;--ink:#c4c2b8;--edge:#3a3935}body[data-theme=beige],body[data-theme=sepia]{--paper:#fbf9f0;--ink:#33291d;--edge:#ddd2b4}button,select,a{color:inherit}button,select{font:inherit;background:transparent;border:1px solid var(--edge);border-radius:8px;padding:9px 13px;cursor:pointer}button:hover,a:hover{opacity:.7}button:disabled{opacity:.25;cursor:default}button:focus-visible,a:focus-visible,select:focus-visible{outline:2px solid currentColor;outline-offset:4px}a{text-decoration:none}header{height:68px;display:flex;align-items:center;justify-content:space-between;gap:20px;padding:0 30px;border-bottom:1px solid var(--edge);font-size:13px}header .book-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;opacity:.65;max-width:48vw}header nav{display:flex;gap:8px}.reading-shell{max-width:760px;margin:0 auto;padding:38px 44px 20px}.viewport{height:calc(100dvh - 195px);min-height:180px;overflow:hidden;overscroll-behavior:none}.prose{height:100%;column-gap:48px;column-fill:auto;font-family:'Source Serif 4',Georgia,serif;font-size:20px;line-height:1.7;overflow-wrap:break-word}.prose p{margin:0 0 1em;orphans:3;widows:3}.prose h1{font-size:1.9em;font-weight:500;text-align:center;line-height:1.2;margin:1.2em 0}.prose h2{font-size:1.4em;font-weight:500;line-height:1.3;break-after:avoid;margin:1em 0}.prose h3{font-size:1.1em;break-after:avoid}.prose blockquote{margin:1em 0;padding-left:1em;border-left:2px solid var(--edge)}.prose hr{border:0;border-top:1px solid var(--edge);width:30%;margin:2em auto}footer{height:62px;display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:12px}.location{text-align:center;opacity:.7;line-height:1.8}progress{width:100%;height:2px;display:block;accent-color:var(--ink)}dialog{color:var(--ink);background:var(--paper);border:1px solid var(--edge);border-radius:16px;padding:26px;max-width:min(480px,92vw);width:100%;max-height:85dvh;overflow:auto;box-shadow:0 20px 90px #0003}dialog::backdrop{background:#0005}dialog h2{font-family:'Source Serif 4',Georgia,serif;font-weight:500;margin:0 0 22px}dialog label{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:20px 0}dialog .close{float:right}dialog p,dialog summary{font-size:14px;line-height:1.6}#contents-list{display:grid;gap:8px;clear:both}#contents-list button{text-align:left;border:0;border-bottom:1px solid var(--edge);border-radius:0;padding:14px 0}dialog a{display:inline-block;text-decoration:underline;margin:12px 0}.draft-label{font-size:11px;opacity:.65}.empty{padding:40px;text-align:center}#reader-hint{font-size:11px;opacity:.55;text-align:center;margin:4px 0}body.focus header{visibility:hidden}body.focus{cursor:default}@media(max-width:600px){header{padding:0 14px;gap:8px;height:58px}header nav{gap:5px}header button{padding:8px}.book-title{display:none}.reading-shell{padding:24px 24px 10px}.viewport{height:calc(100dvh - 165px)}.prose{font-size:19px}footer{height:55px}#reader-hint{display:none}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}

/* Kindle-soft page colors: light/dark ease glare; beige matches site cream. */
body,body[data-theme=beige],body[data-theme=sepia]{--surround:#d7cdaf;--paper:#fbf9f0;--ink:#33291d;--edge:#ddd2b4;--sheet-edge:#c9b888;--sheet-shadow:0 3px 8px #55463108,0 18px 50px #55463112;background:var(--surround)}
body[data-theme=light]{--surround:#e4e2dc;--paper:#f4f3ef;--ink:#2f2e2b;--edge:#d5d3cd;--sheet-edge:#c9c7c1;--sheet-shadow:0 3px 8px #18233006,0 18px 50px #18233010}
body[data-theme=dark]{--surround:#0f0f0e;--paper:#1a1917;--ink:#c4c2b8;--edge:#3a3935;--sheet-edge:#2c2b28;--sheet-shadow:0 4px 24px #0005}
header{background:var(--surround);border-bottom-color:var(--sheet-edge)}
.reading-shell{position:relative;background:var(--paper);border:1px solid var(--sheet-edge);border-radius:4px;box-shadow:var(--sheet-shadow);margin:20px auto 0;padding-top:32px;padding-bottom:16px}
.viewport{height:calc(100dvh - 230px)}
footer{border-top:1px solid var(--edge);margin-top:12px}
#reader-hint{margin-top:8px}
@media(max-width:800px){.reading-shell{margin-left:16px;margin-right:16px}}
@media(max-width:600px){.reading-shell{margin:12px 10px 0;padding:22px 20px 12px;border-radius:3px}.viewport{height:calc(100dvh - 198px)}footer{margin-top:10px}}

/* Optional facing pages; narrow screens retain one comfortable column. */
body[data-layout=spread] .reading-shell{max-width:1180px}
body[data-layout=spread] .viewport{position:relative}
body[data-layout=spread] .viewport::after{content:"";position:absolute;left:50%;top:0;bottom:0;border-left:1px solid var(--edge);pointer-events:none}
@media(max-width:899px){#layout-toggle{display:none}}
header .book-title{min-width:0;flex:1}header nav{flex-shrink:0}
body[data-layout=spread] .viewport::after{display:none}
body[data-layout=spread] .reading-shell::after{content:"";position:absolute;left:50%;top:32px;bottom:118px;border-left:1px solid var(--edge);pointer-events:none}

/* Hide the stationary gutter while the spread slides across it. */
body[data-layout=spread] .reading-shell::after{opacity:1;transition:opacity 120ms ease}
body[data-layout=spread].page-turning .reading-shell::after{opacity:0;transition:none}

/* Quiet spread changes and larger edge controls, outside the prose. */
body[data-layout=spread].page-turning .reading-shell::after{opacity:1;transition:none}
.reading-shell{padding-left:54px;padding-right:54px}
#previous,#next{position:absolute;top:20%;bottom:20%;width:44px;height:auto;border:0;border-radius:0;z-index:2;opacity:.35;font-size:24px;padding:0}
#previous{left:0}#next{right:0}
#previous:hover,#next:hover,#previous:focus-visible,#next:focus-visible{opacity:1;background:color-mix(in srgb,var(--ink) 4%,transparent)}
#previous:disabled,#next:disabled{opacity:.1;background:none}
footer{justify-content:center}
.prose{font-size:15px;line-height:1.5}
@media(max-width:600px){.reading-shell{padding-left:34px;padding-right:34px}#previous,#next{width:28px;font-size:20px}.prose{font-size:15px}}
