/* The guide index reads like the contents page of a book. */
.guide-index {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  align-items: start;
  gap: 7%;
  padding-block: clamp(48px, 6vw, 92px);
  border-top: 1px solid var(--line);
}
.guide-index ul { list-style: none; padding: 0 }
.guide-index li { border-bottom: 1px solid var(--line) }
.guide-index a {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 4px;
  font: 600 1.22rem/1.35 Sans, sans-serif;
}
.guide-index svg:first-child { color: var(--red) }
.guide-index svg:last-child { margin-left: auto }
.guide-index a:hover, .guide-intro a:hover { color: var(--red) }
.guide-page footer { border-top: 1px solid var(--line) }
.guide-intro {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: center;
  gap: 7%;
  padding-block: clamp(40px, 6vw, 95px);
  border-bottom: 1px solid var(--line);
}
.guide-intro h1 {
  margin: 24px 0;
  font-size: clamp(3.3rem, 6.65vw, 6.45rem);
  line-height: .97;
}
.guide-intro em { display: block; color: var(--red) }
.guide-intro > div:first-child > p, .guide-steps p {
  color: var(--body);
  font-size: 1.18rem;
  line-height: 1.64;
  max-width: 56ch;
}
.paper-example {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  padding: 24px clamp(15px, 2.5vw, 38px) 12px;
  border-radius: 16px;
  background: radial-gradient(#17392e20 .8px, transparent 1px) 0 0 / 17px 17px, #efe9d8;
  box-shadow: inset 0 0 0 1px #17392e12;
}
.paper-example input {
  grid-area: 2 / 1;
  width: 1px;
  height: 1px;
  margin: 0;
  clip-path: inset(50%);
}
.paper-example label {
  grid-area: 2 / 1;
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 650;
  line-height: 1.25;
}
.switch-track {
  flex: none;
  width: 34px;
  height: 19px;
  border: 1px solid var(--ink);
  border-radius: 20px;
  background: var(--paper);
  display: flex;
  align-items: center;
  padding: 0 2px;
}
.switch-track::before {
  content: "";
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: currentColor;
}
.paper-example input:checked + label .switch-track { background: var(--ink); color: var(--paper) }
.paper-example input:checked + label .switch-track::before { transform: translateX(15px) }
@media (prefers-reduced-motion: no-preference) {
  .switch-track { transition: color .2s, background-color .2s }
  .switch-track::before { transition: transform .32s cubic-bezier(.2,.95,.3,1.23) }
  .paper-example label { transition: background-color .18s }
  .guide-page.motion-off .switch-track, .guide-page.motion-off .switch-track::before { transition: none }
}
.paper-example label:hover { background: #17392e0a }
.paper-example input:focus-visible + label { outline: 2px solid var(--red) }
@media (forced-colors: active) {
  .switch-track::before { forced-color-adjust: none; background: ButtonText }
  .paper-example input:checked + label .switch-track::before { background: Highlight }
}
/* Reserve the taller of the two examples so the switch stays under the pointer. */
#example { grid-area: 1 / 1; display: grid; min-width: 0 }
#example figure { grid-area: 1 / 1; margin: 0; display: grid; align-items: center; min-height: 330px; grid-template-rows: 1fr auto }
#example figcaption {
  max-width: 41ch;
  min-height: 3.2em;
  text-align: center;
  margin: 22px auto 10px;
  font: italic 1.02rem/1.42 Georgia, serif;
  text-wrap: pretty;
}
#compare:not(:checked) ~ #example figure:last-child,
#compare:checked ~ #example figure:first-child { visibility: hidden }
.paper-example .slip, .paper-doc, .paper-outline {
  background: #fffdf6;
  border: 1px solid #17392e40;
  box-shadow: 0 3px 0 #17392e15, 0 7px 15px #4135190b;
  border-radius: 5px;
  padding: 12px;
}
.paper-example .slip { display: block; font: 600 1rem/1.24 Sans, sans-serif }
.paper-example .clue { background: #ffdb82; border-color: #ae751e; transform: rotate(-2deg) }
.paper-board { display: grid; grid-template-columns: 1fr 1fr; gap: 15px }
.paper-board b, .paper-doc b, .paper-outline b { font: 700 1.65rem/1.2 Display, serif; display: block }
.paper-board small, .paper-doc small { font: 650 .76rem/1.2 Sans, sans-serif; color: var(--red) }
.paper-board .slip, .paper-outline .slip { margin-top: 10px }
.paper-map { text-align: center; display: grid; justify-items: center }
.paper-map .slip { padding: 8px 20px; border-left: 4px solid #518670 }
.paper-map .clue { border-left-color: #bd4929 }
.paper-map .tie { display: grid; font-size: .91rem; line-height: 1.2; padding: 5px 0 }
.tie span { font-size: 1.35rem }
.branches { display: flex; gap: 18px; align-items: stretch }
.branches > div { display: flex; flex-direction: column }
.branches .tie { flex: 1; align-content: space-between; text-wrap: balance }
.branches > div { flex: 1; position: relative }
.branches > div:not(:only-child)::before {
  content: ""; display: block; height: 12px;
  border-top: 1px solid; border-left: 1px solid;
  margin: 10px -9px 0 50%;
}
.branches > div:nth-child(2)::before { transform: scaleX(-1); margin: 10px 50% 0 -9px }
.paper-doc, .paper-outline { width: min(100%, 340px); margin: auto; padding: 23px; transform: rotate(-1deg) }
.paper-doc strong { display: block; margin-top: 15px }
.paper-doc small { float: right; margin: 5px 0 0 8px }
.paper-doc p { font: 1rem/1.5 Georgia, serif }
.paper-outline .slip { margin-left: 18px; border-left: 4px solid var(--sun) }
.guide-steps, .exercise, .compile-reference { width: min(var(--page), 680px); margin: 0 auto }
.guide-steps { padding: 0; list-style: none; counter-reset: step }
.guide-steps li { position: relative; margin: 48px 0; counter-increment: step }
.guide-steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute; right: calc(100% + 26px); top: 4px;
  color: var(--red); font: italic 700 1.7rem/1 Display, serif;
}
.guide-steps h2 { font-size: clamp(2rem, 3.3vw, 2.65rem); margin: 0 0 14px }
.compile-reference a { text-decoration: underline; text-underline-offset: 4px }
.compile-reference h2 { font-size: 2rem }
.compile-reference p { margin: 14px 0; font-size: 1.15rem; line-height: 1.6 }
.step-demo { margin-top: 24px }
.step-demo img {
  display: block; width: 100%; height: auto; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 5px 16px #173a3010;
}
.step-controls {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 4px 16px; margin-top: 8px; font: 550 1rem/1.3 Sans, sans-serif;
}
.step-controls button {
  font: inherit; color: inherit; background: transparent; border: 1px solid var(--line);
  border-radius: 24px; min-width: 88px; min-height: 40px; padding: 6px 18px; cursor: pointer;
}
.step-controls a { padding-block: 10px }
.step-controls :is(button,a):hover { color: var(--red); border-color: currentColor }
.exercise { margin-block: 56px 80px; padding-left: 26px; border-left: 3px solid var(--sun) }
.exercise p + p { font: italic 1.33rem/1.5 Georgia, serif; margin: 18px 0 24px }
@media (max-width: 960px) {
  .guide-steps li::before { position: static; display: block; margin-bottom: 8px }
  .bar nav { flex-wrap: wrap; justify-content: center; row-gap: 8px }
}
@media (max-width: 800px) {
  .guide-intro, .guide-index { grid-template-columns: 1fr; gap: 32px }
  .paper-example { width: min(100%, 540px); margin: auto }
  .guide-intro h1 { font-size: clamp(2.85rem, 10vw, 4.6rem) }
  .guide-intro > div:first-child > p, .guide-steps p { font-size: 1.08rem }
  .guide-intro .eyebrow { justify-content: flex-start }
}
@media (max-width: 450px) {
  .paper-board { gap: 8px }
  .paper-board b { font-size: 1.24rem }
  .paper-example .slip { padding: 9px; font-size: .94rem }
  .paper-doc { padding: 12px }
  .paper-doc small { float: none; display: block; margin: 2px 0 0 }
  .guide-index a { font-size: 1.08rem; gap: 12px }
}

/* A small, keyboard-accessible contents list at the foot of the landing page. */
footer .guide-resources { display: block; padding: 0; border-bottom: 1px solid var(--line) }
.guide-resources summary { justify-content: flex-start; gap: 8px; width: fit-content; cursor: pointer }
.guide-resources .guide-index { padding: 14px 0 32px; border: 0; scroll-margin-top: 56px }
.guide-resources h2.eyebrow { margin: 10px 0; font: 700 .8rem/1.4 Sans, sans-serif }
.guide-resources .guide-index a { font-size: 1.05rem; padding-block: 12px }
.guide-index svg { flex: none }
.guide-intro > *, #example figure { min-width: 0 }
.guide-intro h1 { overflow-wrap: anywhere }
.paper-board { align-self: stretch; align-content: center }
.paper-board > div { min-height: 11rem }
.quay, .draft-sheet, .cut-sheet, .desk-sample, .date-line {
  width: min(100%, 360px);
  margin: auto;
  overflow-wrap: anywhere;
}
.quay { display: grid; justify-items: center; gap: 15px }
.quay .slip:not(.clue) { width: 100%; padding: 17px; font: 1rem/1.42 Georgia, serif }
.quay b, .desk-sample b, .cut-sheet b { display: block; font: 700 1.72rem/1.08 Display, serif; margin-bottom: 10px }
.quay b svg { display: inline-block; vertical-align: baseline; margin-right: 6px; color: var(--red) }
.quay .clue { z-index: 1 }
.draft-sheet, .cut-sheet:not(.divided), .cut-sheet.divided div, .desk-sample {
  border-radius: 7px;
  background: #fffdf6;
  border: 1px solid #17392e35;
  box-shadow: 0 3px 0 #17392e12, 0 8px 18px #4135190b;
}
.draft-sheet { padding: 24px; min-height: 245px; font: 1.08rem/1.7 Georgia, serif }
.draft-sheet p:first-child { display: inline }
.draft-sheet p + p { margin-top: 14px }
.draft-sheet mark { background: #ffdf8c; color: var(--ink); padding: 2px 5px; font: 600 .94rem/1.45 Sans, sans-serif; box-decoration-break: clone; -webkit-box-decoration-break: clone }
.pen { display: inline-block; width: 2px; height: 1.1em; background: var(--red); vertical-align: -.14em; margin-left: 2px }
.date-line { list-style: none; padding: 0; display: grid; gap: 14px; position: relative }
.date-line::before { content: ""; position: absolute; inset: 14% auto 14% 4.25rem; width: 1px; background: #547260 }
.date-line li { display: grid; grid-template-columns: 4.25rem 1fr; align-items: center; position: relative }
.date-line li > span { font: italic 1rem Georgia, serif }
.date-line .slip { margin-left: 17px; position: relative }
.date-line .slip::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 3px #efe9d8; position: absolute; left: -22px; top: calc(50% - 4px) }
.date-line small, .cut-sheet small { display: block; font: 700 .8rem/1.25 Sans, sans-serif; color: var(--red); margin-bottom: 4px }
.cut-sheet { font: 1rem/1.42 Georgia, serif }
.cut-sheet:not(.divided) { padding: 22px }
.cut-sheet div + div { margin-top: 10px }
.cut-sheet.divided div { padding: 10px 14px; border-left: 4px solid #518670 }
.desk-sample { padding: 20px; background: #fffaf0; color: #17392e; font: 1.1rem/1.55 Georgia, serif }
.desk-sample.night { background: #34292b; color: #f5e5ce; font-family: Sans, sans-serif }
.desk-sample div, .desk-sample small { display: flex; align-items: center; gap: 8px; font: 600 .93rem/1.3 Sans, sans-serif }
.desk-sample div span { margin-left: auto }
.desk-sample b { margin-top: 30px; font-size: 2.1rem }
.desk-sample small { margin-top: 24px; border-top: 1px solid currentColor; padding-top: 12px }
.desk-sample.night .pen { background: #ffce92; box-shadow: 0 0 5px #ffac51, 0 0 12px #ffac51 }
@media (max-width: 450px) {
  .desk-sample, .draft-sheet { padding: 15px }
  .desk-sample div { flex-wrap: wrap }
}
