:root {
  color-scheme: dark;
  --bg: #171510;
  --surface: #211e18;
  --surface-2: #29251e;
  --surface-3: #12100d;
  --border: #3b352a;
  --border-soft: #2c2821;
  --text: #f2eadb;
  --muted: #a89e8f;
  --muted-2: #756d61;
  --gold: #d7b46b;
  --gold-2: #b89048;
  --shadow: 0 18px 55px rgba(0,0,0,.28);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% -15%, rgba(215,180,107,.08), transparent 34rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; }
button, input, select { font: inherit; }

.site-header {
  height: 78px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(23,21,16,.88);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand {
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
}
.brand img { width: 40px; height: 40px; object-fit: contain; border-radius: 8px; }

.page-shell { width: min(1120px, calc(100% - 36px)); margin: 0 auto; padding: 30px 0 64px; }
.site-footer { width: min(1120px, calc(100% - 36px)); margin: 0 auto; padding: 0 0 34px; color: var(--muted-2); font-size: 12px; }

.loading-card, .error-card, .empty-card {
  min-height: 260px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 24px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 28px;
  color: var(--muted);
}
.spinner { width: 32px; height: 32px; border-radius: 50%; border: 3px solid #3c352a; border-top-color: var(--gold); animation: spin .75s linear infinite; margin: auto; }
@keyframes spin { to { transform: rotate(360deg); } }

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 22px;
  align-items: end;
  border: 1px solid var(--border);
  background: linear-gradient(145deg, #242018, #1f1c17);
  border-radius: 28px;
  padding: clamp(22px, 5vw, 38px);
  box-shadow: var(--shadow);
}
.eyebrow { color: var(--gold); font-size: 10px; font-weight: 800; letter-spacing: .16em; margin-bottom: 10px; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; }
h1 { margin: 0; font-size: clamp(34px, 6vw, 58px); line-height: 1.02; letter-spacing: -.025em; }
.hero-copy { max-width: 700px; margin-top: 12px; color: var(--muted); line-height: 1.62; font-size: 14px; }
.count-badge { color: var(--bg); background: var(--gold); font-size: 12px; font-weight: 800; padding: 9px 13px; border-radius: 999px; white-space: nowrap; }

.collection-tools { display: flex; gap: 10px; margin: 18px 0; }
.search-wrap { flex: 1; position: relative; }
.search-wrap svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; color: var(--muted-2); }
.search {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  padding: 0 16px 0 42px;
  outline: none;
}
.search:focus { border-color: #80683d; box-shadow: 0 0 0 3px rgba(215,180,107,.08); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.card {
  text-decoration: none;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 20px;
  overflow: hidden;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.card:hover { transform: translateY(-3px); border-color: #76613b; box-shadow: 0 14px 34px rgba(0,0,0,.2); }
.card-image { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--surface-3); }
.card-image img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .22s ease; }
.card:hover .card-image img { transform: scale(1.025); }
.no-photo { width: 100%; height: 100%; display: grid; place-items: center; color: var(--muted-2); font-size: 12px; }
.card-body { padding: 15px 16px 17px; }
.card-name { font: 700 22px/1.1 Georgia, serif; }
.card-location { color: var(--muted); font-size: 12px; line-height: 1.45; margin-top: 7px; min-height: 34px; }

.back-link { display: inline-flex; align-items: center; gap: 8px; color: var(--gold); text-decoration: none; font-size: 12px; font-weight: 700; margin-bottom: 16px; }
.specimen-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: 18px; }
.photo-panel, .info-panel { border: 1px solid var(--border); background: var(--surface); border-radius: 24px; overflow: hidden; }
.photo-panel { display: grid; place-items: center; min-height: 420px; background: #0f0e0b; }
.photo-panel img { width: 100%; height: 100%; max-height: 680px; object-fit: contain; display: block; }
.specimen-empty-photo { color: var(--muted-2); }
.info-panel { padding: clamp(21px, 4vw, 30px); }
.specimen-title { margin: 0; font: 700 clamp(34px, 5vw, 50px)/1.02 Georgia, serif; }
.specimen-location { margin-top: 9px; color: var(--muted); line-height: 1.5; }
.details { margin-top: 23px; border-top: 1px solid var(--border-soft); }
.detail { display: grid; grid-template-columns: 125px 1fr; gap: 15px; padding: 11px 0; border-bottom: 1px solid var(--border-soft); }
.detail-label { color: var(--gold); font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.detail-value { font-size: 13px; line-height: 1.5; min-width: 0; overflow-wrap: anywhere; }
.description-block { margin-top: 22px; }
.description-block h2 { font-size: 22px; margin: 0 0 9px; }
.description-block p { color: #c4b8a6; line-height: 1.65; white-space: pre-wrap; margin: 0; font-size: 13px; }
.wiki-link { margin-top: 15px; display: inline-flex; color: var(--gold); text-decoration: none; font-size: 12px; font-weight: 700; }
.wiki-link:hover { text-decoration: underline; }

.error-card h1, .empty-card h2 { color: var(--text); margin-bottom: 10px; }
.error-card p, .empty-card p { max-width: 560px; margin: 0; line-height: 1.55; }

@media (max-width: 760px) {
  .site-header { height: 66px; }
  .brand img { width: 34px; height: 34px; }
  .hero { grid-template-columns: 1fr; align-items: start; }
  .count-badge { justify-self: start; }
  .specimen-layout { grid-template-columns: 1fr; }
  .photo-panel { min-height: 280px; }
  .detail { grid-template-columns: 105px 1fr; }
}
@media (max-width: 480px) {
  .page-shell, .site-footer, .brand { width: min(100% - 24px, 1120px); }
  .page-shell { padding-top: 18px; }
  .hero { border-radius: 20px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .card { border-radius: 15px; }
  .card-body { padding: 11px; }
  .card-name { font-size: 17px; }
  .card-location { font-size: 10px; min-height: 30px; }
  .info-panel, .photo-panel { border-radius: 18px; }
}
