/* Stories: the public reading site. Built into site/assets/ by scripts/build_site.py. */

/* --- Tokens ------------------------------------------------------------- */

:root {
  --paper: #f5f0e6;
  --paper-raised: #fbf8f1;
  --paper-sunk: #ebe4d5;
  --ink: #1f2420;
  --ink-soft: #565d57;
  --ink-faint: #8a8e84;
  --rule: #dcd3c0;
  --sage: #687466;
  --shadow: 40 30 15;
  --grain: .05;

  --horror: #8f2f2a;
  --scifi: #255f80;
  --fantasy: #87610f;
  --comedy: #7a4690;
  --thriller: #4a5765;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", P052, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --reader-size: 1.2rem;
  --g: var(--sage);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]), :root[data-theme="auto"] {
    --paper: #121513; --paper-raised: #1a1e1b; --paper-sunk: #0c0e0d;
    --ink: #e7e1d3; --ink-soft: #a7aba0; --ink-faint: #747970; --rule: #2b302c;
    --sage: #9db096; --shadow: 0 0 0; --grain: .025;
    --horror: #e58b7d; --scifi: #86bfe2; --fantasy: #e1b75e; --comedy: #c9a1e2; --thriller: #a9b8c7;
    color-scheme: dark;
  }
}

:root[data-theme="night"] {
  --paper: #121513; --paper-raised: #1a1e1b; --paper-sunk: #0c0e0d;
  --ink: #e7e1d3; --ink-soft: #a7aba0; --ink-faint: #747970; --rule: #2b302c;
  --sage: #9db096; --shadow: 0 0 0; --grain: .025;
  --horror: #e58b7d; --scifi: #86bfe2; --fantasy: #e1b75e; --comedy: #c9a1e2; --thriller: #a9b8c7;
  color-scheme: dark;
}

:root[data-theme="sepia"] {
  --paper: #f0e5cc; --paper-raised: #f6eedb; --paper-sunk: #e5d6b6;
  --ink: #3b2f22; --ink-soft: #6c5a45; --ink-faint: #9a866d; --rule: #d9c6a0;
  --sage: #74683f; --shadow: 70 45 10; --grain: .06;
}

.g-horror   { --g: var(--horror); }
.g-scifi    { --g: var(--scifi); }
.g-fantasy  { --g: var(--fantasy); }
.g-comedy   { --g: var(--comedy); }
.g-thriller { --g: var(--thriller); }

/* --- Base --------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.55;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s, color .3s;
}

/* A faint paper grain. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .4 0 0 0 0 .2 0 0 0 1.4 -.3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--g); outline-offset: 3px; border-radius: 2px; }

.wrap {
  width: 100%;
  max-width: 74rem;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
}

.icon { width: 1.1em; height: 1.1em; flex: none; }

.sparkles { width: 2.6em; height: auto; flex: none; color: var(--sage); }

/* The ornament in the story's ink, drawn from the shared sparkle SVG. */
.ornament, .prose .break, .prose h2::before {
  background: var(--g);
  -webkit-mask: url(sparkles.svg) center / contain no-repeat;
  mask: url(sparkles.svg) center / contain no-repeat;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-size: 1.2rem;
  font-style: italic;
  text-decoration: none;
  color: var(--ink);
}
.brand .sparkles { width: 2.1rem; }
.brand:hover .sparkles { color: var(--g); }

.kicker {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .25rem .6rem;
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.kicker > span::before { content: "·"; margin-right: .6rem; color: var(--ink-faint); }

.genres { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; }
.pill, .status {
  display: inline-flex;
  align-items: center;
  gap: .35em;
  padding: .18rem .6rem .18rem .5rem;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 550;
  letter-spacing: .02em;
  line-height: 1.4;
  color: var(--g);
  background: color-mix(in srgb, var(--g) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--g) 32%, transparent);
}
.pill .icon { width: 1.05em; height: 1.05em; }
.status { color: var(--ink-soft); --g: var(--ink-soft); padding-inline: .6rem; font-style: italic; font-weight: 450; }

/* --- Home --------------------------------------------------------------- */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: clamp(1.5rem, 4vw, 2.75rem) clamp(1.25rem, 3vw, 2rem);
}

.masthead h1 {
  display: flex;
  align-items: center;
  gap: .45em;
  margin: 0;
  font-size: clamp(2rem, 5vw, 2.9rem);
  font-weight: 400;
  font-style: italic;
  line-height: 1;
  letter-spacing: -.015em;
}
.masthead h1 .sparkles { width: 1.5em; }

.shelf-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .8rem 2rem;
  padding-top: .9rem;
  border-top: 1.5px solid var(--ink);
}
.shelf-head h2 {
  margin: 0;
  font-family: var(--sans);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.filter { display: flex; flex-wrap: wrap; gap: .4rem; }
.filter button {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .32rem .75rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: transparent;
  font-family: var(--sans);
  font-size: .82rem;
  cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.filter button::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: var(--g); }
.filter button[data-genre="all"]::before { display: none; }
.filter button span { font-size: .72rem; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.filter button:hover { border-color: var(--g); }
.filter button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.filter button[aria-pressed="true"] span { color: inherit; opacity: .7; }

.shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19.5rem), 1fr));
  gap: clamp(2rem, 4vw, 3.25rem) clamp(1.25rem, 2.5vw, 2.25rem);
  margin-top: clamp(1.75rem, 3.5vw, 2.75rem);
}

.card > a { display: flex; flex-direction: column; height: 100%; text-decoration: none; }

.card-art {
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: 3px;
  background: var(--paper-sunk);
  box-shadow: 0 1px 2px rgb(var(--shadow) / .14), 0 14px 30px -18px rgb(var(--shadow) / .55);
}
.card-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .8s cubic-bezier(.2, .7, .2, 1);
}
.card-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, color-mix(in srgb, var(--g) 55%, transparent), transparent 55%);
  mix-blend-mode: multiply;
  opacity: 0;
  transition: opacity .5s;
}
.card > a:hover .card-art img { transform: scale(1.04); }
.card > a:hover .card-art::after { opacity: 1; }

.badge {
  position: absolute;
  top: .7rem;
  left: .7rem;
  z-index: 1;
  padding: .2rem .55rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(6px);
  font-family: var(--sans);
  font-size: .7rem;
  font-weight: 600;
  color: var(--ink);
}

.card-body { display: flex; flex-direction: column; gap: .55rem; padding-top: 1.05rem; flex: 1; }
.card h2 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1.12;
  text-wrap: balance;
  text-decoration: underline transparent 1px;
  text-underline-offset: .18em;
  transition: text-decoration-color .3s, color .3s;
}
.card > a:hover h2 { text-decoration-color: var(--g); }
.card .blurb {
  margin: 0;
  color: var(--ink-soft);
  font-size: .98rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}
.card .genres { margin-top: auto; padding-top: .35rem; }

.card-opening {
  margin: .2rem 0 .3rem;
  padding-left: 1rem;
  border-left: 2px solid var(--g);
  font-size: 1.2rem;
  font-style: italic;
  line-height: 1.4;
  text-wrap: pretty;
}

@media (min-width: 56rem) {
  .card.featured { grid-column: 1 / -1; }
  .card.featured > a {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: clamp(2rem, 4vw, 3.5rem);
    align-items: center;
  }
  .card.featured .card-body { padding-top: 0; gap: .8rem; }
  .card.featured h2 { font-size: clamp(2.3rem, 4vw, 3.3rem); line-height: 1.02; letter-spacing: -.01em; }
  .card.featured .blurb { -webkit-line-clamp: unset; display: block; font-size: 1.04rem; }
  .card.featured .genres { margin-top: .4rem; }
}

/* --- Footer ------------------------------------------------------------- */

.site-footer {
  margin-top: clamp(4rem, 10vw, 7rem);
  padding-block: 2rem 3rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: .85rem;
  color: var(--ink-soft);
}
.footer-main, .fineprint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem 2rem;
}
.site-footer .brand { font-family: var(--serif); font-size: 1.05rem; }
.fineprint { margin-top: 1.4rem; font-size: .75rem; color: var(--ink-faint); }
.fineprint p { margin: 0; }
.fineprint a, .reader-licence a { color: inherit; text-underline-offset: .2em; }
.fineprint .copyright:empty { display: none; }
.fineprint p:last-child { margin-left: auto; }
.feed-link { display: inline-flex; align-items: center; gap: .4rem; text-decoration: none; }
.feed-link:hover { color: var(--ink); }

/* --- Story page --------------------------------------------------------- */

.topbar { display: flex; align-items: center; justify-content: space-between; padding-block: 1.1rem; }

.hero {
  position: relative;
  margin: 0 auto;
  max-width: 110rem;
  height: clamp(16rem, 62vh, 44rem);
  overflow: hidden;
}
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, transparent 45%, var(--paper) 98%),
    linear-gradient(to right, color-mix(in srgb, var(--paper) 35%, transparent), transparent 18%, transparent 82%, color-mix(in srgb, var(--paper) 35%, transparent));
}

.story-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
  margin-top: clamp(-7rem, -9vw, -3rem);
}
@media (min-width: 58rem) {
  .story-grid { grid-template-columns: minmax(0, 1fr) 21rem; gap: clamp(3rem, 6vw, 5.5rem); }
  .take { position: sticky; top: 1.5rem; align-self: start; margin-top: 5.5rem; }
}

.story-main h1 {
  margin: .9rem 0 .7rem;
  font-size: clamp(2.6rem, 7vw, 5rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.meta { margin: 0; font-family: var(--sans); font-size: .88rem; color: var(--ink-soft); }
.author-byline { margin: 0 0 .7rem; font-size: 1rem; color: var(--ink-soft); }
.quick-read { margin-top: 1.4rem; }
@media (min-width: 58rem) { .quick-read { display: none; } }

.opening { margin: 2.4rem 0 2rem; }
.opening figcaption {
  margin-bottom: .6rem;
  font-family: var(--sans);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--g);
}
.opening blockquote {
  margin: 0;
  padding-left: 1.3rem;
  border-left: 2px solid var(--g);
  font-size: clamp(1.35rem, 2.6vw, 1.75rem);
  font-style: italic;
  line-height: 1.38;
  text-wrap: pretty;
}

.story-main > .blurb { max-width: 36em; margin: 0; font-size: 1.16rem; line-height: 1.62; text-wrap: pretty; }

.contents { margin-top: 2.8rem; max-width: 36em; }
.contents h2, .take h2, .drawer h2 {
  margin: 0 0 .5rem;
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.contents ol, .drawer ol { list-style: none; margin: 0; padding: 0; counter-reset: ch; }
.contents li a, .drawer li a {
  display: flex;
  gap: .9rem;
  padding: .55rem 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  line-height: 1.35;
  transition: color .2s;
}
.contents li a::before, .drawer li a::before {
  counter-increment: ch;
  content: counter(ch, decimal-leading-zero);
  min-width: 1.6rem;
  padding-top: .18em;
  font-family: var(--sans);
  font-size: .72rem;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}
.contents li a:hover, .drawer li a:hover { color: var(--g); }

.updated { margin: 2.2rem 0 0; font-family: var(--sans); font-size: .8rem; color: var(--ink-faint); }

.take {
  padding: 1.4rem;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: 6px;
  box-shadow: 0 18px 40px -28px rgb(var(--shadow) / .6);
}
.take h2 { margin-top: 1.6rem; }

.btn-read {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .95rem 1.15rem;
  border-radius: 4px;
  background: var(--g);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: filter .2s;
}
.btn-read .icon { transition: transform .25s; }
.btn-read:hover { filter: brightness(1.08) saturate(1.05); }
.btn-read:hover .icon { transform: translateX(3px); }

.downloads { list-style: none; margin: 0; padding: 0; }
.downloads a {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "icon fmt size" "icon desc desc";
  column-gap: .8rem;
  align-items: center;
  padding: .75rem .2rem;
  border-top: 1px solid var(--rule);
  text-decoration: none;
}
.downloads li:first-child a { border-top: 0; }
.downloads .icon { grid-area: icon; width: 1.45rem; height: 1.45rem; color: var(--g); align-self: start; margin-top: .1rem; }
.downloads .fmt { grid-area: fmt; font-family: var(--sans); font-size: .92rem; font-weight: 600; }
.downloads .desc { grid-area: desc; font-family: var(--sans); font-size: .78rem; color: var(--ink-soft); line-height: 1.35; }
.downloads .size { grid-area: size; font-family: var(--sans); font-size: .72rem; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.downloads a:hover .fmt { color: var(--g); }

.neighbours {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: clamp(3.5rem, 8vw, 5.5rem);
  padding-top: 1.4rem;
  border-top: 1px solid var(--rule);
}
.neighbours a { display: flex; flex-direction: column; gap: .2rem; font-size: 1.25rem; font-style: italic; line-height: 1.25; text-decoration: none; }
.neighbours a span {
  font-family: var(--sans);
  font-size: .7rem;
  font-style: normal;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.neighbours .next { text-align: right; grid-column: 2; }
.neighbours a:hover { color: var(--g); }

.lost { text-align: center; padding-block: 18vh 10vh; }
.lost h1 { font-weight: 400; font-style: italic; font-size: clamp(2rem, 5vw, 3.2rem); margin: 1.5rem 0 2rem; }
.lost .btn-read { display: inline-flex; }
.lost .ornament, .r-end .ornament { width: 4.5rem; height: 1.8rem; margin: 0 auto; }

/* --- Reader ------------------------------------------------------------- */

.progress { position: fixed; inset: 0 0 auto; z-index: 40; height: 2px; pointer-events: none; }
.progress span {
  display: block;
  height: 100%;
  background: var(--g);
  transform-origin: left;
  transform: scaleX(var(--progress, 0));
}

.rbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .45rem clamp(.6rem, 3vw, 1.4rem);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: transform .35s ease, border-color .3s, background-color .3s;
}
.rbar.is-scrolled { border-bottom-color: var(--rule); }
.rbar.is-hidden { transform: translateY(-100%); }

.rbar-back {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-width: 0;
  padding: .4rem .5rem;
  border-radius: 6px;
  font-family: var(--sans);
  font-size: .88rem;
  text-decoration: none;
  color: var(--ink-soft);
}
.rbar-back span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rbar-back:hover { color: var(--ink); background: var(--paper-sunk); }
.rbar-tools { display: flex; gap: .2rem; }

.tool {
  display: grid;
  place-items: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 .55rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}
.tool:hover { background: var(--paper-sunk); }
.tool .icon { width: 1.3rem; height: 1.3rem; }
.tool-aa { font-family: var(--serif); font-size: 1.1rem; }

[popover] {
  margin: 0;
  padding: 1.3rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--paper-raised);
  color: var(--ink);
  box-shadow: 0 24px 60px -24px rgb(var(--shadow) / .55);
}

.drawer {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(24rem, 88vw);
  height: 100dvh;
  max-height: none;
  overflow-y: auto;
  padding: 1.6rem 1.5rem;
  border-width: 0 0 0 1px;
  border-radius: 0;
}
.drawer::backdrop { background: rgb(0 0 0 / .28); }
.drawer li a { font-size: 1.02rem; }

.prefs { position: fixed; inset: 3.5rem .75rem auto auto; width: 17rem; }
.prefs-label {
  margin: 0 0 .5rem;
  font-family: var(--sans);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.prefs-label:not(:first-child) { margin-top: 1.2rem; }
.seg { display: flex; gap: .4rem; }
.seg button {
  flex: 1;
  padding: .55rem .3rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--paper);
  font-family: var(--serif);
  font-size: 1.05rem;
  cursor: pointer;
}
.seg button small { font-size: .8em; margin-left: .1em; }
.seg button:hover { border-color: var(--ink-faint); }
.themes button { font-family: var(--sans); font-size: .75rem; }
.swatch-paper { background: #f5f0e6 !important; color: #1f2420 !important; }
.swatch-sepia { background: #f0e5cc !important; color: #3b2f22 !important; }
.swatch-night { background: #121513 !important; color: #e7e1d3 !important; }
.seg button[aria-pressed="true"] { border-color: var(--g); box-shadow: 0 0 0 1px var(--g); }

.switch {
  display: flex;
  align-items: center;
  gap: .7rem;
  font-family: var(--sans);
  font-size: .88rem;
  cursor: pointer;
}
.switch input {
  appearance: none;
  position: relative;
  flex: none;
  width: 2.3rem;
  height: 1.3rem;
  margin: 0;
  border-radius: 999px;
  background: var(--rule);
  cursor: pointer;
  transition: background-color .2s;
}
.switch input::after {
  content: "";
  position: absolute;
  top: .15rem;
  left: .15rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--paper-raised);
  box-shadow: 0 1px 2px rgb(0 0 0 / .25);
  transition: transform .2s;
}
.switch input:checked { background: var(--g); }
.switch input:checked::after { transform: translateX(1rem); }
.prefs-hint { margin: .55rem 0 0; font-family: var(--sans); font-size: .74rem; line-height: 1.4; color: var(--ink-faint); }

.reader { padding-bottom: 3rem; }

.r-head {
  max-width: 40rem;
  margin: clamp(1.5rem, 5vw, 3.5rem) auto clamp(2.5rem, 6vw, 4rem);
  padding-inline: 1.25rem;
  text-align: center;
}
.r-head img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 18px 40px -24px rgb(var(--shadow) / .6);
}
.r-head .kicker { justify-content: center; margin-top: 2rem; }
.r-head h1 {
  margin: .7rem 0 0;
  font-size: clamp(2.3rem, 7vw, 3.8rem);
  font-weight: 400;
  line-height: 1.03;
  letter-spacing: -.015em;
  text-wrap: balance;
}
.r-head .author-byline { margin: .8rem 0 0; }

.prose {
  max-width: 34em;
  margin-inline: auto;
  padding-inline: 1.25rem;
  font-size: var(--reader-size);
  line-height: 1.68;
  font-variant-numeric: oldstyle-nums;
  hanging-punctuation: first;
  overflow-wrap: break-word;
}
.prose p { margin: 0; text-indent: 1.5em; text-wrap: pretty; }
.prose p.first, .prose p.opening { text-indent: 0; }
.prose p.opening::first-line { font-variant-caps: small-caps; letter-spacing: .05em; }

.prose h2 {
  margin: 4.5em 0 1.8em;
  font-size: 1.5em;
  font-weight: 400;
  line-height: 1.2;
  text-align: center;
  text-wrap: balance;
  scroll-margin-top: 4.5rem;
}
.prose h2:first-child { margin-top: 0; }
.prose h2::before { content: ""; display: block; width: 3rem; height: 1.2rem; margin: 0 auto 1.1rem; }

.prose .break { height: 1rem; width: 3.4rem; margin: 1.9em auto; }

.prose .art {
  position: relative;
  left: 50%;
  width: min(calc(100vw - 2rem), 46rem);
  margin: 2.4em 0;
  transform: translateX(-50%);
}
.prose .art img { width: 100%; height: auto; border-radius: 3px; box-shadow: 0 18px 40px -26px rgb(var(--shadow) / .6); }

.r-end {
  max-width: 34rem;
  margin: 5rem auto 0;
  padding-inline: 1.25rem;
  text-align: center;
  font-family: var(--sans);
  color: var(--ink-soft);
}
.r-end p { margin: 1.4rem 0 0; }
.r-end .reader-licence { font-size: .8rem; color: var(--ink-faint); }
.r-end cite { font-family: var(--serif); font-size: 1.1em; color: var(--ink); }
.r-downloads a { font-weight: 600; text-decoration-color: color-mix(in srgb, var(--g) 50%, transparent); text-underline-offset: .2em; }
.r-downloads a:hover { color: var(--g); }
.r-home {
  display: inline-block;
  margin-top: .6rem;
  padding: .6rem 1.2rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink);
}
.r-home:hover { border-color: var(--g); color: var(--g); }

/* --- Motion and print ----------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

@media print {
  body::before, .rbar, .progress, .take, .neighbours, .site-footer, .filter, [popover] { display: none !important; }
  body { background: #fff; color: #000; }
  .prose { font-size: 11pt; max-width: none; }
}
