/* Shared design system: tokens, type, buttons, header, footer, and the generated book/series pages. */
:root {
  --bg: #14110e;
  --surface: #1e1a16;
  --surface-2: #26211c;
  --text: #f1e8da;
  --muted: #a99c89;
  --accent: #f2a93b;
  --accent-2: #7fa6c4;
  --line: #342e27;
  --font: "Manrope", system-ui, sans-serif;
  --font-head: "Fraunces", Georgia, serif;
  --tshadow: 0 1px 2px rgba(10, 8, 5, .9), 0 3px 12px rgba(10, 8, 5, .7), 0 10px 44px rgba(10, 8, 5, .7);
  --gutter: clamp(16px, 6vw, 96px);
  --radius: 4px;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--text); overflow-x: clip; }
body { font: 400 17px/1.65 var(--font); }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 500; line-height: 1.08; letter-spacing: -0.01em; margin: 0 0 .5em; font-optical-sizing: auto; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 5.2vw, 4.6rem); }
h2 { font-size: clamp(2rem, 3.8vw, 3.3rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; text-wrap: pretty; }
.lede { font-size: clamp(1.08rem, 1.4vw, 1.25rem); color: var(--text); max-width: 40rem; }
.kicker { font-size: .9rem; font-weight: 600; color: var(--accent); margin-bottom: .6em; }
.kicker a { text-decoration: none; }
.subtitle { color: var(--muted); font-size: 1.1rem; margin-top: -.3em; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--accent); color: var(--bg); padding: 8px 14px; }
.skip:focus { left: 8px; }

/* buttons: square-shouldered, never pills */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 46px; padding: 0 22px; border-radius: var(--radius);
  background: var(--accent); color: #1a1208; font: 600 .98rem/1 var(--font); text-decoration: none; border: 1px solid var(--accent); cursor: pointer;
  transition: background .2s, color .2s, transform .2s; }
.btn:hover { background: #ffc061; color: #1a1208; transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--text); border-color: color-mix(in srgb, var(--text) 35%, transparent); }
.btn--ghost:hover { background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text); border-color: var(--text); }
.btn--small { min-height: 40px; padding: 0 16px; font-size: .9rem; }
.link { color: var(--accent); font-weight: 600; text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); padding-bottom: 2px; }
.link:hover { border-color: var(--accent); }
.buy { display: flex; flex-wrap: wrap; gap: 10px; margin: 1.2em 0; }
.buy--compact .btn { min-height: 38px; padding: 0 14px; font-size: .88rem; }

/* header */
.site-head { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 24px; padding: 14px var(--gutter);
  background: color-mix(in srgb, var(--bg) 88%, transparent); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); margin-right: auto; }
.brand .mark { width: 34px; height: 34px; color: var(--accent); flex: none; }
.brand span { display: flex; flex-direction: column; line-height: 1.05; }
.brand b { font: 600 1.15rem var(--font-head); letter-spacing: .005em; }
.brand small { font-size: .74rem; color: var(--muted); letter-spacing: .04em; }
.site-head nav { display: flex; gap: 22px; font-size: .95rem; }
.site-head nav a { text-decoration: none; color: var(--muted); }
.site-head nav a:hover { color: var(--text); }
@media (max-width: 900px) { .site-head nav { display: none; } .site-head { gap: 12px; } }
@media (max-width: 480px) { .site-head { gap: 8px; padding-inline: 16px; } .brand { gap: 7px; min-width: 0; } .brand b { font-size: .9rem; } .brand .mark { width: 24px; height: 24px; } .site-head .btn { white-space: nowrap; padding: 0 11px; font-size: .82rem; min-height: 38px; } }

/* footer */
.site-foot { background: var(--bg); border-top: 1px solid var(--line); padding: 72px var(--gutter) 40px; position: relative; z-index: 10; }
.foot-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 48px; }
.foot-grid h2 { font: 600 .95rem var(--font); color: var(--muted); margin: 0 0 .8em; }
.foot-grid ul { list-style: none; margin: 0 0 1.6em; padding: 0; display: grid; gap: 6px; }
.foot-grid a { text-decoration: none; }
.foot-grid p { color: var(--muted); max-width: 26rem; margin-top: 1em; }
.fine { color: var(--muted); font-size: .85rem; margin-top: 48px; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr; gap: 24px; } }

/* covers */
.cover, .mini-shelf img, .reading-order img { border-radius: 2px 4px 4px 2px; box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 14px 30px -10px rgba(0,0,0,.8), 0 2px 6px rgba(0,0,0,.5); background: var(--surface); }
.tilt { perspective: 900px; }
.tilt > img { transition: transform .4s ease; transform: rotateY(-8deg) rotateX(2deg); transform-origin: left center; }
.tilt:hover > img { transform: rotateY(0) rotateX(0); }

/* generated pages */
body.sub main { padding: 40px var(--gutter) 96px; max-width: 1240px; margin: 0 auto; }
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: 32px; }
.crumbs a { color: var(--muted); }
.book__grid { display: grid; grid-template-columns: minmax(220px, 360px) 1fr; gap: clamp(28px, 5vw, 72px); align-items: start; }
.book__cover { position: sticky; top: 100px; }
.book__info h1 { font-size: clamp(2.2rem, 4.4vw, 3.6rem); margin-bottom: .2em; }
.byline { color: var(--muted); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 24px; margin: 1.5em 0 2em; padding: 18px 0; border-block: 1px solid var(--line); }
.facts dt { font-size: .82rem; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.prose { max-width: 40rem; font-size: 1.06rem; }
.series-nav { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 2em; padding-top: 1.2em; border-top: 1px solid var(--line); }
.more { margin-top: 80px; }
.more h2 { font-size: 1.8rem; }
.mini-shelf { list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 28px 20px; }
.mini-shelf a { text-decoration: none; display: grid; gap: 10px; font-size: .92rem; line-height: 1.3; }
.mini-shelf small { display: block; color: var(--muted); margin-top: 3px; }
.mini-shelf img { aspect-ratio: 2 / 3; object-fit: cover; width: 100%; transition: transform .25s; }
.mini-shelf a:hover img { transform: translateY(-4px); }
.series-page h1 { max-width: 18ch; }
.reading-order { list-style: none; padding: 0; margin: 40px 0 0; display: grid; gap: 40px; counter-reset: ro; }
.reading-order li { display: grid; grid-template-columns: 120px 1fr; gap: 28px; padding-bottom: 40px; border-bottom: 1px solid var(--line); }
.reading-order h2 { font-size: 1.6rem; margin-bottom: .2em; }
.reading-order h2 a { text-decoration: none; }
.shelf-list { margin-top: 64px; }
.shelf-list > p { color: var(--muted); }
@media (max-width: 700px) {
  .book__grid { grid-template-columns: 1fr; }
  .book__cover { position: static; max-width: 240px; }
  .reading-order li { grid-template-columns: 84px 1fr; gap: 16px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* blog posts */
.post { max-width: 46rem; }
.post h1 { font-size: clamp(2.2rem, 4.4vw, 3.4rem); }
.post .prose h2, .post .prose h3 { margin-top: 1.6em; font-size: 1.6rem; }
.post .prose ul { padding-left: 1.2em; }
.post .prose li { margin: .4em 0; }

/* audiobook download page (download.php) */
.download { display: grid; grid-template-columns: 220px 1fr; gap: clamp(24px, 4vw, 56px); align-items: start; }
.download img { width: 100%; height: auto; border-radius: 4px; box-shadow: 0 18px 40px rgba(0,0,0,.45); }
.download .btn { margin-right: .8em; }
.download p { margin-bottom: 1em; }
@media (max-width: 640px) { .download { grid-template-columns: 1fr; } .download img { max-width: 180px; } }
