:root {
  --bg: #0D0D0D;
  --text: #F0F0F0;
  --accent: #D92B2B;
  --muted: #666666;        /* hairline-adjacent uses, empty meters, decorative only */
  --muted-text: #8C8C8C;   /* small secondary text; #666666 fails contrast on #0D0D0D */
  --hairline: #2A2A2A;
  --serif: Georgia, "Iowan Old Style", "Noto Serif", "Times New Roman", serif;
  --sans: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 4px;
  --measure: 34rem;

  /* Type scale, ~1.25 (major third) ratio. --text-base is body copy, fixed;
     the others step out from it. --text-xl/--text-2xl favour the h1 sizes
     already set in an earlier pass over strict ratio math. */
  --text-xs: 0.8rem;
  --text-sm: 1rem;
  --text-base: 1.0625rem;
  --text-md: 1.25rem;
  --text-lg: 1.5rem;
  --text-xl: 2rem;
  --text-2xl: 2.75rem;
}

@font-face {
  font-family: "Wordmark";
  src: url("/assets/wordmark-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Wordmark";
  src: url("/assets/wordmark-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: var(--text-base);
  line-height: 1.6;
  margin: 0;
}

button, input, select, .sys, footer, nav {
  font-family: var(--sans);
}

h1, h2, h3, p, ul, ol {
  margin: 0;
}

h1 {
  font-size: 1.5rem;
  line-height: 1.3;
  font-weight: 400;
}

h2 {
  font-size: 1.2rem;
  font-weight: 400;
}

.sys:not(.btn):not(.btn-quiet):not(.site-nav__toggle) {
  font-size: var(--text-xs);
}

a {
  color: var(--text);
  text-decoration: underline;
  transition: color .15s ease;
}

nav a,
footer a {
  color: var(--muted-text);
  text-decoration: none;
}

nav a:hover,
nav a:focus,
footer a:hover,
footer a:focus {
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.375rem;
}

main.wrap {
  padding-top: 2.25rem;
}

main > * + * {
  margin-top: 2.75rem;
}

.ln {
  border-top: 1px solid var(--hairline);
}

.btn,
.btn-quiet {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: var(--text-sm);
  font-weight: 500;
  text-align: center;
  text-decoration: none;
}

.btn {
  background: var(--accent);
  color: var(--text);
  border: 0;
}

.btn-quiet {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--text);
}

.btn:active,
.btn-quiet:active {
  opacity: .85;
}

input, select {
  height: 2.75rem;
  background: #161616;
  border: 1px solid #444444;
  color: var(--text);
  border-radius: var(--radius);
  padding: 0 .75rem;
  font-size: 0.9375rem;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--hairline);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
}

.brand__word {
  display: inline-flex;
  flex-direction: column;
  font-family: var(--sans);
}

.brand__top {
  font-family: "Wordmark", var(--sans);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--text);
}

.brand__rule {
  height: 3px;
  background: var(--accent);
  margin: 2px 0;
}

.brand__bottom {
  font-family: "Wordmark", var(--sans);
  font-size: 0.5625rem;
  font-weight: 500;
  letter-spacing: .32em;
  color: var(--text);
}

.site-nav {
  position: relative;
}

.site-nav__toggle {
  font-family: var(--sans);
  font-size: var(--text-xs);
  background: transparent;
  border: 1px solid var(--text);
  color: var(--text);
  border-radius: var(--radius);
  padding: 0.4rem 0.75rem;
  cursor: pointer;
}

.site-nav__toggle:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.site-nav__list {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  margin: 0;
  padding: 0.5rem 0;
  list-style: none;
  background: #161616;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  min-width: 14rem;
  z-index: 10;
}

.site-nav__list li {
  list-style: none;
}

.site-nav__list a {
  display: block;
  padding: 0.6rem 1rem;
  color: var(--text);
  text-decoration: none;
  font-family: var(--sans);
  font-size: var(--text-sm);
}

.site-nav__list a:hover,
.site-nav__list a:focus {
  background: #0D0D0D;
}

.site-nav__list[hidden] {
  display: none;
}

.site-footer {
  margin-top: 3rem;
  padding: 1.25rem 0 2rem;
  font-size: var(--text-xs);
  color: var(--muted-text);
  line-height: 2;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.social-icon {
  flex: none;
}

.roadmap {
  list-style: none;
  padding: 0;
}

.book {
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr) auto;
  column-gap: 0.75rem;
  align-items: start;
  padding: 1rem 0;
  border-top: 1px solid var(--hairline);
}

.book:first-child {
  border-top: none;
}

.book:last-child {
  border-bottom: 1px solid var(--hairline);
}

.book__number {
  grid-column: 1;
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--muted-text);
  padding-top: 0.2em;
}

.book__body {
  grid-column: 2;
  min-width: 0;
}

.book__cover {
  width: 60px;
  height: auto;
  border: 1px solid var(--muted);
  border-radius: 2px;
}

.book__meter {
  grid-column: 3;
  justify-self: end;
  margin-top: 0.35rem;
}

.book__title {
  font-size: var(--text-sm);
  margin: 0;
}

.book__line {
  margin: 0.375rem 0 0;
  font-size: var(--text-sm);
}

.book__lie {
  color: var(--muted-text);
}

.book__status,
.book__length {
  font-family: var(--sans);
  font-size: var(--text-xs);
  color: var(--muted-text);
  margin-top: 0.5rem;
}

.book .btn {
  display: inline-flex;
  width: auto;
  margin-top: 0.75rem;
}

.roadmap-section h2 {
  font-size: var(--text-md);
  margin: 2.25rem 0 0.75rem;
}

.book-plain {
  padding: 1rem 0;
  border-top: 1px solid var(--hairline);
}

.book-plain:first-child {
  border-top: none;
}

.book-plain:last-child {
  border-bottom: 1px solid var(--hairline);
}

.book-plain__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.book-plain__head .book__meter {
  margin-top: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

body {
  overflow-x: clip;
}

.framed {
  border: 1px solid var(--hairline);
  padding: 1.5rem;
}

.lede h1 {
  font-size: var(--text-xl);
}

.lede-second {
  color: var(--muted-text);
  font-size: var(--text-md);
}

picture {
  display: contents;
}

.book-hero__row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.book-hero__text {
  align-self: stretch;
}

.cover {
  width: 100%;
  max-width: 200px;
  height: auto;
  flex: none;
  border: 1px solid var(--muted);
  border-radius: 2px;
}

.cover--placeholder {
  padding: 8px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.cover__number {
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--muted-text);
}

.cover__title {
  font-family: var(--serif);
  font-size: var(--text-sm);
  line-height: 1.2;
  text-align: center;
}

.cover__mark {
  align-self: flex-end;
}

.book-hero__text h2 {
  font-size: var(--text-lg);
  margin: 0;
}

.book-hero__terrain {
  margin-top: 0.625rem;
}

.book-hero__lie {
  color: var(--muted-text);
}

.chapter-link {
  margin-top: 0.75rem;
}

.chapter-link a {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-family: var(--sans);
  font-size: var(--text-sm);
  color: var(--text);
}

.chapter-link__icon {
  flex: none;
}

.book-hero .btn {
  margin-top: 1.375rem;
}

.chapter__body {
  padding-top: 1rem;
}

.chapter__body .chapter__title {
  font-family: var(--sans);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-text);
  margin-bottom: 0.75rem;
}

.chapter__body p {
  margin: 1rem 0 0;
}

.epigraph {
  font-style: italic;
  color: var(--muted-text);
  margin: 1rem 0 0;
  padding-left: 1rem;
  border-left: 2px solid var(--hairline);
}

.sectionbreak {
  border: 0;
  height: 1em;
  margin: 1.5rem auto 0;
  text-align: center;
}

.sectionbreak::after {
  content: "\2022  \2022  \2022";
  color: var(--muted);
  letter-spacing: 0.3em;
}

.signature {
  margin-top: 2.75rem;
}

/* .chapter__body p and .prose p are more specific than .signature alone and
   would otherwise zero this margin; restate it here so it wins deterministically. */
.chapter__body .signature,
.prose .signature {
  margin-top: 2.75rem;
}

.prose h2 {
  font-size: 1.2rem;
  font-weight: 400;
  margin: 2.25rem 0 0.75rem;
}

.prose p {
  margin: 1rem 0 0;
}

.book-under .btn {
  margin-top: 1rem;
}

.subscribe .btn-quiet {
  margin-top: 1rem;
}

@media (min-width: 48rem) {
  main > * + * {
    margin-top: 3.5rem;
  }

  .lede h1 {
    font-size: var(--text-2xl);
  }

  .lede-second {
    font-size: var(--text-lg);
  }

  .intro p,
  .subscribe p {
    font-size: var(--text-md);
  }

  .intro p + p,
  .subscribe p + p {
    margin-top: 0.5rem;
  }

  .book-hero__row {
    flex-direction: row;
    align-items: flex-start;
    gap: 1.125rem;
  }

  .book-hero__text {
    align-self: auto;
  }

  .book-hero__text h2 {
    font-size: var(--text-xl);
  }

  .book-hero__terrain {
    margin-top: 0.75rem;
    font-size: var(--text-md);
  }

  .book-hero__lie {
    margin-top: 0.5rem;
    font-size: var(--text-md);
  }

  .cover {
    width: 238px;
    max-width: none;
  }

  .book__cover {
    width: 110px;
  }

  .roadmap-section h2 {
    font-size: var(--text-lg);
    margin: 3rem 0 1rem;
  }

  .book__title {
    font-size: var(--text-md);
  }

  .book__line {
    margin-top: 0.5rem;
  }
}
