@font-face {
  font-family: "Source Serif 4";
  src: url("fonts/ss4-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("fonts/ss4-400i.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("fonts/ss4-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("fonts/ss4-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Fraunces;
  src: url("fonts/fraunces-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f4ead6;
  --paper-edge: #e7d7b8;
  --ink: #2a2118;
  --ink-soft: #5a4a3a;
  --rule: rgba(70, 48, 28, 0.18);
  --accent: #6b4a2a;
  --accent-deep: #3d2a18;
  --choice-bg: rgba(255, 248, 232, 0.55);
  --shadow: 0 18px 50px rgba(60, 35, 10, 0.18);
}

.book-orbit-alarm { --accent: #2f5f9a; --accent-deep: #16345c; }
.book-hollow-marsh { --accent: #2c6d68; --accent-deep: #163f3c; }
.book-horn-hollow { --accent: #a07a22; --accent-deep: #5c430d; }
.book-market-day-at-greyfen { --accent: #b04a28; --accent-deep: #6a2614; }
.book-tide-that-keeps-its-word { --accent: #1e6f8a; --accent-deep: #0d3a4c; }
.book-atlas-that-tries-to-be-true { --accent: #6b4a8a; --accent-deep: #3a2458; }
.book-nine-hundred-down { --accent: #1a6f8c; --accent-deep: #0a3344; }
.book-dust-on-the-glass { --accent: #b05a28; --accent-deep: #5c2a12; }
.book-last-light-station { --accent: #3a5a78; --accent-deep: #1a2c40; }
.book-cinder-notch { --accent: #6a4a3a; --accent-deep: #2e1c14; }
.book-tracing-floor-woldminster { --accent: #8a6a3a; --accent-deep: #4a3414; }
.book-packhorse-bridge-lynford { --accent: #4a6a48; --accent-deep: #243624; }

* { box-sizing: border-box; }
html { font-size: 18px; }
html, body { margin: 0; min-height: 100%; }

body {
  color: var(--ink);
  font-family: "Source Serif 4", "Liberation Serif", Georgia, "Times New Roman", serif;
  line-height: 1.65;
  background-color: #cbb896;
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(255, 250, 235, 0.45), transparent 55%),
    repeating-linear-gradient(0deg, rgba(90, 55, 20, 0.035) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, #d7c19a, #c3ab80);
}

.page {
  max-width: 42rem;
  margin: 1.5rem auto 2.5rem;
  padding: 2.1rem 2.4rem 1.6rem;
  background:
    linear-gradient(90deg, rgba(90, 50, 20, 0.06), transparent 18px),
    linear-gradient(180deg, #f8f0de 0%, var(--paper) 12%, var(--paper) 88%, #ead9b8 100%);
  box-shadow: var(--shadow);
  border: 1px solid rgba(90, 60, 30, 0.18);
  position: relative;
  min-height: calc(100vh - 4rem);
  display: flex;
  flex-direction: column;
}
.page::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid var(--rule);
  pointer-events: none;
}

.running {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--rule);
  padding: 0 0 0.55rem;
  margin-bottom: 1.4rem;
  font-family: Fraunces, Georgia, serif;
}
.running .series { color: var(--accent-deep); }

main { flex: 1; }

.section-num {
  font-family: Fraunces, Georgia, serif;
  font-size: 2.4rem;
  color: var(--accent-deep);
  line-height: 1;
  margin: 0 0 0.85rem;
}

.prose p { margin: 0 0 0.95rem; }
.prose p:first-of-type::first-letter {
  font-family: Fraunces, Georgia, serif;
  float: left;
  font-size: 3.35rem;
  line-height: 0.78;
  padding: 0.12rem 0.35rem 0 0;
  color: var(--accent-deep);
  font-weight: 600;
}

.the-end {
  text-align: center;
  letter-spacing: 0.28em;
  font-family: Fraunces, Georgia, serif;
  font-size: 0.95rem;
  margin: 1.6rem 0 0.8rem !important;
  color: var(--accent-deep);
}
.the-end::first-letter { float: none !important; font-size: inherit !important; padding: 0 !important; }

.learned {
  font-style: italic;
  color: var(--ink-soft);
  border-left: 3px solid var(--accent);
  padding: 0.35rem 0 0.35rem 0.9rem;
  margin: 0.4rem 0 1.2rem !important;
}
.learned::first-letter { float: none !important; font-size: inherit !important; padding: 0 !important; }

.choices {
  list-style: none;
  margin: 1.6rem 0 0.4rem;
  padding: 0.4rem 0 0;
  border-top: 1px solid var(--rule);
}
.choices li { margin: 0; }
.choices a {
  display: block;
  color: var(--accent-deep);
  text-decoration: none;
  padding: 0.7rem 0.2rem 0.7rem 1.4rem;
  position: relative;
  border-bottom: 1px dotted var(--rule);
  font-style: italic;
}
.choices a::before {
  content: "❧";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-style: normal;
}
.choices a:hover,
.choices a:focus {
  color: var(--accent);
  background: var(--choice-bg);
}

.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--rule);
  font-family: Fraunces, Georgia, serif;
  font-size: 0.88rem;
}
.pager a {
  color: var(--accent-deep);
  text-decoration: none;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.72rem;
}
.pager a:hover { color: var(--accent); }
.pagenum {
  min-width: 2.2rem;
  text-align: center;
  color: var(--ink-soft);
}
.byline {
  text-align: center;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0.7rem 0 0;
}
.home-link {
  display: block;
  text-align: center;
  margin-top: 0.55rem;
  font-size: 0.85rem;
  color: var(--accent-deep);
  text-decoration: none;
}
.home-link:hover { color: var(--accent); }

/* Cover / title page */
body.cover {
  background: #1b1610;
}
.jacket {
  max-width: 28rem;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #111;
}
.jacket img.cover-art {
  width: 100%;
  height: auto;
  display: block;
  flex: 1;
  object-fit: cover;
}
.jacket-panel {
  padding: 1.15rem 1.35rem 1.5rem;
  background: linear-gradient(180deg, #1a140e, #120e0a);
  color: #f3e6cf;
  text-align: center;
}
.jacket-panel .series-kicker {
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 0.68rem;
  color: #d8b56a;
  font-family: Fraunces, Georgia, serif;
  margin: 0 0 0.35rem;
}
.jacket-panel h1 {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.55rem;
  line-height: 1.2;
  margin: 0 0 0.35rem;
  font-weight: 600;
}
.jacket-panel .author {
  margin: 0 0 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: #c9b79a;
}
.jacket-panel .blurb {
  font-size: 0.92rem;
  line-height: 1.5;
  color: #eadcc6;
  margin: 0 0 1rem;
}
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fffaf0;
  text-decoration: none;
  padding: 0.65rem 1.4rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: Fraunces, Georgia, serif;
  font-size: 0.82rem;
  border-radius: 2px;
}
.btn:hover { background: var(--accent-deep); }
.jacket-panel .back {
  display: block;
  margin-top: 0.85rem;
  color: #c9b79a;
  font-size: 0.82rem;
  text-decoration: none;
}
.jacket-panel .back:hover { color: #fff; }

.cover-fallback {
  min-height: 58vh;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 2rem 1.2rem;
  color: #f6ead4;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cover-fallback .big-title {
  font-family: Fraunces, Georgia, serif;
  font-size: 2rem;
  position: relative;
  z-index: 1;
}
.book-orbit-alarm .cover-fallback {
  background: radial-gradient(circle at 70% 30%, #6a3a12, transparent 40%),
    radial-gradient(circle at 30% 70%, #1b4d8a, #070b16 70%);
}
.book-hollow-marsh .cover-fallback {
  background: radial-gradient(circle at 40% 80%, #3aa08a, transparent 35%),
    linear-gradient(180deg, #0b1c22, #163530);
}
.book-horn-hollow .cover-fallback {
  background: radial-gradient(circle at 50% 20%, #f0d48a, transparent 30%),
    linear-gradient(180deg, #1d2a14, #0d140a);
}
.book-market-day-at-greyfen .cover-fallback {
  background: radial-gradient(circle at 30% 30%, #e08a40, transparent 40%),
    linear-gradient(180deg, #4a1e12, #1a0d08);
}
.book-tide-that-keeps-its-word .cover-fallback {
  background: radial-gradient(circle at 70% 25%, #c9e6f2, transparent 32%),
    radial-gradient(circle at 40% 80%, #2a9bb0, transparent 40%),
    linear-gradient(180deg, #0a2430, #071820);
}
.book-atlas-that-tries-to-be-true .cover-fallback {
  background: radial-gradient(circle at 50% 18%, #e8d48a, transparent 28%),
    radial-gradient(circle at 20% 70%, #5a3a78, transparent 40%),
    linear-gradient(180deg, #1a1224, #0c0814);
}
.book-nine-hundred-down .cover-fallback {
  background: radial-gradient(circle at 60% 20%, #3aa0c8, transparent 32%),
    radial-gradient(circle at 30% 80%, #0a3a50, transparent 40%),
    linear-gradient(180deg, #041018, #02080c);
}
.book-dust-on-the-glass .cover-fallback {
  background: radial-gradient(circle at 70% 25%, #e0a060, transparent 32%),
    radial-gradient(circle at 20% 70%, #8a4020, transparent 40%),
    linear-gradient(180deg, #2a1408, #120804);
}
.book-last-light-station .cover-fallback {
  background: radial-gradient(circle at 50% 18%, #f0e0a8, transparent 26%),
    radial-gradient(circle at 80% 70%, #3a6088, transparent 40%),
    linear-gradient(180deg, #0c141c, #060a10);
}
.book-cinder-notch .cover-fallback {
  background: radial-gradient(circle at 40% 20%, #d8c8b0, transparent 28%),
    radial-gradient(circle at 70% 80%, #4a3020, transparent 40%),
    linear-gradient(180deg, #1a120c, #0c0806);
}
.book-tracing-floor-woldminster .cover-fallback {
  background: radial-gradient(circle at 50% 15%, #f0d8a0, transparent 28%),
    radial-gradient(circle at 25% 75%, #6a5030, transparent 40%),
    linear-gradient(180deg, #2a1c10, #120c08);
}
.book-packhorse-bridge-lynford .cover-fallback {
  background: radial-gradient(circle at 30% 20%, #c8d8b0, transparent 30%),
    radial-gradient(circle at 70% 80%, #3a5848, transparent 40%),
    linear-gradient(180deg, #121810, #080c08);
}

/* Series home */
body.home {
  background:
    radial-gradient(ellipse at top, rgba(255,250,235,0.5), transparent 50%),
    linear-gradient(180deg, #efe0c4, #c9b287);
}
.home-wrap {
  max-width: 68rem;
  margin: 0 auto;
  padding: 2.2rem 1.2rem 3rem;
}
.masthead {
  text-align: center;
  margin-bottom: 2rem;
}
.masthead .kicker {
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: #6a4a22;
}
.masthead h1 {
  font-family: Fraunces, Georgia, serif;
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  margin: 0.2rem 0 0.3rem;
  color: #2a1c10;
  font-weight: 600;
}
.masthead .by {
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #5a4030;
  margin: 0 0 0.8rem;
}
.masthead .lede {
  max-width: 38rem;
  margin: 0 auto;
  font-size: 1.05rem;
  color: #3a2a1c;
}
.shelf {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr));
  gap: 1.2rem;
  margin: 2rem 0 2.4rem;
}
.card {
  background: #f7eedc;
  border: 1px solid rgba(90,60,30,0.16);
  box-shadow: 0 14px 32px rgba(50,30,10,0.12);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 40px rgba(50,30,10,0.18);
}
.card img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  display: block;
  background: #222;
}
.card .meta { padding: 0.9rem 1rem 1.1rem; }
.card h2 {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.15rem;
  margin: 0 0 0.35rem;
  line-height: 1.25;
  color: #24180f;
}
.card p { margin: 0; font-size: 0.92rem; color: #5a4534; }
.about {
  max-width: 42rem;
  margin: 0 auto;
  background: rgba(247, 238, 220, 0.75);
  padding: 1.3rem 1.5rem;
  border: 1px solid rgba(90,60,30,0.14);
}
.about h2 {
  font-family: Fraunces, Georgia, serif;
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
}
.about p { margin: 0 0 0.7rem; }
.home-foot {
  text-align: center;
  margin-top: 2rem;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #5a4534;
}

@media (max-width: 640px) {
  html { font-size: 17px; }
  .page { margin: 0; min-height: 100vh; padding: 1.35rem 1.15rem 1.2rem; border: 0; }
  .page::before { inset: 6px; }
  .prose p:first-of-type::first-letter { font-size: 2.7rem; }
}

.book-baby-zoo { --accent: #2e8a4a; --accent-deep: #145c2c; }

.picturebook .section-num { display: none; }
.picturebook .prose p:first-of-type::first-letter {
  float: none;
  font-size: inherit;
  line-height: inherit;
  padding: 0;
  font-weight: inherit;
  font-family: inherit;
  color: inherit;
}
.spread {
  margin: 0 0 1rem;
  border-radius: 10px;
  overflow: hidden;
  background: #d9c8a4;
}
.spread img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.baby-line p {
  font-size: 1.35rem;
  line-height: 1.4;
  text-align: center;
  font-family: Fraunces, Georgia, serif;
}
.choices.big-taps {
  list-style: none;
  padding: 0;
  margin: 1.1rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.choices.big-taps a {
  display: block;
  text-align: center;
  background: var(--accent);
  color: #fffaf0;
  text-decoration: none;
  padding: 0.95rem 1rem;
  font-size: 1.2rem;
  font-family: Fraunces, Georgia, serif;
  border-radius: 999px;
}
.choices.big-taps a:hover { background: var(--accent-deep); }

.age-kicker {
  font-family: Fraunces, Georgia, serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: #5a4030;
  margin: 2rem 0 0.4rem;
  text-align: center;
}
.age-kicker + .lede-mini {
  text-align: center;
  max-width: 36rem;
  margin: 0 auto 0.6rem;
  color: #3a2a1c;
}
.card.soon { opacity: 0.72; pointer-events: none; }
.card.soon .cover-fallback {
  min-height: 16rem;
  aspect-ratio: 2 / 3;
  background: linear-gradient(180deg, #f0d48a, #7a9e4a);
}
