:root {
  --paper: #f3ecdc;
  --paper-deep: #e6d8bc;
  --surface: #fffdf7;
  --ink: #142d3d;
  --ink-soft: #405561;
  --terracotta: #a3442e;
  --terracotta-dark: #7f2f20;
  --gold: #b38a3e;
  --sage: #6d7e68;
  --blue: #496b7a;
  --rule: #c9ae72;
  --shadow: 0 12px 24px rgb(20 45 61 / 14%);
  --serif: Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --canvas: 1380px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: auto;
}

body {
  min-width: 900px;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgb(255 253 247 / 42%), rgb(255 253 247 / 42%)),
    repeating-linear-gradient(0deg, transparent 0 4px, rgb(20 45 61 / 2%) 4px 5px),
    var(--paper);
  font-family: var(--sans);
  font-size: 20px;
  line-height: 1.6;
}

a {
  color: inherit;
}

.page-shell {
  width: min(calc(100% - 96px), var(--canvas));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 16px;
  left: 16px;
  padding: 12px 18px;
  border: 3px solid var(--surface);
  border-radius: 4px;
  color: var(--surface);
  background: var(--terracotta-dark);
  font-size: 20px;
  font-weight: 700;
  transform: translateY(-160%);
}

.skip-link:focus {
  outline: 4px solid var(--gold);
  outline-offset: 3px;
  transform: translateY(0);
}

.masthead {
  position: relative;
  overflow: hidden;
  border-bottom: 6px solid var(--terracotta);
  color: var(--surface);
  background: var(--ink);
}

.masthead::after {
  position: absolute;
  right: -80px;
  bottom: -145px;
  width: 470px;
  height: 330px;
  border: 2px solid rgb(201 174 114 / 32%);
  border-radius: 50%;
  box-shadow:
    -52px -24px 0 -1px var(--ink),
    -52px -24px 0 1px rgb(201 174 114 / 22%),
    -104px -48px 0 -1px var(--ink),
    -104px -48px 0 1px rgb(201 174 114 / 14%);
  content: "";
  pointer-events: none;
}

.masthead__inner {
  position: relative;
  z-index: 1;
  padding-block: 64px 56px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  color: var(--terracotta-dark);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1.3;
  text-transform: uppercase;
}

.eyebrow {
  color: #e4c98e;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 1060px;
  margin-bottom: 24px;
  font-family: var(--serif);
  font-size: 64px;
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.03;
}

h1 small {
  display: block;
  max-width: 980px;
  margin-top: 14px;
  color: #f2dfbb;
  font-size: 34px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.25;
}

.draft-status {
  margin-bottom: 0;
  color: #f3ead7;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.025em;
}

.welcome {
  padding-block: 64px 72px;
}

.welcome__copy {
  max-width: 940px;
}

h2 {
  margin-bottom: 14px;
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 400;
  line-height: 1.2;
}

.welcome__copy > p:last-child {
  max-width: 880px;
  margin-bottom: 0;
  color: var(--ink-soft);
}

.review-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 40px 0 32px;
  padding: 0;
  list-style: none;
  counter-reset: review-step;
}

.review-steps li {
  position: relative;
  min-height: 156px;
  padding: 24px 24px 22px 76px;
  border-top: 4px solid var(--gold);
  background: rgb(255 253 247 / 68%);
  color: var(--ink-soft);
  font-size: 20px;
  line-height: 1.45;
  counter-increment: review-step;
}

.review-steps li::before {
  position: absolute;
  top: 25px;
  left: 22px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 2px solid var(--terracotta);
  border-radius: 50%;
  color: var(--terracotta-dark);
  content: counter(review-step);
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
}

.review-steps strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 20px;
}

.folder-button {
  display: inline-flex;
  min-height: 58px;
  align-items: center;
  gap: 12px;
  padding: 12px 22px;
  border: 2px solid var(--terracotta-dark);
  border-radius: 4px;
  color: var(--surface);
  background: var(--terracotta-dark);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.3;
  text-decoration: none;
}

.folder-button:hover {
  border-color: var(--ink);
  background: var(--ink);
}

.folder-button:focus-visible,
.chapter-card:focus-visible {
  outline: 4px solid var(--terracotta-dark);
  outline-offset: 5px;
}

.chapters {
  padding-bottom: 88px;
  scroll-margin-top: 24px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--rule);
}

.section-heading h2,
.section-heading p {
  margin-bottom: 0;
}

.section-heading > p {
  color: var(--ink-soft);
  font-size: 20px;
  font-weight: 700;
}

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chapter-grid > li {
  display: flex;
}

.chapter-card {
  display: flex;
  width: 100%;
  min-height: 444px;
  flex-direction: column;
  overflow: hidden;
  border: 2px solid #ab9467;
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
  text-decoration: none;
}

.chapter-card:hover,
.chapter-card:focus-visible {
  border-color: var(--terracotta-dark);
  box-shadow: var(--shadow);
}

.chapter-card:visited {
  color: var(--ink);
}

.chapter-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-bottom: 2px solid #ab9467;
  background: var(--paper-deep);
  object-fit: cover;
}

.prologue-art {
  position: relative;
  display: flex;
  aspect-ratio: 16 / 9;
  flex-direction: column;
  justify-content: end;
  overflow: hidden;
  padding: 30px;
  border-bottom: 2px solid #ab9467;
  color: var(--surface);
  background:
    linear-gradient(135deg, transparent 0 52%, rgb(228 201 142 / 18%) 52% 53%, transparent 53%),
    linear-gradient(28deg, var(--ink) 0 55%, #294a59 55% 73%, var(--terracotta-dark) 73%);
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.08;
}

.prologue-art::before {
  position: absolute;
  top: 24px;
  right: 26px;
  width: 86px;
  height: 86px;
  border: 2px solid rgb(228 201 142 / 62%);
  border-radius: 50%;
  content: "";
}

.prologue-art span {
  position: relative;
}

.chapter-card--prologue:hover .prologue-art,
.chapter-card--prologue:focus-visible .prologue-art {
  border-bottom-color: var(--terracotta-dark);
}

.chapter-card:hover img,
.chapter-card:focus-visible img {
  border-bottom-color: var(--terracotta-dark);
}

.chapter-card__body {
  display: flex;
  min-height: 194px;
  flex: 1;
  flex-direction: column;
  padding: 22px 24px 20px;
}

.chapter-number {
  margin-bottom: 7px;
  color: var(--terracotta-dark);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.3;
  text-transform: uppercase;
}

.chapter-title {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 700;
  line-height: 1.24;
}

.chapter-action {
  margin-top: auto;
  padding-top: 20px;
  color: var(--blue);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.3;
}

.chapter-card:hover .chapter-action,
.chapter-card:focus-visible .chapter-action {
  color: var(--terracotta-dark);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.site-footer {
  border-top: 5px solid var(--terracotta);
  color: #f2eadb;
  background: var(--ink);
}

.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
  padding-block: 34px;
}

.site-footer p {
  margin: 0;
  font-size: 20px;
}

.site-footer p:last-child {
  color: #d8cfbd;
  text-align: right;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
