:root {
  --wine: #6e0f1d;
  --wine-deep: #3a0810;
  --cream: #fbf6ef;
  --paper: #fffdf9;
  --ink: #241a17;
  --muted: #6d5d57;
  --gold: #b58a4c;
  --serif-display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --serif-body: "Lora", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
}
img { max-width: 100%; display: block; }
a { color: var(--wine); }

/* Landing */
.hero {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  background: var(--wine-deep);
}
.hero img {
  width: 100%;
  height: min(76vw, 440px);
  object-fit: cover;
  object-position: 50% 14%;
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 45%;
  background: linear-gradient(to bottom, rgba(58, 8, 16, 0), rgba(58, 8, 16, 0.92));
  pointer-events: none;
}
.hero-text {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 0 20px 18px;
  text-align: center;
  color: #fff;
  z-index: 1;
}
.eyebrow {
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.85;
  margin: 0 0 6px;
}
.hero h1 {
  font-family: var(--serif-display);
  font-weight: 400;
  font-size: clamp(30px, 10.6vw, 58px);
  white-space: nowrap;
  line-height: 0.92;
  letter-spacing: -0.01em;
  margin: 0;
}

.panel {
  max-width: 560px;
  margin: 0 auto;
  padding: 26px 24px 40px;
  background: var(--paper);
}
.setup {
  font-family: var(--serif-body);
  font-size: 19px;
  line-height: 1.45;
  margin: 0 0 14px;
}
.offer {
  font-size: 18px;
  font-weight: 600;
  color: var(--wine);
  margin: 0 0 20px;
}

form.signup { display: grid; gap: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
form.signup label { font-size: 16px; font-weight: 600; }
form.signup input[type="email"] {
  font: inherit;
  font-size: 18px;
  padding: 14px 16px;
  border: 1.5px solid #cdbdb4;
  border-radius: 10px;
  background: #fff;
  width: 100%;
}
form.signup input[type="email"]:focus { outline: 3px solid rgba(110, 15, 29, 0.25); border-color: var(--wine); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
button.cta {
  font: inherit;
  font-size: 19px;
  font-weight: 700;
  padding: 15px 18px;
  border: 0;
  border-radius: 10px;
  background: var(--wine);
  color: #fff;
  cursor: pointer;
}
button.cta:active { transform: translateY(1px); }
.fine {
  font-size: 14px;
  color: var(--muted);
  margin: 8px 0 0;
}
.error {
  background: #fdecec;
  color: #7a1b1b;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 16px;
}

.quote {
  margin: 28px 0 0;
  padding: 18px 0 0;
  border-top: 1px solid #eadfd6;
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 14px;
  align-items: center;
}
.quote img { width: 84px; height: 84px; object-fit: cover; object-position: 50% 22%; border-radius: 50%; }
.quote p { font-family: var(--serif-body); font-style: italic; font-size: 18px; margin: 0; }

footer {
  max-width: 560px;
  margin: 0 auto;
  padding: 18px 24px 36px;
  font-size: 13px;
  color: var(--muted);
}
footer a { color: var(--muted); }

/* Reading page */
:root { --read-size: 20px; }
.progress {
  position: fixed; top: 0; left: 0; right: 0;
  height: 3px; z-index: 20;
  background: transparent;
}
.progress span { display: block; height: 100%; width: 0; background: var(--wine); transition: width 0.15s linear; }
.reader-bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 16px 8px;
  background: rgba(251, 246, 239, 0.94);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border-bottom: 1px solid #eadfd6;
}
.reader-bar-title { font-family: var(--serif-display); font-size: 19px; color: var(--wine); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-tools { display: flex; gap: 6px; flex-shrink: 0; }
.reader-tools button {
  font: inherit; font-size: 15px; font-weight: 600;
  min-width: 44px; height: 36px; padding: 0 10px;
  border: 1px solid #d8c8bd; border-radius: 18px;
  background: #fff; color: var(--ink); cursor: pointer;
}
.reader-head {
  max-width: 640px;
  margin: 0 auto;
  padding: 44px 24px 6px;
  text-align: center;
}
.reader-head .part {
  font-size: 13px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 10px;
}
.reader-head .book {
  font-family: var(--serif-display);
  font-size: clamp(42px, 12vw, 60px);
  line-height: 0.95; margin: 0; color: var(--wine); font-weight: 400;
}
.reader-head .ornament { color: var(--gold); font-size: 22px; margin: 16px 0 4px; }
.reader-head .readtime { font-size: 14px; color: var(--muted); margin: 0; }
.welcome, .resume { max-width: 640px; margin: 16px auto 0; padding: 0 24px; }
.welcome p { background: #f3e7dc; border-radius: 10px; padding: 12px 14px; font-size: 16px; margin: 0; }
.resume button {
  width: 100%; font: inherit; font-size: 17px; font-weight: 600;
  padding: 14px; border-radius: 10px; border: 1.5px solid var(--wine);
  background: transparent; color: var(--wine); cursor: pointer;
}
article.chapter {
  max-width: 34em;
  margin: 0 auto;
  padding: 26px 24px 10px;
  font-family: var(--serif-body);
  font-size: var(--read-size);
  line-height: 1.75;
  color: var(--ink);
  hyphens: manual;
  text-wrap: pretty;
}
article.chapter p { margin: 0 0 1em; }
article.chapter .previously {
  font-size: 0.85em; font-style: italic; color: var(--muted);
  text-align: center; margin: 0 auto 2.2em; max-width: 28em;
}
article.chapter .previously::after {
  content: ""; display: block; width: 40px; height: 1px; background: var(--gold); margin: 1.4em auto 0;
}
article.chapter p.first::first-letter {
  float: left;
  font-family: var(--serif-display);
  font-size: 4.1em; line-height: 0.82;
  padding: 0.06em 0.09em 0 0;
  color: var(--wine);
}
article.chapter p.first::first-line { font-variant: small-caps; letter-spacing: 0.03em; }
article.chapter hr { border: 0; margin: 2.2em auto; text-align: center; }
article.chapter hr::before { content: "\2766"; color: var(--gold); font-size: 1.1em; }
article.chapter .end-mark { text-align: center; color: var(--gold); font-size: 1.3em; margin: 2em 0 0.2em; }
article.chapter .end-line {
  text-align: center; font-family: var(--sans); font-size: 13px;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted);
}
.after { max-width: 640px; margin: 0 auto; padding: 18px 24px 44px; }
.after-box { background: var(--wine-deep); color: #fff; border-radius: 14px; padding: 24px 22px; }
.after-box h2 { font-family: var(--serif-display); font-weight: 400; font-size: 34px; line-height: 1.05; margin: 0 0 10px; }
.after-box p { margin: 0 0 10px; font-size: 17px; }
.after-box .share { opacity: 0.85; font-size: 15px; margin: 14px 0 0; }
.after-box a { color: #fff; }
.after-box a.sub-cta { display: inline-block; margin-top: 4px; padding: 13px 20px; border-radius: 10px; background: #fff; color: var(--wine-deep); font-family: var(--sans); font-weight: 700; font-size: 16px; text-decoration: none; }

/* Night reading */
body.night { background: #16110f; color: #e9dfd6; }
body.night .reader-bar { background: rgba(22, 17, 15, 0.94); border-bottom-color: #2e2420; }
body.night .reader-tools button { background: #241c19; color: #e9dfd6; border-color: #3a2f2a; }
body.night article.chapter { color: #e9dfd6; }
body.night .reader-head .book, body.night .reader-bar-title, body.night article.chapter p.first::first-letter { color: #e3a7ae; }
body.night .welcome p { background: #2a201c; }
body.night .resume button { color: #e3a7ae; border-color: #e3a7ae; }
body.night .progress span { background: #e3a7ae; }
body.night footer, body.night footer a { color: #9c8e86; }

/* Stats */
.stats { max-width: 640px; margin: 0 auto; padding: 28px 20px 40px; }
.stats h1 { font-family: var(--serif-display); font-weight: 400; font-size: 38px; color: var(--wine); margin: 0 0 4px; }
.stats .range a { margin-right: 12px; }
.stats table { width: 100%; border-collapse: collapse; margin: 14px 0 22px; font-size: 16px; }
.stats th, .stats td { text-align: left; padding: 9px 6px; border-bottom: 1px solid #eadfd6; }
.stats td.n { text-align: right; font-variant-numeric: tabular-nums; }
.stats .note { color: var(--muted); font-size: 14px; }

.legal {
  max-width: 640px;
  margin: 0 auto;
  padding: 36px 24px;
  font-size: 17px;
}
.legal h1 { font-family: var(--serif-display); font-weight: 400; font-size: 40px; color: var(--wine); margin: 0 0 12px; }

/* Story picker (/more) */
.hub { max-width: 560px; margin: 0 auto; padding: 34px 20px 20px; text-align: center; }
.hub .eyebrow { color: var(--wine); opacity: 0.8; }
.hub h1 { font-family: var(--serif-display); font-weight: 400; font-size: clamp(34px, 10vw, 50px); line-height: 1; color: var(--wine); margin: 6px 0 8px; }
.hub-sub { margin: 0 0 22px; font-size: 17px; }
.hub-card { display: flex; align-items: center; gap: 14px; text-align: left; text-decoration: none; color: inherit; background: #fff; border: 1px solid rgba(58, 8, 16, 0.12); border-radius: 14px; padding: 10px; margin: 0 0 12px; }
.hub-card img { width: 86px; height: 86px; object-fit: cover; border-radius: 10px; flex: none; }
.hub-text { display: flex; flex-direction: column; gap: 4px; }
.hub-title { font-family: var(--serif-body); font-size: 18px; line-height: 1.25; color: var(--wine-deep); }
.hub-line { font-family: var(--sans); font-size: 14px; opacity: 0.75; }
