/* Self-hosted fonts (PLAN D9), SIL OFL 1.1 – see fonts/OFL-*.txt. Files from @fontsource 5.3.0.
   IM Fell has no latin-ext cut: a č/š in a heading falls back to the next font in --f-display. */
@font-face{font-family:"IM Fell English";font-style:normal;font-weight:400;font-display:swap;src:url(../fonts/im-fell-english-latin-400-normal.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"IM Fell English";font-style:italic;font-weight:400;font-display:swap;src:url(../fonts/im-fell-english-latin-400-italic.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"IM Fell English SC";font-style:normal;font-weight:400;font-display:swap;src:url(../fonts/im-fell-english-sc-latin-400-normal.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Spectral";font-style:normal;font-weight:400;font-display:swap;src:url(../fonts/spectral-latin-ext-400-normal.woff2) format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Spectral";font-style:normal;font-weight:400;font-display:swap;src:url(../fonts/spectral-latin-400-normal.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Spectral";font-style:italic;font-weight:400;font-display:swap;src:url(../fonts/spectral-latin-ext-400-italic.woff2) format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Spectral";font-style:italic;font-weight:400;font-display:swap;src:url(../fonts/spectral-latin-400-italic.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Spectral";font-style:normal;font-weight:500;font-display:swap;src:url(../fonts/spectral-latin-ext-500-normal.woff2) format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Spectral";font-style:normal;font-weight:500;font-display:swap;src:url(../fonts/spectral-latin-500-normal.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}

/* Cabinet of Curiosities: an endless flocked-green wall, click-and-drag pan, wheel zoom toward the cursor,
   no camera easing. Single deliberate dark look. Layout comes from data.json (placed by hand). */
:root{
  --wall:#163126;
  --wall-deep:#0a1a12;
  --flock:rgba(132,182,140,.10);
  --gilt:#c9a24a;
  --gilt-hi:#f3d98b;
  --ink:#ecdfc0;
  --ink-dim:#b7ab8c;
  --paper:#e9dcbb;
  --paper-ink:#2a2117;
  --red-ink:#8a2a1e;
  --f-display:"IM Fell English", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --f-label:"IM Fell English SC", "IM Fell English", Georgia, serif;
  --f-body:"Spectral", "Iowan Old Style", Georgia, serif;
  color-scheme:dark;
}
[hidden]{display:none!important}
html,body{height:100%;margin:0;overflow:hidden}
body{background:var(--wall);color:var(--ink);font-family:var(--f-body);touch-action:none;-webkit-font-smoothing:antialiased}

#wall{position:fixed;left:0;top:0;display:block;background-color:var(--wall);background-repeat:repeat;will-change:transform}
#world{position:fixed;left:0;top:0;transform-origin:0 0;will-change:transform;contain:layout style}
.vignette{position:fixed;inset:0;pointer-events:none;background:radial-gradient(ellipse 80% 78% at 50% 50%,transparent 38%,rgba(0,0,0,.55) 72%,#000 100%)}
.glow{position:fixed;left:0;top:0;width:900px;height:900px;margin:-450px 0 0 -450px;pointer-events:none;will-change:transform,opacity;background:radial-gradient(circle closest-side,rgba(255,176,84,.20),rgba(255,160,70,.08) 45%,transparent)}
/* candlelight: a small gradient texture the compositor scales up and moves with the pointer; never repainted per frame */
.dark{position:fixed;left:0;top:0;width:100vw;height:100vh;display:block;pointer-events:none}

/* ---------- frames ---------- */
.hang{position:absolute;animation:hangIn .8s cubic-bezier(.2,.7,.2,1) backwards;animation-delay:calc(var(--i) * 75ms + 120ms)}
@keyframes hangIn{from{opacity:0;transform:translateY(-22px)}to{opacity:1;transform:none}}
.wire{position:absolute;left:0;top:-46px;width:100%;height:60px;overflow:visible;pointer-events:none}
.frame{position:relative;box-sizing:border-box;padding:var(--fw);transform:rotate(var(--tilt));transition:transform .35s cubic-bezier(.2,.7,.2,1);outline:none}
#world,#wall{cursor:grab;-webkit-user-select:none;user-select:none;touch-action:none}
body.dragging,body.dragging *{cursor:grabbing!important}
body.dragging .frame.work,body.dragging .shelf.work,body.dragging .cabinet *{pointer-events:none}
/* cabinet: walnut chest of drawers; its foot is always below the page end */
.cabinet{position:absolute}
.cab-top{position:absolute;left:0;right:0;top:0;height:34px;border-radius:4px 4px 0 0;background:linear-gradient(180deg,#c08e5a 0,#8f5e35 4px,#6e4524 6px,#55341b 55%,#3c2410 100%);box-shadow:0 10px 14px rgba(0,0,0,.6),inset 0 -2px 0 rgba(0,0,0,.4)}
.cab-top::after{content:"";position:absolute;inset:6px 0 0;background:repeating-linear-gradient(90deg,rgba(0,0,0,.10) 0 1px,transparent 1px 9px,rgba(255,220,170,.05) 9px 10px,transparent 10px 23px)}
.cab-body{position:absolute;left:22px;right:22px;top:34px;bottom:0;background:repeating-linear-gradient(90deg,rgba(0,0,0,.08) 0 1px,transparent 1px 11px,rgba(255,215,160,.04) 11px 12px,transparent 12px 27px),linear-gradient(90deg,#2e1b0c,#4f311a 12%,#43291a 50%,#52331c 88%,#2c190b);box-shadow:inset 0 12px 16px rgba(0,0,0,.55)}
/* An open drawer is raised above the ones below it. Closing keeps it raised until the front has slid
   back (.45s, the .front transition): dropping the layer at once let the closing front pass behind the
   drawer below. z-index:0 (not auto) so the value is a number that a transition can hold; 0 paints in the
   same order as auto. */
.drawer{position:absolute;z-index:0;transition:z-index 0s .45s}
.drawer.open{z-index:2;transition:none}
.tray{position:absolute;inset:0;background:#1a1009;box-shadow:inset 0 0 0 7px #3b2412,inset 0 16px 20px rgba(0,0,0,.9);overflow:hidden}
.tray::before{content:"";position:absolute;inset:7px 7px 0;background:radial-gradient(ellipse 70% 80% at 50% 30%,#2f4c37,#142219);box-shadow:inset 0 14px 18px rgba(0,0,0,.75)}
.tray .item{position:absolute;display:block;max-width:none;transform:rotate(var(--tilt,0deg))}
.tray .item.work{cursor:pointer;transition:transform .3s cubic-bezier(.2,.7,.2,1)}
.tray .item.work:hover,.tray .item.work:focus-visible{transform:translateY(-4px) rotate(var(--tilt,0deg))}
.tray .item.work:focus-visible{outline:2px solid var(--ink);outline-offset:4px}
.tray .tag{position:absolute;font-family:var(--f-label);font-size:12px;letter-spacing:.06em;color:#2a2117;background:#e9dcbb;padding:2px 7px 3px;transform:rotate(-4deg);box-shadow:1px 2px 3px rgba(0,0,0,.5);white-space:nowrap;pointer-events:none}
.tray .tag b{font-weight:400;color:#8a2a1e;margin-right:.4em}
.front{position:absolute;inset:0;border-radius:2px;cursor:pointer;outline:none;background:repeating-linear-gradient(90deg,rgba(0,0,0,.09) 0 1px,transparent 1px 13px,rgba(255,215,160,.05) 13px 14px,transparent 14px 31px),linear-gradient(180deg,#6d4627,#523319 55%,#5e3c20);box-shadow:inset 0 0 0 2px rgba(0,0,0,.4),0 2px 3px rgba(0,0,0,.4);transition:transform .45s cubic-bezier(.2,.7,.2,1),box-shadow .45s}
.front::before{content:"";position:absolute;inset:13px;border-radius:2px;box-shadow:inset 1px 1px 0 rgba(0,0,0,.5),inset -1px -1px 0 rgba(255,220,170,.12),1px 1px 0 rgba(255,220,170,.10),-1px -1px 0 rgba(0,0,0,.45)}
.front:focus-visible{outline:2px solid var(--ink);outline-offset:3px}
.front svg{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);overflow:visible}
.drawer.open .front{transform:translateY(76%) scale(1.03);box-shadow:inset 0 0 0 2px rgba(0,0,0,.4),0 22px 28px rgba(0,0,0,.65)}
.cab-obj{position:absolute;display:block;max-width:none;transform:rotate(var(--tilt,0deg))}
.cab-obj.work{cursor:pointer;transition:transform .35s cubic-bezier(.2,.7,.2,1);outline:none}
.cab-obj.work:hover,.cab-obj.work:focus-visible{transform:translateY(-6px) rotate(var(--tilt,0deg))}
.cab-obj.work:focus-visible{outline:2px solid var(--ink);outline-offset:6px}
.cabinet .plaque{top:4px;transform:translateX(-50%);font-size:calc(var(--pq-size,14px) - 1px);padding:3px 12px 4px}
.frame.work{cursor:pointer}
.frame.work:hover,.frame.work:focus-visible{transform:translateY(-5px)}
.frame.work:focus-visible{outline:2px solid var(--ink);outline-offset:10px}
.liner{position:relative;box-sizing:border-box;width:100%;height:100%;padding:6px;background:var(--liner,#1c2a20)}
.liner img{display:block;width:100%;height:100%;max-width:none;background:#0c1510}
.liner::after{content:"";position:absolute;inset:6px;border-radius:inherit;pointer-events:none;box-shadow:inset 0 3px 14px rgba(0,0,0,.65),inset 0 0 2px rgba(0,0,0,.8)}

.m-gold{background:repeating-linear-gradient(45deg,rgba(70,40,5,.16) 0 2px,transparent 2px 6px),linear-gradient(135deg,#6e4f17 0%,#e8c66e 17%,#9a7224 33%,#f6dc93 50%,#8a6420 66%,#d9b55a 83%,#5e4313 100%)}
.m-antique{background:repeating-linear-gradient(-45deg,rgba(30,18,4,.2) 0 2px,transparent 2px 5px),linear-gradient(135deg,#4a3512 0%,#b99242 22%,#6b5020 42%,#cfae62 58%,#5c4519 78%,#a3803a 100%)}
.m-walnut{--liner:linear-gradient(135deg,#8a6420,#e2c174,#8a6420);background:repeating-linear-gradient(90deg,rgba(0,0,0,.14) 0 1px,transparent 1px 4px,rgba(255,220,180,.04) 4px 5px,transparent 5px 9px),linear-gradient(160deg,#2c1a0f,#5b3a22 35%,#3a2416 60%,#6a4429 85%,#2a180d)}
.m-ebony{--liner:linear-gradient(135deg,#7a5a1e,#e8c66e,#7a5a1e);background:linear-gradient(135deg,#0d0b09,#2d2722 30%,#100d0b 55%,#3a332c 78%,#0b0907)}
.m-verdigris{--liner:#14211b;background:repeating-linear-gradient(45deg,rgba(220,190,110,.12) 0 1px,transparent 1px 5px),linear-gradient(135deg,#2f4a3b,#8fae8a 22%,#4f6e52 42%,#b9c79c 58%,#456349 78%,#7f9a6f)}
.m-oxblood{--liner:linear-gradient(135deg,#8a6420,#e8c66e,#8a6420);background:linear-gradient(135deg,#2a0a0b,#6e1d1c 30%,#3b0f10 55%,#7c2624 78%,#250808)}
.frame{box-shadow:inset 0 0 0 2px rgba(255,236,180,.28),inset 0 0 0 4px rgba(40,22,4,.45),inset 0 0 calc(var(--fw) * .9) rgba(30,14,0,.55),0 22px 36px rgba(0,0,0,.55),0 5px 10px rgba(0,0,0,.45)}
.orn{position:absolute;inset:-5px;pointer-events:none;--o:calc(var(--fw) * 1.55);background:var(--rosette) top left/var(--o) var(--o) no-repeat,var(--rosette) top right/var(--o) var(--o) no-repeat,var(--rosette) bottom left/var(--o) var(--o) no-repeat,var(--rosette) bottom right/var(--o) var(--o) no-repeat,var(--crest) top center/calc(var(--o) * 2.2) var(--o) no-repeat}

.plaque{position:absolute;left:50%;top:calc(100% + 16px);transform:translateX(-50%);white-space:nowrap;padding:5px 14px 6px;font-family:var(--pq-font,var(--f-label));font-style:var(--pq-style,normal);font-size:var(--pq-size,14px);letter-spacing:.06em;color:var(--pq-color,#2a1d0b);background:linear-gradient(180deg,#e9cf8c,#b8954a 55%,#9c7a35);border-radius:2px;box-shadow:0 2px 4px rgba(0,0,0,.5),inset 0 1px 0 rgba(255,245,210,.6),inset 0 -1px 0 rgba(60,35,5,.5);text-shadow:0 1px 0 rgba(255,240,200,.45);pointer-events:none}
.plaque b{font-weight:400;color:var(--pq-num,#6b2a14);margin-right:.5em}
/* standing on a shelf or the cabinet top: the plaque goes above the object (wall.js decides) */
.plaque.above{top:auto;bottom:calc(100% + 12px)}
.cabinet .plaque.above{bottom:auto;transform:translate(calc(-50% + var(--pq-dx,0px)),calc(-100% - 12px + var(--pq-dy,0px)))}
/* Exhibits hung on the wall (2026-11-19, Martin): the plaque sits at the lower RIGHT corner, close under the
   frame, instead of centred 16 px away. The hang box already carries 6 px of margin around the frame, so
   `top:100% + 2px` leaves ~8 px of wall between frame and plaque. Only `.hang > .plaque`: the plaques on the
   cabinet (inline left, centred on the object), in the tray (.tag) and in the phone list (in the flow) place
   themselves and must not get a `right`, which together with their `left` would stretch the box. */
/* --pq-dx / --pq-dy: the plaque's own offset (item.plaqueAt, dragged in the admin; wall.js sets them) */
.hang > .plaque{left:auto;right:14px;top:calc(100% + 2px);transform:translate(var(--pq-dx,0px),var(--pq-dy,0px))}
.hang > .plaque.above{top:auto;bottom:calc(100% + 6px)}
/* a plaque made of a "plate" image (admin → Jmenovka a štítky): 9-slice, the ends keep their shape and
   the middle stretches with the title; the text sits between the ends. Height is 2.2 × the set size – the
   same number wall.js uses to work out how wide an end is. */
.pq-img .plaque,.pq-img .cabinet .plaque{box-sizing:border-box;display:flex;align-items:center;height:calc(var(--pq-size,14px) * 2.2);line-height:1;padding:0 2px;background:none;border-radius:0;box-shadow:none;
  border-style:solid;border-color:transparent;border-width:0 var(--pq-end);border-image:var(--pq-img) 0 var(--pq-slice) fill / 0 var(--pq-end) stretch}
.pq-flat .plaque{text-shadow:none}

/* ---------- HUD ---------- */
/* shelves: a plank on two iron brackets, one object standing on it */
.shelf{position:relative;outline:none}
.shelf.work{cursor:pointer}
.shelf .obj{transition:transform .35s cubic-bezier(.2,.7,.2,1)}
.shelf.work:hover .obj,.shelf.work:focus-visible .obj{transform:translateY(-6px)}
.shelf.work:focus-visible{outline:2px solid var(--ink);outline-offset:8px}
.shelf .obj{position:absolute;display:block;max-width:none}
.shelf .plank{position:absolute;left:0;right:0;height:18px;border-radius:2px;background:linear-gradient(180deg,#a87a4c 0,#7c5530 4px,#5b3b20 5px,#4a2f19 60%,#38230f 100%);box-shadow:0 12px 14px rgba(0,0,0,.5),0 3px 4px rgba(0,0,0,.45),inset 0 -1px 0 rgba(0,0,0,.4)}
.shelf .plank::before{content:"";position:absolute;inset:5px 0 0;background:repeating-linear-gradient(90deg,rgba(0,0,0,.12) 0 1px,transparent 1px 7px,rgba(255,220,170,.05) 7px 8px,transparent 8px 15px)}
.shelf .brackets{position:absolute;left:0;width:100%;overflow:visible}
/* the room's surround (wall.js): laid along the room's edges, never hit-tested – everything under it stays
   reachable in the admin. Side panels and the cornice sit above all hung things, the wainscot below them. */
.surround{position:absolute;pointer-events:none;background-repeat:repeat-x;background-position:left top}
.surround.side{z-index:300;display:flex;flex-direction:column}
.surround.side.right{transform:scaleX(-1)} /* the right panel is the left one mirrored (Martin) */
.surround.side .cap{display:block;width:100%;height:auto;flex:none;max-width:none}
.surround.side .mid{flex:1;background-repeat:repeat-y;background-size:100% auto;background-position:left top}
.surround.cornice{z-index:301}
/* nameplate: engraved gilt cartouche screwed to the wall above the centre piece */
.nameplate{position:absolute;box-sizing:border-box;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;padding-bottom:4px;background-size:100% 100%;animation:plateIn .9s cubic-bezier(.2,.7,.2,1) backwards;pointer-events:none}
@keyframes plateIn{from{opacity:0;transform:translateY(-14px)}to{opacity:1;transform:none}}
.nameplate h1{margin:0;font-family:var(--f-display);font-weight:400;font-size:54px;line-height:1;letter-spacing:.015em;color:#3b2707;text-shadow:0 1px 0 rgba(255,242,200,.55),0 -1px 0 rgba(60,36,4,.35)}
.nameplate p{margin:0;font-family:var(--f-label);font-size:15px;letter-spacing:.24em;color:#5a3d10;text-shadow:0 1px 0 rgba(255,242,200,.5)}
.nameplate h1,.nameplate p{position:relative;translate:0 var(--np-dy,0)}
.nameplate.flat h1,.nameplate.flat p{text-shadow:none}
.np-img{position:absolute;inset:0;width:100%;height:100%;max-width:none;display:block}
.btn{font:inherit;font-family:var(--f-label);font-size:14px;letter-spacing:.08em;color:#2a1d0b;padding:6px 14px;border:0;border-radius:2px;cursor:pointer;background:linear-gradient(180deg,#e9cf8c,#b8954a 60%,#9c7a35);box-shadow:0 2px 4px rgba(0,0,0,.45),inset 0 1px 0 rgba(255,245,210,.6)}
.btn:hover{filter:brightness(1.1)}
.btn:focus-visible{outline:2px solid var(--ink);outline-offset:3px}

/* ---------- viewer ---------- */
.viewer{position:fixed;inset:0;z-index:20;display:flex;align-items:center;justify-content:center;padding:calc(20px + env(safe-area-inset-top,0px)) 16px calc(20px + env(safe-area-inset-bottom,0px));background:rgba(4,11,7,.93);animation:fadeIn .3s ease both;overflow:auto}
@keyframes fadeIn{from{opacity:0}to{opacity:1}}
.viewer-inner{display:grid;grid-template-columns:minmax(0,1fr) minmax(260px,340px);gap:36px;align-items:center;width:min(1240px,100%);animation:liftIn .5s cubic-bezier(.2,.7,.2,1) both}
@keyframes liftIn{from{opacity:0;transform:translateY(14px) scale(.985)}to{opacity:1;transform:none}}
.stage-wrap{display:flex;flex-direction:column;align-items:center;gap:14px;min-width:0}
/* no frame around the photo: a picture brings its own frame or has none (Martin, 2026-10-13) */
.stage-frame{position:relative;box-sizing:border-box;width:min(100%,calc(74vh * var(--ar)));max-width:100%}
.stage{position:relative;aspect-ratio:var(--ar);overflow:hidden;max-width:100%}
.stage img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:0;transition:opacity .6s ease;max-width:none}
.stage img.on{opacity:1}
.nav{position:absolute;top:50%;transform:translateY(-50%);z-index:2;width:44px;height:44px;border-radius:50%;border:1px solid rgba(243,217,139,.5);background:rgba(10,22,15,.7);color:var(--gilt-hi);font-size:22px;line-height:1;cursor:pointer;font-family:var(--f-display)}
.nav:hover{background:rgba(10,22,15,.92)}
.nav:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
/* inside the photo: .stage clips what sticks out (they used to sit on the gilt frame, now gone) */
.nav.prev{left:12px}.nav.next{right:12px}
.slide-meta{display:flex;gap:14px;align-items:baseline;color:var(--ink-dim);font-style:italic;font-size:14px;flex-wrap:wrap;justify-content:center}
.slide-meta .count{font-family:var(--f-label);font-style:normal;letter-spacing:.14em;color:var(--gilt-hi);font-variant-numeric:tabular-nums}
.dots{display:flex;gap:8px}
.dots button{width:9px;height:9px;padding:0;border-radius:50%;border:1px solid var(--gilt);background:transparent;cursor:pointer}
.dots button[aria-current="true"]{background:var(--gilt)}
/* The description is a sheet of paper of any length, three textures from The Book (paper_top/mid/bot,
   downscaled to 40 %): the middle one repeats down the card, clipped to the content box so it never shows
   through the transparent parts of the torn edges; the edges are ::before/::after. Every measurement is
   a percentage of the card's WIDTH (percentage padding is), so the sheet scales as one piece. The numbers
   belong to that export of the textures – a new export means re-measuring its alpha bounding box
   (bottom: 34 px of empty canvas on the left and 3 at the bottom of 2281 × 171; middle: 3 px on the right). */
.viewer .card{
  --paper-top-h:7.788%;   /* 175 / 2247 px of drawing in paper_top */
  --paper-bot-h:7.477%;   /* 168 / 2247 in paper_bot */
  --paper-mid-top:4.467%; /* where the repeating middle starts under the top edge */
  --paper-mid-bot:3.447%; /* and where it ends above the bottom one */
  --paper-pad-top:clamp(20px,6%,30px);--paper-pad-x:9%;--paper-pad-bot:clamp(22px,7%,32px);
  position:relative;min-width:0;min-height:120px;color:var(--paper-ink);
  padding:var(--paper-mid-top) 0 var(--paper-mid-bot);
  background:url(../img/paper_mid.webp) top left / 100.134% auto repeat-y;background-origin:content-box;background-clip:content-box}
.viewer .card::before,.viewer .card::after{content:"";position:absolute;left:0;right:0;height:0;pointer-events:none}
.viewer .card::before{top:0;padding-top:var(--paper-top-h);z-index:2;background:url(../img/paper_top.webp) top center / 100% 100% no-repeat}
.viewer .card::after{bottom:0;padding-top:var(--paper-bot-h);z-index:1;background:url(../img/paper_bot.webp) right bottom / 101.513% 101.786% no-repeat}
/* the text over the paper; the negative margins cancel the card's padding (there only for the clip) */
.viewer .card-body{position:relative;z-index:3;margin:calc(-1 * var(--paper-mid-top)) 0 calc(-1 * var(--paper-mid-bot));padding:var(--paper-pad-top) var(--paper-pad-x) var(--paper-pad-bot)}
.viewer .card .inv{font-family:var(--f-label);letter-spacing:.14em;color:var(--red-ink);font-size:14px}
.viewer .card h2{font-family:var(--f-display);font-weight:400;font-size:34px;line-height:1.05;margin:6px 0 4px;text-wrap:balance}
.viewer .card .medium{font-style:italic;color:#5b4a33;margin:0 0 14px;font-size:15px}
/* the description: one paragraph per line Martin wrote (viewer.js) */
.viewer .card .desc{font-size:16px;line-height:1.55;margin:0 0 16px;max-width:60ch}
.viewer .card .desc p{margin:0}
.viewer .card .desc p+p{margin-top:.7em}
.viewer .card ul{list-style:none;margin:0;padding:12px 0 0;border-top:1px solid rgba(42,33,23,.25);display:flex;flex-wrap:wrap;gap:6px 14px;font-family:var(--f-label);letter-spacing:.08em;font-size:13px;color:#5b4a33}
.viewer .card .note{margin:16px 0 0;font-size:13px;font-style:italic;color:#7a6647}
.close{position:fixed;top:calc(14px + env(safe-area-inset-top,0px));right:16px;z-index:21;width:44px;height:44px;border-radius:50%;border:1px solid rgba(243,217,139,.5);background:rgba(10,22,15,.8);color:var(--gilt-hi);font-size:26px;line-height:1;cursor:pointer}
.close:focus-visible{outline:2px solid var(--ink);outline-offset:2px}

@media (max-width:820px){
  .viewer{align-items:flex-start}
  .viewer-inner{grid-template-columns:1fr;gap:20px;padding-top:44px}
  .stage-frame{width:100%}
  .viewer .card h2{font-size:28px}
}
@media (prefers-reduced-motion:reduce){
  .hang,.viewer,.viewer-inner{animation:none}
  .frame,.stage img{transition:none}
}

/* ---------- real images (PLAN phase 2) ---------- */
.piece{display:block;max-width:none;transform:rotate(var(--tilt));transition:transform .35s cubic-bezier(.2,.7,.2,1);outline:none}
.piece.work{cursor:pointer}
.piece.work:hover,.piece.work:focus-visible{transform:translateY(-5px) rotate(var(--tilt))}
.piece.work:focus-visible{outline:2px solid var(--ink);outline-offset:10px}
body.dragging .piece.work{pointer-events:none}
.grime{position:absolute;display:block;max-width:none;pointer-events:none;object-fit:cover}
.cab-photo{position:absolute;left:0;top:0;width:100%;height:auto;display:block;max-width:none;pointer-events:none}
.front.photo{background:none;box-shadow:none}
.front.photo::before{content:none}
.front-photo{position:absolute;inset:0;width:100%;height:100%;display:block;max-width:none;pointer-events:none}
.drawer.open .front.photo{box-shadow:0 22px 28px rgba(0,0,0,.65)}
.tray.photo{background:#140d07;box-shadow:none} /* no painted brown rim around an uploaded velvet (Martin) */
.tray.photo::before{content:none}
.tray-photo{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block;max-width:none;pointer-events:none}
.stage.real img{object-fit:contain}
.noscript{position:fixed;inset:auto 0 40px;z-index:30;text-align:center;font-size:18px;color:var(--ink)}
.noscript a{color:var(--gilt-hi)}

/* ---------- light and shadow (PLAN phase 6) ---------- */
.shadows{position:fixed;left:0;top:0;width:100vw;height:100vh;display:block;pointer-events:none}
/* the hand candle replaces the cursor on the wall, never over the viewer */
html body.candle-cursor:not(.viewer-open),html body.candle-cursor:not(.viewer-open) *{cursor:none!important}
.hand-candle{position:fixed;left:0;top:0;z-index:25;pointer-events:none;will-change:transform}
body.viewer-open .hand-candle{display:none}
/* with moving cast shadows the baked "light from above" shadows shrink to a contact shadow, or every
   picture would carry two shadows pointing in different directions */
body.cast .frame{box-shadow:inset 0 0 0 2px rgba(255,236,180,.28),inset 0 0 0 4px rgba(40,22,4,.45),inset 0 0 calc(var(--fw) * .9) rgba(30,14,0,.55),0 3px 6px rgba(0,0,0,.45)}
body.cast .shelf .plank{box-shadow:0 3px 4px rgba(0,0,0,.45),inset 0 -1px 0 rgba(0,0,0,.4)}
/* fx.darkness off: no candlelight darkness and no warm glow at the cursor (the static vignette stays) */
body.no-dark .dark,body.no-dark .glow{display:none}
/* Shadows under things are pre-rendered images (shadows.js addStaticShadows), never CSS filters: a
   blurred drop-shadow on every picture is re-rasterised for each tile of the wall that pans into view,
   and that is what made panning stutter once every item was a large image. */
.shade{position:absolute;display:block;max-width:none;pointer-events:none;transform-origin:50% 50%}

/* ---------- the phone version (mobile.js): exhibits one under another on the wallpaper ---------- */
html.mobile,html.mobile body{height:auto;overflow:auto;overflow-x:hidden}
body.mobile{touch-action:auto;background:var(--wall)}
body.mobile #world,body.mobile #wall,body.mobile .shadows,body.mobile .glow,body.mobile .dark,body.mobile .vignette{display:none}
/* the detail is the whole screen; the list behind it does not scroll along */
html.mobile body.viewer-open{overflow:hidden}
/* the wallpaper is this element's background (mobile.js): it scrolls with the exhibits */
.m-list{position:relative;z-index:1;box-sizing:border-box;min-height:100vh;display:flex;flex-direction:column;align-items:center;gap:56px;padding:40px 0 72px;background-color:var(--wall);background-repeat:repeat}
.m-plate{position:relative}
.m-plate .nameplate{position:absolute;left:0;top:0;transform-origin:0 0;animation:none}
.m-ex{margin:0;display:flex;flex-direction:column;align-items:center;gap:14px}
.m-pic{display:block;padding:0;border:0;background:none;cursor:pointer;line-height:0;-webkit-tap-highlight-color:transparent}
.m-pic img{display:block;height:auto;max-width:none;filter:drop-shadow(0 10px 14px rgba(0,0,0,.55))}
.m-pic:focus-visible{outline:2px solid var(--ink);outline-offset:6px}
/* the plaque under each exhibit: the wall's .plaque, in the flow instead of absolutely placed */
.m-list .m-ex .plaque{position:relative;left:auto;top:auto;transform:none;white-space:normal;text-align:center;max-width:86vw}
.pq-img.m-list .m-ex .plaque{display:inline-flex;white-space:nowrap}
/* a swipe across the photo turns the page (viewer.js); vertical moves still scroll */
.stage{touch-action:pan-y}

