:root {
  color-scheme: light;
  --bg: #ebe6de;
  --paper: #f7f4ef;
  --ink: #211e1a;
  --muted: #6f695f;
  --line: rgba(33, 30, 26, 0.12);
  --accent: #9a3f1a;
  --shadow: 0 16px 40px rgba(48, 36, 22, 0.08);
  --serif: Fraunces, "Iowan Old Style", Palatino, Georgia, serif;
  --sans: Figtree, "Avenir Next", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }

.wrap { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; gap: 16px; align-items: center;
  padding: 16px 0 12px;
  background: rgba(235, 230, 222, 0.92);
  backdrop-filter: blur(10px);
}
.brand { display: flex; flex-direction: column; min-width: 140px; }
.brand span { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.brand strong { font-family: var(--serif); font-size: 32px; font-weight: 560; line-height: 1; }
.search {
  flex: 1;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 16px;
}
.search:focus { outline: 2px solid #e7c3b2; border-color: transparent; }
.pill, .text-btn {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 999px;
  padding: 8px 12px;
  white-space: nowrap;
}
.text-btn:hover { border-color: var(--ink); }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0 18px; }
.crumbs button, .crumbs span { font-family: var(--mono); font-size: 13px; }
.crumbs button { border: 0; background: transparent; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.sep { color: var(--muted); }
.section-title {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 8px 0 12px;
  font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}
.card, .photo {
  position: relative;
  border: 0;
  padding: 0;
  text-align: left;
  background: #ddd6cb;
  border-radius: 16px;
  overflow: hidden;
  min-height: 180px;
  aspect-ratio: 4 / 5;
}
.card img, .photo img { width: 100%; height: 100%; object-fit: cover; }
.card .meta, .photo .name {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 36px 12px 12px;
  background: linear-gradient(to top, rgba(22, 16, 12, 0.78), transparent);
  color: white;
}
.card .meta strong, .photo .name { font-family: var(--mono); font-size: 13px; font-weight: 500; }
.tag {
  display: inline-block;
  margin-bottom: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: white;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.photos { margin: 22px 0 48px; }
.photo .name { font-family: var(--mono); font-size: 12px; }
.empty, .error, .note { color: var(--muted); }
.error { color: var(--accent); }
.more {
  margin: 16px 0 32px;
  background: var(--ink);
  color: var(--paper);
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
}
.lightbox {
  position: fixed; inset: 0; z-index: 20;
  background: rgba(22, 16, 12, 0.92);
  display: grid;
  grid-template-rows: auto 1fr auto;
  color: white;
  padding: 16px;
}
.lightbox header, .lightbox footer {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
}
.lightbox header button, .lightbox footer button {
  background: transparent; color: white; border: 1px solid rgba(255,255,255,0.3);
  border-radius: 999px; padding: 8px 12px;
}
.lightbox figure { margin: 0; display: grid; place-items: center; min-height: 0; }
.lightbox img { max-height: 78vh; max-width: min(1100px, 100%); object-fit: contain; }
.lightbox p { font-family: var(--mono); font-size: 13px; margin: 0; }
.results { display: grid; gap: 8px; margin-bottom: 28px; }
.result {
  display: flex; justify-content: space-between; gap: 12px;
  width: 100%; text-align: left;
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
}
.result b { font-family: var(--mono); font-weight: 500; }
.result span { color: var(--muted); font-size: 13px; }
@media (max-width: 720px) {
  .top { flex-wrap: wrap; }
  .search { order: 3; flex-basis: 100%; }
  .brand strong { font-size: 28px; }
}
