/* The Chronicle: one page per chapter, read like a page of the hunt's book.
   The entry is written on the journal's parchment, marked by an oxblood ribbon
   (the ribbon on the logo) carrying the chapter's number. The record sits
   beside it on the ink, like notes in the margin. */

:root {
  --oxblood: #6b1e1b;
  --oxblood-deep: #4a1210;
  --oxblood-light: #8c2b25;
}

.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Top line: the crest home, and the contents */

.chron-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gold-dim);
}
.chron-nav a { color: var(--gold-text); text-decoration: none; font-family: var(--serif); font-size: 1.15rem; }
.chron-nav a:hover { color: var(--gold-bright); text-decoration: underline; }
.chron-home { display: flex; align-items: center; gap: 0.7rem; }
.chron-home img { width: 3.875rem; height: auto; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5)); }
.chron-pages { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.3rem 1.4rem; }

.chron-loading, .chron-missing { margin: 4rem 0; font-family: var(--serif); font-size: 1.3rem; color: var(--ivory-soft); }

/* Chapter heading */

.ch-head { margin: 2.4rem 0 2.2rem; max-width: 46rem; }
.ch-number { font-family: var(--serif); font-style: italic; font-size: 1.35rem; color: var(--gold-text); }
.ch-title {
  margin-top: 0.15rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.6rem, 6vw, 4.1rem);
  line-height: 1.02;
  color: var(--ivory);
  text-wrap: balance;
}
.ch-title.is-untitled { color: var(--ivory-soft); }
.ch-when { margin-top: 0.75rem; font-size: 1.1rem; color: var(--ivory-soft); text-wrap: pretty; }

/* Entry beside the margin */

.ch-body {
  display: grid;
  grid-template-columns: minmax(0, 46rem) minmax(0, 1fr);
  gap: 2.75rem;
  align-items: start;
}

/* Old parchment, for the book and the contents. The paper is drawn on a layer
   behind the words (::before), so its edge can be roughened by the #deckle
   filter in chronicle.html without touching the text. */

.parchment {
  --grain: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.30 0 0 0 0 0.22 0 0 0 0 0.12 0 0 0 0.26 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(#g)'/%3E%3C/svg%3E");
  --fibres: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.004 0.11' numOctaves='2' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.42 0 0 0 0 0.31 0 0 0 0 0.17 0 0 0 0.22 -0.03'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(#f)'/%3E%3C/svg%3E");
  --mottle: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='900'%3E%3Cfilter id='m'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.006' numOctaves='4' seed='11' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.45 0 0 0 0 0.30 0 0 0 0 0.12 0 0 0 0.75 -0.33'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(#m)'/%3E%3C/svg%3E");
  position: relative;
  isolation: isolate;
  color: var(--paper-ink);
}
.parchment::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 3px;
  background-color: #e4d0a3;
  background-image:
    var(--wear, none),
    /* foxing: the little rust spots old paper gets */
    radial-gradient(circle at 14% 22%, rgba(140, 92, 40, 0.22) 0 2px, transparent 7px),
    radial-gradient(circle at 81% 67%, rgba(140, 92, 40, 0.18) 0 3px, transparent 10px),
    radial-gradient(circle at 37% 88%, rgba(140, 92, 40, 0.16) 0 2px, transparent 8px),
    radial-gradient(circle at 92% 31%, rgba(120, 80, 34, 0.14) 0 1.5px, transparent 6px),
    radial-gradient(ellipse 30% 18% at 70% 12%, rgba(150, 105, 50, 0.10), transparent),
    var(--grain),
    var(--fibres),
    var(--mottle),
    /* lighter where the light falls, browner toward the edges */
    radial-gradient(ellipse 75% 70% at 46% 42%, rgba(255, 249, 228, 0.65), rgba(255, 249, 228, 0) 70%),
    linear-gradient(180deg, #e9d8b0, #dcc596);
  background-size: auto, auto, auto, auto, auto, auto, 220px 220px, 600px 600px, 900px 900px, auto, auto;
  box-shadow:
    inset 0 0 2px 1px rgba(96, 62, 24, 0.55),
    inset 0 0 26px rgba(122, 82, 34, 0.42),
    inset 0 0 90px rgba(150, 108, 52, 0.30);
  filter: url(#deckle) drop-shadow(0 16px 22px rgba(0, 0, 0, 0.5));
}

/* The book: the posts on one sheet, a page at a time */
.book {
  /* a reader's thumb, worn into the turning corner */
  --wear: radial-gradient(circle at calc(100% - 3.3rem) 3.6rem, rgba(104, 72, 34, 0.34), transparent 4rem);
  margin-bottom: 4.6rem;     /* room for the ribbon */
  padding: 2.5rem 4.4rem 0.9rem 3rem;   /* the right side clears the corner on every page */
  outline-offset: 6px;
}

.book-window { overflow: hidden; overflow: clip; touch-action: pan-y; }   /* (hidden for Safari before 16) */

.book-flow {
  --page-h: 360px;
  --page-w: 30rem;
  height: var(--page-h);
  /* Columns exactly as wide as the page, rather than "1 column": Safari doesn't
     make columns at all when there's only one and it has no width. */
  column-width: var(--page-w);
  column-count: auto;
  column-gap: 64px;
  column-fill: auto;
  transition: transform 0.5s cubic-bezier(0.3, 0.7, 0.2, 1);
}
.book-flow.is-instant { transition: none; }
.book-flow.is-measuring, .book.is-scroll .book-flow { height: auto; columns: auto; transform: none !important; }
.leaf + .leaf { break-before: column; }
.book.is-scroll .leaf + .leaf { margin-top: 2.6rem; padding-top: 2.2rem; border-top: 1px solid rgba(43, 38, 32, 0.25); }

/* The ribbon: a bookmark hanging out from under the bottom of the sheet,
   carrying the chapter's number. It sits behind the paper, so it never
   covers a word on any page. */
.ribbon {
  position: absolute;
  bottom: -4.9rem;
  left: 2.4rem;
  z-index: -2;
  width: 3rem;
  height: 6.4rem;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 1.5rem;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.3), transparent 22%, transparent 78%, rgba(0, 0, 0, 0.34)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, var(--oxblood-deep), var(--oxblood) 30%, var(--oxblood-light) 75%, var(--oxblood));
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 84%, 0 100%);
  pointer-events: none;
}
.ribbon span {
  font-family: var(--serif);
  font-size: 1.6rem;
  line-height: 1;
  color: var(--gold-bright);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
}
.ribbon.is-word span { font-size: 0.95rem; letter-spacing: 0.02em; writing-mode: vertical-rl; transform: rotate(180deg); }

/* The turned-down corner: the next page, or the next entry. The flap is the
   back of the page, folded along the diagonal; it casts a shadow on the page
   under it, and its tip is soft and browned from being turned. */
.book-corner {
  --corner-scale: 1;
  position: absolute;
  top: 0;
  right: 0;
  z-index: 1;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transform-origin: 100% 0;
  transform: scale(var(--corner-scale));
  transition: transform 0.2s ease;
}
.book-corner::before, .book-corner::after { content: ""; position: absolute; inset: 0; }
/* where the corner was: folded away, so the ink behind shows (reaching past
   the square, over the paper's roughened edge) */
.book-corner::before {
  inset: -8px -8px 0 0;
  background: var(--ink);
  clip-path: polygon(0 0, 100% 0, 100% 100%, calc(100% - 8px) 100%, 0 8px);
}
/* the flap, with a softened tip */
.book-corner::after {
  background:
    radial-gradient(circle at 6% 94%, rgba(92, 60, 24, 0.55), transparent 42%),
    linear-gradient(225deg, transparent 49%, rgba(255, 252, 238, 0.95) 50%, #efe1bd 56%, #d9c091 76%, #b8955a 100%);
  clip-path: path("M0 0 L64 64 L10 64 Q0 64 0 54 Z");
  filter: drop-shadow(-4px 5px 4px rgba(58, 34, 8, 0.5));
}
.book-corner:hover, .book-corner:focus-visible { transform: scale(calc(var(--corner-scale) * 1.22)); }
.book-corner:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }
.book-corner[hidden] { display: none; }
/* Once, as the book appears, the corner lifts and settles, so it's noticed. */
.book.is-new .book-corner { animation: corner-lift 1.4s ease-in-out 0.6s 1; }
@keyframes corner-lift {
  0%, 100% { transform: scale(var(--corner-scale)); }
  35% { transform: scale(calc(var(--corner-scale) * 1.38)); }
  60% { transform: scale(calc(var(--corner-scale) * 1.1)); }
}

.book-foot {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem 1.2rem;
  min-height: 2.4rem;
  margin-top: 0.9rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(43, 38, 32, 0.25);
  font-size: 0.95rem;
  color: var(--paper-soft);
}
.book-foot button {
  padding: 0.2rem 0;
  font: inherit;
  font-weight: 700;
  color: var(--paper-gold);
  background: none;
  border: 0;
  cursor: pointer;
}
.book-foot button:hover { text-decoration: underline; }
/* Turning pages: an arrow either side of where you are in the book */
.book-turn { display: flex; align-items: center; gap: 0.75rem; margin-left: auto; }
.book-where { margin: 0; font-family: var(--serif); font-style: italic; text-align: center; }
.book-foot .book-arrow {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid rgba(122, 90, 28, 0.55);
  border-radius: 50%;
  background: rgba(255, 250, 235, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 1px 2px rgba(58, 34, 8, 0.18);
  font-family: var(--serif);
  font-size: 1.75rem;
  font-weight: 400;
  line-height: 1;
  color: var(--paper-gold);
  transition: background 0.15s ease, transform 0.1s ease;
}
.book-foot .book-arrow svg { width: 46%; height: 46%; }
.book-foot .book-arrow:hover:not(:disabled) { text-decoration: none; background: rgba(122, 90, 28, 0.13); }
.book-foot .book-arrow:active:not(:disabled) { transform: scale(0.94); }
.book-foot .book-arrow:focus-visible { outline: 2px solid var(--paper-gold); outline-offset: 2px; }
.book-foot .book-arrow:disabled { opacity: 0.28; cursor: default; box-shadow: none; }
.book-mode { order: -1; font-weight: 500 !important; }
.book.is-single .book-foot { display: none; }
.book.is-scroll .book-turn, .book.is-scroll .book-corner { display: none; }
.book.is-scroll .book-mode { margin-left: auto; }
/* In one-page mode, the way back to the book is at the top of the sheet too */
.book-mode-top {
  display: none;
  position: absolute;
  top: 0.8rem;
  right: 1.4rem;
  padding: 0.2rem 0;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--paper-gold);
  background: none;
  border: 0;
  cursor: pointer;
}
.book-mode-top:hover { text-decoration: underline; }
.book.is-scroll .book-mode-top { display: block; }
/* A browser that can't page the book shows it on one page, with no way back to pages */
.book.is-flat .book-mode, .book.is-flat .book-mode-top { display: none; }
.book.is-flat .book-foot { display: none; }

.entry-title {
  max-width: 34rem;
  padding-right: 0.5rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 2rem;
  line-height: 1.12;
  color: var(--paper-ink);
}
.entry-meta { margin-top: 0.45rem; font-family: var(--serif); font-style: italic; color: var(--paper-soft); }

.entry-text {
  margin-top: 1.4rem;
  font-family: var(--serif);
  font-size: 1.22rem;
  line-height: 1.62;
  color: var(--paper-ink);
  overflow-wrap: break-word;
}
.entry-text > * + * { margin-top: 0.85em; }
.entry-text h1, .entry-text h2, .entry-text h3, .entry-text h4 {
  font-weight: 400; line-height: 1.2; margin-top: 1.3em;
}
.entry-text h1 { font-size: 1.55em; }
.entry-text h2 { font-size: 1.35em; }
.entry-text h3, .entry-text h4 { font-size: 1.15em; font-style: italic; }
.entry-text a { color: var(--paper-gold); }
.entry-text strong { font-weight: 400; color: #000; text-shadow: 0.02em 0 0 currentColor; }
.entry-text blockquote {
  padding: 0.1em 0 0.1em 1.1em;
  border-left: 3px solid var(--gold);
  color: var(--paper-soft);
  font-style: italic;
}
.entry-text ul, .entry-text ol { padding-left: 1.4em; }
.entry-text li + li { margin-top: 0.3em; }
.entry-text img { display: block; max-width: 100%; max-height: calc(var(--page-h) - 3rem); height: auto; margin: 0.4em auto; border: 1px solid #c4ae82; break-inside: avoid; }
.entry-text li, .entry-text h2, .entry-text h3 { break-inside: avoid; }
.entry-text { orphans: 2; widows: 2; }
.entry-text h1, .entry-text h2, .entry-text h3, .entry-text h4 { break-after: avoid; }
.entry-text code, .entry-text pre { font-family: Consolas, "Courier New", monospace; font-size: 0.85em; }
.entry-text pre { overflow-x: auto; padding: 0.6em 0.8em; background: rgba(43, 38, 32, 0.08); }
.entry-text table { border-collapse: collapse; font-family: var(--sans); font-size: 0.85em; }
.entry-text th, .entry-text td { padding: 0.25em 0.6em; border-bottom: 1px solid rgba(43, 38, 32, 0.25); text-align: left; }
.entry-text hr { border: 0; border-top: 1px solid rgba(43, 38, 32, 0.3); }
/* Reddit spoilers: blurred until clicked */
.entry-text .spoiler {
  color: transparent;
  text-shadow: 0 0 0.42em rgba(43, 38, 32, 0.8);
  border-bottom: 1px dashed rgba(43, 38, 32, 0.45);
  cursor: pointer;
}
.entry-text .spoiler.is-shown, .entry-text .spoiler:focus-visible { color: inherit; text-shadow: none; border-bottom-color: transparent; }

.entry-foot {
  margin-top: 1.8rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(43, 38, 32, 0.22);
  font-size: 1rem;
}
.entry-foot a { color: var(--paper-gold); font-weight: 700; }

.leaf.is-unwritten { padding-bottom: 1rem; }
.leaf.is-unwritten p { max-width: 32rem; font-family: var(--serif); font-size: 1.22rem; line-height: 1.55; color: var(--paper-soft); }
.leaf.is-unwritten p + p { margin-top: 0.7rem; }
.leaf.is-unwritten .entry-title + p { margin-top: 1.2rem; }

/* The margin: map, numbers, boars and zones */

.margin { display: grid; gap: 1.6rem; }
.margin h2 { font-family: var(--serif); font-weight: 400; font-size: 1.3rem; color: var(--ivory); margin-bottom: 0.45rem; }

.ch-map { margin: 0; }
.ch-map .frame {
  position: relative;
  padding: 5px;
  background: var(--ink-deep);
  border: 1px solid var(--gold);
  box-shadow: inset 0 0 0 3px var(--ink-deep), inset 0 0 0 4px var(--gold-dim);
}
.ch-map svg { display: block; width: 100%; height: auto; }
.ch-map .kill { fill: var(--marker); fill-opacity: 0.88; stroke: #f3e8cf; stroke-width: 1.25; vector-effect: non-scaling-stroke; }
.ch-map .death-halo { fill: none; stroke: #f6eddb; stroke-width: 5; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.ch-map .death { fill: none; stroke: #b3402b; stroke-width: 2.5; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.ch-map .pin { fill: var(--oxblood); stroke: var(--gold-bright); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.ch-map .pin-label { fill: var(--gold-bright); font-family: var(--sans); font-weight: 800; text-anchor: middle; dominant-baseline: central; }
.ch-map figcaption { margin-top: 0.5rem; font-size: 0.95rem; color: var(--ivory-soft); }

.ch-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem 1.2rem;
  padding: 1rem 0;
  border-top: 3px double var(--gold-dim);
  border-bottom: 1px solid var(--gold-dim);
}
.ch-facts dt { font-size: 0.9rem; color: var(--gold-text); }
.ch-facts dd { margin: 0; font-size: 1.35rem; font-weight: 700; color: var(--ivory); }
.ch-facts .is-boars dd { color: var(--gold-bright); }
.ch-facts .is-deaths dd { color: var(--ember); }
/* Where the XP came from: boar XP across the margin, with its share of all the
   XP and a slim bar of the split; quests, exploring and other kills beside each
   other under it, each with its colour from the bar */
.ch-facts .is-xp { grid-column: 1 / -1; }
.ch-facts .share { font-weight: 500; font-size: 1.05rem; color: var(--gold-text); }
.ch-facts .xp-bar.is-slim { height: 7px; margin-top: 0.4rem; border: 0; border-radius: 1px; }
.ch-facts dt .xp-swatch { width: 0.6rem; height: 0.6rem; margin-right: 0.4rem; vertical-align: 0.02em; }
.ch-facts .is-other dd { color: var(--ember); }

/* The walk: the chapter's treadmill miles, its miles in Azeroth, and the toll */
.ch-walk h2 { margin-bottom: 0.3rem; }
.ch-walk .walk-note { margin: 0 0 0.7rem; font-family: var(--serif); font-style: italic; font-size: 1.05rem;
  line-height: 1.4; color: var(--ivory-soft); }
.ch-walk .ch-facts { padding: 0.8rem 0 0.9rem; }
.ch-walk .ch-facts dd small { margin-left: 0.1rem; font-size: 0.95rem; font-weight: 500; color: var(--gold-text); }
.ch-walk .is-toll { grid-column: 1 / -1; }
.ch-walk .is-toll dd { font-size: 1.05rem; font-weight: 500; line-height: 1.4; color: var(--ivory-soft); }
.ch-walk .is-toll dd b { margin-right: 0.15rem; font-size: 1.2rem; font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--ember); }

/* The Epilogue's margin, before the hunt's numbers are in */
.margin > .section-note { padding: 1rem 0; border-top: 3px double var(--gold-dim); border-bottom: 1px solid var(--gold-dim); font-style: italic; }

.ch-list { list-style: none; padding: 0; }
.ch-list li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.28rem 0; border-bottom: 1px dotted var(--gold-dim); }
.ch-list li span:last-child { font-weight: 700; }

/* Along the way: the chapter's moments, in order */

.along { margin-top: 3.2rem; max-width: 46rem; }
.along > h2 { font-family: var(--serif); font-weight: 400; font-size: 2rem; color: var(--ivory); margin-bottom: 1.1rem; }

/* --tl-time: the width of the times; the line runs down the middle of the gap after them */
.timeline { --tl-time: 6rem; --tl-gap: 1.7rem; list-style: none; padding: 0; position: relative; }
.timeline::before {
  content: "";
  position: absolute;
  top: 0.6rem;
  bottom: 0.6rem;
  left: calc(var(--tl-time) + var(--tl-gap) / 2);
  width: 1px;
  background: linear-gradient(180deg, var(--gold-dim), var(--gold) 12%, var(--gold) 88%, var(--gold-dim));
}
.timeline li {
  position: relative;
  display: grid;
  grid-template-columns: var(--tl-time) minmax(0, 1fr);
  gap: var(--tl-gap);
  padding: 0.55rem 0;
}
.timeline time { padding-top: 0.15rem; text-align: right; font-size: 0.95rem; color: var(--ivory-soft); line-height: 1.3; white-space: nowrap; }
.timeline .what { position: relative; font-size: 1.1rem; }
.timeline .what::before {
  content: "";
  position: absolute;
  top: 0.5rem;
  left: calc(var(--tl-gap) / -2 - 5px);
  width: 9px;
  height: 9px;
  transform: rotate(45deg);
  background: var(--gold);
  box-shadow: 0 0 0 2px var(--ink);
}
.timeline .is-level .what { font-family: var(--serif); font-size: 1.3rem; color: var(--gold-bright); }
.timeline .is-level .what::before {
  width: 13px; height: 13px; top: 0.45rem; left: calc(var(--tl-gap) / -2 - 7px);
  background: conic-gradient(from -45deg, #e0b65e 0 25%, #7d5a1f 0 50%, #a8802f 0 75%, #f6d98a 0);
}
.timeline .is-death .what { color: var(--ember); font-style: italic; }
.timeline .is-death .what::before { background: #b3402b; }
.timeline .is-milestone .what { color: var(--gold-bright); font-weight: 700; }
.timeline .is-tale .what::before { background: var(--oxblood-light); box-shadow: 0 0 0 2px var(--ink), 0 0 0 3px var(--gold-dim); }
.timeline .where { color: var(--ivory-soft); }
/* Quests turned in and areas discovered come often, so they're set quieter:
   smaller, softer, closer together, with a small hollow marker in the colour
   they have in the XP bar, and only the time when the line above has the day */
.timeline li.is-quiet { padding: 0.25rem 0; }
.timeline .is-quiet time { padding-top: 0.1rem; font-size: 0.85rem; color: #93999a; }
.timeline .is-quiet .what { font-size: 1rem; color: var(--ivory-soft); }
.timeline .is-quiet .what::before {
  top: 0.48rem;
  left: calc(var(--tl-gap) / -2 - 4px);
  width: 7px;
  height: 7px;
  background: var(--ink);
  box-shadow: 0 0 0 1.5px var(--xp-quests);
}
.timeline .is-discover .what::before { box-shadow: 0 0 0 1.5px var(--xp-exploring); }
.timeline .is-quiet .where { color: inherit; }
.timeline .xp { margin-left: 0.5rem; font-size: 0.88rem; font-weight: 700; color: var(--gold-text); white-space: nowrap; }

/* A note written for the Chronicle with /boarlog tale */
.tale {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.3rem;
  line-height: 1.45;
  color: var(--ivory);
}
.tale-pin {
  display: inline-grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  margin-right: 0.45rem;
  vertical-align: 0.15em;
  border-radius: 50%;
  font-family: var(--sans);
  font-style: normal;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--gold-bright);
  background: var(--oxblood);
  box-shadow: 0 0 0 1.5px var(--gold-bright);
}
.tale-where { margin-top: 0.2rem; font-size: 0.95rem; color: var(--ivory-soft); }

/* Videos: a poster until the visitor chooses to play one */
.video { margin: 0.2rem 0 0; max-width: 34rem; }
.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background-color: var(--ink-deep);
  background-image: var(--grain-light);
  border: 1px solid var(--gold-dim);
  overflow: hidden;
}
.video.is-vertical .video-frame { aspect-ratio: 9 / 16; max-width: 15rem; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.8rem;
  width: 100%;
  padding: 1rem;
  font: inherit;
  color: var(--ivory);
  background: radial-gradient(ellipse at 50% 45%, rgba(56, 104, 128, 0.32), transparent 70%);
  border: 0;
  cursor: pointer;
}
.video-play img { width: 46%; max-width: 9rem; height: auto; opacity: 0.85; filter: saturate(0.8) drop-shadow(0 6px 14px rgba(0, 0, 0, 0.5)); }
.video-play span { padding: 0.35rem 0.9rem; font-weight: 700; color: var(--ink); background: var(--gold-bright); border-radius: 2px; }
.video-play:hover span, .video-play:focus-visible span { background: var(--ivory); }
.video figcaption { margin-top: 0.5rem; font-size: 1rem; }
.video figcaption a { margin-left: 0.4rem; font-size: 0.95rem; }

/* The contents ---------------------------------------------------------------- */

.toc-head { margin: 2.6rem 0 2.4rem; max-width: 44rem; }
.toc-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3rem, 7vw, 4.6rem);
  line-height: 1;
  color: var(--ivory);
}
.toc-lede { margin-top: 0.9rem; max-width: 36rem; font-family: var(--serif); font-size: 1.35rem; line-height: 1.4; color: var(--ivory); }
.toc-now { margin-top: 0.9rem; color: var(--ivory-soft); font-size: 1.05rem; }
.toc-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.4rem; margin-top: 1.3rem; }
.toc-links a { font-size: 1rem; }
.toc-links .button { display: inline-block; text-decoration: none; }

/* On a wide screen the contents open like a spread: the title page on the
   left (it stays put while the contents scroll), the contents page on the right */
@media (min-width: 1001px) {
  .toc-spread {
    display: grid;
    grid-template-columns: minmax(0, 24rem) minmax(0, 1fr);
    gap: 0 4rem;
    align-items: start;
    margin-top: 2.8rem;
  }
  .toc-spread .toc-head { position: sticky; top: 2rem; margin: 0; }
  .toc-spread .toc-title { font-size: 3.9rem; }
  .toc-spread .toc-sheet { max-width: none; }
}

.toc-sheet {
  --wear: radial-gradient(ellipse 40% 22% at 12% 96%, rgba(104, 72, 34, 0.18), transparent);
  max-width: 50rem;
  margin-bottom: 1rem;
  padding: 2.2rem 3rem 2rem;
}
.toc-sheet > h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.9rem;
  color: var(--paper-ink);
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(43, 38, 32, 0.3);
}
.toc { list-style: none; padding: 0; }
.toc-row { position: relative; }
.toc-row a, .toc-row .toc-later {
  display: grid;
  grid-template-columns: 3.4rem minmax(0, 1fr);
  gap: 0 0.6rem;
  padding: 0.85rem 0 0.8rem;
  border-bottom: 1px solid rgba(43, 38, 32, 0.16);
  color: var(--paper-ink);
  text-decoration: none;
}
.toc-row a:hover .toc-name, .toc-row a:focus-visible .toc-name { text-decoration: underline; text-decoration-thickness: 1px; }
.toc-num { font-family: var(--serif); font-size: 1.55rem; line-height: 1.3; color: var(--paper-gold); }
.toc-line { display: flex; align-items: baseline; gap: 0.6rem; min-width: 0; }
.toc-name { font-family: var(--serif); font-size: 1.45rem; line-height: 1.25; }
.toc-name.is-untitled { font-style: italic; color: var(--paper-soft); }
/* the dotted leader between a chapter's name and its numbers, as in an old contents page */
.toc-leader { flex: 1; min-width: 1.5rem; border-bottom: 2px dotted rgba(43, 38, 32, 0.35); transform: translateY(-0.3em); }
.toc-meta { font-size: 0.95rem; color: var(--paper-soft); white-space: nowrap; }
.toc-sub { grid-column: 2; margin-top: 0.15rem; font-size: 0.98rem; color: var(--paper-soft); }
.toc-sub em { font-family: var(--serif); font-size: 1.08rem; color: var(--paper-ink); }
.toc-row.is-prologue .toc-num, .toc-row.is-epilogue .toc-num { font-size: 1.15rem; padding-top: 0.25rem; font-style: italic; }
/* the Epilogue comes after the chapters still ahead: a rule sets it apart */
.toc-row.is-epilogue { border-top: 3px double rgba(43, 38, 32, 0.28); margin-top: 0.35rem; }
.toc-row .toc-later { grid-template-columns: 3.4rem minmax(0, 1fr); color: var(--paper-soft); border-bottom: 0; }
.toc-later .toc-name { font-style: italic; }
.toc-now-tag {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.05rem 0.45rem;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 700;
  vertical-align: 0.25em;
  color: #fff3ec;
  background: var(--oxblood);
  border-radius: 2px;
}
/* The ribbon lies across the page at the chapter being played */
.toc-row.is-current::after {
  content: "";
  position: absolute;
  top: 0.95rem;
  right: -4.1rem;
  width: 2.6rem;
  height: 1.4rem;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.3), transparent 30%, transparent 70%, rgba(0, 0, 0, 0.3)),
    linear-gradient(90deg, var(--oxblood-deep), var(--oxblood-light));
  clip-path: polygon(0 0, 100% 0, 84% 50%, 100% 100%, 0 100%);
  pointer-events: none;
}

/* The Prologue's ledger of the beta's chapters */

.beta-chapters { margin-top: 3.2rem; max-width: 46rem; }
.beta-chapters > h2 { font-family: var(--serif); font-weight: 400; font-size: 2rem; color: var(--ivory); }
.beta-chapters .section-note { margin: 0.3rem 0 1rem; }
.beta-table { width: 100%; border-collapse: collapse; border-top: 3px double var(--gold-dim); font-size: 1rem; }
.beta-table th { padding: 0.35rem 0.5rem; text-align: right; font-weight: 500; font-size: 0.9rem; color: var(--gold-text); border-bottom: 1px solid var(--gold-dim); }
.beta-table td { padding: 0.45rem 0.5rem; text-align: right; border-bottom: 1px dotted var(--gold-dim); white-space: nowrap; }
.beta-table th:first-child, .beta-table td:first-child { text-align: left; width: 1%; }
.beta-table .is-title { text-align: left; white-space: normal; width: 100%; }
.beta-table td.is-title { font-family: var(--serif); font-style: italic; font-size: 1.15rem; color: var(--ivory); }
.beta-table td.is-untitled { color: var(--ivory-soft); }
.beta-table .is-deaths { color: var(--ember); font-weight: 700; }
.beta-table .is-zero { color: #4b5a64; }

/* Previous and next chapters */

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 3.2rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--gold-dim);
}
.pager a, .pager p { display: block; margin: 0; text-decoration: none; }
.pager .next { text-align: right; }
.pager small { display: block; font-size: 0.95rem; color: var(--gold-text); }
.pager strong { display: block; font-family: var(--serif); font-weight: 400; font-size: 1.45rem; line-height: 1.2; color: var(--ivory); }
.pager a:hover strong { color: var(--gold-bright); text-decoration: underline; }
.pager p strong { color: var(--ivory-soft); }

/* Narrower screens: the margin goes under the entry */

@media (max-width: 1000px) {
  .ch-body { grid-template-columns: minmax(0, 1fr); }
  .margin { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 1.6rem 2rem; align-items: start; }
  .ch-map { grid-row: span 3; }
}

@media (max-width: 640px) {
  .ch-head { margin: 1.6rem 0 1.6rem; }
  .toc-head { margin: 1.8rem 0 1.8rem; }
  .toc-lede { font-size: 1.2rem; }
  .toc-sheet { padding: 1.6rem 1.2rem 1.4rem; }
  .toc-row a, .toc-row .toc-later { grid-template-columns: 2.4rem minmax(0, 1fr); }
  .toc-name { font-size: 1.25rem; }
  .toc-line { flex-wrap: wrap; }
  .toc-leader { display: none; }
  .toc-meta { flex-basis: 100%; }
  .toc-row.is-current::after { right: -1.9rem; width: 1.6rem; }
  .book { padding: 2.3rem 3.5rem 0.7rem 1.3rem; margin-bottom: 4.8rem; }
  .ribbon { left: 1rem; width: 2.5rem; height: 6.3rem; bottom: -5rem; padding-bottom: 1.1rem; }
  .ribbon.is-word span { font-size: 0.8rem; }
  .ribbon span { font-size: 1.35rem; }
  .entry-title { font-size: 1.5rem; padding-right: 1rem; }
  .book-corner { --corner-scale: 0.8; }
  .book-turn { width: 100%; margin-left: 0; justify-content: space-between; }
  .book-foot .book-arrow { width: 3rem; height: 3rem; font-size: 2rem; }
  .book-mode { order: 1; width: 100%; text-align: center; font-size: 0.9rem; }
  .entry-text { font-size: 1.08rem; line-height: 1.55; }
  .margin { grid-template-columns: minmax(0, 1fr); }
  .ch-map { grid-row: auto; }
  .timeline { --tl-time: 3.9rem; --tl-gap: 1.9rem; }
  .timeline time { font-size: 0.85rem; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .book-flow, .book-corner { transition: none; }
  .book.is-new .book-corner { animation: none; }
}
