/* Coach Houses: a coachbuilder's pattern book and an architect's measured drawing.
   Cream laid paper, iron-gall ink, one accent: coachbuilder's vermilion.
   Text in Libre Caslon Text, titles in Abril Fatface (both self-hosted, see /fonts/OFL.txt). */

@font-face {
  font-family: "Libre Caslon Text";
  src: url("/fonts/caslon.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Libre Caslon Text";
  src: url("/fonts/caslon-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Abril Fatface";
  src: url("/fonts/fatface.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f1e8d3;
  --paper-lit: #f7f0df;
  --ink: #2a221c;
  --ink-2: #5a4838;
  --sepia: #7b5b3c;
  --rule: #3b2e24;
  --red: #ad3518;
  --wash1: #e6dcc3;
  --wash2: #d9cbab;
  --wash3: #c9b891;
  --leather: #4a3a2d;
  --text: "Libre Caslon Text", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --fat: "Abril Fatface", "Bodoni 72", Didot, "Libre Caslon Text", Georgia, serif;
  --gutter: clamp(1rem, 4vw, 3.5rem);
  --road-h: 4.75rem;
  --head-h: 4.6rem;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 1.25rem;
  background-color: var(--paper);
}

/* laid paper: fibres in the tile, laid lines across, chain lines down */
body {
  margin: 0;
  padding-bottom: calc(var(--road-h) + 1.5rem);
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    url("/paper.svg"),
    repeating-linear-gradient(0deg, rgba(110, 80, 45, .045) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(110, 80, 45, .05) 0 1px, transparent 1px 7.5rem);
  font: 400 1.1875rem/1.6 var(--text);
  font-synthesis: none;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

h1, h2, h3 { font-weight: 400; margin: 0; }
p { margin: 0; }
em, i, cite, dfn { font-style: italic; }
b, strong { font-weight: 400; }

a { color: var(--red); text-decoration-line: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
::selection { background: var(--ink); color: var(--paper); }

.skip { position: absolute; left: var(--gutter); top: -4rem; z-index: 20; padding: .4rem .8rem; background: var(--paper-lit); border: 1px solid var(--ink); color: var(--ink); }
.skip:focus { top: .5rem; }

.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ------------------------------------------------------------ running head */

.head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .1rem 2rem;
  padding: 1rem var(--gutter) .55rem;
  margin-bottom: 5px;
  border-bottom: 3px solid var(--rule);
  position: relative;
}
.head::after { content: ""; position: absolute; left: 0; right: 0; bottom: -7px; border-bottom: 1px solid var(--rule); }
.name { font: 400 1.6rem/1.1 var(--fat); color: var(--ink); text-decoration: none; }
.name:hover { color: var(--red); }
.head ul { display: flex; flex-wrap: wrap; gap: 0 1.5rem; margin: 0; padding: 0; list-style: none; font-style: italic; font-size: 1.0625rem; }
.head li a { display: block; padding: .3rem 0; color: var(--ink); text-decoration: none; }
.head li a:hover { text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; }
.head li a[aria-current] { color: var(--red); }

/* ------------------------------------------------------------ the plate */

.plate { max-width: 78rem; margin: 0 auto; padding: clamp(1.75rem, 4.5vw, 3.75rem) var(--gutter) 2.5rem; }
.plate-no { font-style: italic; color: var(--red); font-size: 1.125rem; line-height: 1.3; margin-bottom: .5rem; }
h1 { font: 400 clamp(2.75rem, 7.4vw, 6.25rem)/.94 var(--fat); letter-spacing: -.005em; max-width: 13em; text-wrap: balance; }
.lead { font-style: italic; font-size: clamp(1.2rem, 2.2vw, 1.45rem); line-height: 1.4; max-width: 32rem; margin-top: 1.1rem; }
.plate-head { padding-bottom: clamp(1.4rem, 3vw, 2.25rem); margin-bottom: clamp(1.75rem, 4vw, 3rem); border-bottom: 3px solid var(--rule); position: relative; }
.plate-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: -7px; border-bottom: 1px solid var(--rule); }

h2 { font: 400 clamp(1.6rem, 3.2vw, 2.15rem)/1.08 var(--fat); margin: 0 0 .6em; }

/* text set as in a book: indents, and no gaps between paragraphs */
.text { max-width: 34rem; }
.text p + p { text-indent: 1.6em; }
.text h2 { margin-top: 1.9em; }
.text h2:first-child { margin-top: 0; }
.text h2 + p { text-indent: 0; }
.text .note { text-indent: 0; margin-top: 1.4em; padding-top: .9em; border-top: 1px solid var(--rule); font-style: italic; }
.drop::first-letter { font: 400 3.55em/.8 var(--fat); float: left; margin: .1em .09em 0 0; color: var(--red); }

@media (min-width: 44rem) {
  .text p { text-align: justify; hyphens: auto; -webkit-hyphens: auto; hyphenate-limit-chars: 7 3 3; }
}

/* ruled tables */
.ruled { width: 100%; border-collapse: collapse; border-top: 3px solid var(--rule); border-bottom: 3px solid var(--rule); }
.ruled caption { caption-side: top; text-align: left; font: 400 1.6rem/1.1 var(--fat); padding-bottom: .7rem; }
.ruled th, .ruled td { text-align: left; vertical-align: baseline; padding: .62rem 1.2rem .62rem 0; border-top: 1px solid var(--rule); font-weight: 400; }
.ruled tr:first-child th, .ruled tr:first-child td { border-top: 0; }
.ruled th { font-style: italic; white-space: nowrap; width: 1%; padding-right: 1.6rem; }
.ruled td:last-child { padding-right: 0; }

.foot { max-width: 78rem; margin: 0 auto; padding: 0 var(--gutter); }
.foot p { border-top: 1px solid var(--rule); padding-top: .9rem; font-size: 1rem; font-style: italic; color: var(--ink-2); }
.foot a { color: var(--ink-2); }
.foot a:hover { color: var(--red); }

/* ------------------------------------------------------------ drawings
   Line weights as on a real sheet: w4 the ground, w3 outlines, w2 parts, w1 detail, w0 texture. */

.dwg { display: block; width: 100%; height: auto; fill: none; stroke: var(--ink); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.dwg .w0 { stroke-width: .6; stroke: var(--sepia); }
.dwg .w0p { stroke-width: .8; stroke: var(--wash2); }
.dwg .w1 { stroke-width: .9; }
.dwg .w2 { stroke-width: 1.4; }
.dwg .w3 { stroke-width: 2.1; }
.dwg .w4 { stroke-width: 3; }
.dwg .pf { fill: var(--paper-lit); }
.dwg .inkf { fill: var(--ink); }
.dwg .wash1 { fill: var(--wash1); stroke: none; }
.dwg .wash2 { fill: var(--wash2); stroke: none; }
.dwg .wash2s { fill: var(--wash2); }
.dwg .wash3 { fill: var(--wash3); stroke: none; }
.dwg .hood { fill: var(--leather); }
.dwg .glass { fill: var(--wash1); }
.dwg .roof { fill: var(--wash1); }
.dwg .door { fill: var(--wash2); }
.dwg .dark { fill: var(--rule); }
.dwg rect.dark { stroke: none; }
.dwg .floor { fill: var(--wash3); stroke: none; }
.dwg .blind { fill: var(--paper-lit); stroke: none; }
.dwg .poche { fill: var(--ink); stroke: var(--ink); stroke-width: .6; }
.dwg .tb { stroke: var(--ink); }
.dwg .tbi { stroke: var(--paper-lit); }
.dwg .red { stroke: var(--red); stroke-width: 1.5; }
.dwg .dash { stroke-dasharray: 5 4; }
.dwg .brace { stroke: var(--leather); stroke-width: 5.5; stroke-linecap: butt; }
.dwg .brace.red { stroke: var(--red); }
.dwg .rope { stroke-width: 1.2; }
.dwg .lou { stroke: var(--wash3); stroke-width: 2.4; stroke-linecap: butt; }
.dwg .dot { stroke: var(--sepia); stroke-width: 1.7; }
.dwg .dotr { fill: var(--red); stroke: none; }
.dwg .shade { fill: rgba(92, 64, 36, .17); stroke: none; }
.dwg .shade2 { fill: rgba(70, 48, 28, .32); stroke: none; }
.dwg .hx, .dwg .hx2, .dwg .setts { stroke: none; }
.dwg text { fill: var(--ink); stroke: none; font-family: var(--text); font-style: italic; }
.hatch { fill: none; stroke: #6d5a47; stroke-width: .8; }
.hatch2 { fill: none; stroke: var(--sepia); stroke-width: .6; opacity: .5; }

/* the plate mark: the dent a copper plate leaves in the sheet */
.mark {
  margin: 0;
  padding: clamp(.5rem, 1.6vw, 1.25rem);
  background-color: rgba(250, 245, 230, .5);
  box-shadow:
    inset 0 0 0 1px rgba(59, 46, 36, .32),
    inset 3px 3px 5px -2px rgba(59, 46, 36, .22),
    inset -2px -2px 3px -2px rgba(255, 255, 255, .9);
}

/* lettering on the smaller drawings; a name that is a link goes red under the pointer */
.fig .lab { font-size: 21px; }
.fig .lab.sm { font-size: 16.5px; }
.fig .npt { font: 400 24px var(--fat); }
.fig a text { fill: var(--ink); }
.fig a:hover text, .fig a:focus-visible text { fill: var(--red); }

/* ------------------------------------------------------------ the road at the foot
   The carriage stands as far along it as the page has been read. */

.road {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: var(--road-h);
  z-index: 5;
  pointer-events: none;
  background: linear-gradient(to top, var(--paper) 58%, rgba(241, 232, 211, 0));
}
.road::before { content: ""; position: absolute; left: 0; right: 0; bottom: .55rem; border-top: 2px solid var(--ink); }
.road::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: calc(.55rem - 5px); height: 6px;
  background-image: repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 5%);
}
.roller { position: absolute; left: 0; bottom: calc(.55rem + 1px); width: auto; height: 3.25rem; will-change: transform; }
.roller .w3 { stroke-width: 7.5; }
.roller .w2 { stroke-width: 5; }
.roller .pf { fill: var(--paper); }

/* ------------------------------------------------------------ Plate I, the elevation */

.stage-wrap { position: relative; }
.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--road-h) - var(--head-h));
  height: calc(100svh - var(--road-h) - var(--head-h));
  min-height: 25rem;
}
/* with scripts and motion: the sheet stays put while the scroll swings the doors */
.js.motion .stage-wrap { height: calc(195vh - var(--road-h) - var(--head-h)); height: calc(100svh + 95vh - var(--road-h) - var(--head-h)); }
.js.motion .stage { position: sticky; top: var(--stage-top, calc(var(--head-h) / 2)); }
.stage-title { position: absolute; left: var(--gutter); top: clamp(.9rem, 3.4vh, 2.6rem); z-index: 2; max-width: 31vw; pointer-events: none; }
.stage-title h1 { font-size: clamp(3rem, 6.2vw, 6.9rem); }
.stage-title .lead { max-width: min(14.5em, 24vw); font-size: clamp(1.05rem, 1.55vw, 1.45rem); margin-top: .9rem; }
.sheet { flex: 1; min-height: 0; padding: .4rem var(--gutter) 0; }
.sheet svg { width: 100%; height: 100%; }

.elevation .dim { stroke: var(--red); stroke-width: .9; }
.elevation .dimt { fill: var(--red); font-size: 15px; }
.elevation .sct { font-size: 20px; }
.elevation .card { font-size: 13px; font-style: normal; }
.elevation .leaf-edge { fill: var(--leather); stroke: var(--ink); stroke-width: 1; }
.elevation .leaf-shade { fill: var(--ink); stroke: none; }
.elevation .car .w3 { stroke-width: 2.6; }
.elevation .car .w2 { stroke-width: 1.9; }
.elevation .car .w1 { stroke-width: 1.2; }
/* what stands inside is not there to be seen until the doors move */
.elevation .inside { visibility: hidden; }
.elevation.ajar .inside { visibility: visible; }

/* the parts: a red ring marks each, a dashed line shows its reach, a callout names it */
.elevation .mk { fill: var(--paper-lit); stroke: var(--red); stroke-width: 1.6; pointer-events: none; }
.elevation .hitp { fill: transparent; stroke: none; pointer-events: all; cursor: pointer; }
.elevation .lead { stroke: var(--red); stroke-width: 1.4; }
.elevation .cot { fill: var(--red); font-size: 30px; paint-order: stroke; stroke: var(--paper); stroke-width: 8px; stroke-linejoin: round; }
.hit:focus, .doors:focus, .co:focus { outline: none; }
.hit.hot .hitp, .hit:focus-visible .hitp, .doors.hot .hitp, .doors:focus-visible .hitp { stroke: var(--red); stroke-width: 1.5; stroke-dasharray: 6 5; }
.hit-car .hitp { pointer-events: none; }
.is-open .hit-car .hitp { pointer-events: all; }
.co { opacity: 0; pointer-events: none; }
.co.on, .co:focus-visible { opacity: 1; pointer-events: auto; }
.co:focus-visible .cot { text-decoration: underline; }
/* without scripts the callouts still answer to hover and focus */
.elevation:has(.hit[data-part="cupola"]:hover) .co[data-part="cupola"],
.elevation:has(.hit[data-part="cupola"]:focus-visible) .co[data-part="cupola"],
.elevation:has(.hit[data-part="clock"]:hover) .co[data-part="clock"],
.elevation:has(.hit[data-part="clock"]:focus-visible) .co[data-part="clock"],
.elevation:has(.hit[data-part="hayloft"]:hover) .co[data-part="hayloft"],
.elevation:has(.hit[data-part="hayloft"]:focus-visible) .co[data-part="hayloft"],
.elevation:has(.hit[data-part="coachman"]:hover) .co[data-part="coachman"],
.elevation:has(.hit[data-part="coachman"]:focus-visible) .co[data-part="coachman"],
.elevation:has(.hit[data-part="stable"]:hover) .co[data-part="stable"],
.elevation:has(.hit[data-part="stable"]:focus-visible) .co[data-part="stable"],
.elevation:has(.hit[data-part="harness"]:hover) .co[data-part="harness"],
.elevation:has(.hit[data-part="harness"]:focus-visible) .co[data-part="harness"],
.elevation:has(.hit[data-part="block"]:hover) .co[data-part="block"],
.elevation:has(.hit[data-part="block"]:focus-visible) .co[data-part="block"],
.elevation:has(.hit[data-part="pump"]:hover) .co[data-part="pump"],
.elevation:has(.hit[data-part="pump"]:focus-visible) .co[data-part="pump"],
.elevation:has(.hit[data-part="setts"]:hover) .co[data-part="setts"],
.elevation:has(.hit[data-part="setts"]:focus-visible) .co[data-part="setts"],
.elevation:has(.doors:hover) .co[data-part="doors"],
.elevation:has(.doors:focus-visible) .co[data-part="doors"] { opacity: 1; pointer-events: auto; }

/* the sheet inks itself in: outlines first, then openings, detail, texture, red ink */
@media (prefers-reduced-motion: no-preference) {
  .elevation .draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: ink 1.6s cubic-bezier(.45, 0, .2, 1) .15s forwards; }
  .elevation .ly, .elevation .doors { animation: rise .9s ease both; }
  .elevation .l2, .elevation .doors { animation-delay: .6s; }
  .elevation .l3 { animation-delay: 1s; }
  .elevation .l4 { animation-delay: 1.4s; }
  .elevation .l5 { animation-delay: 1.9s; }
}
@keyframes ink { to { stroke-dashoffset: 0; } }
@keyframes rise { from { opacity: 0; } }

/* once the sheet is inked, the red rings swell one after another: they are the parts that answer.
   A leader line is drawn out from its part to its name. */
@media (prefers-reduced-motion: no-preference) {
  .elevation .mk { transform-box: fill-box; transform-origin: center; animation: ring .55s ease-in-out 2.9s 1 both; }
  .elevation .mk:nth-child(2) { animation-delay: 2.98s; }
  .elevation .mk:nth-child(3) { animation-delay: 3.06s; }
  .elevation .mk:nth-child(4) { animation-delay: 3.14s; }
  .elevation .mk:nth-child(5) { animation-delay: 3.22s; }
  .elevation .mk:nth-child(6) { animation-delay: 3.3s; }
  .elevation .mk:nth-child(7) { animation-delay: 3.38s; }
  .elevation .mk:nth-child(8) { animation-delay: 3.46s; }
  .elevation .mk:nth-child(9) { animation-delay: 3.54s; }
  .elevation .mk:nth-child(10) { animation-delay: 3.62s; }
  .js .co .lead { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .3s ease-out; }
  .js .co.on .lead, .js .co:focus-visible .lead { stroke-dashoffset: 0; }
}
@keyframes ring { 45% { transform: scale(1.9); } }

/* stacked: on a tall or narrow screen the title sits above and the building is shown alone */
@media (max-aspect-ratio: 1/1), (max-width: 47.5rem) {
  .stage { height: auto; min-height: 0; }
  .js.motion .stage-wrap { height: auto; }
  .js.motion .stage-wrap::after { content: ""; display: block; height: 95vh; }
  .sheet { flex: none; padding: 0 .2rem; }
  /* as tall as fits under the head and title; never so short that the building shrinks away */
  .sheet svg {
    height: auto;
    max-height: calc(100vh - var(--road-h) - 9.75rem);
    max-height: min(calc(100svh - var(--road-h) - 9.75rem), max(calc(100svh - var(--road-h) - var(--head-h) - 10rem), 62svh));
  }
  .stage-title { position: static; max-width: none; padding: .9rem var(--gutter) .2rem; pointer-events: auto; }
  .stage-title h1 { font-size: clamp(2.5rem, 11.4vw, 5.2rem); max-width: none; }
  .stage-title .plate-no { margin-bottom: .25rem; }
  .stage-title .lead { max-width: none; margin-top: .45rem; font-size: 1.08rem; }
  .elevation .cot { font-size: 41px; stroke-width: 10px; }
  .elevation .sct { font-size: 27px; }
  .elevation .dimt { font-size: 19px; }
  .elevation .card { font-size: 16px; }
  .elevation .w0 { stroke-width: .9; }
  .elevation .w1 { stroke-width: 1.3; }
  .elevation .w2 { stroke-width: 1.9; }
  .elevation .w3 { stroke-width: 2.8; }
  .elevation .mk { stroke-width: 2.4; }
  .elevation .lead { stroke-width: 2.2; }
  .elevation .dim { stroke-width: 1.3; }
}

.after { display: grid; grid-template-columns: minmax(0, 34rem) minmax(0, 1fr); gap: 2.5rem clamp(2rem, 6vw, 5rem); align-items: start; padding-top: clamp(2rem, 6vw, 4.5rem); }
.list th { color: var(--red); }
.list td a { color: var(--ink); font: 400 1.3rem/1.2 var(--fat); text-decoration-color: var(--red); }
.list td a:hover { color: var(--red); }
.list .line { display: block; margin-top: .15rem; color: var(--ink-2); }

/* ------------------------------------------------------------ Plate II */

.plan-row { display: grid; grid-template-columns: minmax(0, 40rem) minmax(0, 1fr); gap: 2rem clamp(2rem, 6vw, 5rem); align-items: start; margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.plan { margin: 0; }
.parts { list-style: none; margin: 0; padding: 0; border-top: 3px solid var(--rule); border-bottom: 3px solid var(--rule); counter-reset: part; max-width: 24rem; }
.parts li { counter-increment: part; border-top: 1px solid var(--rule); }
.parts li:first-child { border-top: 0; }
.parts a { display: grid; grid-template-columns: 2.4rem 1fr; padding: .44rem 0; color: var(--ink); text-decoration: none; }
.parts a::before { content: counter(part) "."; font-style: italic; color: var(--red); }
.parts a:hover { color: var(--red); }
.entries { counter-reset: entry; }
.entry { display: grid; grid-template-columns: minmax(0, 34rem) minmax(0, 1fr); gap: 1.5rem clamp(2rem, 6vw, 5rem); align-items: center; padding: clamp(1.75rem, 4vw, 3rem) 0; border-top: 1px solid var(--rule); }
.entry h2::before { counter-increment: entry; content: counter(entry) ". "; color: var(--red); }
.entry figure { margin: 0; width: 100%; max-width: 27rem; justify-self: center; }
.entry:target h2 { color: var(--red); }

/* ------------------------------------------------------------ Plates III to XII */

.book { display: grid; grid-template-columns: minmax(0, 1fr) 14rem; gap: 2rem clamp(1.5rem, 4vw, 4rem); align-items: start; }
.thumb { grid-column: 2; grid-row: 1; position: sticky; top: 1.25rem; }
.thumb ol { list-style: none; margin: 0; padding: 0; border-top: 3px solid var(--rule); border-bottom: 3px solid var(--rule); }
.thumb li + li { border-top: 1px solid var(--rule); }
.thumb a { display: grid; grid-template-columns: 2.7rem 1fr; padding: .4rem 0; color: var(--ink); text-decoration: none; line-height: 1.35; }
.thumb .num { font-style: italic; }
.thumb a:hover, .thumb a[aria-current] { color: var(--red); }
.leaves { grid-column: 1; grid-row: 1; min-width: 0; }
.leaf-page { padding-bottom: 1rem; }
.leaf-page + .leaf-page { margin-top: 3rem; padding-top: 2.5rem; border-top: 3px solid var(--rule); }
.leaf-page h2 { font-size: clamp(2.1rem, 5.4vw, 3.75rem); line-height: 1; margin-bottom: .45em; }
.leaf-page h2:focus { outline: none; }
.leaf-page .mark { margin-bottom: 1.6rem; }
.turn { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1.5rem; margin-top: 1.8rem; padding-top: .7rem; border-top: 1px solid var(--rule); font-style: italic; }
.turn a, .way a { display: inline-flex; align-items: center; gap: .7rem; padding: .45rem 0; color: var(--ink); text-decoration: none; }
.turn a:hover, .way a:hover { color: var(--red); }
.turn .next { margin-left: auto; text-align: right; }
.arrow { flex: none; fill: none; stroke: currentColor; stroke-width: 1.2; }
.arrow .hd { fill: currentColor; stroke: none; }
.prev .arrow, .way .arrow { transform: scaleX(-1); }

/* with scripts the plates are one stack; a leaf lifts away on its spine to show the next */
.leaves.live { display: grid; perspective: 2600px; }
.leaves.live > .leaf-page { grid-area: 1 / 1; margin: 0; padding-top: 0; border: 0; transform-origin: 0 50%; }
.leaf-page.under { z-index: 0; }
.leaf-page.lifting, .leaf-page.landing { z-index: 2; background: var(--paper) url("/paper.svg"); box-shadow: 1.5rem 0 2.5rem -1.5rem rgba(42, 34, 28, .45); }
.leaf-page.lifting { animation: lift .6s cubic-bezier(.5, 0, .75, .6) forwards; }
.leaf-page.landing { animation: lift .6s cubic-bezier(.5, 0, .75, .6) reverse forwards; }
@keyframes lift { to { transform: rotateY(-89deg); filter: brightness(.8); } }

/* ------------------------------------------------------------ text with things beside it */

.cols { display: grid; grid-template-columns: minmax(0, 34rem) minmax(0, 1fr); gap: 2.5rem clamp(2rem, 6vw, 5rem); align-items: start; }
.side { display: grid; gap: 2.5rem; }
.side > * { max-width: 30rem; width: 100%; }
.side .mark { margin: 0; }
.frieze { margin-bottom: clamp(2rem, 5vw, 3.25rem); }
.chron th { color: var(--red); }

/* ------------------------------------------------------------ Plate XV */

.gloss-grid { display: grid; grid-template-columns: 2.1rem minmax(0, 42rem) minmax(0, 1fr); gap: 0 clamp(1.1rem, 4vw, 3.5rem); align-items: start; }
.az { grid-column: 1; grid-row: 1; position: sticky; top: .6rem; }
.gloss { grid-column: 2; grid-row: 1; min-width: 0; }
.wheel { grid-column: 3; grid-row: 1; margin: 0; width: 100%; max-width: 27rem; justify-self: end; position: sticky; top: 1.25rem; }
.az ol { list-style: none; margin: 0; padding: 0; text-align: center; font-size: .98rem; line-height: 1.3; }
.az a, .az span { display: block; }
.az a { color: var(--red); text-decoration: none; }
.az a:hover { text-decoration: underline; }
.az span, .az a.off { color: #8a7d63; pointer-events: none; }
.find { display: flex; align-items: baseline; gap: .8rem; margin-bottom: 1.6rem; }
.find label { font-style: italic; }
/* the box to type in is a ruled line */
.find input { flex: 0 1 19rem; min-width: 0; font: inherit; color: var(--ink); background: transparent; border: 0; border-bottom: 1.5px solid var(--ink); border-radius: 0; padding: .1rem .15rem; -webkit-appearance: none; appearance: none; }
.find input::-webkit-search-cancel-button, .find input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.find input:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; }
.none { font-style: italic; }
.letter { display: grid; grid-template-columns: 3.4rem minmax(0, 1fr); border-top: 3px solid var(--rule); margin-bottom: 1.5rem; }
.letter h2 { font-size: 2.7rem; line-height: 1; color: var(--red); margin: .7rem 0 0; }
.letter dl { margin: 0; }
.term { padding: .7rem 0 .8rem; border-top: 1px solid var(--rule); }
.term:first-child { border-top: 0; }
.term dt { font: 400 1.32rem/1.2 var(--fat); }
.term dd { margin: .2rem 0 0; }
.term:target dt { color: var(--red); }

/* ------------------------------------------------------------ Plate XVI, colophon, dead end */

.places { max-width: 62rem; }
.places th { white-space: normal; width: 44%; font-style: normal; }
.places .town { display: block; font-style: italic; color: var(--ink-2); }
.places cite { font-style: italic; }
.aside-note { font-style: italic; margin: 1rem 0 clamp(2.5rem, 6vw, 4rem); }
.colophon p + p { text-indent: 0; margin-top: .85em; }
.lost { align-items: center; }
.lost .mark { margin: 0; max-width: 28rem; width: 100%; }
.text .way { text-indent: 0; margin-top: 1.4rem; font-style: italic; }

/* ------------------------------------------------------------ narrower screens */

@media (max-width: 70rem) {
  .gloss-grid { grid-template-columns: 2.1rem minmax(0, 1fr); }
  .wheel { grid-column: 1 / -1; grid-row: 1; position: static; justify-self: start; max-width: 24rem; margin-bottom: 2rem; }
  .az, .gloss { grid-row: 2; }
}

@media (max-width: 56rem) {
  .after, .cols, .entry, .plan-row { grid-template-columns: minmax(0, 1fr); }
  .entry figure { justify-self: start; }
  .book { grid-template-columns: minmax(0, 1fr); }
  .thumb { grid-column: 1; grid-row: 1; position: static; }
  .leaves { grid-row: 2; }
  /* the index of plates becomes a row of numerals */
  .thumb ol { display: flex; flex-wrap: wrap; gap: 0 .2rem; border-width: 1px 0; }
  .thumb li + li { border-top: 0; }
  .thumb a { display: block; padding: .5rem .5rem; }
  .thumb .nm { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

@media (max-width: 40rem) {
  :root { --road-h: 3.9rem; --head-h: 6.4rem; }
  body { font-size: 1.125rem; }
  .head { padding-top: .7rem; }
  .name { font-size: 1.45rem; }
  .head ul { gap: 0 1.1rem; font-size: 1.03rem; }
  .roller { height: 2.6rem; }
  .roller .w3 { stroke-width: 9; }
  .roller .w2 { stroke-width: 6.5; }
  .places tr { display: block; padding: .7rem 0; border-top: 1px solid var(--rule); }
  .places tr:first-child { border-top: 0; }
  .places th, .places td { display: block; width: auto; border: 0; padding: 0; }
  .places td { margin-top: .2rem; }
  .letter { grid-template-columns: 2.5rem minmax(0, 1fr); }
  .letter h2 { font-size: 2.1rem; }
  .ruled th { padding-right: 1rem; }
}
