@font-face {
  font-family: Caveat;
  src: url('fonts/caveat-latin.woff2') format('woff2');
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}
:root {
  color-scheme: light;
  --paper: #fcf8ee;
  --ink: #243952;
  --muted: #5e635b;
  --rule: #b5bdbe;
  --hand: Caveat, "Segoe Print", "Bradley Hand", cursive;
  font-family: 'Trebuchet MS', system-ui, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: #eae5d9;
  background-image: repeating-linear-gradient(101deg, #fff1 0 1px, transparent 1px 4px);
}
main { width: min(100% - 60px, 1060px); margin: 0 auto; padding-bottom: 30px; }
.masthead {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1rem 0 .7rem; border-bottom: 1px solid #9a9b8c;
  font-size: .88rem;
}
.separator { margin: 0 .35em; color: #8d5948; }
button { color: inherit; font: inherit; cursor: pointer; }
button:focus-visible { outline: 2px solid #8c3e24; outline-offset: 4px; }
.text-button {
  border: 0; padding: .25em .05em; background: transparent; text-decoration: underline;
  text-underline-offset: .2em;
}
.intro {
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  padding: 17px 4px 20px;
}
.intro h1 {
  font: 700 clamp(3.55rem, 8.7vw, 7.6rem)/.94 var(--hand);
  letter-spacing: -.045em; margin: 0; position: relative; padding-bottom: 8px;
}
.intro h1::after {
  content: ''; position: absolute; left: 6%; right: 8%; bottom: 4px; height: 9px;
  border-top: 2px solid #9d573c; border-radius: 54% 61% 0 0; transform: rotate(-2.8deg);
  opacity: .75; pointer-events: none;
}
.intro p { margin: 0; color: #494d45; line-height: 1.48; font-size: 1rem; }
.exhibit { box-shadow: 2px 5px 0 #28271e0c, 0 12px 24px #4b463919; }
.transport {
  display: flex; align-items: center; gap: .9rem; padding: .65rem .85rem;
  background: #e1e5d8; border: 1px solid #a6ad9d; border-bottom: 0;
}
.transport button {
  border: 1px solid #526353; border-radius: 2px; padding: .41rem .75rem;
  background: #faf7eb; white-space: nowrap; font-size: .86rem;
}
#all { background: #2f5144; color: #fff9ec; border-color: #2f5144; }
#all:hover { background: #416653; }
#play { min-width: 65px; }
#play:hover { background: #eeefe0; }
.timeline { background: #a5b2a3; position: relative; height: 2px; flex: 1; min-width: 10px; }
.timeline::before { content:''; display: block; height: 2px; width: var(--progress, 0%); background: #365944; }
.timeline::after { content:''; position: absolute; left: 47.06%; top: -3px; height: 8px; width: 1px; background: #566d5f; }
#time { font-size: .78rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.page {
  --row: 28px;
  position: relative; padding: 22px 26px 12px 65px; border: 1px solid #b6ad93;
  background: repeating-linear-gradient(0deg, transparent 0 calc(var(--row) - 1px), #899fb62b calc(var(--row) - 1px) var(--row)), var(--paper);
  background-position: 0 12px; transition: background-color .7s;
}
.page::before {
  content:''; position: absolute; left: 43px; top: 0; bottom: 0; width: 3px;
  border-inline: 1px solid #a64f4270; pointer-events: none;
}
.page::after {
  content:''; position: absolute; top: 43px; bottom: 42px; left: 15px; width: 13px;
  background: radial-gradient(circle at 50% 8px, #bcb8a6 0 4px, #8e8f78 4.5px, transparent 5px) 0 0 / 13px 110px repeat-y;
  pointer-events: none;
}
.page.in-drop { background-color: #fff4d9; }
.layers { display: grid; grid-template-columns: repeat(12,minmax(0,1fr)); align-items: start; column-gap: 18px; row-gap: 12px; }
.scene-card {
  --tilt: -2deg;
  min-width: 0; grid-column: span 4; border: 0; padding: 2px 5px 5px;
  background: transparent; text-align: left; display: block;
}
.scene-card:nth-child(2) { --tilt: 1.5deg; transform: translateY(7px); }
.scene-card:nth-child(3) { --tilt: -1.1deg; }
.scene-card:nth-child(4) { --tilt: .8deg; grid-column: 2 / span 5; width: 86%; justify-self: center; }
.scene-card:nth-child(5) { --tilt: -1.8deg; grid-column: 7 / span 5; width: 84%; justify-self: center; }
.scene-card canvas {
  display: block; width: 100%; aspect-ratio: 1.79; transform: rotate(var(--tilt));
  transition: transform .25s ease;
}
.scene-card:hover canvas, .scene-card[aria-pressed=true] canvas { transform: rotate(0); }
.legend {
  display: flex; justify-content: space-between; align-items: baseline; gap: 6px;
  padding: 0 7px; color: #273c55;
}
.legend strong { font: 700 clamp(1.25rem, 2.55vw, 1.9rem)/1.03 var(--hand); }
.legend small {
  text-transform: lowercase; font: 600 clamp(1rem, 1.7vw, 1.28rem)/1 var(--hand);
  color: #535e50;
}
.scene-card[aria-pressed=true] strong {
  text-decoration: underline; text-underline-offset: .14em;
  text-decoration-thickness: 1px; text-decoration-color: #975d44;
}
.scene-card[aria-pressed=true] small::before { content: '+ '; color: #87452c; }
.page-footer {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  color: #4e574e; margin: 10px 4px 0; font-size: .81rem;
}
dialog {
  width: min(550px, calc(100% - 28px)); background: var(--paper); color: var(--ink);
  padding: 28px; border: 1px solid #a49882; line-height: 1.6; box-shadow: 3px 5px #302b2133;
}
dialog h2 { font: 700 2.8rem/1 var(--hand); margin: 0 0 12px; }
dialog button { float: right; margin-left: 12px; }
dialog::backdrop { background: #14241888; }
@media (max-width: 760px) {
  main { width: calc(100% - 30px); }
  .intro { align-items: start; flex-direction: column; gap: .55rem; }
  .intro p br { display: none; }
  .page { padding-left: 39px; padding-right: 14px; padding-top: 13px; }
  .page::before { left: 27px; }
  .page::after { left: 7px; width: 11px; }
  .layers { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px 6px; }
  .scene-card,.scene-card:nth-child(4),.scene-card:nth-child(5) { grid-column: auto; width: 100%; }
  .scene-card:nth-child(5) { grid-column: 1 / -1; width: 50%; }
  .legend { padding-inline: 1px; }
}
@media (max-width: 430px) {
  main { width: calc(100% - 24px); }
  .intro { padding-block: 13px 16px; }
  .intro h1 { font-size: clamp(2.85rem, 14.4vw, 3.9rem); }
  .intro p { font-size: .89rem; }
  .transport { gap: .42rem; padding-inline: .45rem; }
  .transport button { padding-inline: .5rem; font-size: .75rem; }
  #play { min-width: 51px; }
  #time { font-size: .7rem; }
  .scene-card {padding-inline: 2px}
  .legend { flex-wrap: wrap; gap: 2px 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::after, *::before { transition: none !important; }
}
