/* The Underground Fungarium — Exercise Book 1
   A school exercise book: blue card cover, feint-ruled pages with a red margin,
   everything typed in emerald on one old machine. book.js turns the pages.
   All sizes are in page pixels; the whole book is scaled to fit the screen. */

@font-face { font-family: "Hand"; src: url("../fonts/caveat-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Hand"; src: url("../fonts/caveat-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Elite"; src: url("../fonts/special-elite-latin-400-normal.woff2") format("woff2"); font-display: block; }

:root {
  --W: 440px;               /* one page */
  --H: 570px;
  --line: 20px;             /* the ruling: narrow feint, ~7.5 mm at this scale */
  --top: 72px;              /* head band above the first rule */
  --margin-x: 50px;         /* the red margin */
  --emerald: #0e6a4d;
  --emerald-soft: #4b8a71;
  --fine: #1f1d1a;          /* fineliner */
  --paper: #fcfbf6;
  --feint: rgba(86, 136, 204, 0.42);
  --red: rgba(214, 74, 92, 0.62);
  --cover: #3d6aa3;
  --cover-ink: #1d2f4f;
  --type: "Elite", "Special Elite", "Courier Prime", "Courier New", monospace;
  --print: "Helvetica Neue", Arial, "Liberation Sans", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: #24211f radial-gradient(ellipse at 50% 45%, #34302c, #1c1a18 75%);
  color: var(--emerald); font: 11.5px/var(--line) var(--type);
  overflow: hidden; -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
::selection { background: rgba(14, 106, 77, 0.2); }

/* ---------- stage & book ---------- */
.stage { position: fixed; inset: 0; overflow: hidden; touch-action: pan-y pinch-zoom; }
.fit { position: absolute; left: 50%; top: 50%; width: calc(var(--W) * 2); height: var(--H); transform-origin: 50% 50%; }
.single .fit { width: var(--W); }
.book { position: relative; width: 100%; height: 100%; perspective: 4200px; transition: transform .8s cubic-bezier(.35, .1, .25, 1); cursor: pointer; outline: none; }

.under { position: absolute; top: 0; bottom: 0; left: var(--W); width: var(--W); border-radius: 2px 5px 5px 2px;
  box-shadow: 0 22px 46px rgba(0, 0, 0, 0.55), 0 4px 10px rgba(0, 0, 0, 0.35); transition: left .8s, width .8s; }
.book.open .under { left: 0; width: calc(var(--W) * 2); }
.book.at-back .under { left: 0; width: var(--W); }
.single .under, .single .book.open .under { left: 0; width: var(--W); }

.leaf { position: absolute; top: 0; left: var(--W); width: var(--W); height: var(--H);
  transform-style: preserve-3d; transform-origin: 0 50%; transition: transform .8s cubic-bezier(.35, .1, .25, 1); }
.single .leaf { left: 0; }
.leaf.turned { transform: rotateY(-180deg); }
.leaf.gone { visibility: hidden; }
.face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; }
.face.back { transform: rotateY(180deg); }
.face > .page { position: absolute; inset: 0; }
/* the gutter: paper curving into the staples */
.face::after { content: ""; position: absolute; top: 0; bottom: 0; width: 46px; pointer-events: none; z-index: 5; }
.face.front::after { left: 0; background: linear-gradient(90deg, rgba(40, 35, 25, 0.22), rgba(40, 35, 25, 0.06) 30%, transparent); }
.face.back::after { right: 0; background: linear-gradient(-90deg, rgba(40, 35, 25, 0.22), rgba(40, 35, 25, 0.06) 30%, transparent); }
.face.cover-face::after { width: 14px; opacity: .6; }
/* the page edge darkens a touch as it lifts */
.leaf .face::before { content: ""; position: absolute; inset: 0; z-index: 6; pointer-events: none; background: #000; opacity: 0; transition: opacity .4s; }
.leaf.flipping .face::before { opacity: .08; }

/* staples, seen from the middle of the book */
.staple { position: absolute; width: 3px; height: 34px; z-index: 7; border-radius: 1px;
  background: linear-gradient(90deg, #8d9196, #e3e6ea 45%, #9a9ea3); box-shadow: 0 0 1px rgba(0, 0, 0, 0.5); }
.face.front .staple { left: -1.5px; }
.face.back .staple { right: -1.5px; }
.staple.a { top: 22%; } .staple.b { bottom: 22%; }

/* ---------- ruled paper ---------- */
.page { background: var(--paper); }
.page.lined {
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='400' height='400'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .45  0 0 0 0 .42  0 0 0 0 .35  0 0 0 .07 0'/></filter><rect width='100%' height='100%' filter='url(%23g)'/></svg>"),
    var(--paper);
}
.page.lined::before { /* feint rules */
  content: ""; position: absolute; left: 0; right: 0; top: var(--top); bottom: calc(var(--line) - 2px);
  /* one rule per tile, tiled down the page: a repeating gradient drops lines in bands when the book is scaled down on a 1x screen */
  background: linear-gradient(180deg, transparent calc(100% - 1px), var(--feint) calc(100% - 1px)) 0 0 / 100% var(--line) repeat-y;
}
.page.lined::after { /* margin */
  content: ""; position: absolute; top: 0; bottom: 0; left: var(--margin-x); width: 1.2px; background: var(--red);
}
.rh { position: absolute; z-index: 2; top: 38px; left: calc(var(--margin-x) + 8px); right: 22px; display: flex; justify-content: space-between; align-items: baseline;
  font-size: 11px; line-height: 1; letter-spacing: 0.16em; text-transform: uppercase; color: var(--emerald); }
.face.back .rh { flex-direction: row-reverse; }
.rh .pn { font-size: 11.5px; letter-spacing: 0; }

.pc { position: absolute; z-index: 1; top: calc(var(--top) + 6px); left: calc(var(--margin-x) + 8px); right: 22px; bottom: var(--line); }
.pc p, .pc h1, .pc h2, .pc ol, .pc ul, .pc dl, .pc figure, .pc table { margin: 0; }
.pc p.ind { text-indent: 3ch; }
.pc .blank { height: var(--line); }
.soft { color: var(--emerald-soft); }
b { font-weight: 400; letter-spacing: 0.04em; }
i, u { font-style: normal; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
s { text-decoration-thickness: 1.3px; }
a { color: inherit; text-decoration: none; }
a:hover, a:focus-visible { background: linear-gradient(transparent 62%, rgba(14, 106, 77, 0.16) 62%); outline: none; }
h1, h2 { font-weight: 400; }
.pc h2 { font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; }

/* title page */
.title { font-size: 18px; line-height: var(--line); letter-spacing: 0.12em; text-transform: uppercase; margin-top: calc(var(--line) * -1) !important; padding-top: 0; }
.title { line-height: calc(var(--line) * 1.0); }
.sub { letter-spacing: 0.04em; }
.field .k { display: inline-block; min-width: 9ch; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; }
.toc { list-style: none; padding: 0; counter-reset: c; }
.toc li { display: flex; gap: 1ch; }
.toc li::after { content: attr(data-pp); margin-left: auto; padding-left: 1ch; }
.toc a { flex: 0 1 auto; }
.toc li::before { content: ""; order: 2; flex: 1; margin: 0 0 7px; border-bottom: 1.5px dotted rgba(14, 106, 77, 0.45); align-self: flex-end; }
.toc a { order: 1; } .toc li::after { order: 3; }
.motto { position: absolute; bottom: 0; right: 0; }

/* journal */
.entry .date { margin-right: 1ch; text-decoration: underline; text-underline-offset: 3px; }
.sign { text-align: right; }

/* plate I */
.plate-page .pc { top: 44px; bottom: 8px; display: flex; align-items: center; justify-content: center; }
.plate-drawing { display: block; width: auto; height: 100%; max-width: 100%; }
.plate-drawing .lbl, .plate-drawing .fig-no, .plate-drawing .hand-lbl, .plate-drawing .pl-title,
.plate-drawing .pl-name, .plate-drawing .pl-common { font-family: var(--type); font-style: normal; fill: var(--emerald); letter-spacing: 0.02em; }
.plate-drawing .pl-title { font-size: 17px; letter-spacing: 0.3em; }
.plate-drawing .pl-name { font-size: 17px; }
.plate-drawing .pl-common { font-size: 12.5px; }
.plate-drawing .fig-no { font-size: 15px; }
.plate-drawing .lbl { font-size: 11.5px; }
.plate-drawing .hand-lbl { font-size: 12.5px; }
.plate-drawing tspan[font-style] { font-style: normal; text-decoration: underline; }
.plate-page .rh { display: none; }
/* the plate inks itself in when its page is turned to (book.js sets the stroke lengths) */
.plate-drawing.pending .wash, .plate-drawing.pending .wart, .plate-drawing.pending text { opacity: 0; }
.plate-drawing.drawn [data-draw] { stroke-dashoffset: 0 !important; transition: stroke-dashoffset 2.2s cubic-bezier(.45, .05, .3, 1); }
.plate-drawing.drawn .wash { opacity: 1; transition: opacity 1.8s ease 1.6s; }
.plate-drawing.drawn .wart { opacity: 1; transition: opacity .8s ease 2.6s; }
.plate-drawing.drawn text { opacity: 1; transition: opacity 1s ease 2.2s; }

.expl p { margin-bottom: 0; }
.expl p + p { margin-top: 0; }

/* drawing No. 6, inked straight onto the page */
.ink-drawing { height: calc(var(--line) * 14); display: flex; justify-content: center; }
.ink-drawing img { height: 100%; width: auto; mix-blend-mode: multiply; }
.ink-drawing.tall { height: calc(var(--line) * 16); }
.ink-drawing svg { height: 100%; width: auto; overflow: visible; }
.ink-drawing.wide { height: calc(var(--line) * 13); margin-bottom: 6px !important; }

/* culture record */
.plate-row { display: grid; grid-template-columns: 220px 1fr; gap: 18px; align-items: center; margin-top: 16px !important; }
.snapshot { position: relative; margin: 0; padding: 9px 9px 30px; background: #fdfcf8; transform: rotate(-1.6deg);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.12), 0 6px 14px rgba(40, 30, 20, 0.22); cursor: pointer; }
.bench { padding: 12px; background: radial-gradient(circle at 50% 40%, #5a4636, #2c2119 78%); }
.dish { position: relative; aspect-ratio: 1; border-radius: 50%; box-shadow: 0 8px 18px rgba(0, 0, 0, 0.5); outline: none; }
.dish canvas { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; }
.readout { line-height: var(--line); }

/* tables written onto the ruling */
.ruled { width: 100%; border-collapse: collapse; table-layout: fixed; }
.ruled th { height: var(--line); padding: 0 4px; text-align: left; vertical-align: bottom; font-size: 10px; line-height: 1.2; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 400; padding-bottom: 5px; }
.ruled td { height: var(--line); padding: 0 4px; line-height: var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ruled th + th, .ruled td + td { border-left: 1px solid rgba(14, 106, 77, 0.28); }
.ruled td[colspan] { white-space: normal; }
.catalogue th:nth-child(1) { width: 78px; } .catalogue th:nth-child(2) { width: 52px; }
.catalogue th:nth-child(4) { width: 70px; } .catalogue th:nth-child(5) { width: 40px; }
.catalogue td.num { font-size: 12px; letter-spacing: 0.02em; }

/* spore prints */
.prints { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; margin-top: 14px !important; }
.prints.one { grid-template-columns: 1fr; width: 50%; margin-top: 4px !important; }
.sp { margin: 0; }
.print-card { display: block; width: 100%; height: auto; filter: drop-shadow(0 2px 3px rgba(60, 40, 20, 0.18)); }
.sp figcaption { text-align: center; font-size: 10.5px; line-height: 15px; margin-top: -2px; }
.sp-name { display: block; font-size: 12.5px; line-height: 18px; letter-spacing: 0.06em; }

/* fineliner diagrams */
.fl-block { margin: 10px 0 8px !important; }
.fl-block figcaption { font-size: 11px; line-height: 18px; letter-spacing: 0.16em; text-transform: uppercase; }
.fine { display: block; width: 100%; height: auto; }
.fl-lbl { font: 11px var(--type); fill: var(--emerald); }
.pc > .fl-block:nth-of-type(1) .fl-lbl { font-size: 11.5px; }
.fl-block.lens { width: 210px; margin: 6px 0 0 auto !important; transform: rotate(-4deg); }
.fl-block.lens figcaption { display: none; }

/* photos stuck in with light-blue tape */
.tape { position: absolute; z-index: 3; width: 74px; height: 20px; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0) 45%, rgba(255, 255, 255, 0.22)),
    rgba(148, 196, 228, 0.55);
  box-shadow: 0 0 0 0.5px rgba(80, 130, 170, 0.35), 0 1px 2px rgba(60, 90, 120, 0.18);
  clip-path: polygon(0 6%, 3% 0, 97% 0, 100% 8%, 98% 22%, 100% 38%, 97% 54%, 100% 70%, 98% 86%, 100% 100%, 3% 100%, 0 92%, 2% 76%, 0 60%, 3% 44%, 0 28%, 2% 14%); }
.snapshot .t1 { top: -9px; left: -20px; transform: rotate(-32deg); }
.snapshot .t2 { bottom: -6px; right: -22px; transform: rotate(-28deg); }
.photo-print { position: relative; margin: 6px 6px 14px !important; padding: 8px 8px 8px; background: #fdfcf8; transform: rotate(1.1deg);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.12), 0 6px 14px rgba(40, 30, 20, 0.22); }
.photo-print img { display: block; width: 100%; height: 236px; object-fit: cover; filter: saturate(.9) contrast(1.02); }
.photo-print .t3 { top: -10px; left: 50%; margin-left: -37px; transform: rotate(-3deg); width: 90px; }

.snaps { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px 14px; margin-top: 12px !important; }
.snaps .snap { width: calc((100% - 28px) / 3); }
.snap { position: relative; margin: 0; padding: 6px 6px 4px; background: #fdfcf8; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1), 0 5px 10px rgba(40, 30, 20, 0.2); }
.snap img { display: block; width: 100%; height: 110px; object-fit: contain; background: #f3f0e6; }
.snap figcaption { font-size: 10.5px; line-height: 16px; text-align: center; padding-top: 3px; white-space: nowrap; }
.snap .tape { top: -9px; left: 50%; width: 52px; height: 17px; margin-left: -26px; }
.s1 { transform: rotate(-2deg); } .s2 { transform: rotate(1.5deg); } .s3 { transform: rotate(-1deg); }
.s4 { transform: rotate(2deg); } .s5 { transform: rotate(-1.5deg); }
.snaps-note { margin-top: 22px !important; }

/* key + label */
.levels { list-style: none; padding: 0; }
.levels li { padding-left: 4ch; text-indent: -4ch; }
.label { position: relative; width: 300px; margin: 22px auto 0 !important; padding: 10px 14px 8px; background: #fffef9; font-size: 11px; line-height: 17px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.12), 0 5px 12px rgba(40, 30, 20, 0.2); transform: rotate(-0.8deg); }
.label .tape { top: -10px; left: 50%; margin-left: -37px; transform: rotate(2deg); }
.label .lh { display: flex; justify-content: space-between; padding-bottom: 4px; margin-bottom: 5px !important; border-bottom: 1px solid rgba(14, 106, 77, 0.5); font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; }
.label .taxon { font-size: 13px; margin-bottom: 4px !important; }
.label dl { display: grid; grid-template-columns: 70px 1fr; }
.label dt { font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; }
.label dd { margin: 0; border-bottom: 1px dotted rgba(14, 106, 77, 0.35); }
.label-note { text-align: center; margin-top: 8px !important; }

/* last page */
.last { display: flex; flex-direction: column; align-items: center; }
.stamp { display: inline-block; margin-top: 10px !important; padding: 6px 14px 4px; border: 2px solid var(--emerald); border-radius: 3px; transform: rotate(-3deg);
  font-size: 15px; line-height: 20px; letter-spacing: 0.12em; text-transform: uppercase; text-align: center; opacity: .88;
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.55' numOctaves='2'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 -1.6 1.45'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
          mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.55' numOctaves='2'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 -1.6 1.45'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
.stamp small { display: block; font-size: 10px; letter-spacing: 0.3em; }
.stamp-note { text-align: center; margin-top: 14px !important; }
.pressed { position: relative; margin-top: 18px !important; text-align: center; }
.fern { display: block; width: 92px; height: 230px; margin: 0 auto; transform: rotate(8deg); }
.pressed .t4 { top: 120px; left: 50%; margin-left: -40px; transform: rotate(-12deg); width: 80px; }

/* ---------- covers ---------- */
.page.cover {
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .09 0'/></filter><rect width='100%' height='100%' filter='url(%23g)'/></svg>"),
    linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(0, 0, 0, 0.08)),
    var(--cover);
  border-radius: 2px 6px 6px 2px; color: var(--cover-ink);
}
.face.back > .page.cover { border-radius: 6px 2px 2px 6px; }
.crease { position: absolute; top: 0; bottom: 0; left: 15px; width: 2px; background: linear-gradient(90deg, rgba(0, 0, 0, 0.18), rgba(255, 255, 255, 0.12)); }
.back-cover .crease { left: auto; right: 15px; }
.cv-label { position: absolute; left: 50px; right: 38px; top: 112px; padding: 20px 22px 12px; background: #fdfdfb; border-radius: 12px;
  box-shadow: inset 0 0 0 2px var(--cover-ink), inset 0 0 0 5px #fdfdfb, inset 0 0 0 6px var(--cover-ink), 0 1px 0 rgba(0, 0, 0, 0.2); }
.cv-row { display: flex; align-items: baseline; gap: 10px; margin: 0 0 4px; border-bottom: 1px solid var(--cover-ink); height: 34px; padding-bottom: 3px; align-items: flex-end; }
.cv-k { flex: 0 0 58px; font: 700 10px/1 var(--print); letter-spacing: 0.08em; text-transform: uppercase; color: var(--cover-ink); padding-bottom: 2px; }
.cv-v { font: 15px/1.2 var(--type); color: var(--emerald); white-space: nowrap; transform: rotate(-0.4deg); }
.cv-brand { position: absolute; left: 0; right: 0; bottom: 34px; margin: 0; text-align: center; color: rgba(255, 255, 255, 0.85); font-family: var(--print); }
.cv-brand b { display: block; font-size: 22px; letter-spacing: 0.32em; text-transform: uppercase; font-weight: 700; }
.cv-brand span { display: block; margin-top: 6px; font-size: 9.5px; letter-spacing: 0.22em; text-transform: uppercase; }
.cv-brand.small { bottom: 18px; } .cv-brand.small span { letter-spacing: 0.12em; text-transform: none; font-size: 10px; }
.tables { position: absolute; left: 36px; right: 50px; top: 32px; bottom: 50px; padding: 14px 14px 10px; background: rgba(255, 255, 255, 0.94); border-radius: 8px;
  box-shadow: inset 0 0 0 1.5px var(--cover-ink); color: var(--cover-ink); font-family: var(--print); }
.tables-h { margin: 0 0 8px; text-align: center; font-weight: 700; font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase; }
.tables-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 6px; }
.tt { display: flex; flex-direction: column; padding: 4px 0 3px 6px; border: 1px solid rgba(29, 47, 79, 0.45); font-size: 9px; line-height: 10.6px; }
.page.card { background: linear-gradient(160deg, #f1f0ea, #e7e5dc); }
.sticker { position: absolute; left: 70px; right: 70px; top: 150px; padding: 18px 20px 14px; background: #fffef9; text-align: center; transform: rotate(-1.5deg);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1), 0 4px 10px rgba(40, 30, 20, 0.16); font-size: 13.5px; line-height: 22px; }
.sticker h2 { margin: 0 0 6px; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; font-weight: 400; }
.sticker p { margin: 0 0 6px; }
.sticker .tape { top: -10px; left: 50%; margin-left: -37px; transform: rotate(-4deg); }
.paper-back { background: var(--paper); }
.paper-back.cover-back { background: var(--cover); }

/* ---------- no-script fallback: just stack the pages ---------- */
.no-book body { overflow: auto; }
.no-book .stage { position: static; }
.no-book .fit { position: static; transform: none; width: auto; height: auto; }
.no-book .book { display: flex; flex-direction: column; align-items: center; gap: 24px; padding: 24px 0; }
.no-book .page { position: relative; width: var(--W); height: var(--H); flex: none; }

@media (prefers-reduced-motion: reduce) {
  .book, .leaf, .under { transition: none !important; }
}

.spare-note { position: absolute; z-index: 1; top: calc(var(--top) + 6px); left: calc(var(--margin-x) + 8px); margin: 0; color: var(--emerald-soft); }

.pc p.li { padding-left: 2ch; text-indent: -2ch; }

/* fineliner figures (gen_ink.py) */
.ink-block { margin: 8px 0 6px !important; }
.ink-fig { display: block; width: 100%; height: auto; overflow: visible; }
.ink-fig .fl-lbl { font: 15px var(--type); fill: var(--emerald); }
.ink-fig.caps .fl-lbl { font-size: 11.5px; }
.ink-fig.print-setup { width: 92%; margin: 0 auto; }
.lens-block { width: 120px; margin: 4px 10px 0 auto !important; transform: rotate(-6deg); }
.ckey { display: grid; grid-template-columns: 13ch 1fr; column-gap: 1ch; }
.ckey span:nth-child(odd) { letter-spacing: 0.04em; }

/* entries (build.py) */
.spec-h { display: flex; justify-content: space-between; }
.spec-h .det { letter-spacing: 0.08em; }
.taxon-line { font-size: 13px; }
.entry .field .k { min-width: 9ch; }
.entry-photo { position: relative; width: 62%; margin: 10px 0 8px 4px !important; padding: 6px; background: #fdfcf8; transform: rotate(-1.2deg);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.12), 0 6px 14px rgba(40, 30, 20, 0.22); }
.entry-photo img { display: block; width: 100%; height: 136px; object-fit: cover; }
.entry-photo .tape { top: -9px; left: 50%; margin-left: -37px; transform: rotate(-4deg); }
.entry-drawing { height: calc(var(--line) * 8); display: flex; justify-content: center; }
.entry-drawing img { height: 100%; width: auto; mix-blend-mode: multiply; }
.catalogue td a { color: inherit; }

/* a photo taped in for decoration (no number, no caption: not a record) */
.deco-photo { position: relative; width: 70%; margin: 22px auto 0 !important; padding: 7px 7px 20px; background: #fdfcf8; transform: rotate(2.2deg);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.12), 0 6px 14px rgba(40, 30, 20, 0.22); }
.deco-photo img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.deco-photo .t1 { top: -9px; left: -18px; transform: rotate(-35deg); }
.deco-photo .t2 { top: -9px; right: -18px; transform: rotate(35deg); }

.deco-pair { position: relative; height: 232px; margin-top: 14px !important; }
.deco-pair .deco-photo { position: absolute; margin: 0 !important; }
.deco-pair .land { left: 4px; top: 22px; width: 62%; transform: rotate(-2deg); }
.deco-pair .port { right: 6px; top: 0; width: 34%; padding-bottom: 16px; transform: rotate(3.5deg); z-index: 2; }
.deco-pair .port img { aspect-ratio: 3 / 4; }
.deco-photo .t3 { top: -10px; left: 50%; margin-left: -30px; width: 60px; transform: rotate(-6deg); }

/* the If found sticker: red ballpoint, with a glow-in-the-dark ghost fungus stuck on its corner */
.sticker { color: #b3261e; }

/* ---------- GO LOOK: a red rubber stamp on the cover when it's been raining in season (extras.js) ---------- */
.golook { position: absolute; left: 50%; top: 334px; z-index: 3; padding: 8px 18px 6px; transform-origin: 50% 50%; translate: -50% 0; white-space: nowrap; text-align: center;
  border: 3px double #e0473b; border-radius: 4px; color: #e0473b; transform: rotate(-9deg); font-family: var(--print);
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.6' numOctaves='2'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 -1.1 1.35'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
          mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.6' numOctaves='2'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 -1.1 1.35'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: golook .35s cubic-bezier(.2, 1.6, .4, 1) both; }
.golook b { display: block; font-size: 32px; line-height: 1; letter-spacing: .14em; text-transform: uppercase; font-weight: 800; }
.golook small { display: block; margin-top: 5px; font-size: 9.5px; letter-spacing: .2em; text-transform: uppercase; }
@keyframes golook { from { opacity: 0; transform: rotate(-9deg) scale(1.6); } to { opacity: 1; transform: rotate(-9deg) scale(1); } }

/* ---------- the dog-ear (book.js) ---------- */
.dog-ear { position: absolute; z-index: 9; top: 0; right: 0; width: 30px; height: 30px; pointer-events: none; }
.dog-ear::before { content: ""; position: absolute; inset: 0; background: #d8d2c3; clip-path: polygon(0 0, 100% 0, 100% 100%); }       /* the page beneath */
.dog-ear::after { content: ""; position: absolute; inset: 0; clip-path: polygon(0 0, 0 100%, 100% 100%);                                     /* the folded flap */
  background: linear-gradient(225deg, #fbf9f2, #ece7da); filter: drop-shadow(-1px 2px 2px rgba(0, 0, 0, .25)); }
.face.back .dog-ear { right: auto; left: 0; transform: scaleX(-1); }

/* ---------- accession stamp on specimen pages (build.py) ---------- */
.accession { position: absolute; right: 6px; bottom: 4px; z-index: 2; padding: 5px 9px 4px; border: 1.6px solid #5b3f8c; border-radius: 3px;
  color: #5b3f8c; font-family: var(--print); text-align: center; line-height: 1.25; transform: rotate(-7deg); opacity: .82;
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='2'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 -1.5 1.45'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
          mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='2'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 -1.5 1.45'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
.accession span { display: block; font-size: 7.5px; letter-spacing: .18em; text-transform: uppercase; }
.accession b { display: block; font-size: 11px; letter-spacing: .12em; font-weight: 700; }

/* ---------- the tally on the inside back cover (build.py) ---------- */
.tally { position: absolute; left: 70px; right: 70px; top: 404px; }
.tally p { display: flex; align-items: flex-start; gap: 14px; min-height: 52px; margin: 0 0 14px; border-bottom: 1px solid rgba(0, 0, 0, .08); }
.tally .k { flex: 0 0 9ch; padding-top: 16px; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--emerald); }
.tally-marks { display: flex; flex-wrap: wrap; gap: 2px 10px; flex: 1; }
.tally .gate { height: 44px; flex: none; }

/* ---------- ghost fungus stickers: cream by day, glowing after dusk (extras.js sets html.night) ----------
   Two forms of Omphalotus nidiformis: a tier of overlapping fans on the back cover,
   a single funnel with decurrent gills on the corner of the If found sticker. */
.ghost { position: absolute; z-index: 3; height: auto; filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, .3)); transition: filter 1.2s; }
.ghost-tier { right: 20px; bottom: 22px; width: 104px; transform: rotate(-12deg); }
.ghost .cap { fill: #efe9dc; stroke: #7a6f5e; stroke-width: 1.6; transition: fill 1.2s, stroke 1.2s; }
.ghost .gill { fill: none; stroke: #8f846f; stroke-width: 1.2; transition: stroke 1.2s; }
.ghost .ghost-cut { transition: opacity 1.2s; }
.night .ghost { filter: drop-shadow(0 0 4px rgba(150, 255, 120, .9)) drop-shadow(0 0 14px rgba(90, 230, 90, .7)) drop-shadow(0 0 30px rgba(60, 200, 80, .45)); }
.night .night .ghost .cap { fill: #c9ffb0; stroke: #7fe878; }
.night .ghost .gill { stroke: #9ff58f; }
.night .ghost .ghost-cut { opacity: .25; }
.page.back-cover { transition: background 1.2s; }
.night .back-cover { background-color: #2d4f7c; }


/* ---------- stickers (a shop-bought sheet, stuck on through the book) ---------- */
.stk { position: absolute; z-index: 4; height: auto; pointer-events: none; user-select: none; transform: rotate(var(--r, 0deg));
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .32)) drop-shadow(0 3px 6px rgba(0, 0, 0, .12)); }
.stk.margin { left: 3px; width: 44px; }
.single .stk.margin { left: 2px; }

/* ---------- writing on the lines ---------- */
.pc .ed p, .pc .ed h2 { min-height: var(--line); }       /* an empty line is still a line */
.ed:empty { min-height: var(--line); }
.stamp-note p { margin: 0; }

/* the warning on page one: house green ink, the last phrase under a pink highlighter */
.warning { margin-top: var(--line); color: var(--emerald); }
.warning p { transform: rotate(-0.4deg); }
/* a pink highlighter dragged over the words: ragged at both ends, a bit heavier where the nib started and stopped */
.hl { white-space: nowrap; padding: 1px 3px; margin: 0 -2px; border-radius: 3px 6px 4px 7px; color: inherit;
  background: linear-gradient(100deg, rgba(255, 92, 170, 0) 0%, rgba(255, 92, 170, .62) 2.5%, rgba(255, 120, 186, .44) 7%,
              rgba(255, 112, 182, .4) 60%, rgba(255, 92, 170, .52) 94%, rgba(255, 92, 170, .66) 97%, rgba(255, 92, 170, 0) 100%);
  -webkit-box-decoration-break: clone; box-decoration-break: clone; mix-blend-mode: multiply; }

/* ---------- inside front cover: a photo print, stuck in with mushroom washi tape ---------- */
.taped-photo { position: absolute; z-index: 3; margin: 0; padding: 6px; background: #fbfbf8;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 6px 16px rgba(0, 0, 0, .15); }
.taped-photo img { display: block; width: 100%; object-fit: cover; }
.taped-photo.blue { left: 34px; top: 30px; width: 192px; transform: rotate(-3deg); }
.taped-photo.blue img { aspect-ratio: 4 / 5; }
.taped-photo.amethyst { z-index: 4; right: 22px; top: 176px; width: 262px; transform: rotate(2.5deg); }
.taped-photo.amethyst img { aspect-ratio: 3 / 2; }
.washi { position: absolute; height: 26px; opacity: .92; clip-path: polygon(3px 0, calc(100% - 2px) 0, 100% 12%, calc(100% - 3px) 25%, 100% 38%, calc(100% - 2px) 50%, 100% 63%, calc(100% - 3px) 76%, 100% 88%, calc(100% - 1px) 100%, 2px 100%, 0 88%, 3px 76%, 0 63%, 2px 50%, 0 38%, 3px 25%, 0 12%);
  background: url("../images/washi-mushrooms.webp") 0 50% / auto 100% repeat-x; filter: drop-shadow(0 .5px .6px rgba(0, 0, 0, .18)); }
.washi.w1 { width: 104px; left: -36px; top: 8px; transform: rotate(-38deg); background-position-x: -34px; }
.washi.w2 { width: 98px; right: -34px; top: 4px; transform: rotate(36deg); background-position-x: -140px; }
/* the second roll: vintage plate illustrations, one long strip cut from the photo of the roll */
.washi.vintage { background: url("../images/washi-vintage.webp") 0 50% / auto 100% no-repeat; opacity: .94; }
.washi.v1 { width: 108px; left: -40px; top: 10px; transform: rotate(-34deg); background-position-x: -20px; }
.washi.v2 { width: 104px; right: -26px; bottom: 8px; transform: rotate(-34deg); background-position-x: -128px; }

/* the editor's note: one print of a club table of finds, under the mushroom-row washi tape */
.deco-single { position: relative; width: 92%; margin: 26px auto 0 !important; padding: 6px; background: #fbfbf8; transform: rotate(1.4deg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 6px 16px rgba(0, 0, 0, .14); }
.deco-single img { display: block; width: 100%; aspect-ratio: 1152 / 720; object-fit: cover; }
.washi.wa { width: 104px; left: -38px; top: 6px; transform: rotate(-36deg); background-position-x: -60px; }
.washi.wb { width: 100px; right: -36px; top: 4px; transform: rotate(38deg); background-position-x: -180px; }
.washi.wc { width: 96px; right: 34%; bottom: -12px; transform: rotate(-4deg); background-position-x: -300px; }
