:root {
  --ink: #1a1714;
  --muted: #6b635a;
  --line: #e3ddd3;
  --paper: #faf8f4;
  --accent: #7a1f1f;       /* oxblood — initials / rubrication */
  --accent-soft: #f0e7e3;
  --max: 1080px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: ui-sans-serif, system-ui, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.55;
}

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.5rem; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.muted { color: var(--muted); }

/* ---- header ---- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: sticky; top: 0; z-index: 10;
}
.header-inner {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-top: 1rem; padding-bottom: .5rem; gap: 1rem; flex-wrap: wrap;
}
.brand {
  font-weight: 700; font-size: 1.6rem; letter-spacing: .12em;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand-sub {
  font-weight: 400; font-size: .7em; letter-spacing: .25em;
  color: var(--accent); margin-left: .15em;
}
.site-nav { font-family: var(--sans); font-size: .85rem; letter-spacing: .04em; }
.site-nav a { margin-left: 1.2rem; color: var(--ink); text-transform: uppercase; }

.searchbar { display: flex; gap: .5rem; padding-bottom: 1rem; }
.searchbar input {
  flex: 1; padding: .55rem .8rem; border: 1px solid var(--line);
  border-radius: 2px; font-family: var(--sans); font-size: .95rem; background: var(--paper);
}
.searchbar button {
  padding: .55rem 1.2rem; border: 1px solid var(--accent); background: var(--accent);
  color: #fff; border-radius: 2px; font-family: var(--sans); cursor: pointer;
}

/* ---- browse grid ---- */
.browse-head { display: flex; justify-content: space-between; align-items: baseline;
  margin: 2rem 0 1rem; flex-wrap: wrap; gap: .5rem; }
.browse-head h1 { font-size: 1.5rem; margin: 0; font-weight: 600; }
.filters { font-family: var(--sans); font-size: .8rem; }
.filters a {
  display: inline-block; padding: .2rem .6rem; margin-left: .3rem;
  border: 1px solid var(--line); border-radius: 999px; color: var(--muted);
}
.filters a.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.filter-sep { display: inline-block; width: 1px; height: 1rem; margin: 0 .25rem 0 .55rem;
  background: var(--line); vertical-align: middle; }

.grid {
  display: grid; gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  margin: 1.5rem 0 3rem; padding: 0; list-style: none;
}
.card { display: block; color: inherit; }
.card:hover { text-decoration: none; }
.card .frame {
  background: #fff; border: 1px solid var(--line); padding: .4rem;
  aspect-ratio: 3 / 4; display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.card img { max-width: 100%; max-height: 100%; object-fit: contain; }
.card .noimg { color: var(--muted); font-family: var(--sans); font-size: .8rem; }
.card .cap { font-size: .9rem; margin-top: .45rem; line-height: 1.3; }
.card .cap .t { display: block; }
.card .cap .m { color: var(--muted); font-size: .8rem; font-family: var(--sans); }

.badge {
  font-family: var(--sans); font-size: .65rem; letter-spacing: .08em;
  text-transform: uppercase; padding: .1rem .45rem; border-radius: 2px;
  background: var(--accent-soft); color: var(--accent);
}
.badge.b { background: #e7eef0; color: #1f5a7a; }

/* ---- record detail ---- */
.record { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 2.5rem; margin: 2rem 0 3rem; }
@media (max-width: 760px) { .record { grid-template-columns: 1fr; } }

.record-figure { background: #fff; border: 1px solid var(--line); padding: .6rem; }
.record-figure img { width: 100%; display: block; }
.record-figure figcaption { font-family: var(--sans); font-size: .78rem; color: var(--muted);
  margin-top: .5rem; }
.source-link { font-family: var(--sans); font-size: .8rem; margin-top: .6rem; display: block; }

.record h1 { font-size: 1.9rem; margin: 0 0 .2rem; font-weight: 600; line-height: 1.15; }
.record .subtitle { color: var(--muted); font-style: italic; margin: 0 0 1rem; }

.meta { width: 100%; border-collapse: collapse; font-size: .95rem; margin: 1rem 0; }
.meta th { text-align: right; vertical-align: top; color: var(--muted); font-weight: 400;
  font-family: var(--sans); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em;
  padding: .35rem .9rem .35rem 0; white-space: nowrap; width: 1%; }
.meta td { padding: .35rem 0; vertical-align: top; border-bottom: 1px solid var(--line); }
.meta tr:last-child td { border-bottom: 0; }

.description { margin: 1.5rem 0; }

/* tabs */
.tabs { margin-top: 2rem; border-top: 1px solid var(--line); }
.tab-strip { display: flex; gap: 0; list-style: none; padding: 0; margin: 0;
  font-family: var(--sans); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.tab-strip label {
  padding: .7rem 1.1rem; cursor: pointer; border-bottom: 2px solid transparent;
  color: var(--muted);
}
.tabs input[type=radio] { position: absolute; opacity: 0; }
.tab-panel { display: none; padding: 1.2rem 0; }
#tab-music:checked   ~ .tab-strip label[for=tab-music],
#tab-ref:checked     ~ .tab-strip label[for=tab-ref],
#tab-prov:checked    ~ .tab-strip label[for=tab-prov] {
  color: var(--accent); border-bottom-color: var(--accent);
}
#tab-music:checked ~ #panel-music,
#tab-ref:checked   ~ #panel-ref,
#tab-prov:checked  ~ #panel-prov { display: block; }

.tab-panel dl { margin: 0; display: grid; grid-template-columns: max-content 1fr;
  gap: .35rem 1rem; font-size: .95rem; }
.tab-panel dt { color: var(--muted); font-family: var(--sans); font-size: .8rem; }
.tab-panel dd { margin: 0; }

/* related carousel */
.related { margin: 2.5rem 0; }
.related h2 { font-size: 1.1rem; font-weight: 600; }
.carousel { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: .6rem; }
.carousel a { flex: 0 0 130px; }
.carousel .frame { background:#fff; border:1px solid var(--line); height:160px;
  display:flex; align-items:center; justify-content:center; padding:.3rem; }
.carousel img { max-width:100%; max-height:100%; object-fit:contain; }
.carousel .cap { font-size:.78rem; font-family:var(--sans); color:var(--muted); margin-top:.3rem; }

/* ---- footer ---- */
.site-footer { border-top: 1px solid var(--line); margin-top: 3rem; padding: 1.5rem 0;
  font-family: var(--sans); font-size: .8rem; color: var(--muted); }
.site-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }

/* image comparison slider */
.img-compare { position: relative; width: 100%; overflow: hidden;
  user-select: none; touch-action: none; line-height: 0; }
.img-compare > img { display: block; width: 100%; height: auto; }
.compare-overlay { position: absolute; top: 0; left: 0; height: 100%;
  width: 50%; overflow: hidden; }
.compare-overlay img { display: block; height: auto; max-width: none; }
.compare-handle { position: absolute; top: 0; bottom: 0; left: 50%;
  width: 2px; background: var(--accent); cursor: ew-resize; }
.compare-handle::after { content: "↔"; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%); width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); color: #fff; opacity: .9; display: flex;
  align-items: center; justify-content: center; font-size: 1rem; line-height: 1; }
.compare-label { font-family: var(--sans); font-size: .72rem; color: var(--muted);
  display: flex; justify-content: space-between; margin-top: .4rem; }

.thumbs { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .7rem; }
.thumbs a { display: block; width: 76px; height: 76px; border: 1px solid var(--line);
  background: #fff; padding: 2px; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }

.prose { max-width: 40rem; margin: 2rem auto; }
.prose h1 { font-weight: 600; }
.empty { color: var(--muted); font-style: italic; margin: 3rem 0; text-align: center; }
