/* museum — the runner's own ground. Mobile-first: the card is the whole screen. */
:root {
  --serif: 'IBM Plex Serif', georgia, 'Times New Roman', serif;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, menlo, monospace;

  --paper: #131316;
  --matte: #23252b;
  --matte-line: rgba(255, 255, 255, 0.07);
  --ink: #e8e6e1;
  --muted: #9a978f;
  --faint: #6d6a64;
  --white: #fff;
  --gold: #d8b46a;
  --theme: #6f7bd6;

  --t-xs: 12.5px;
  --t-sm: 15px;
  --t-base: 18px;
  --t-lg: 22px;
  --t-xl: 30px;
  --radius: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--paper); color: var(--ink); }
body { font-family: var(--sans); font-size: var(--t-base); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.caps { font-family: var(--sans); font-size: var(--t-xs); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.pill { display: inline-block; padding: 3px 9px; border: 1px solid var(--matte-line); border-radius: 999px; font-size: var(--t-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

/* ── the wall ─────────────────────────────────────────────────────────────── */
.wall { max-width: 980px; margin: 0 auto; padding: 18px 14px 60px; }
.wall h1 { font-family: var(--serif); font-size: clamp(24px, 7vw, 40px); line-height: 1.12; margin: 6px 0 4px; }
.wall .sub { color: var(--muted); margin: 0 0 14px; font-size: var(--t-sm); }
.wall .row-of-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.searchbar { display: flex; gap: 8px; margin: 12px 0 18px; }
.searchbar input { flex: 1; min-width: 0; padding: 11px 13px; border-radius: var(--radius); border: 1px solid var(--matte-line); background: var(--matte); color: var(--ink); font-size: var(--t-sm); }
.searchbar button { padding: 11px 16px; border-radius: var(--radius); background: var(--white); color: #111; font-weight: 600; }

.themes { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; margin-bottom: 6px; }
.themes span { font-size: 9.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); text-align: center; overflow: hidden; text-overflow: ellipsis; }
.board { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.tile { position: relative; aspect-ratio: 1; border-radius: 8px; background: var(--matte); border: 1px solid var(--matte-line); padding: 5px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; transition: transform 140ms ease, background 200ms ease; }
.tile:hover { background: #2b2e36; transform: translateY(-1px); }
.tile:active { transform: scale(0.97); }
.tile .ic { font-size: 17px; line-height: 1; color: var(--gold); }
.tile .nm { font-size: 9px; line-height: 1.18; color: var(--ink); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.tile .yr { font-size: 8.5px; color: var(--faint); }
.tile .tier { position: absolute; top: 4px; right: 4px; width: 5px; height: 5px; border-radius: 50%; background: var(--faint); }
/* a cell on the plan with nothing hung in it: the maker's worklist, on the wall */
.tile.empty { background: transparent; border-style: dashed; border-color: rgba(255,255,255,0.10); }
.tile.empty .ic, .tile.empty .nm, .tile.empty .yr { color: var(--faint); }
@media (max-width: 620px) {
  .themes { display: none; }
  .board { gap: 4px; }
  .tile { padding: 3px; }
  .tile .nm { font-size: 7.5px; -webkit-line-clamp: 2; }
  .tile .ic { font-size: 13px; }
}

/* ── a room: card = whole screen ──────────────────────────────────────────── */
.room { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--paper); }
.hairline { height: 3px; background: var(--matte-line); flex: 0 0 auto; }
.hairline > i { display: block; height: 100%; background: var(--white); transition: width 260ms ease; }
.card { flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.card-inner { max-width: 680px; margin: 0 auto; padding: 16px 16px 30px; animation: fade 240ms ease both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px 4px; max-width: 680px; margin: 0 auto; width: 100%; }
.bar .where { font-size: var(--t-xs); letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.plate { width: 100%; border-radius: var(--radius); background: var(--matte); display: block; margin: 4px 0 14px; }
.plate.small { width: 62%; }
.art-title { font-family: var(--serif); font-size: clamp(22px, 6.4vw, 32px); line-height: 1.15; margin: 2px 0 6px; }
.dateline { font-size: var(--t-sm); color: var(--muted); margin: 0 0 14px; }
.prose p { margin: 0 0 0.85em; }
.prose strong { color: var(--white); }
.cite { font-size: 0.68em; vertical-align: super; color: var(--gold); padding: 0 1px; }
.glyph { font-family: var(--mono); font-size: var(--t-sm); line-height: 1.35; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--matte); border: 1px solid var(--matte-line); border-radius: var(--radius); padding: 14px; margin: 14px 0; }
.glyph .lbl { display: block; margin-top: 10px; font-family: var(--sans); font-size: var(--t-xs); letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
blockquote { margin: 14px 0; padding-left: 13px; border-left: 2px solid var(--matte-line); color: var(--muted); }
.sources { margin-top: 22px; border-top: 1px solid var(--matte-line); padding-top: 12px; }
.sources ol { padding-left: 20px; margin: 6px 0; }
.sources li { margin-bottom: 8px; font-size: var(--t-sm); }
.sources .note { color: var(--muted); font-size: var(--t-xs); }
.reading { margin-top: 16px; }
.reading li { font-size: var(--t-sm); margin-bottom: 7px; }
.plaque { border: 1px dashed var(--matte-line); border-radius: var(--radius); padding: 12px; margin: 14px 0; color: var(--muted); font-size: var(--t-sm); }
.plaque b { color: var(--ink); }

.quiz .opt { display: block; width: 100%; text-align: left; padding: 12px 14px; margin: 8px 0; border: 1px solid var(--matte-line); border-radius: var(--radius); background: var(--matte); }
.quiz .opt.right { border-color: #4c8b5a; background: #1d2b21; }
.quiz .opt.wrong { border-color: #8b4c4c; background: #2b1d1d; }
.quiz .verdict { margin-top: 12px; color: var(--muted); font-size: var(--t-sm); }

.nav { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--matte-line); background: var(--paper); }
.nav .dots { display: flex; gap: 5px; flex-wrap: wrap; max-width: 60vw; }
.nav .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--matte-line); }
.nav .dots i.on { background: var(--white); }
.next-btn { min-width: 54px; height: 44px; border-radius: 999px; background: var(--white); color: #111; font-size: 20px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.back-btn { color: var(--muted); font-size: var(--t-sm); }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.94); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 10px; }
.lightbox img { max-width: 100%; max-height: 100%; }

/* ── the desk ─────────────────────────────────────────────────────────────── */
.desk { max-width: 980px; margin: 0 auto; padding: 18px 14px 80px; }
.desk h2 { font-family: var(--serif); font-size: var(--t-lg); margin: 28px 0 8px; }
.desk h3 { font-size: var(--t-sm); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 18px 0 6px; font-weight: 600; }
.desk table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.desk td, .desk th { text-align: left; padding: 5px 8px 5px 0; border-bottom: 1px solid var(--matte-line); vertical-align: top; }
.desk th { color: var(--faint); font-weight: 500; font-size: var(--t-xs); letter-spacing: 0.08em; text-transform: uppercase; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.stat { background: var(--matte); border: 1px solid var(--matte-line); border-radius: var(--radius); padding: 10px; }
.stat b { display: block; font-size: var(--t-lg); font-family: var(--serif); }
.stat span { font-size: var(--t-xs); color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }
.check { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--matte-line); font-size: var(--t-sm); }
.check .mark { width: 58px; flex: 0 0 auto; font-size: var(--t-xs); letter-spacing: 0.08em; text-transform: uppercase; }
.mark.ok { color: #6fae7f; } .mark.fail { color: #d4756f; } .mark.warn { color: var(--gold); }
.rule { padding: 9px 0; border-bottom: 1px solid var(--matte-line); }
.rule b { font-weight: 600; }
.rule p { margin: 4px 0 0; color: var(--muted); font-size: var(--t-sm); }
details { margin: 6px 0; }
summary { cursor: pointer; color: var(--muted); font-size: var(--t-sm); }
.sr { font-size: var(--t-sm); padding: 8px 0; border-bottom: 1px solid var(--matte-line); }
.sr .u { color: var(--faint); font-size: var(--t-xs); overflow-wrap: anywhere; }
.boot { padding: 40px; color: var(--muted); }
.error { color: #d4756f; }
