:root {
  --stone: #c5c0b5;
  --pencil: #25221d;
  --red: #8f2615;
  --vermilion: #c33d25;
  --rule: #777164;
  --writing: #d6d1c7;
  --heading-face: Didot, "Bodoni MT", "Noto Serif Display", Georgia, serif;
  --body-face: "Gill Sans", "Gill Sans MT", Candara, "Trebuchet MS", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 1.5rem; }
body {
  margin: 0;
  background: var(--stone);
  color: var(--pencil);
  font-family: var(--body-face);
  font-size: 1.25rem;
  line-height: 1.5;
}
h1, h2, h3, h4, p, figure, dl { margin: 0; }
h1, h2, h3, h4, legend { font-family: var(--heading-face); font-weight: 400; }
h2 { font-size: clamp(2rem, 3.2vw, 2.65rem); line-height: 1.12; margin-bottom: 1.2rem; }
h3 { font-size: 1.65rem; line-height: 1.2; margin: 1.8rem 0 .75rem; }
h4 { font-size: 1.4rem; line-height: 1.25; margin-bottom: .5rem; }
p + p { margin-top: .85rem; }
a { color: var(--red); text-decoration-thickness: .08em; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: .14em; }
a:focus-visible, button:focus-visible, textarea:focus-visible, input:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 4px;
}
button, textarea, input { font: inherit; border-radius: 0; }
button, a, label, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 5.5rem;
  padding: .65rem .8rem;
  margin-top: .6rem;
  border: 0;
  border-bottom: 2px solid var(--rule);
  background: var(--writing);
  color: var(--pencil);
  font-size: 1.125rem;
  line-height: 1.5;
  resize: vertical;
}
input[type="checkbox"] { accent-color: var(--red); width: 44px; height: 44px; flex-shrink: 0; margin: .22rem 0 0; }
fieldset { min-inline-size: 0; }
legend { padding: 0 .65rem 0 0; font-size: 1.7rem; line-height: 1.2; }
[hidden] { display: none !important; }

.bound-width { width: min(79rem, calc(100% - 5rem)); margin-inline: auto; }
.mast-rule { border-bottom: 2px solid var(--pencil); }
.mast-space { padding-block: 1.3rem; display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; }
.mast-name { display: inline-flex; gap: .8rem; align-items: center; min-height: 44px; color: var(--pencil); font-family: var(--heading-face); font-size: 1.6rem; text-decoration: none; }
.red-mark { width: .65rem; height: .65rem; background: var(--vermilion); }
.page-link { display: inline-flex; align-items: center; gap: .6rem; min-height: 48px; padding-block: .6rem; font-size: 1.125rem; }
.rail-grid { display: grid; grid-template-columns: 9rem minmax(0, 1fr); column-gap: 2.25rem; }
.rail-position { position: sticky; top: 2rem; align-self: start; padding-top: 3.1rem; font-size: 1rem; }
.rail-list { list-style: none; padding: .5rem 0 0; margin: 0; }
.rail-link { display: flex; align-items: center; min-height: 48px; padding-block: .5rem; font-size: 1.0625rem; }
.min-width-zero { min-width: 0; }
.hero-space { padding: 3rem 0 3.5rem; }
.guide-line { font-size: 1.125rem; margin-bottom: 1.25rem; color: var(--red); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(12rem, 1fr); gap: 2rem; align-items: start; }
.display-title { font-size: clamp(3.2rem, 5.4vw, 4.9rem); line-height: 1.035; letter-spacing: -.035em; text-wrap: balance; }
.title-narrow { max-width: 17ch; }
.lead-copy { font-size: 1.375rem; line-height: 1.45; margin-top: 1.4rem; max-width: 48ch; }
.lead-narrow { max-width: 47ch; }
.action-link { display: inline-flex; align-items: center; gap: 1.3rem; min-height: 54px; padding: .85rem 1.15rem; margin-top: 1.8rem; color: #fff9f0; background: var(--red); font-size: 1.125rem; text-decoration: none; }
.action-link:hover { background: #832311; }
.illustration-place { margin-top: .25rem; }
.illustration-stage { position: relative; aspect-ratio: 9 / 7; overflow: hidden; isolation: isolate; }
.drawn-sheet { position: absolute; inset: 12% 13% 15% 10%; background: #ded8cc; clip-path: polygon(0 0, 100% 0, 100% 83%, 70% 100%, 0 100%); }
.drawn-sheet::before { content: ""; position: absolute; top: 0; bottom: 0; left: 52%; width: 1px; background: #b4ac9d; }
.drawn-sheet::after { content: ""; position: absolute; width: 21%; aspect-ratio: 1; right: 8%; top: 12%; background: #999382; }
.drawn-pencil { position: absolute; width: 7%; height: 73%; left: 29%; top: 20%; transform: rotate(29deg); background: var(--vermilion); clip-path: polygon(0 0, 100% 0, 100% 86%, 50% 100%, 0 86%); }
.illustration-image { position: relative; display: block; width: 100%; height: auto; }
.illustration-loaded .drawn-sheet, .illustration-loaded .drawn-pencil { visibility: hidden; }
figcaption { font-size: 1.0625rem; line-height: 1.45; padding: 1rem 0 0; }
.section-space { padding: 2.6rem 0 3.1rem; }
.rule-top { border-top: 1px solid var(--pencil); }
.margin-grid { display: grid; grid-template-columns: minmax(0, 1fr) 12rem; gap: 2.5rem; }
.reading-column { max-width: 68ch; min-width: 0; }
.note-column { align-self: start; margin-top: .35rem; font-size: 1.0625rem; line-height: 1.45; }
.rule-left { border-left: 2px solid var(--vermilion); }
.pad-left-note { padding-left: 1rem; }
.ink-red { color: var(--red); }
.weight-semibold { font-weight: 600; }
.space-before-md { margin-top: 1.2rem; }
.space-before-lg { margin-top: 2.25rem; }
.term-rules { border-top: 1px solid var(--rule); }
.term-title { font-family: var(--heading-face); font-size: 1.4rem; line-height: 1.25; padding-top: 1rem; }
dd { margin: .4rem 0 0; padding-bottom: 1rem; border-bottom: 1px solid var(--rule); }
.worksheet-set { border: 0; border-top: 2px solid var(--rule); padding: 1rem 0 0; margin: 2.2rem 0 0; }
.tick-row { display: flex; gap: .9rem; align-items: flex-start; min-height: 48px; padding-block: .55rem; cursor: pointer; }
.field-label { display: block; min-height: 44px; padding-top: .55rem; font-weight: 600; }
.field-hint { font-size: 1.0625rem; line-height: 1.45; }
.word-switch { min-height: 48px; padding: .5rem .9rem; margin-top: 1.2rem; border: 1px solid var(--red); background: transparent; color: var(--red); font-size: 1.0625rem; }
.word-switch[aria-pressed="false"] { color: var(--pencil); border-color: var(--rule); }
.word-switch:disabled { cursor: default; }
.word-gloss { margin-top: 1.1rem; padding: .6rem 0 .6rem 1rem; border-left: 2px solid var(--vermilion); }
.next-sheet { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 56px; padding-block: .75rem; border-top: 2px solid var(--red); font-size: 1.25rem; }
.reading-list { list-style: none; padding: 0; margin: 0; }
.reading-entry { padding: 1rem 0 1.2rem; border-bottom: 1px solid var(--rule); }
.reading-entry:last-child { border-bottom: 0; }
.source-link { display: inline-flex; gap: .6rem; align-items: center; min-height: 48px; padding-block: .45rem; font-weight: 600; }
.reading-entry p { font-size: 1.125rem; line-height: 1.5; }
.footer-rule { border-top: 2px solid var(--pencil); }
.footer-space { padding-block: 1.8rem 2.1rem; font-size: 1.0625rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: .35rem 2rem; margin-top: .8rem; }
.skip-link { position: fixed; z-index: 10; left: 1rem; top: -8rem; min-height: 48px; padding: .7rem 1rem; background: #fff9f0; font-size: 1.125rem; }
.skip-link:focus { top: 1rem; }

@media (min-width: 1441px) {
  .hero-grid { grid-template-columns: minmax(0, 2.4fr) minmax(12rem, 1fr); }
}
@media (max-width: 1100px) {
  .bound-width { width: calc(100% - 3rem); }
  .rail-grid { grid-template-columns: 8rem minmax(0, 1fr); column-gap: 1.6rem; }
  .hero-grid { grid-template-columns: 1fr; }
  .illustration-place { display: grid; grid-template-columns: 11rem 1fr; gap: 1.5rem; align-items: center; margin-top: .3rem; }
  .illustration-stage { max-width: 11rem; }
  figcaption { padding-top: 0; max-width: 25ch; }
  .margin-grid { grid-template-columns: minmax(0, 1fr); gap: 1.4rem; }
  .note-column { max-width: 45ch; }
  .display-title { font-size: clamp(3rem, 6vw, 4.3rem); }
}
@media (max-width: 700px) {
  .bound-width { width: calc(100% - 2rem); }
  .mast-space { display: block; padding-block: .9rem; }
  .mast-name { font-size: 1.4rem; }
  .mast-space > .page-link { display: flex; width: fit-content; padding-bottom: 0; }
  .rail-grid { display: block; }
  .rail-position { position: static; padding-top: 1rem; border-bottom: 1px solid var(--rule); }
  .rail-position > p { display: none; }
  .rail-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; padding-top: 0; padding-bottom: .75rem; }
  .rail-link { font-size: 1rem; }
  .hero-space { padding: 1.8rem 0 2.3rem; }
  .hero-grid { gap: 1.6rem; }
  .display-title { font-size: clamp(2.75rem, 10.8vw, 4rem); letter-spacing: -.025em; }
  .lead-copy { font-size: 1.25rem; }
  .illustration-place { grid-template-columns: 7rem 1fr; gap: 1.2rem; }
  .illustration-stage { max-width: 7rem; }
  figcaption { font-size: 1rem; }
  .guide-line { font-size: 1.0625rem; margin-bottom: 1rem; }
  .section-space { padding-block: 2rem 2.5rem; }
  .margin-grid { gap: 1.5rem; }
  .reading-column { max-width: 100%; }
  .note-column { font-size: 1.0625rem; }
  .footer-links { display: grid; grid-template-columns: 1fr; gap: .2rem; }
  .footer-space { padding-block: 1.4rem 1.8rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
@media print {
  body { background: #fff; color: #000; font-size: 12pt; }
  .bound-width { width: 100%; }
  .rail-grid, .margin-grid, .hero-grid { display: block; }
  .rail-position, .word-switch, .skip-link, .illustration-place, .footer-links { display: none !important; }
  .display-title { font-size: 32pt; }
  .hero-space, .section-space { padding-block: 1rem; }
  .note-column { margin: 1rem 0; }
  .worksheet-set { break-inside: avoid; }
  textarea { background: #fff; border: 1px solid #777; }
  a { color: #000; }
}
