:root {
  --bg: #f6f3ec;
  --card: #fffdf8;
  --ink: #23291f;
  --muted: #5f675a;
  --line: #ddd8c8;
  --accent: #3e6b48;
  --accent-ink: #ffffff;
  --free: #8a5a2b;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161a15;
    --card: #1e231d;
    --ink: #e8ebe2;
    --muted: #a3ab9c;
    --line: #333a30;
    --accent: #8cc79a;
    --accent-ink: #12180f;
    --free: #e0b27a;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 1.0625rem/1.55 ui-rounded, "Avenir Next", system-ui, -apple-system, "Segoe UI", sans-serif;
  padding: 0 16px 48px;
}
header, main, footer { max-width: 40rem; margin: 0 auto; }
header { padding: 32px 0 8px; }
h1 { font-size: 1.9rem; line-height: 1.15; margin: 0 0 12px; letter-spacing: -0.01em; }
h2 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin: 32px 0 10px; }
p { margin: 0 0 10px; }
.intro { font-size: 1.15rem; }
.note { color: var(--muted); font-size: 0.95rem; }
a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.grid {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 8px;
}
.card a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  color: inherit;
  text-decoration: none;
}
.card img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 10px;
  background: var(--line);
}
.card .name { font-size: 0.85rem; font-weight: 600; line-height: 1.25; }
.card:hover .name, .card a:focus-visible .name { text-decoration: underline; }
.card.sold img { opacity: 0.55; }
.card.sold .name { color: var(--muted); text-decoration: line-through; }
.tag {
  align-self: flex-start;
  margin-top: auto;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 1px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.tag-price { background: var(--accent); color: var(--accent-ink); }
.tag-free { border: 1.5px solid var(--free); color: var(--free); }
.tag-sold { border: 1.5px solid var(--muted); color: var(--muted); }

/* Detail card: opens with the URL hash (:target), no scripts needed. */
.detail {
  display: none;
  position: fixed; inset: 0;
  z-index: 10;
  overflow-y: auto;
  background: rgba(10, 14, 9, 0.62);
  padding: 16px;
}
.detail:target { display: block; }
body:has(.detail:target) { overflow: hidden; }
.backdrop { position: fixed; inset: 0; }
.sheet {
  position: relative;
  max-width: 40rem;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 16px 18px;
}
.sheet h3 { font-size: 1.25rem; line-height: 1.25; margin: 0 56px 12px 0; }
.sheet h3 .tag { vertical-align: middle; margin-left: 6px; }
.sheet h4 { margin: 18px 0 4px; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.close {
  position: absolute; top: 12px; right: 12px;
  padding: 8px 12px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}
.photos { display: grid; gap: 10px; margin-bottom: 12px; }
.photos img {
  width: 100%;
  height: auto;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 10px;
  background: var(--line);
}
.short { color: var(--muted); }
dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; }
dt { color: var(--muted); }
dd { margin: 0; }

footer { border-top: 1px solid var(--line); margin-top: 36px; padding-top: 4px; }
footer p { font-size: 1.1rem; }

@media (min-width: 700px) {
  body { padding-bottom: 80px; }
  h1 { font-size: 2.4rem; }
  header, main, footer { max-width: 46rem; }
  .grid { gap: 22px 14px; }
  .card .name { font-size: 1rem; }
  .tag { font-size: 0.9rem; }
  .photos img { max-height: 600px; }
}
