/* style.css */
:root {
  --paper: #f3ecdf;
  --paper-2: #e9dfcc;
  --ink: #1d1a16;
  --ink-soft: #5b5347;
  --sea: #0e5a63;
  --sea-deep: #083d44;
  --stamp: #c8412e;
  --kraft: #d9b98a;
  --kraft-edge: #b8935f;
  --radius: 14px;
  --display: "Unbounded", "Arial Black", "Helvetica Neue", sans-serif;
  --body: "Golos Text", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  color: var(--ink);
  font: 16px/1.5 var(--body);
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(14, 90, 99, .10), transparent 38%),
    radial-gradient(circle at 92% 30%, rgba(200, 65, 46, .07), transparent 32%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  min-height: 100vh;
}

a { color: var(--sea); }

main { padding: 0 clamp(16px, 4vw, 48px) 48px; max-width: 1280px; margin: 0 auto; }

.masthead {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between;
  padding: 20px clamp(16px, 4vw, 48px);
  max-width: 1280px; margin: 0 auto;
}

.brand {
  display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink);
  font: 800 15px/1.05 var(--display); text-transform: uppercase; letter-spacing: .02em;
}

.brand-mark {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%;
  background: var(--sea); color: var(--paper); font-size: 24px; transform: rotate(-8deg);
  box-shadow: 3px 3px 0 var(--ink);
}

.searchbar { display: flex; flex: 1 1 320px; max-width: 560px; }

.searchbar input, .filters input, .filters select {
  font: inherit; color: var(--ink); background: #fffaf1; border: 2px solid var(--ink);
  border-radius: 999px; padding: 10px 16px; min-width: 0;
}

.searchbar input { flex: 1; border-radius: 999px 0 0 999px; border-right: 0; }

button, .button {
  font: 600 15px var(--body); cursor: pointer; border: 2px solid var(--ink); border-radius: 999px;
  background: var(--ink); color: var(--paper); padding: 10px 18px; text-decoration: none; display: inline-block;
  transition: transform .15s ease, box-shadow .15s ease;
}

button:hover, .button:hover { transform: translate(-2px, -2px); box-shadow: 3px 3px 0 var(--stamp); }

.searchbar button { border-radius: 0 999px 999px 0; }

.button-ghost { background: transparent; color: var(--ink); }

.headline {
  font: 800 clamp(30px, 6vw, 64px)/1 var(--display); letter-spacing: -.02em; margin: 24px 0 20px;
}

.headline em { font-style: normal; color: var(--sea); }

.shelf-list { list-style: none; padding: 0; margin: 0 0 40px; display: flex; flex-wrap: wrap; gap: 10px; }

.shelf {
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; text-decoration: none;
  color: var(--ink); background: #fffaf1; border: 2px solid var(--ink); border-radius: 999px;
  transition: background .15s ease, color .15s ease;
}

.shelf b {
  font: 800 12px var(--display); background: var(--sea); color: var(--paper); border-radius: 999px; padding: 4px 9px;
}

.shelf:hover { background: var(--ink); color: var(--paper); }

.section-title { font: 800 clamp(20px, 3vw, 28px) var(--display); margin: 8px 0 20px; }

.section-title small { font: 400 15px var(--body); color: var(--ink-soft); margin-left: 8px; }

.grid {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: clamp(14px, 2vw, 24px); grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}

.card { animation: rise .5s both; animation-delay: calc(var(--i) * 30ms); }

@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

.card-link {
  position: relative; display: block; height: 100%; color: inherit; text-decoration: none;
  background: #fffaf1; border: 2px solid var(--ink); border-radius: var(--radius); overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}

.card-link:hover { transform: translateY(-3px) rotate(-.4deg); box-shadow: 6px 6px 0 var(--ink); }

.card-photo { margin: 0; aspect-ratio: 1; background: var(--paper-2); display: grid; place-items: center; }

.card-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.no-photo {
  display: grid; place-items: center; min-height: 120px; color: var(--ink-soft);
  font: 500 12px var(--display); text-transform: uppercase; letter-spacing: .08em;
}

.tag {
  position: absolute; top: 10px; right: -2px; display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 10px; background: var(--kraft); border: 2px solid var(--kraft-edge); border-right: 0;
  border-radius: 8px 0 0 8px; font: 800 14px var(--display); color: var(--ink);
  clip-path: polygon(10px 0, 100% 0, 100% 100%, 10px 100%, 0 50%);
  padding-left: 16px;
}

.tag-hole { width: 7px; height: 7px; border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--kraft-edge); }

.tag-big { position: static; font-size: clamp(20px, 3vw, 28px); border-right: 2px solid var(--kraft-edge); border-radius: 8px; margin: 8px 0 16px; }

.card-title { font: 600 15px/1.3 var(--body); margin: 10px 12px 6px; }

.card-meta { display: flex; align-items: center; justify-content: space-between; margin: 0 12px 12px; font-size: 13px; }

.stamp {
  display: inline-block; color: var(--stamp); border: 1.5px solid var(--stamp); border-radius: 4px;
  padding: 1px 6px; font: 500 11px var(--display); text-transform: uppercase; letter-spacing: .06em; transform: rotate(-2deg);
}

.reposts { font: 800 12px var(--display); color: var(--ink-soft); }

.filters {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: end; padding: 16px; margin: 8px 0 28px;
  background: var(--paper-2); border: 2px dashed var(--ink-soft); border-radius: var(--radius);
}

.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-soft); }

.filters input[type=number] { width: 110px; }

.empty { font-size: 18px; color: var(--ink-soft); padding: 40px 0; }

.pager, .more { display: flex; gap: 20px; justify-content: center; align-items: center; margin: 32px 0; font-weight: 600; }

.item { display: grid; gap: clamp(20px, 4vw, 48px); grid-template-columns: minmax(0, 1fr); margin-top: 16px; }

@media (min-width: 860px) { .item { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); } }

.item-photos { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); align-content: start; }

.item-photos a:first-child { grid-column: 1 / -1; }

.item-photos img {
  width: 100%; display: block; border: 2px solid var(--ink); border-radius: var(--radius); background: var(--paper-2);
}

.crumb { font: 500 12px var(--display); text-transform: uppercase; letter-spacing: .08em; color: var(--sea); text-decoration: none; }

.item-title { font: 800 clamp(26px, 4vw, 44px)/1.05 var(--display); margin: 8px 0 4px; letter-spacing: -.01em; }

.item-dates { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; color: var(--ink-soft); font-size: 14px; }

.item-text {
  white-space: pre-wrap; overflow-wrap: anywhere; background: #fffaf1; border-left: 4px solid var(--sea);
  padding: 16px 20px; border-radius: 0 var(--radius) var(--radius) 0; margin: 20px 0;
}

.seller { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.seller-name { color: var(--ink-soft); }

.history h2 { font: 800 16px var(--display); margin: 28px 0 8px; }

.history ol { list-style: none; padding: 0; margin: 0; }

.history li {
  display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--ink-soft);
  overflow-wrap: anywhere;
}

.sample { line-height: 2; }

.colophon { text-align: center; color: var(--ink-soft); font-size: 13px; padding: 24px 16px 40px; }

@media (prefers-reduced-motion: reduce) {
  .card { animation: none; }
  .card-link, button, .button { transition: none; }
}
