:root { color-scheme: light; --ink: #383b34; --muted: #77796d; --paper: #f6f4ec; --line: #d9d9cb; --green: #3f5945; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-gutter: stable; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 15px/1.6 Arial, Helvetica, sans-serif; background-image: radial-gradient(#7e806219 .7px, transparent .7px); background-size: 5px 5px; }
body.viewer-open { overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
button, select, summary { cursor: pointer; }
button, select, input { border: 1px solid var(--line); border-radius: 2px; background: #fffdf7; }
button { padding: 9px 15px; }
button:hover { border-color: #969b88; background: #eceee3; }
a { color: var(--green); text-underline-offset: 4px; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 5px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -100px; left: 20px; padding: 10px; background: white; z-index: 5; }
.skip-link:focus { top: 10px; }
.page { max-width: 1216px; padding: 0 48px; margin: auto; }
.masthead { display: grid; grid-template-columns: 340px 1fr; gap: 74px; align-items: center; padding: 66px 0 52px; }
.title-note { display: block; transform: rotate(-3deg); box-shadow: 2px 7px 10px #44432b25; line-height: 0; }
.title-note img { display: block; width: 100%; height: auto; }
.eyebrow { font: 11px/1.6 "Courier New", monospace; letter-spacing: 1.3px; text-transform: uppercase; color: var(--muted); }
.intro .eyebrow { margin: 0 0 10px; }
h1 { font: normal 29px/1.2 Georgia, "Times New Roman", serif; margin: 0 0 12px; }
.intro > p:not(.eyebrow) { max-width: 450px; margin: 0; color: #64685a; }
.about { margin-top: 12px; font-size: 13px; }
.about summary { text-decoration: underline; text-underline-offset: 3px; color: var(--green); }
.about p { max-width: 500px; }
.collection-heading { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); padding: 24px 0 15px; }
h2 { font: normal 25px/1.3 Georgia, "Times New Roman", serif; margin: 0; }
#totalCount { font: 12px "Courier New", monospace; color: var(--muted); display: inline-block; margin-left: 8px; vertical-align: middle; }
.text-button { border: 0; background: transparent; padding: 2px 0; font-size: 13px; color: var(--green); text-decoration: underline; text-underline-offset: 4px; }
.text-button:hover { background: none; color: #1d3622; }
#randomButton { text-decoration: none; }
#randomButton span { margin-left: 6px; font-size: 22px; }
.toolbar { display: flex; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.type-filters { display: flex; gap: 25px; }
.type-filters button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; padding: 11px 0 14px; font-size: 13px; color: var(--muted); }
.type-filters button[aria-pressed="true"] { color: var(--green); border-bottom-color: var(--green); font-weight: bold; }
.type-filters button:hover { color: var(--green); }
.find-tools { display: flex; gap: 10px; padding-bottom: 10px; align-items: center; }
select { max-width: 190px; width: 160px; padding: 7px 26px 7px 10px; font-size: 12px; height: 35px; }
.search-wrap { display: flex; align-items: center; position: relative; }
.search-wrap svg { position: absolute; left: 10px; color: var(--muted); pointer-events: none; }
input { width: 192px; height: 35px; padding: 7px 8px 7px 33px; font-size: 12px; }
.collection-meta { display: flex; gap: 15px; align-items: center; min-height: 60px; font-size: 12px; color: var(--muted); }
.collection-meta p { margin: 0; }
.browse-hint { margin-left: auto; font: italic 13px Georgia, serif; }
.gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 30px 26px; }
.drawing { min-width: 0; }
.drawing-link { display: block; color: inherit; text-decoration: none; }
.thumbnail { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; padding: 9px; background: #fffef9; box-shadow: 0 2px 4px #4b4c3020; border: 1px solid #dbdccd; transition: transform .18s, box-shadow .18s; }
.thumbnail img { display: block; width: 100%; height: 100%; object-fit: contain; background: #eeeee5; }
.drawing-link:hover .thumbnail { transform: translateY(-4px) rotate(-1deg); box-shadow: 1px 6px 10px #4b4c3025; }
.drawing:nth-child(3n + 2) .drawing-link:hover .thumbnail { transform: translateY(-4px) rotate(1deg); }
.drawing-caption { display: flex; align-items: baseline; gap: 9px; padding: 12px 2px 0; }
.drawing-id { flex-shrink: 0; font: 10px "Courier New", monospace; color: var(--muted); }
.drawing h3 { font: normal 16px/1.35 Georgia, "Times New Roman", serif; margin: 0; }
.drawing-link:hover h3 { text-decoration: underline; text-underline-offset: 4px; }
.drawing-type { display: block; font: 10px "Courier New", monospace; text-transform: uppercase; letter-spacing: 1px; margin: 5px 2px 0 34px; color: var(--muted); }
.empty-state { padding: 65px 15px 90px; text-align: center; }
.empty-state h3 { font: normal 25px Georgia, serif; }
footer { border-top: 1px solid var(--line); margin-top: 60px; padding: 24px 0 35px; display: flex; gap: 25px; color: var(--muted); font-size: 11px; }
footer span:first-child { font-family: Georgia, serif; color: var(--ink); font-size: 14px; }
footer a { margin-left: auto; }
dialog { width: min(1120px, calc(100% - 64px)); max-width: none; max-height: calc(100dvh - 48px); padding: 0; color: var(--ink); border: 1px solid #b8bba8; background: var(--paper); box-shadow: 0 18px 90px #10180f55; overscroll-behavior: contain; }
dialog::backdrop { background: #282e29bf; }
.viewer-top { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--paper); z-index: 2; }
.viewer-top button { border: 0; background: none; padding: 5px 0 5px 10px; font-size: 12px; }
.viewer-top button span { font-size: 23px; vertical-align: middle; margin-left: 15px; }
.viewer-content { display: grid; grid-template-columns: minmax(0, 1fr) 285px; }
.image-stage { position: relative; min-height: 400px; height: min(65vh, 670px); display: flex; align-items: center; justify-content: center; padding: 28px; background: #e7e9de; }
#mainImage { display: block; max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 2px 4px 8px #373d2c25; }
.image-stage[aria-busy="true"] img { opacity: .25; }
#imageStatus { position: absolute; background: var(--paper); padding: 8px 14px; font-size: 13px; }
.drawing-info { padding: 30px 24px; overflow-wrap: anywhere; }
.drawing-info > .eyebrow { margin: 0 0 8px; }
.drawing-info h2 { font-size: 27px; }
.item-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0 28px; }
.item-tags button { font: 11px/1.5 "Courier New", monospace; padding: 3px 7px; border-color: #d1d7c4; color: var(--green); background: #e9edde; }
.explanation { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 13px; }
.explanation summary { padding: 13px 0; color: var(--green); }
#context { padding: 0 0 18px; line-height: 1.8; }
.reference-image { margin: 20px 0 0; padding-top: 18px; border-top: 1px dashed var(--line); text-align: center; }
.reference-image a { display: inline-block; line-height: 0; }
.reference-image img { display: block; max-width: 100%; height: auto; }
.reference-image figcaption { margin-top: 10px; color: var(--muted); font: italic 12px/1.6 Georgia, serif; }
.original-link { display: inline-block; margin-top: 24px; font-size: 12px; }
.viewer-hint { font: italic 13px/1.6 Georgia, serif; color: var(--muted); margin-top: 20px; }
.viewer-bottom { display: flex; align-items: center; justify-content: space-between; padding: 14px 22px; border-top: 1px solid var(--line); gap: 15px; position: sticky; bottom: 0; background: var(--paper); z-index: 2; }
.viewer-bottom button { min-width: 110px; font-size: 13px; }
.viewer-bottom button:disabled { opacity: .4; cursor: default; }
.keyboard-hint { color: var(--muted); font: 11px "Courier New", monospace; }
@media (min-width: 1450px) { .page { max-width: 1336px; } }
@media (max-width: 1000px) {
  .page { padding: 0 30px; }
  .masthead { grid-template-columns: 280px 1fr; gap: 45px; padding: 48px 0 40px; }
  h1 { font-size: 25px; }
  .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 22px; }
  .type-filters { gap: 18px; }
  .toolbar { gap: 15px; }
  input { width: 160px; }
  select { width: 140px; }
  .viewer-content { grid-template-columns: minmax(0, 1fr) 255px; }
}
@media (max-width: 700px) {
  .page { padding: 0 20px; }
  .masthead { grid-template-columns: 1fr; gap: 28px; padding: 36px 0 30px; }
  .title-note { width: 230px; margin: 0 auto 4px; }
  h1 { font-size: 26px; }
  .intro { max-width: 460px; }
  .intro > p:not(.eyebrow) { font-size: 14px; }
  .collection-heading { padding-top: 20px; }
  .collection-heading h2 { font-size: 23px; }
  #randomButton { font-size: 12px; }
  .toolbar { flex-direction: column; gap: 12px; }
  .type-filters { gap: 27px; }
  .type-filters button { padding-bottom: 7px; }
  .find-tools { width: 100%; }
  select, .search-wrap { width: 50%; max-width: none; }
  input { width: 100%; }
  .collection-meta { min-height: 52px; }
  .browse-hint { display: none; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 27px 16px; }
  .thumbnail { padding: 6px; }
  .drawing-caption { gap: 6px; padding-top: 10px; }
  .drawing h3 { font-size: 15px; }
  .drawing-type { margin-left: 31px; font-size: 9px; }
  footer { flex-wrap: wrap; gap: 10px 20px; margin-top: 40px; }
  footer span:nth-child(2) { order: 3; width: 100%; }
  dialog { width: calc(100% - 20px); max-height: calc(100dvh - 20px); }
  .viewer-top { padding: 10px 14px; }
  .viewer-top .eyebrow { font-size: 10px; letter-spacing: .5px; }
  .viewer-content { grid-template-columns: 1fr; }
  .image-stage { height: auto; min-height: 200px; padding: 18px; }
  #mainImage { max-height: 55dvh; }
  .drawing-info { padding: 20px; }
  .drawing-info h2 { font-size: 25px; }
  .item-tags { margin: 12px 0 20px; }
  .viewer-hint, .keyboard-hint { display: none; }
  .original-link { margin-top: 16px; }
  .viewer-bottom { padding: 12px 14px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; } }
