:root {
  --red: #C00000;
  --red-deep: #8B0000;
  --ink: #1a1a1a;
  --paper: #fafaf7;
  --muted: #6b6b6b;
  --rule: rgba(0, 0, 0, 0.12);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --max-w: 56rem;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

/* ---------- Landing ---------- */

.landing {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 4rem 1.5rem 3rem;
  display: grid;
  gap: 3rem;
}

.cover {
  display: flex;
  justify-content: center;
}

.cover-img {
  width: 100%;
  max-width: 760px;
  aspect-ratio: 1264 / 819;
  object-fit: cover;
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.3),
              0 6px 20px -10px rgba(0, 0, 0, 0.15);
  border-radius: 2px;
}

.meta {
  text-align: center;
  display: grid;
  gap: 0.75rem;
  max-width: 36rem;
  margin: 0 auto;
}

.title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.dek {
  font-size: 1.125rem;
  font-style: italic;
  color: var(--red);
  margin: 0;
}

.byline {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0;
  font-variant: small-caps;
  letter-spacing: 0.04em;
}

.blurb {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  margin: 1.5rem auto 0.5rem;
  max-width: 32rem;
  text-wrap: pretty;
}

.cta {
  display: inline-block;
  margin: 1.5rem auto 0;
  padding: 0.875rem 2.25rem;
  background: var(--red);
  color: #fff;
  font-family: var(--serif);
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
  width: fit-content;
  justify-self: center;
}

.cta:hover { background: var(--red-deep); }
.cta:active { transform: translateY(1px); }
.cta:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

.site-foot {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--muted);
  border-top: 1px solid var(--rule);
  padding-top: 2rem;
  margin-top: 2rem;
}

.site-foot p { margin: 0; }

/* ---------- Reader (overlay) ---------- */

.reader {
  position: fixed;
  inset: 0;
  background: #1a1a1a;
  z-index: 1000;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.reader[aria-hidden="false"] {
  display: flex;
}

.reader-stage {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem 1rem;
  overflow: hidden;
}

.flipbook {
  /* StPageFlip injects sized children */
  max-width: 100%;
  max-height: 100%;
}

.flipbook .page {
  background: #fff;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flipbook .page canvas,
.flipbook .page img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.reader-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s ease;
}

.reader-close:hover { background: rgba(255,255,255,0.1); }
.reader-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.reader-status {
  color: rgba(255,255,255,0.7);
  font-size: 0.95rem;
  font-style: italic;
  padding: 0.5rem 1rem 1rem;
  text-align: center;
}

.reader-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.5rem 1rem 1.25rem;
  color: rgba(255,255,255,0.85);
}

.nav-btn {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 2px;
  padding: 0.5rem 1rem;
  font-size: 1.125rem;
  cursor: pointer;
  font-family: var(--serif);
  transition: background 0.2s ease;
  min-width: 3rem;
}

.nav-btn:hover:not(:disabled) { background: rgba(255,255,255,0.1); }
.nav-btn:disabled { opacity: 0.35; cursor: default; }
.nav-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.page-indicator {
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  min-width: 5rem;
  text-align: center;
}

/* ---------- Print: just send to PDF.js print path? No: hide everything ---------- */
@media print {
  body * { display: none !important; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .cta { transition: none; }
}
