:root {
  --wall: #efe9df;
  --ink: #2a2520;
  --muted: #6f665b;
  --frame: #1f1b17;
  --line: #d6cdbf;
  --accent: #8a5a2b;
  --shadow: 0 18px 40px rgba(40, 30, 20, 0.28), 0 2px 6px rgba(40, 30, 20, 0.18);
}

@media (prefers-color-scheme: dark) {
  :root {
    --wall: #171513;
    --ink: #ece4d8;
    --muted: #a39887;
    --frame: #0c0b0a;
    --line: #34302b;
    --accent: #d7a96b;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.6), 0 2px 8px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--wall);
  color: var(--ink);
  font: 400 15px/1.55 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}

a { color: inherit; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 20px 28px;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.topbar p { margin: 0; }

.links { display: flex; gap: 18px; }
.links a { text-decoration: none; }
.links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

.gallery {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 24px 32px;
}

.frame {
  margin: 0;
  padding: 12px;
  background: var(--frame);
  box-shadow: var(--shadow);
  max-width: min(1100px, 100%);
  min-height: 200px;
  min-width: min(480px, 100%);
  display: grid;
  place-items: center;
}

.frame img {
  display: block;
  max-width: 100%;
  max-height: 64vh;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.frame img.loaded { opacity: 1; }

.placard {
  margin-top: 28px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  text-align: center;
  max-width: 560px;
}

.placard p { margin: 0; }

.artist {
  font: 600 20px/1.25 "Cormorant Garamond", Georgia, serif;
}

.title {
  font: 500 18px/1.35 "Cormorant Garamond", Georgia, serif;
}

.title cite { font-style: italic; }

.source {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  text-underline-offset: 3px;
}

.source:hover { color: var(--accent); }

.reason {
  margin: 22px 0 0;
  font: italic 500 22px/1.35 "Cormorant Garamond", Georgia, serif;
  text-align: center;
  min-height: 1.35em;
}

.another {
  margin-top: 14px;
  padding: 7px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.another:hover { color: var(--ink); border-color: var(--muted); }
.another:disabled { opacity: 0.5; cursor: progress; }

.note {
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 24px 40px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

.note p { margin: 0 0 8px; }
.visits:empty { display: none; }
.sig { font: italic 500 17px "Cormorant Garamond", Georgia, serif; color: var(--ink); }

@media (max-width: 600px) {
  .topbar { padding: 16px; flex-direction: column; gap: 6px; }
  .gallery { padding: 4px 16px 24px; }
  .frame { padding: 8px; min-width: 0; }
  .reason { font-size: 19px; }
}
