/* A book, in four editions, each with a day and a night printing. --paper and --ink are what the
   page and the plates are printed with; --rubric is the second ink. */
:root {
  color-scheme: light;
  --paper: #f2ebdc;
  --paper-2: #e8dfcc;
  --ink: #1b1714;
  --ink-2: #594f43;
  --rule: rgba(27, 23, 20, 0.22);
  --rule-2: rgba(27, 23, 20, 0.5);
  --rubric: #d1391b;
  --pencil: #5d5d66;
  --shade: 44, 30, 18;
  --wash: 0.5;
  --fox: rgba(146, 93, 38, 0.13);
  --serif: "Old Standard", "Iowan Old Style", Georgia, serif;
  --fat: "Gravitas One", "Old Standard", Georgia, serif;
  --script: "Pinyon Script", "Snell Roundhand", cursive;
  --hand: "Reenie Beanie", "Bradley Hand", cursive;
  --edge: 16px;
  --gutter: clamp(16px, 5vw, 64px);
  --measure: 38rem;

  /* What the Manual's stylesheet reads. */
  --d-bg: var(--paper);
  --d-bg-2: var(--paper-2);
  --d-surface: var(--paper-2);
  --d-ink: var(--ink);
  --d-muted: var(--ink-2);
  --d-line-strong: var(--rule-2);
  --d-accent: var(--rubric);
  --d-font-text: var(--serif);
  --d-font-display: var(--serif);
}
:root[data-edition="cyanotype"] { --paper: #eef2f5; --paper-2: #dfe7ee; --ink: #0d2f5c; --ink-2: #3f5a7d; --rule: rgba(13, 47, 92, 0.22); --rule-2: rgba(13, 47, 92, 0.5); --rubric: #0d4fa8; --pencil: #5c6a80; --shade: 12, 34, 70; --wash: 0.12; --fox: rgba(60, 100, 150, 0.1); }
:root[data-edition="herbarium"] { --paper: #e4e8d4; --paper-2: #d7dcc4; --ink: #1d2c1c; --ink-2: #4b5a44; --rule: rgba(29, 44, 28, 0.24); --rule-2: rgba(29, 44, 28, 0.5); --rubric: #8a4a12; --pencil: #58604f; --shade: 34, 44, 24; --wash: 0.42; --fox: rgba(120, 100, 40, 0.13); }
:root[data-edition="school"] { --paper: #f7c915; --paper-2: #efbb06; --ink: #161208; --ink-2: #4a3c08; --rule: rgba(22, 18, 8, 0.3); --rule-2: rgba(22, 18, 8, 0.6); --rubric: #c6230f; --pencil: #4c4630; --shade: 70, 44, 0; --wash: 0.62; --fox: rgba(150, 90, 0, 0.14); }

/* The night printings: light ink on dark stock. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { color-scheme: dark; --paper: #121417; --paper-2: #1c1f24; --ink: #ece5d6; --ink-2: #a79f8f; --rule: rgba(236, 229, 214, 0.2); --rule-2: rgba(236, 229, 214, 0.45); --rubric: #ff6a3d; --pencil: #a8a8b0; --shade: 0, 0, 0; --wash: 0.62; --fox: rgba(200, 160, 100, 0.05); }
  :root[data-edition="cyanotype"]:not([data-theme="light"]) { --paper: #0d3566; --paper-2: #0a2c56; --ink: #f2f6fa; --ink-2: #b3c6dd; --rule: rgba(242, 246, 250, 0.24); --rule-2: rgba(242, 246, 250, 0.5); --rubric: #ffffff; --pencil: #c0d2e6; --shade: 2, 14, 34; --wash: 0.1; --fox: rgba(255, 255, 255, 0.03); }
  :root[data-edition="herbarium"]:not([data-theme="light"]) { --paper: #15201a; --paper-2: #1d2b23; --ink: #e2e6d2; --ink-2: #a3ad97; --rule: rgba(226, 230, 210, 0.2); --rule-2: rgba(226, 230, 210, 0.45); --rubric: #d9a441; --pencil: #a5ad9b; --shade: 0, 6, 2; --wash: 0.58; --fox: rgba(200, 180, 90, 0.05); }
  :root[data-edition="school"]:not([data-theme="light"]) { --paper: #16130a; --paper-2: #231e0e; --ink: #f7c915; --ink-2: #c7a533; --rule: rgba(247, 201, 21, 0.24); --rule-2: rgba(247, 201, 21, 0.5); --rubric: #ff5a3a; --pencil: #b8a662; --shade: 0, 0, 0; --wash: 0.58; --fox: rgba(247, 201, 21, 0.04); }
}
:root[data-theme="dark"] { color-scheme: dark; --paper: #121417; --paper-2: #1c1f24; --ink: #ece5d6; --ink-2: #a79f8f; --rule: rgba(236, 229, 214, 0.2); --rule-2: rgba(236, 229, 214, 0.45); --rubric: #ff6a3d; --pencil: #a8a8b0; --shade: 0, 0, 0; --wash: 0.62; --fox: rgba(200, 160, 100, 0.05); }
:root[data-theme="dark"][data-edition="cyanotype"] { --paper: #0d3566; --paper-2: #0a2c56; --ink: #f2f6fa; --ink-2: #b3c6dd; --rule: rgba(242, 246, 250, 0.24); --rule-2: rgba(242, 246, 250, 0.5); --rubric: #ffffff; --pencil: #c0d2e6; --shade: 2, 14, 34; --wash: 0.1; --fox: rgba(255, 255, 255, 0.03); }
:root[data-theme="dark"][data-edition="herbarium"] { --paper: #15201a; --paper-2: #1d2b23; --ink: #e2e6d2; --ink-2: #a3ad97; --rule: rgba(226, 230, 210, 0.2); --rule-2: rgba(226, 230, 210, 0.45); --rubric: #d9a441; --pencil: #a5ad9b; --shade: 0, 6, 2; --wash: 0.58; --fox: rgba(200, 180, 90, 0.05); }
:root[data-theme="dark"][data-edition="school"] { --paper: #16130a; --paper-2: #231e0e; --ink: #f7c915; --ink-2: #c7a533; --rule: rgba(247, 201, 21, 0.24); --rule-2: rgba(247, 201, 21, 0.5); --rubric: #ff5a3a; --pencil: #b8a662; --shade: 0, 0, 0; --wash: 0.58; --fox: rgba(247, 201, 21, 0.04); }


/* Old Standard for the text: the Modern face of old science books. Gravitas One for the title: a
   nineteenth-century fat face. Pinyon for the names on the plates: the hand engravers cut. Reenie
   Beanie for the pencil in the margins. All four are under the SIL Open Font License. */
@font-face { font-family: "Old Standard"; src: url("/fonts/old-standard-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Old Standard"; src: url("/fonts/old-standard-400i.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Old Standard"; src: url("/fonts/old-standard-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Gravitas One"; src: url("/fonts/gravitas-one.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Pinyon Script"; src: url("/fonts/pinyon-script.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Reenie Beanie"; src: url("/fonts/reenie-beanie.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 64px; overflow-x: clip; }
body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.5 var(--serif);
  font-variant-numeric: oldstyle-nums;
  font-feature-settings: "liga", "dlig";
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  padding-right: var(--edge);
}
/* The sheet: a few fibers, and the brown spots old paper gets. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9 .35' numOctaves='2' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 .55 0 0 0 0 .47 0 0 0 0 .35 0 0 0 .32 -.08'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23f)'/%3E%3C/svg%3E");
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--rubric); }
h1, h2, h3 { font-weight: 400; margin: 0; line-height: 1.1; }
p { margin: 0 0 0.8em; }
code, .code, .cite { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.82em; font-variant-numeric: lining-nums; }
:focus-visible { outline: 2px solid var(--rubric); outline-offset: 3px; }
.skip { position: absolute; left: -999px; top: 0; z-index: 90; background: var(--ink); color: var(--paper); padding: 10px 14px; }
.skip:focus { left: 8px; top: 8px; }
.kicker { font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 0.5rem; font-variant-numeric: lining-nums; }
.kicker a { text-decoration: none; }
.fine { font-size: 0.86rem; color: var(--ink-2); }
.pencil { font-family: var(--hand); color: var(--pencil); font-size: 1.5rem; line-height: 1; margin: 0; }
.needs-words { font-family: var(--hand); color: var(--pencil); font-size: 1.32rem; line-height: 1.12; transform: rotate(-0.5deg); }
.needs-words strong { font-weight: 400; }

/* The running head. */
.site-head {
  position: relative;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 52px;
  padding: 0 0 0 var(--gutter);
  margin-right: calc(var(--gutter) - var(--edge));
  padding-right: 2px;
  border-bottom: 1px solid var(--rule-2);
}
.brand { font: 400 1.14rem/1 var(--fat); text-decoration: none; letter-spacing: 0.01em; }
.site-nav { display: flex; align-items: center; gap: 2px; }
.site-nav > a, .site-menu > summary { padding: 10px 6px; text-decoration: none; font-size: 0.98rem; font-style: italic; cursor: pointer; }
.nav-wide { display: none; }
.nav-tally { display: inline-flex; align-items: center; gap: 2px; font-style: normal !important; font-family: var(--hand); font-size: 1.3rem !important; line-height: 1; color: var(--pencil); }
.nav-tally svg { width: 14px; height: 14px; }
.nav-tally[hidden] { display: none; }
.mode { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; gap: 4px; width: 40px; height: 40px; justify-content: center; cursor: pointer; border-radius: 50%; }
.mode:focus-visible { outline: 2px solid var(--rubric); }
.mode[hidden] { display: none; }
.mode svg { width: 22px; height: 22px; }
.mode-word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.mode svg { display: none; }
.mode[data-now="light"] .m-light, .mode[data-now="dark"] .m-dark, .mode[data-now="auto"] .m-auto { display: block; }
.site-menu { position: relative; }
.site-menu > summary { list-style: none; }
.site-menu > summary::-webkit-details-marker { display: none; }
.site-menu-panel {
  position: absolute;
  right: -40px;
  top: 100%;
  width: min(250px, 72vw);
  background: var(--paper-2);
  border: 1px solid var(--rule-2);
  box-shadow: 0 16px 34px -14px rgba(var(--shade), 0.5);
  padding: 8px 0;
  z-index: 50;
}
.site-menu-panel a { display: block; padding: 10px 16px; text-decoration: none; font-size: 1.06rem; }
.site-nav-go { font-style: normal !important; font-weight: 700; color: var(--rubric); padding-right: 0 !important; }
.site-nav-go:hover { color: var(--ink); }

/* The fore-edge: the thumb index, painted. */
.edge {
  position: fixed;
  z-index: 45;
  right: 0;
  top: 56px;
  bottom: 8px;
  width: var(--edge);
  display: flex;
  flex-direction: column;
  gap: 1px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.edge > a {
  flex: 1 1 0;
  min-height: 0;
  background: var(--c);
  border-radius: 3px 0 0 3px;
  box-shadow: inset 2px 0 2px -1px rgba(255, 255, 255, 0.35), inset -6px 0 6px -6px rgba(0, 0, 0, 0.35);
  transition: transform 0.14s;
  transform-origin: right center;
}
.edge > a:hover, .edge > a.is-on, .edge > a[aria-current="true"] { transform: scaleX(1.7); }
.edge::before { content: ""; position: absolute; top: 0; bottom: 0; right: 100%; width: 10px; } /* more room for a thumb */
.edge-tip {
  position: fixed;
  right: 40px;
  z-index: 46;
  width: min(232px, 60vw);
  padding: 10px 12px 11px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule-2);
  box-shadow: 0 18px 30px -14px rgba(var(--shade), 0.55);
  pointer-events: none;
  transform: translateY(-50%);
}
#edge-art { display: block; width: 100%; height: auto; aspect-ratio: 1; }
.edge.is-off .edge-tip { opacity: 0.6; }
.edge-tip[hidden] { display: none; }
.edge-tip b { font-weight: 400; font-size: 1.16rem; display: block; line-height: 1.12; margin-top: 8px; font-style: italic; }
.edge-tip i { font-style: normal; font-size: 0.8rem; color: var(--ink-2); font-variant-numeric: lining-nums; }
.site-foot { margin: 72px var(--gutter) 0; padding: 24px 0 36px; border-top: 3px double var(--rule-2); }
.foot-inner { display: grid; gap: 16px; max-width: 72rem; margin: 0 auto; }
.foot-title { font: 400 1.5rem/1 var(--fat); margin: 0; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 4px 16px; font-style: italic; }
.site-foot nav a { text-decoration: none; padding: 4px 0; }
.site-foot .fine { margin: 0; }

@media (max-width: 439px) {
  .brand { font-size: 1.02rem; }
  .site-nav > a, .site-menu > summary { padding: 10px 4px; font-size: 0.94rem; }
  .mode { width: 34px; }
  .nav-tally { font-size: 1.14rem !important; }
}
@media (max-width: 379px) {
  .brand { font-size: 0.98rem; }
  .site-nav { gap: 0; }
  .site-nav > a, .site-menu > summary { padding: 10px 5px; font-size: 0.92rem; }
  .mode { width: 34px; }
  .nav-tally { display: none; }
}
@media (min-width: 900px) {
  :root { --edge: 22px; }
  .nav-wide { display: block; }
  .site-menu { display: none; }
  .site-head { height: 58px; }
  .site-nav { gap: 8px; }
  .site-foot .foot-inner { grid-template-columns: auto 1fr 1fr; gap: 16px 48px; }
  .site-foot .fine, .foot-editions { grid-column: 1 / -1; }
  .edge { top: 64px; }
}
@media print { .edge, .site-head, body::before { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; } }

/* A browser without page transitions still gets a page that settles in. */
@media (prefers-reduced-motion: no-preference) {
  @supports not (view-transition-name: none) {
    main { animation: page-in 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both; transform-origin: left center; }
    @keyframes page-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
  }
}
/* Every link turns the page; a specimen flies up into its plate. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-group(root) { animation: none; }
  ::view-transition-image-pair(root) { isolation: isolate; }
  ::view-transition-old(root) { z-index: 2; mix-blend-mode: normal; transform-origin: left center; backface-visibility: hidden; animation: leaf-away 0.56s cubic-bezier(0.42, 0.02, 0.3, 1) both; }
  ::view-transition-new(root) { z-index: 1; mix-blend-mode: normal; animation: leaf-under 0.56s ease-out both; }
  html:active-view-transition-type(back)::view-transition-old(root) { z-index: 1; animation: leaf-under-out 0.56s ease-in both; }
  html:active-view-transition-type(back)::view-transition-new(root) { z-index: 2; transform-origin: left center; animation: leaf-back 0.56s cubic-bezier(0.42, 0.02, 0.3, 1) both; }
  ::view-transition-group(plate-fly) { animation-duration: 0.5s; animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1); z-index: 5; }
  ::view-transition-old(plate-fly), ::view-transition-new(plate-fly) { animation-duration: 0.5s; }
  @keyframes leaf-away { 0% { transform: perspective(1500px) rotateY(0); filter: brightness(1); } 100% { transform: perspective(1500px) rotateY(-96deg); filter: brightness(0.82); } }
  @keyframes leaf-back { 0% { transform: perspective(1500px) rotateY(-96deg); filter: brightness(0.82); } 100% { transform: perspective(1500px) rotateY(0); filter: brightness(1); } }
  @keyframes leaf-under { 0% { filter: brightness(0.86); } 100% { filter: brightness(1); } }
  @keyframes leaf-under-out { 0% { filter: brightness(1); } 100% { filter: brightness(0.86); } }
}
