/* Library, thank-you and privacy pages (on top of site.css) */
.page{min-height:100vh;min-height:100dvh;display:grid;grid-template-rows:auto 1fr auto}
.top.solid{background:color-mix(in srgb,var(--bg) 90%,transparent);box-shadow:0 1px 0 var(--line)}
.top .spacer{flex:1}
.page main{padding-block:clamp(2rem,6vw,4.5rem)}
.page h1{font-size:clamp(2rem,5vw,3.2rem)}
.page .lede{max-width:60ch}
.page .stack{display:grid;gap:1.2rem;align-content:start}
.card{background:var(--card);border:1px solid var(--line);border-radius:24px;padding:clamp(1.2rem,4vw,2.2rem);display:grid;gap:1rem}
.narrow{max-width:640px}
.mini-foot{padding-block:2rem calc(2rem + env(safe-area-inset-bottom,0px));font-size:.8rem;color:var(--ink-2);border-top:1px solid var(--line)}
.mini-foot .wrap{display:flex;gap:1rem;flex-wrap:wrap;justify-content:space-between}
.mini-foot a{color:inherit}

/* the shelf of owned books */
.shelf-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(180px,100%),1fr));gap:1.6rem}
.owned{display:grid;gap:.7rem;text-align:left;background:none;border:0;padding:0;cursor:pointer;color:inherit}
.owned .bookbox{position:relative;aspect-ratio:3/4.1;border-radius:3px 12px 12px 3px;box-shadow:var(--shadow);transition:transform .5s cubic-bezier(.2,.7,.2,1)}
.owned:hover .bookbox,.owned:focus-visible .bookbox{transform:translateY(-6px) rotate(-1deg)}
.owned[disabled]{cursor:default}
.owned[disabled] .bookbox{filter:saturate(.4) opacity(.7)}
.owned b{font-weight:500}
.owned span{font-size:.82rem;color:var(--ink-2)}

/* the reader */
.reader-wrap{display:grid;grid-template-columns:minmax(200px,260px) minmax(0,1fr);gap:clamp(1.2rem,4vw,3rem);align-items:start}
.toc-side{position:sticky;top:88px;display:grid;gap:.9rem}
.toc-side ol{list-style:none;margin:0;padding:0;display:grid;gap:.15rem}
.toc-side button{width:100%;text-align:left;background:none;border:0;border-left:2px solid var(--line);padding:.45rem .8rem;cursor:pointer;color:var(--ink-2);font-size:.88rem;line-height:1.4}
.toc-side button[aria-current="true"]{border-left-color:var(--rasp);color:var(--ink);font-weight:500}
.chapter{scroll-margin-top:90px;background:#FFFDFB;color:#2A1720;border-radius:20px;padding:clamp(1.4rem,5vw,3.4rem);box-shadow:0 20px 50px -30px rgba(74,20,44,.35);font-size:var(--rfs,1.05rem);line-height:1.8;max-width:72ch}
.chapter h2{font-size:clamp(1.7rem,4vw,2.4rem);color:#6B2341;margin-bottom:1rem}
.chapter h3{font-family:var(--f-body);font-size:.76rem;letter-spacing:.24em;text-transform:uppercase;font-weight:500;color:#C2375F;margin:1.8rem 0 .5rem}
.chapter h4{font-size:1.1rem;margin:1.4rem 0 .4rem}
.chapter p{margin:.7rem 0}
.chapter em{font-family:var(--f-voice);font-size:1.15em;color:#6E5A64}
.chapter blockquote{margin:1rem 0;padding:.8rem 1.1rem;border-radius:12px;background:#F7EEF2;font-size:.9rem;color:#6E5A64}
.chapter blockquote p{margin:0}
.chapter ul,.chapter ol{padding-left:1.3rem;margin:.5rem 0}
.chapter li{margin:.3rem 0}
.chapter li::marker{color:#C2375F}
.rnav2{display:flex;justify-content:space-between;gap:1rem;flex-wrap:wrap;margin-top:1.4rem;max-width:72ch}
.tools{display:flex;gap:.6rem;flex-wrap:wrap;align-items:center}
.tools .copy-btn{font-size:.85rem;padding:.3em .9em}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]) .chapter{background:#241A1F;color:#F1E6EA}
  :root:not([data-theme="light"]) .chapter h2{color:#F2C3D4}
  :root:not([data-theme="light"]) .chapter blockquote{background:#2F2329;color:#CDB9C2}
  :root:not([data-theme="light"]) .chapter em{color:#D9C6CE}}
:root[data-theme="dark"] .chapter{background:#241A1F;color:#F1E6EA}
:root[data-theme="dark"] .chapter h2{color:#F2C3D4}
:root[data-theme="dark"] .chapter blockquote{background:#2F2329;color:#CDB9C2}
:root[data-theme="dark"] .chapter em{color:#D9C6CE}
@media (max-width:820px){
  .reader-wrap{grid-template-columns:1fr}
  .toc-side{position:static}
  .toc-side ol{display:flex;overflow-x:auto;gap:.4rem;padding-bottom:.3rem}
  .toc-side li{flex:none}
  .toc-side button{border-left:0;border:1px solid var(--line);border-radius:999px;white-space:nowrap;padding:.4rem .9rem}
  .toc-side button[aria-current="true"]{border-color:var(--rasp)}
}

/* thank-you */
.spinner{width:42px;height:42px;border-radius:50%;border:3px solid var(--line);border-top-color:var(--rasp);animation:spin 1s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion: reduce){.spinner{animation-duration:3s}}
.lines-list{display:grid;gap:.35rem;font-size:.92rem}
.lines-list div{display:flex;justify-content:space-between;gap:1rem}
.prose h2{font-size:1.5rem;margin-top:2rem}
.prose p,.prose li{max-width:70ch}
