:root {
  color-scheme: light;
  --paper: var(--journal-paper);
  --stage: var(--journal-raised);
  --ink: var(--journal-ink);
  --muted: var(--journal-muted);
  --rule: var(--journal-line);
  --wine: var(--journal-accent);
  --white: var(--journal-card);
  font: 16px/1.5 var(--journal-sans);
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); }
.frame { width: min(1140px, calc(100% - 48px)); margin-inline: auto; }
.masthead { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:.3rem 1rem; padding:1rem 0 .72rem; border-bottom:1px solid var(--rule); }
.wordmark { font: var(--journal-wordmark-weight) clamp(1.45rem,4vw,2rem)/1.1 var(--journal-wordmark-family); letter-spacing:var(--journal-wordmark-spacing); color:var(--ink); text-decoration:none; }
.edition { color: var(--wine); font-size: .78rem; text-align:right; }
.khev-languages { display:flex; flex-wrap:wrap; gap:.25rem; }
.khev-languages button { font-size:.8rem; }
.intro { padding: clamp(1.6rem,4vw,3rem) 0 1.45rem; }
h1, h2 { font-family: var(--journal-serif); font-weight: 500; }
h1 { margin: 0 0 .45rem; max-width: 20ch; font-size: clamp(2.1rem,6vw,4rem); line-height: 1.07; letter-spacing: -.044em; }
.intro p { margin:0; color:var(--muted); max-width: 49ch; }
.collection { border: 1px solid var(--rule); background: var(--paper); }
.toolbar { display:flex; flex-wrap:wrap; justify-content:space-between; gap: .55rem 1rem; padding:.75rem; border-bottom:1px solid var(--rule); }
.views,.tools { display:flex; flex-wrap:wrap; align-items:center; gap:.35rem; }
button {
  appearance:none; border:1px solid var(--rule); background:var(--white); color:var(--ink);
  font-family:inherit; font-size:.88rem; font-weight:550; line-height:1.2; min-height:44px; min-width:44px;
  padding:.45rem .7rem; cursor:pointer; border-radius:3px;
}
button[aria-pressed="true"] { background: var(--wine); border-color:var(--wine); color:var(--journal-on-accent); }
button:hover:not([aria-pressed="true"]):not(:disabled) { border-color:var(--wine); }
button:disabled { opacity:.5; cursor:default; }
.views label { color:var(--muted); font-size:.78rem; margin-right:.15rem; }
.views select { min-height:44px; max-width:100%; padding:.45rem .5rem; color:var(--ink); background:var(--white); border:1px solid var(--rule); border-radius:3px; font:inherit; font-size:.86rem; }
:focus-visible { outline: 2px solid var(--wine); outline-offset:3px; }
#zoom-level { min-width:2.6rem; text-align:center; color:var(--muted); font-variant-numeric:tabular-nums; }
.exhibit-viewport { overflow-x:auto; }
.exhibit-viewport:focus-visible { outline-offset:-2px; }
.scroll-hint { margin:0; padding:.45rem .8rem; font-size:.78rem; color:var(--muted); border-bottom:1px solid var(--rule); }
.exhibits {
  --base-columns:5;
  --row-columns:var(--columns,var(--base-columns));
  display:flex;
  flex-wrap:wrap;
  gap:1px;
  background:var(--rule);
}
.exhibit {
  flex:1 0 calc((100% - (var(--row-columns) - 1) * 1px) / var(--row-columns));
  min-width:0;
  background:var(--paper);
}
.exhibit.long { flex-basis:100%; }
.stage { background:radial-gradient(ellipse at 48% 37%,#fff9ee,var(--stage) 78%); }
canvas { display:block; width:100%; height:clamp(155px,20vw,244px); min-height:var(--shield-height,0px); touch-action:none; cursor:grab; }
canvas:active { cursor:grabbing; }
canvas:focus-visible { outline-offset:-3px; }
.long canvas { height:clamp(110px,14vw,161px); min-height:var(--blade-height,0px); }
.caption { display:flex; flex-wrap:wrap; align-items:baseline; justify-content:space-between; gap:.15rem 1rem; padding:.6rem .8rem; border-top:1px solid var(--rule); }
.caption h2 { font-size:clamp(1rem,2.6vw,1.35rem); line-height:1.25; margin:0; }
.caption span { color:var(--muted); white-space:nowrap; font-size:.8rem; font-variant-numeric:tabular-nums; }
.caption small { flex-basis:100%; color:var(--wine); font-size:.72rem; }
.outline .stage { background:radial-gradient(ellipse at 48% 37%,#fbf9f3,#eae6de 78%); }
html[data-theme="dark"] .stage { background:radial-gradient(ellipse at 48% 37%,var(--journal-line),var(--stage) 78%); }
.exhibit[data-selected="true"] .stage { box-shadow:inset 0 -2px var(--wine); }
.scale { padding:.6rem .8rem; display:flex; align-items:center; gap:.55rem; font-size:.77rem; color:var(--muted); border-top:1px solid var(--rule); }
.ruler { width:var(--ruler,30px); min-width:1px; height:7px; border:1px solid var(--ink); border-top:0; }
.shared { margin-left:auto; }
.state:empty { display:none; }
.state { margin:.4rem .8rem .7rem; color:var(--wine); }
.records { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:1.2rem; margin:1.5rem 0; }
.records article { border-top:1px solid var(--rule); padding-top:.85rem; }
.records h2 { font-size:1.3rem; margin:0 0 .35rem; line-height:1.25; }
.records p { margin:.45rem 0; font-size:.88rem; }
.records .meta { color:var(--muted); font-size:.78rem; }
.links { display:flex; flex-wrap:wrap; gap:.3rem 1rem; }
a { color:var(--wine); text-underline-offset:.16em; }
.footer { color:var(--muted); padding:1rem 0; border-top:1px solid var(--rule); font-family:Georgia,serif; }
@media (max-width:1080px) {
  .exhibits { --base-columns:3; }
}
@media (max-width:700px) {
  .frame { width:calc(100% - 26px); }
  .exhibits { --base-columns:2; }
  .records { grid-template-columns:1fr; gap:.8rem; }
}
@media (max-width:460px) {
  .edition { max-width:13ch; }
  .toolbar { padding:.55rem; }
  button { padding-inline:.57rem; }
  .caption { padding:.45rem .55rem; }
}

.intro .back { display: inline-block; margin-bottom: .6rem; font-size: .85rem; }
