:root {
  --reader-night: #11100e;
  --reader-night-soft: #1a1712;
  --reader-paper: #eee7d8;
  --reader-ink: #27221b;
  --reader-muted: #766b5a;
  --reader-copper: #a66d3f;
  --reader-line: rgb(82 67 49 / 20%);
  --reader-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --reader-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.story-reader {
  margin: 0;
  background:
    radial-gradient(circle at 78% 8%, rgb(155 91 42 / 12%), transparent 30rem),
    linear-gradient(180deg, var(--reader-night-soft), var(--reader-night));
  color: var(--reader-paper);
  font-family: var(--reader-serif);
  min-width: 20rem;
}

a {
  color: inherit;
}

.story-skip-link {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 20;
  padding: .7rem 1rem;
  background: var(--reader-paper);
  color: var(--reader-ink);
  font: 700 .82rem/1 var(--reader-sans);
  transform: translateY(-200%);
}

.story-skip-link:focus {
  transform: translateY(0);
}

.story-cover {
  min-height: min(52rem, 88svh);
  display: grid;
  align-items: center;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgb(238 231 216 / 10%);
}

.story-cover::before,
.story-cover::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.story-cover::before {
  inset: 7% 6%;
  border: 1px solid rgb(238 231 216 / 7%);
  border-bottom: 0;
}

.story-cover::after {
  width: 34rem;
  height: 34rem;
  right: -12rem;
  bottom: -18rem;
  border: 1px solid rgb(166 109 63 / 24%);
  border-radius: 50%;
  box-shadow: 0 0 0 4rem rgb(166 109 63 / 3%), 0 0 0 9rem rgb(166 109 63 / 2%);
}

.story-cover-inner {
  width: min(100% - 3rem, 68rem);
  margin: 0 auto;
  padding: 6rem 0 9rem;
  position: relative;
  z-index: 1;
}

.story-brand,
.story-section-label,
.story-status,
.story-credit {
  font-family: var(--reader-sans);
}

.story-brand {
  display: flex;
  gap: .65rem;
  margin: 0 0 4.5rem;
  color: rgb(238 231 216 / 58%);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.story-status {
  display: inline-block;
  margin: 0 0 1.15rem;
  color: #c7966d;
  font-size: .7rem;
  font-weight: 750;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.story-cover h1 {
  margin: 0;
  color: #f2ebdd;
  font-size: clamp(5.2rem, 15vw, 10.5rem);
  font-weight: 400;
  letter-spacing: -.065em;
  line-height: .8;
}

.story-subtitle {
  margin: 2.6rem 0 0;
  color: #d8c9b1;
  font-size: clamp(1.35rem, 2.4vw, 1.8rem);
  line-height: 1.35;
}

.story-synopsis {
  max-width: 38rem;
  margin: 1.4rem 0 0;
  color: rgb(238 231 216 / 68%);
  font-size: 1.05rem;
  line-height: 1.7;
}

.story-start {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  margin-top: 2.8rem;
  padding-bottom: .45rem;
  border-bottom: 1px solid rgb(199 150 109 / 55%);
  color: #e1c3a8;
  font: 650 .78rem/1.2 var(--reader-sans);
  letter-spacing: .08em;
  text-decoration: none;
  text-transform: uppercase;
}

.story-start:hover,
.story-start:focus-visible {
  color: #fff5e8;
  border-color: currentColor;
}

.story-paper {
  width: min(100% - 3rem, 76rem);
  margin: -4rem auto 0;
  position: relative;
  z-index: 2;
  background: var(--reader-paper);
  color: var(--reader-ink);
  border: 1px solid rgb(255 255 255 / 25%);
  box-shadow: 0 2rem 7rem rgb(0 0 0 / 38%);
}

.story-toc {
  padding: 4.5rem clamp(2rem, 8vw, 6rem);
  border-bottom: 1px solid var(--reader-line);
  background: linear-gradient(135deg, rgb(255 255 255 / 15%), transparent 55%);
}

.story-toc-heading {
  margin-bottom: 2.3rem;
}

.story-section-label {
  margin: 0 0 .55rem;
  color: var(--reader-copper);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.story-toc h2,
.story-chapter h2 {
  margin: 0;
  font-weight: 400;
}

.story-toc h2 {
  font-size: clamp(2rem, 4vw, 2.8rem);
}

.story-toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.story-toc li {
  border-top: 1px solid var(--reader-line);
}

.story-toc li:last-child {
  border-bottom: 1px solid var(--reader-line);
}

.story-toc a {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 1.2rem;
  align-items: center;
  padding: 1.4rem .15rem;
  text-decoration: none;
}

.story-toc a:hover .story-toc-title strong,
.story-toc a:focus-visible .story-toc-title strong {
  color: var(--reader-copper);
}

.story-toc-number {
  color: var(--reader-muted);
  font-family: var(--reader-sans);
  font-size: .73rem;
}

.story-toc-title {
  display: grid;
  gap: .16rem;
}

.story-toc-title > span {
  color: var(--reader-muted);
  font: 650 .69rem/1.3 var(--reader-sans);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.story-toc-title strong {
  font-size: 1.22rem;
  font-weight: 500;
  transition: color 160ms ease;
}

.story-chapter {
  padding: clamp(5rem, 9vw, 8rem) 2rem;
  scroll-margin-top: 1rem;
}

.story-chapter + .story-chapter {
  border-top: 1px solid var(--reader-line);
}

.story-chapter-heading,
.story-prose {
  width: min(100%, 43rem);
  margin-inline: auto;
}

.story-chapter-heading {
  margin-bottom: 4rem;
}

.story-chapter h2 {
  font-size: clamp(2.8rem, 7vw, 4.7rem);
  letter-spacing: -.035em;
  line-height: 1;
}

.story-prose {
  font-size: clamp(1.08rem, 1.6vw, 1.18rem);
  line-height: 1.82;
}

.story-prose p {
  margin: 0 0 1.45em;
}

.story-prose p:last-child {
  margin-bottom: 0;
}

.story-figure {
  width: min(100%, 64rem);
  margin: 4.5rem auto;
  background: #17140f;
  border: .55rem solid #d8ccb6;
  box-shadow: 0 1.2rem 3rem rgb(48 38 27 / 22%);
}

.story-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.story-figure figcaption {
  padding: .85rem 1rem .25rem;
  color: #a99b86;
  font: .75rem/1.5 var(--reader-sans);
}

.story-end {
  padding: 1rem 2rem 6rem;
  text-align: center;
}

.story-end span {
  display: block;
  width: 2.6rem;
  height: 1px;
  margin: 0 auto 1.5rem;
  background: var(--reader-copper);
}

.story-end p {
  margin: 0;
  color: var(--reader-muted);
  font-size: 1rem;
  font-style: italic;
}

.story-credit {
  padding: 2.7rem 1.5rem 3rem;
  color: rgb(238 231 216 / 36%);
  font-size: .65rem;
  letter-spacing: .13em;
  text-align: center;
  text-transform: uppercase;
}

.story-credit p {
  margin: 0;
}

.story-missing {
  width: min(100% - 3rem, 42rem);
  min-height: 100svh;
  margin: 0 auto;
  display: grid;
  align-content: center;
  padding: 4rem 0;
}

.story-missing .story-brand {
  margin-bottom: 3rem;
}

.story-missing h1 {
  margin: 0;
  color: #f2ebdd;
  font-size: clamp(3rem, 10vw, 6rem);
  font-weight: 400;
  letter-spacing: -.05em;
  line-height: .95;
}

.story-missing > p:last-child {
  max-width: 30rem;
  margin: 2rem 0 0;
  color: rgb(238 231 216 / 62%);
  font-size: 1.05rem;
  line-height: 1.7;
}

@media (max-width: 42rem) {
  .story-cover {
    min-height: 47rem;
  }

  .story-cover::before {
    inset: 1.25rem;
  }

  .story-cover-inner {
    width: min(100% - 2.7rem, 38rem);
    padding: 4rem 0 7rem;
  }

  .story-brand {
    margin-bottom: 3.5rem;
  }

  .story-cover h1 {
    font-size: clamp(4.8rem, 26vw, 7.2rem);
  }

  .story-paper {
    width: 100%;
    margin-top: -2rem;
    border-inline: 0;
  }

  .story-toc {
    padding: 3.7rem 1.4rem;
  }

  .story-toc a {
    grid-template-columns: 2.2rem 1fr;
    gap: .8rem;
  }

  .story-chapter {
    padding: 4.5rem 0;
  }

  .story-chapter-heading,
  .story-prose {
    width: auto;
    margin-inline: 1.35rem;
  }

  .story-chapter-heading {
    margin-bottom: 3.2rem;
  }

  .story-prose {
    font-size: 1.08rem;
    line-height: 1.76;
  }

  .story-figure {
    width: 100%;
    margin: 3.5rem 0;
    border-width: .35rem 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .story-toc-title strong {
    transition: none;
  }
}

@media print {
  body.story-reader {
    background: white;
    color: black;
  }

  .story-cover,
  .story-paper {
    width: 100%;
    margin: 0;
    color: black;
    background: white;
    border: 0;
    box-shadow: none;
  }

  .story-cover {
    min-height: auto;
  }

  .story-cover h1,
  .story-subtitle,
  .story-synopsis {
    color: black;
  }

  .story-start,
  .story-credit {
    display: none;
  }
}
