/* Plate: the site set as the plates of a natural history monograph.

   Type. Old Standard TT is Alexey Kryukov's revival of the Modern face that
   late nineteenth-century editions were set in, the type a field guide or a
   monograph of that time would have. One family, roman and italic, no bold.
   The figure letters are italic, the way engravers lettered plates.
   Fallback: Liberation Serif or Times, size-adjusted to Old Standard's width
   and vertical metrics so the swap does not reflow the page.

   Colour. Plate paper, a little grey, and one warm black ink. The one accent
   is Prussian blue, the pigment of the cyanotype and the blueprint. It is used
   for plate numbers and leader lines and nothing else. The serif is high
   contrast and the ground is paper, so this is not the cream and clay look:
   the paper is greyer than #f4f1ea and there is no clay.
   Each figure sits on a flat tint inside a plate mark, as tinted lithographs
   did. The tint is one flat colour, not a gradient.

   Shape. No radius, no shadow. Motion: the leader line of a part thickens when
   its letter is hovered or focused. No transitions. */

@font-face {
  font-family: "OST fallback";
  src: local("Liberation Serif"), local("LiberationSerif"), local("Times New Roman"), local("TimesNewRomanPSMT"), local("Tinos");
  size-adjust: 107.5%;
  ascent-override: 70.9%;
  descent-override: 22.1%;
  line-gap-override: 22%;
}
@font-face {
  font-family: "OST fallback";
  font-style: italic;
  src: local("Liberation Serif Italic"), local("LiberationSerif-Italic"), local("Times New Roman Italic"), local("TimesNewRomanPS-ItalicMT"), local("Tinos Italic");
  size-adjust: 107%;
  ascent-override: 71.2%;
  descent-override: 22.2%;
  line-gap-override: 22%;
}

:root {
  --paper: #e8e5da;
  --tint: #dcd6c5;
  --mark: #b3ab96;
  --ink: #221f1b;
  --ink-2: #4a443b;
  --blue: #1f4a6e;
  --serif: "Old Standard TT", "OST fallback", "Times New Roman", serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.1875rem;
  line-height: 1.5;
  font-kerning: normal;
}
h1, h2 { font-weight: 400; margin: 0; }
p { margin: 0 0 0.9em; }
i, em { font-style: italic; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.16em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.vh {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* The sheet. Every plate shares the margins; what sits inside varies. */
.sheet {
  max-width: 80rem;
  margin: 0 auto;
  padding-left: clamp(1.125rem, 5vw, 4.5rem);
  padding-right: clamp(1.125rem, 5vw, 4.5rem);
}
.plate { scroll-margin-top: 0; }
.plate + .plate { border-top: 1px solid var(--mark); }

/* Running head: a link back to the list, the book's title, the plate number. */
.rh {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-top: 1.25rem;
  padding-bottom: 0.55rem;
  margin-bottom: 2.25rem;
  border-bottom: 1px solid var(--ink);
  font-size: 0.8125rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.plate .rh { padding-left: 0; padding-right: 0; }
.rh a { text-decoration: none; border-bottom: 1px solid var(--mark); }
.rh a:hover { border-bottom-color: var(--ink); }
.pl { color: var(--blue); font-size: 1rem; letter-spacing: 0.12em; }

.folio {
  text-align: center;
  font-size: 0.9375rem;
  margin: 2.75rem 0 0;
  padding-bottom: 2.25rem;
}

/* Figures: tint inside a plate mark. */
figure { margin: 0; }
.mark { border: 1px solid var(--mark); padding: clamp(0.3125rem, 1vw, 0.6875rem); }
.stone { background: var(--tint); padding: clamp(0.5rem, 2.2vw, 1.75rem); }
.fig-svg { display: block; width: 100%; height: auto; overflow: visible; }
figcaption { font-size: 0.9375rem; text-align: center; margin-top: 0.75rem; }
.fno { letter-spacing: 0.04em; }

/* Drawing classes */
.o { fill: var(--paper); stroke: var(--ink); stroke-linejoin: round; }
.l { fill: none; stroke: var(--ink); }
.core { fill: none; stroke: var(--paper); }
.k { fill: var(--ink); }
.p { fill: var(--paper); }
.dash { fill: none; stroke: var(--ink); }
.ld { stroke: var(--blue); fill: none; }
.dot { fill: var(--blue); }
.hit { fill: transparent; }
.lt { font-family: var(--serif); font-style: italic; font-size: 30px; fill: var(--ink); }
.tt { font-family: var(--serif); font-size: 15px; fill: var(--ink); }
.ti { font-family: var(--serif); font-style: italic; font-size: 16px; fill: var(--ink); }
.hand { font-family: var(--serif); font-style: italic; font-size: 34px; fill: var(--ink); }
.hand-s { font-size: 25px; }
.lk { cursor: pointer; }
.lk:hover .ld, .lk:focus-visible .ld { stroke-width: 2.6; }
.lk:hover .lt { text-decoration: underline; }
.p1:has(.k-a a:is(:hover, :focus-visible)) .ld-a,
.p1:has(.k-b a:is(:hover, :focus-visible)) .ld-b,
.p1:has(.k-c a:is(:hover, :focus-visible)) .ld-c,
.p1:has(.k-d a:is(:hover, :focus-visible)) .ld-d { stroke-width: 2.6; }

/* Keys: the letter is the link. */
.key { list-style: none; margin: 0; padding: 0; font-size: 1.0625rem; line-height: 1.45; }
.key li {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  align-items: baseline;
  padding: 0.55rem 0 0.15rem;
  border-top: 1px solid var(--mark);
}
.key li p { margin: 0 0 0.4em; }
.k {
  font-style: italic;
  font-size: 1.375rem;
  line-height: 1;
  display: inline-block;
  min-width: 1.75rem;
  padding: 0.2rem 0.3rem 0.25rem 0;
}
.explain .k { font-size: 1.1875rem; min-width: 0; padding: 0 0.1rem; }
li:target { background: var(--tint); }
.keyhead { font-size: 1.1875rem; font-style: italic; margin: 1.75rem 0 0.5rem; }

/* Plate I: figure left, a column narrower than the figure on the right. */
.p1 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 26.5rem);
  grid-template-areas: "fig title" "fig cap" "folio folio";
  grid-template-rows: auto 1fr auto;
  column-gap: clamp(2rem, 4vw, 3.75rem);
}
.p1 .title { grid-area: title; }
.p1 .fig { grid-area: fig; }
.p1 .cap { grid-area: cap; }
.p1 .folio { grid-area: folio; }
.p1 h1 { font-size: 3.75rem; line-height: 1; letter-spacing: -0.01em; margin: -0.3rem 0 0.75rem; }
.lede { font-style: italic; font-size: 1.3125rem; line-height: 1.4; margin-bottom: 1.5rem; }

/* Plate II: three figures of unequal size on one stone, explanation below. */
.figs {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 2.6fr);
  grid-template-areas: "f1 f2" "f3 f2";
  gap: 2.25rem 3rem;
  align-items: end;
}
.f1 { grid-area: f1; }
.f2 { grid-area: f2; align-self: end; }
.f3 { grid-area: f3; }
.figs .lt { font-size: 24px; }
.expl {
  display: grid;
  grid-template-columns: minmax(0, 24rem) minmax(0, 38rem);
  gap: 2rem 3.5rem;
  margin-top: 2.5rem;
}
.expl h2, .p3 h2, .p4 h2, .p5 h2 { font-size: 2.25rem; line-height: 1.1; margin-bottom: 0.75rem; }
.explain { list-style: none; margin: 0; padding: 0; }
.explain li { padding: 0.15rem 0 0; }
.explain li p { margin-bottom: 0.9em; }

/* Plate III: intro left, shelf right, key in two columns under the shelf. */
.p3-grid {
  display: grid;
  grid-template-columns: minmax(0, 24rem) minmax(0, 1fr);
  grid-template-areas: "intro fig" "intro list";
  gap: 1.75rem 3.5rem;
}
.p3 .intro { grid-area: intro; }
.p3 .fig { grid-area: fig; }
.essays { grid-area: list; columns: 2 22rem; column-gap: 2.5rem; }
.essays li { break-inside: avoid; }
.et { font-style: italic; }

/* Plate IV: a smaller figure, text beside it. */
.p4-grid {
  display: grid;
  grid-template-columns: minmax(0, 36rem) minmax(0, 24rem);
  gap: 2rem 3.5rem;
  align-items: start;
}
.p4 .lt { font-size: 28px; }

/* List of plates */
.p5 h2 { margin-bottom: 1.25rem; }
.lop { border-collapse: collapse; width: 100%; max-width: 46rem; font-size: 1.0625rem; line-height: 1.4; }
.lop th, .lop td { text-align: left; font-weight: 400; vertical-align: baseline; padding: 0.55rem 1.25rem 0.55rem 0; border-bottom: 1px solid var(--mark); }
.lop thead th { font-style: italic; border-bottom: 1px solid var(--ink); font-size: 0.9375rem; }
.lop tbody tr:last-child > * { border-bottom: 1px solid var(--ink); }
.lop .n { text-align: right; padding-right: 0; padding-left: 1rem; }
.pn { color: var(--blue); text-decoration-color: var(--blue); letter-spacing: 0.06em; }

/* Colophon */
.colophon { border-top: 1px solid var(--ink); padding-top: 2rem; padding-bottom: 3rem; font-size: 1rem; }
.colophon h2 { font-size: 1.1875rem; font-style: italic; margin-bottom: 0.5rem; }
.colophon p { max-width: 40rem; }
.sample { color: var(--ink-2); font-size: 0.9375rem; }

@media (max-width: 64rem) {
  .p1 { grid-template-columns: minmax(0, 1fr) minmax(0, 21rem); }
  .expl, .p3-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: none; }
  .p3 .intro, .p3 .fig, .essays { grid-area: auto; }
}
@media (max-width: 52rem) {
  .p1 {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "title" "fig" "cap" "folio";
    grid-template-rows: auto;
  }
  .p1 h1 { font-size: 3rem; }
  .p1 .fig { margin-bottom: 1.5rem; }
  .figs { grid-template-columns: minmax(0, 1fr); grid-template-areas: "f1" "f2" "f3"; }
  .f2 { width: 62%; justify-self: center; }
  .figs .lt { font-size: 30px; }
  .p4-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 30rem) {
  body { font-size: 1.125rem; }
  .rh-c { display: none; }
  .fig-svg .lt { font-size: 44px; }
  .figs .fig-svg .lt { font-size: 32px; }
  .fig-svg .tt, .fig-svg .ti { font-size: 24px; }
  .expl { row-gap: 0.75rem; }
  .lop th, .lop td { padding-right: 0.75rem; }
}
