/* TomeTrellis — print-publisher look. Serif for reading, Inter for UI. */

:root {
  --paper: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #f3f1ec;
  --ink: #141210;
  --ink-2: #4a4542;
  --ink-3: #8a847d;
  --line: #e4e0d8;
  --line-2: #c9c3b9;
  --accent: #b23a1f;
  --accent-ink: #8d2d17;
  --accent-bg: #fbeee9;
  --ok: #2f6b43; --ok-bg: #e9f2ec;
  --warn: #7a5a0f; --warn-bg: #f8f0d8;
  --bad: #9b2f2f; --bad-bg: #f9e6e6;
  --r: 3px;
  --r-sm: 2px;
  --shadow: 0 1px 0 rgba(20,18,16,.06), 0 12px 32px -20px rgba(20,18,16,.35);
  --serif: "Newsreader", "Iowan Old Style", "Charter", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --max: 1080px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #151311; --surface: #1c1917; --surface-2: #252220; --ink: #efeae2; --ink-2: #bdb5ab; --ink-3: #847c74;
    --line: #2f2b27; --line-2: #4a443e; --accent: #e07a5f; --accent-ink: #ec9a84; --accent-bg: #3a241d;
    --ok: #8fc49d; --ok-bg: #1d2a21; --warn: #e2b55e; --warn-bg: #352c15; --bad: #ee8f8f; --bad-bg: #3a2222;
    --shadow: 0 1px 0 rgba(0,0,0,.4), 0 12px 32px -20px rgba(0,0,0,.8); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #151311; --surface: #1c1917; --surface-2: #252220; --ink: #efeae2; --ink-2: #bdb5ab; --ink-3: #847c74;
  --line: #2f2b27; --line-2: #4a443e; --accent: #e07a5f; --accent-ink: #ec9a84; --accent-bg: #3a241d;
  --ok: #8fc49d; --ok-bg: #1d2a21; --warn: #e2b55e; --warn-bg: #352c15; --bad: #ee8f8f; --bad-bg: #3a2222; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--serif); font-size: 18px; line-height: 1.55; -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.08; letter-spacing: -0.02em; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(2.4rem, 5.4vw, 4.2rem); }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); }
h3 { font-size: 1.35rem; }
h4 { font-family: var(--sans); font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 .6rem; }
p { margin: 0 0 1em; }
a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
a:hover { text-decoration-color: var(--accent); color: var(--accent-ink); }
small, .muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.sans { font-family: var(--sans); }
.lead { font-size: 1.25rem; line-height: 1.5; color: var(--ink-2); max-width: 54ch; }
.kicker, .eyebrow { font-family: var(--sans); font-size: .74rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 .9rem; display: block; }
.eyebrow { color: var(--accent); }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }
section { padding: 4.5rem 0; }
.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }
.ui { font-family: var(--sans); font-size: .92rem; }

/* header */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 94%, transparent); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; gap: 2rem; min-height: 60px; }
.brand { font-family: var(--serif); font-weight: 600; font-size: 1.3rem; color: var(--ink); text-decoration: none; letter-spacing: -.01em; display: inline-flex; align-items: center; gap: .5rem; }
.brand svg { display: none; }
.nav { display: flex; gap: 1.1rem; margin-left: auto; align-items: center; font-family: var(--sans); font-size: .9rem; }
.nav a { text-decoration: none; color: var(--ink-2); font-weight: 500; padding: .3rem 0; border-bottom: 1px solid transparent; }
.nav a:hover { color: var(--ink); border-bottom-color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.nav .hello { color: var(--ink-3); }
.nav .btn { border-bottom: 0; }
@media (max-width: 720px) {
  .topbar .wrap { flex-wrap: wrap; gap: .5rem; padding-top: .5rem; }
  .nav { flex: 1 0 100%; margin-left: 0; overflow-x: auto; padding-bottom: .5rem; gap: .9rem; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex: none; }
  .nav .hello, .nav .hide-sm { display: none; }
}

/* buttons */
.btn { font-family: var(--sans); display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .7rem 1.1rem; border-radius: var(--r); border: 1px solid var(--ink); font-weight: 600; font-size: .9rem; line-height: 1.1; cursor: pointer; text-decoration: none; background: transparent; color: var(--ink); transition: background .12s, color .12s, border-color .12s; white-space: nowrap; }
.btn:hover:not(:disabled) { background: var(--ink); color: var(--paper); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-ghost { border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); border-color: var(--ink); }
.btn-soft { border-color: transparent; background: var(--surface-2); }
.btn-soft:hover:not(:disabled) { background: var(--line); color: var(--ink); }
.btn-dark { background: var(--ink); color: var(--paper); }
.btn-dark:hover:not(:disabled) { background: #000; color: #fff; }
.btn-paypal { background: #ffc439; border-color: #ffc439; color: #111; }
.btn-paypal:hover:not(:disabled) { background: #f0b52d; border-color: #f0b52d; color: #111; }
.btn-sm { padding: .45rem .75rem; font-size: .82rem; }
.btn-lg { padding: .9rem 1.4rem; font-size: .98rem; }
.btn .spin { display: none; }
.btn.is-busy .spin { display: inline-block; }
.spin { width: 1em; height: 1em; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn svg { width: 1.05em; height: 1.05em; }
.textlink { font-family: var(--sans); font-weight: 600; font-size: .92rem; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--ink); padding-bottom: .1rem; }
.textlink:hover { color: var(--accent-ink); border-color: var(--accent); }

/* cards and layout */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 1.6rem; }
.card + .card { margin-top: 1.25rem; }
.card-soft { background: var(--surface-2); border-color: transparent; }
.card-accent { border-color: var(--ink); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.card h2, .card h3 { margin-top: 0; }
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.split { display: grid; gap: 2.5rem; grid-template-columns: minmax(0, 1.6fr) minmax(240px, .7fr); align-items: start; }
@media (max-width: 880px) { .split { grid-template-columns: 1fr; } }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.between { justify-content: space-between; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }

/* forms */
.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1.1rem; font-family: var(--sans); }
.field label { font-weight: 600; font-size: .88rem; }
.field .hint { font-size: .82rem; color: var(--ink-3); margin: 0; }
.field .err { font-size: .82rem; color: var(--bad); margin: 0; font-weight: 600; display: none; }
.field.has-error .err { display: block; }
.field.has-error input, .field.has-error textarea { border-color: var(--bad); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], textarea, select {
  width: 100%; font: inherit; font-family: var(--sans); font-size: .95rem; padding: .65rem .75rem; border-radius: var(--r-sm); border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink);
}
textarea { min-height: 92px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 2px color-mix(in srgb, var(--ink) 12%, transparent); }
.choices { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.choice { display: flex; gap: .75rem; align-items: flex-start; padding: .85rem .95rem; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); cursor: pointer; font-family: var(--sans); font-size: .92rem; }
.choice:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.choice:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.choice input { margin-top: .3rem; accent-color: var(--ink); }
.choice strong { display: block; font-weight: 600; }
.choice .sub { font-size: .84rem; color: var(--ink-2); display: block; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { font-family: var(--sans); border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--r-sm); padding: .28rem .65rem; font-size: .82rem; font-weight: 500; color: var(--ink-2); cursor: pointer; }
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* notices, pills */
.notice { display: flex; gap: .7rem; align-items: flex-start; padding: .8rem .95rem; border-radius: var(--r-sm); border: 1px solid var(--line); border-left: 3px solid var(--ink-3); background: var(--surface); font-family: var(--sans); font-size: .9rem; line-height: 1.5; }
.notice p { margin: 0; }
.notice .ico { flex: none; width: 16px; height: 16px; margin-top: .2rem; color: var(--ink-2); }
.notice-good { border-left-color: var(--ok); } .notice-good .ico { color: var(--ok); }
.notice-warn { border-left-color: var(--warn); } .notice-warn .ico { color: var(--warn); }
.notice-bad { border-left-color: var(--bad); } .notice-bad .ico { color: var(--bad); }
.notice-info { border-left-color: var(--accent); } .notice-info .ico { color: var(--accent); }
.pill { font-family: var(--sans); display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .5rem; border-radius: var(--r-sm); font-size: .72rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; background: transparent; color: var(--ink-2); border: 1px solid var(--line-2); }
.pill-good { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 50%, transparent); }
.pill-warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 50%, transparent); }
.pill-accent { color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }

/* stepper */
.stepper { display: flex; margin: 0 0 1.75rem; padding: 0; list-style: none; counter-reset: step; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-family: var(--sans); }
.stepper li { flex: 1; position: relative; padding: .8rem .5rem .8rem 2.1rem; font-weight: 500; font-size: .85rem; color: var(--ink-3); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stepper li::before { counter-increment: step; content: counter(step, decimal-leading-zero); position: absolute; left: .4rem; top: 50%; transform: translateY(-50%); font-size: .72rem; font-weight: 600; letter-spacing: .05em; color: var(--ink-3); }
.stepper li.is-done { color: var(--ink-2); }
.stepper li.is-done::before { content: "\2713"; color: var(--ok); }
.stepper li.is-now { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); }
.stepper li.is-now::before { color: var(--ink); }
@media (max-width: 640px) { .stepper { flex-wrap: wrap; } .stepper li { flex: 1 0 50%; } }

/* progress, lists */
.bar { height: 4px; background: var(--surface-2); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--ink); transition: width .4s ease; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: .9rem 0; border-top: 1px solid var(--line); display: flex; gap: 1rem; align-items: flex-start; }
.list li:first-child { border-top: 0; padding-top: 0; }
.num { flex: none; width: 1.7rem; height: 1.7rem; display: grid; place-items: center; border: 1px solid var(--line-2); color: var(--ink-2); font-family: var(--sans); font-weight: 600; font-size: .75rem; }
.num.is-done { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.num.is-locked { color: var(--ink-3); border-style: dashed; }
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { position: relative; padding-left: 1.3rem; margin: .4rem 0; }
.check-list li::before { content: "—"; position: absolute; left: 0; top: 0; color: var(--ink-3); }
dl.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .9rem 1.2rem; margin: 0; font-family: var(--sans); }
dl.facts dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; color: var(--ink-3); }
dl.facts dd { margin: .15rem 0 0; font-weight: 500; font-size: .95rem; white-space: pre-wrap; }
table.plain { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: .9rem; }
table.plain th, table.plain td { text-align: left; padding: .7rem .5rem; border-top: 1px solid var(--line); vertical-align: top; }
table.plain th { color: var(--ink-3); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; border-top: 0; }

/* prose (reader) */
.prose { font-size: 1.12rem; line-height: 1.7; max-width: 66ch; }
.prose h2 { font-size: 1.6rem; margin: 2rem 0 .6rem; }
.prose h3 { font-size: 1.25rem; margin: 1.6rem 0 .4rem; }
.prose p { margin: 0 0 1.1em; }
.prose ul, .prose ol { padding-left: 1.4rem; margin: 0 0 1.1em; }
.prose li { margin: .3em 0; }
.prose blockquote { margin: 1.2rem 0; padding: .2rem 0 .2rem 1rem; border-left: 2px solid var(--ink); color: var(--ink-2); font-style: italic; }
.prose code { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--surface-2); padding: .1em .35em; border-radius: 3px; font-size: .88em; }
.prose pre { background: var(--surface-2); padding: 1rem; overflow: auto; }
.prose pre code { background: none; padding: 0; }
mark.verify, .prose mark.verify { background: none; color: var(--accent-ink); border-bottom: 1px dotted var(--accent); font-family: var(--sans); font-weight: 600; font-size: .72em; letter-spacing: .06em; text-transform: uppercase; padding: 0 .15em; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }

/* landing: hero */
.hero { padding: 5rem 0 3.5rem; }
.hero h1 { max-width: 20ch; }
.hero .lead { margin-top: 1.25rem; }
.hero .actions { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; margin-top: 2rem; }
.hero .meta { font-family: var(--sans); font-size: .85rem; color: var(--ink-3); margin-top: 2.5rem; display: flex; gap: 2rem; flex-wrap: wrap; }

/* landing: book spread */
.spread-wrap { padding: 0 0 4.5rem; }
.spread { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); position: relative; }
.spread::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: linear-gradient(to right, rgba(0,0,0,.08), rgba(0,0,0,0)); }
.page { padding: 3rem 3rem 2.5rem; font-size: 1rem; line-height: 1.62; min-height: 520px; display: flex; flex-direction: column; }
.page .running { font-family: var(--sans); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); display: flex; justify-content: space-between; margin-bottom: 2rem; }
.page .chapter-no { font-family: var(--sans); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: .8rem; }
.page h3 { font-size: 1.9rem; font-weight: 500; line-height: 1.1; margin-bottom: 1.4rem; letter-spacing: -.02em; }
.page p { margin: 0 0 .9em; color: var(--ink); }
.page p.dropcap::first-letter { float: left; font-size: 3.6rem; line-height: .85; padding: .1em .12em 0 0; font-weight: 500; }
.page .folio { margin-top: auto; padding-top: 1.5rem; font-family: var(--sans); font-size: .72rem; color: var(--ink-3); display: flex; justify-content: space-between; }
.page ul { padding-left: 1.2rem; margin: 0 0 .9em; }
.page li { margin: .25em 0; }
.page .side { font-family: var(--sans); font-size: .78rem; color: var(--ink-2); border-top: 1px solid var(--line); padding-top: .6rem; margin-top: 1rem; }
@media (max-width: 760px) { .spread { grid-template-columns: 1fr; } .spread::before { display: none; } .page { min-height: 0; padding: 2rem 1.5rem; } .page.right { border-top: 1px solid var(--line); } }
.caption { font-family: var(--sans); font-size: .82rem; color: var(--ink-3); margin-top: .9rem; }

/* landing: shelf of covers */
.shelf { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1.5rem; align-items: start; }
@media (max-width: 900px) { .shelf { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cover { aspect-ratio: 2 / 3; padding: 1rem .95rem; display: flex; flex-direction: column; justify-content: space-between; color: #fff; border-radius: 2px 6px 6px 2px; box-shadow: inset 6px 0 10px -8px rgba(0,0,0,.6), 0 10px 20px -14px rgba(0,0,0,.6); position: relative; }
.cover::after { content: ""; position: absolute; left: 8px; top: 0; bottom: 0; width: 1px; background: rgba(255,255,255,.18); }
.cover .pub { font-family: var(--sans); font-size: .6rem; letter-spacing: .14em; text-transform: uppercase; opacity: .8; }
.cover .t { font-family: var(--serif); font-size: 1.05rem; line-height: 1.15; font-weight: 500; letter-spacing: -.01em; }
.cover .s { font-family: var(--sans); font-size: .66rem; opacity: .85; margin-top: .3rem; }
.cover-cap { font-family: var(--sans); font-size: .78rem; color: var(--ink-2); margin-top: .7rem; line-height: 1.4; }
.c1 { background: #2b4a3e; } .c2 { background: #8d2d17; } .c3 { background: #1f2f4d; } .c4 { background: #5a4a2f; } .c5 { background: #3a3a3a; }

/* landing: numbered rows */
.rows { border-top: 1px solid var(--ink); }
.rows > div { display: grid; grid-template-columns: 80px 1fr 1.6fr; gap: 1.5rem; padding: 1.6rem 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.rows .n { font-family: var(--sans); font-size: .8rem; font-weight: 600; letter-spacing: .1em; color: var(--ink-3); }
.rows h3 { font-size: 1.35rem; margin: 0; }
.rows p { color: var(--ink-2); margin: 0; font-size: 1.02rem; }
@media (max-width: 760px) { .rows > div { grid-template-columns: 50px 1fr; } .rows p { grid-column: 2; } }

/* landing: pricing table */
.pricing { width: 100%; border-collapse: collapse; }
.pricing th { font-family: var(--sans); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); text-align: left; padding: 0 .75rem 1rem 0; border-bottom: 1px solid var(--ink); font-weight: 600; }
.pricing td { padding: 1.4rem .75rem 1.4rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.pricing .name { font-size: 1.35rem; font-weight: 500; }
.pricing .name small { display: block; font-family: var(--sans); font-size: .85rem; color: var(--ink-2); margin-top: .25rem; }
.pricing .amount { font-size: 1.6rem; font-weight: 500; white-space: nowrap; }
.pricing .amount small { font-family: var(--sans); font-size: .78rem; color: var(--ink-3); display: block; }
.pricing .spec { font-family: var(--sans); font-size: .9rem; color: var(--ink-2); line-height: 1.6; }
@media (max-width: 640px) { .pricing thead { display: none; } .pricing td { display: block; padding: .4rem 0; border: 0; } .pricing tr { display: block; padding: 1.2rem 0; border-bottom: 1px solid var(--line); } }

/* faq */
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-size: 1.1rem; font-weight: 500; padding: 1rem 0; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--ink-3); font-family: var(--sans); font-size: 1.1rem; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { color: var(--ink-2); margin: 0 0 1.2rem; max-width: 64ch; }

/* closing band */
.band { border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); padding: 3rem 0; display: flex; justify-content: space-between; align-items: center; gap: 2rem; flex-wrap: wrap; }
.band h2 { margin: 0; }
.band p { margin: .4rem 0 0; color: var(--ink-2); }

/* footer */
footer { border-top: 1px solid var(--line); padding: 2.5rem 0; color: var(--ink-3); font-family: var(--sans); font-size: .82rem; margin-top: 4rem; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: 2fr 1fr 1fr 1fr; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
footer ul { list-style: none; padding: 0; margin: 0; }
footer li { margin: .3rem 0; }
footer a { color: var(--ink-2); text-decoration: none; }
footer a:hover { color: var(--ink); text-decoration: underline; }
.footer-bottom { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* toasts, misc */
#toasts { position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%); display: flex; flex-direction: column; gap: .5rem; z-index: 50; width: min(92vw, 420px); }
.toast { font-family: var(--sans); background: var(--ink); color: var(--paper); padding: .8rem 1rem; border-radius: var(--r-sm); box-shadow: var(--shadow); font-weight: 500; font-size: .9rem; animation: pop .25s ease; }
.toast-good { background: var(--ok); color: #fff; }
.toast-bad { background: var(--bad); color: #fff; }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--ink-2); }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; height: 1em; }
@keyframes shimmer { to { background-position: -200% 0; } }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.reader-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.5rem; flex-wrap: wrap; }
.toc-side { position: sticky; top: 84px; font-family: var(--sans); }
.toc-side a { display: block; padding: .4rem 0; text-decoration: none; color: var(--ink-2); font-size: .88rem; border-bottom: 1px solid var(--line); }
.toc-side a.is-now { color: var(--ink); font-weight: 600; }
.toc-side a:hover { color: var(--ink); }
.pay-options { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.pay-options .btn { width: 100%; padding: .85rem 1rem; }
.secure { display: flex; gap: 1.2rem; flex-wrap: wrap; font-family: var(--sans); font-size: .8rem; color: var(--ink-3); margin-top: .9rem; }
.secure span { display: inline-flex; align-items: center; gap: .35rem; }
.secure svg { width: 13px; height: 13px; }

/* fixes: nav button must not inherit link styling; old footers space their links */
.nav .btn { padding: .45rem .85rem; color: var(--paper); border: 1px solid var(--ink); border-radius: var(--r); }
.nav .btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
footer span > a + a, footer .footer-bottom span a + a { margin-left: 1rem; }
footer span > a { text-decoration: none; }

/* ---------- visuals: photos, annotated spread, stories, artifacts, 3D shelf ---------- */
.hero-grid { display: grid; gap: 3rem; grid-template-columns: minmax(0, 1.05fr) minmax(300px, .95fr); align-items: center; }
@media (max-width: 880px) { .hero-grid { grid-template-columns: 1fr; } }
.hero-photo { margin: 0; }
.hero-photo img { width: 100%; height: 520px; object-fit: cover; display: block; border-radius: var(--r); }
.hero-photo figcaption { font-family: var(--sans); font-size: .8rem; color: var(--ink-3); margin-top: .6rem; }
@media (max-width: 880px) { .hero-photo img { height: 320px; } }

.spread-grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 2.5rem; align-items: start; }
@media (max-width: 980px) { .spread-grid { grid-template-columns: 1fr; } }
.page { position: relative; }
.mark { display: inline-grid; place-items: center; width: 1.25rem; height: 1.25rem; border-radius: 50%; background: var(--accent); color: #fff; font-family: var(--sans); font-size: .68rem; font-weight: 700; vertical-align: middle; margin: 0 .3rem 0 0; position: relative; top: -2px; box-shadow: 0 0 0 3px var(--surface); }
.mark::after { content: attr(data-n); }
.page li .mark, .side .mark { margin-left: .3rem; }
.annotations { position: sticky; top: 84px; }
.annotations ol { list-style: none; margin: 0; padding: 0; }
.annotations li { display: flex; gap: .75rem; align-items: flex-start; padding: .8rem 0; border-top: 1px solid var(--line); font-family: var(--sans); font-size: .88rem; line-height: 1.5; color: var(--ink-2); }
.annotations li b { flex: none; width: 1.25rem; height: 1.25rem; border-radius: 50%; background: var(--accent); color: #fff; font-size: .68rem; display: grid; place-items: center; margin-top: .15rem; }
.annotations li strong { color: var(--ink); display: block; }

.stories { display: grid; gap: 1.5rem; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 2rem; }
@media (max-width: 880px) { .stories { grid-template-columns: 1fr; } }
.story img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; border-radius: var(--r); }
.story blockquote { margin: 1.1rem 0 .9rem; font-size: 1.12rem; line-height: 1.45; font-style: italic; color: var(--ink); }
.story .became { border-top: 1px solid var(--ink); padding-top: .7rem; font-family: var(--sans); font-size: .85rem; color: var(--ink-2); display: grid; gap: .15rem; }
.story .became .kicker { margin: 0; font-size: .68rem; }
.story .became strong { font-family: var(--serif); font-size: 1.2rem; color: var(--ink); font-weight: 500; }

.rows-art > div { grid-template-columns: 60px 180px 1fr; align-items: center; }
@media (max-width: 760px) { .rows-art > div { grid-template-columns: 50px 1fr; } .rows-art .art { display: none; } }
.art { display: flex; justify-content: center; }
.sheet { width: 130px; height: 150px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: 2px 3px 0 var(--line); padding: .8rem .75rem; display: flex; flex-direction: column; gap: .45rem; font-family: var(--sans); font-size: .62rem; color: var(--ink-2); position: relative; }
.sheet i { display: block; height: 5px; background: var(--line); border-radius: 2px; }
.sheet i.w60 { width: 60%; } .sheet i.w80 { width: 80%; }
.sheet-row { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: .25rem; }
.sheet-row b { color: var(--ink); }
.sheet-title { font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink); font-size: .6rem; }
.sheet.plan ol { margin: .2rem 0 0; padding-left: 1rem; display: grid; gap: .35rem; }
.sheet.plan li { height: 5px; background: var(--line); border-radius: 2px; list-style: decimal; color: var(--ink-3); }
.sheet .free { position: absolute; right: -10px; top: -10px; background: var(--accent); color: #fff; font-weight: 700; font-size: .6rem; letter-spacing: .08em; text-transform: uppercase; padding: .25rem .45rem; transform: rotate(6deg); }
.paybtn { border-radius: 2px; text-align: center; font-weight: 600; font-size: .62rem; padding: .35rem; }
.paybtn.dark { background: var(--ink); color: var(--paper); }
.paybtn.pp { background: #ffc439; color: #111; }

.book3d { position: relative; width: 140px; aspect-ratio: 2 / 3; color: #fff; padding: .9rem .85rem .9rem 1.1rem; display: flex; flex-direction: column; gap: .3rem; border-radius: 2px 5px 5px 2px; transform: perspective(900px) rotateY(-22deg); transform-origin: left center; box-shadow: 10px 14px 24px -14px rgba(0,0,0,.65), inset 8px 0 12px -10px rgba(0,0,0,.7), inset -2px 0 2px rgba(255,255,255,.08); transition: transform .35s ease, box-shadow .35s ease; }
.book3d::before { content: ""; position: absolute; left: 7px; top: 0; bottom: 0; width: 1px; background: rgba(255,255,255,.22); }
.book3d::after { content: ""; position: absolute; right: -6px; top: 3px; bottom: 3px; width: 6px; background: repeating-linear-gradient(to bottom, #f4efe6 0 1px, #d9d2c6 1px 2px); transform: skewY(0deg); border-radius: 0 2px 2px 0; }
.book3d:hover { transform: perspective(900px) rotateY(-8deg) translateY(-4px); }
.book3d .pub { font-family: var(--sans); font-size: .55rem; letter-spacing: .14em; text-transform: uppercase; opacity: .8; }
.book3d .t { font-family: var(--serif); font-size: 1rem; line-height: 1.15; font-weight: 500; margin-top: auto; }
.book3d .s { font-family: var(--sans); font-size: .62rem; opacity: .85; }
.book3d.small { width: 96px; padding: .6rem .55rem .6rem .8rem; }
.book3d.small .t { font-size: .75rem; }
.shelf3d { display: flex; gap: 2.2rem; align-items: flex-end; margin-top: 2.5rem; padding: 0 1rem; overflow-x: auto; scrollbar-width: none; }
.shelf3d::-webkit-scrollbar { display: none; }
.shelf3d > div { flex: none; width: 160px; }
.shelf-board { height: 10px; background: linear-gradient(to bottom, #d9cfbf, #bdb09c); border-radius: 2px; box-shadow: 0 10px 18px -10px rgba(0,0,0,.5); margin-top: -1px; }
.cover-cap { font-family: var(--sans); font-size: .78rem; color: var(--ink-2); margin-top: .9rem; line-height: 1.4; }

.rules-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .9fr); gap: 3rem; align-items: center; }
@media (max-width: 880px) { .rules-grid { grid-template-columns: 1fr; } }
.rules-photo { margin: 0; }
.rules-photo img { width: 100%; aspect-ratio: 5 / 4; object-fit: cover; display: block; border-radius: var(--r); }
.rules-photo figcaption { font-family: var(--sans); font-size: .8rem; color: var(--ink-3); margin-top: .6rem; }

.band-photo { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); }
@media (max-width: 760px) { .band-photo { grid-template-columns: 1fr; } }
.band-photo .band-text { padding: 3rem 2.5rem; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: .4rem; }
.band-photo .band-text h2 { margin: 0; }
.band-photo .band-text p { color: var(--ink-2); margin: 0 0 1.2rem; }
.band-photo img { width: 100%; height: 100%; min-height: 320px; object-fit: cover; display: block; }
.page .folio span:first-child, .page .folio span:last-child { flex: none; }
.page .folio { gap: 1.5rem; align-items: baseline; }
.page .folio span:nth-child(2) { text-align: right; }

/* line illustrations instead of photos */
.hero-photo img, .story img, .rules-photo img, .band-photo img { object-fit: contain; background: var(--surface); border: 1px solid var(--line); padding: 1.25rem; }
.hero-photo img { height: 440px; }
.story img { aspect-ratio: 4 / 3; }
.rules-photo img { aspect-ratio: 5 / 4; }
.band-photo img { min-height: 300px; border: 0; border-left: 1px solid var(--line); padding: 2rem; }
@media (max-width: 760px) { .band-photo img { border-left: 0; border-top: 1px solid var(--line); } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero-photo img, :root:not([data-theme="light"]) .story img, :root:not([data-theme="light"]) .rules-photo img, :root:not([data-theme="light"]) .band-photo img { filter: invert(1) hue-rotate(180deg); background: #e9e4dc; } }

/* drawings sit directly on the page, no frame */
.hero-photo img, .story img, .rules-photo img, .band-photo img { background: transparent; border: 0; padding: 0; }
.band-photo { border: 0; background: transparent; }
.band-photo .band-text { padding-left: 0; }
.band-photo img { border: 0; padding: 1rem 2rem; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero-photo img, :root:not([data-theme="light"]) .story img, :root:not([data-theme="light"]) .rules-photo img, :root:not([data-theme="light"]) .band-photo img { filter: invert(1) hue-rotate(180deg) brightness(.92); background: transparent; } }


/* ---------- opening book ---------- */
.spread { --open: 1; background: transparent; border: 0; box-shadow: none; perspective: 2200px; perspective-origin: 50% 40%; }
.spread::before { display: none; }
.spread .page { background: var(--surface); border: 1px solid var(--line); }
.spread .page.left { border-right: 0; opacity: clamp(0, calc((var(--open) - 0.55) * 5), 1); box-shadow: var(--shadow); }
.spread .page.right { box-shadow: var(--shadow); }
.spread .page.right::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to right, rgba(0,0,0,.28), rgba(0,0,0,0) 35%); opacity: calc(1 - var(--open)); }
.flip { position: absolute; top: 0; bottom: 0; left: 50%; width: 50%; transform-origin: left center; transform-style: preserve-3d; transform: rotateY(calc(var(--open) * -180deg)); z-index: 3; will-change: transform; pointer-events: none; }
.flip .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flip .face.front { background: #2b4a3e; color: #fff; border-radius: 2px 6px 6px 2px; box-shadow: 14px 18px 30px -18px rgba(0,0,0,.6), inset 10px 0 14px -12px rgba(0,0,0,.8), inset -3px 0 3px rgba(255,255,255,.08); }
.flip .face.front::before { content: ""; position: absolute; left: 10px; top: 0; bottom: 0; width: 1px; background: rgba(255,255,255,.22); }
.flip .face.front::after { content: ""; position: absolute; right: -7px; top: 4px; bottom: 4px; width: 7px; background: repeating-linear-gradient(to bottom, #f4efe6 0 1px, #d9d2c6 1px 2px); border-radius: 0 2px 2px 0; }
.cover-inner { height: 100%; padding: 2.4rem 2.2rem 2.2rem 2.6rem; display: flex; flex-direction: column; justify-content: space-between; }
.cover-pub { font-family: var(--sans); font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; opacity: .8; }
.cover-title { font-family: var(--serif); font-size: clamp(1.6rem, 2.6vw, 2.3rem); line-height: 1.08; font-weight: 500; letter-spacing: -.02em; }
.cover-sub { font-family: var(--sans); font-size: .85rem; opacity: .85; margin-top: .6rem; }
.cover-foot { font-family: var(--sans); font-size: .7rem; opacity: .7; letter-spacing: .06em; }
.flip .face.back { transform: rotateY(180deg); background: var(--surface); border: 1px solid var(--line); border-right: 0; box-shadow: var(--shadow); }
.flip .face.back .page { position: absolute; inset: 0; border: 0; box-shadow: none; opacity: 1; min-height: 0; }
@media (max-width: 760px) { .flip { display: none; } .spread .page.left { opacity: 1; border-right: 1px solid var(--line); } .spread .page.right::before { display: none; } }

.spread-grid { --open: 1; }
.spread-grid .annotations { opacity: clamp(0, calc((var(--open) - 0.7) * 3.4), 1); transform: translateY(calc((1 - var(--open)) * 12px)); }
