:root {
  --ink: #1a1a1a;
  --paper: #ffffff;
  --cream: #fbf8f2;
  --gold: #bfa054;
  --gold-soft: rgba(226, 179, 110, 0.14);
  --muted: #5f5f5f;
  --faint: #9a9a9a;
  --line: #e7e2d8;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 80% 50% at 15% 20%, var(--gold-soft) 0%, transparent 60%);
  z-index: 0;
}

a { color: inherit; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }

.wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1132px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ── Header ─────────────────────────────────────────── */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(251, 248, 242, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--ink);
}
.top .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  letter-spacing: 0.32em;
  font-size: 13px;
  text-transform: uppercase;
  white-space: nowrap;
}
.brand img { width: 28px; height: 28px; object-fit: contain; }
.brand b { color: var(--gold); font-weight: 600; }
.brand small {
  letter-spacing: 0.2em;
  font-size: 10px;
  color: var(--faint);
  border-left: 1px solid var(--line);
  padding-left: 10px;
}
.top-link {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 10px 14px;
  border: 2px solid var(--ink);
  background: var(--paper);
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}
.top-link:hover { background: var(--ink); color: var(--paper); }

/* ── Catalog head ───────────────────────────────────── */
main { flex: 1; padding: 56px 0 80px; }

.hero { text-align: center; margin-bottom: 36px; }
.eyebrow {
  display: block;
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(34px, 6vw, 52px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}
.hero p {
  max-width: 520px;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 12px;
}

.tools { max-width: 560px; margin: 0 auto 40px; }
.search {
  position: relative;
  border: 2px solid var(--ink);
  background: var(--paper);
  transition: box-shadow 0.2s;
}
.search:focus-within { box-shadow: 4px 4px 0 0 var(--ink); }
.search input {
  width: 100%;
  padding: 13px 70px 13px 16px;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  color: var(--ink);
}
.search input::placeholder { color: var(--faint); }
.search button {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: none;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}
.search button:hover { color: var(--ink); }

.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}
.chip {
  padding: 7px 13px;
  border: 1px solid var(--ink);
  background: transparent;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.chip:hover { background: var(--paper); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* ── Grid ───────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 28px;
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 2px solid var(--ink);
  text-decoration: none;
  transition: box-shadow 0.2s, transform 0.2s;
}
.card:hover { box-shadow: 6px 6px 0 0 var(--ink); transform: translate(-2px, -2px); }
.card:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.thumb {
  height: 224px;
  background: #f4f2ee;
  border-bottom: 2px solid var(--ink);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--ink);
  color: var(--paper);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 4px 8px;
}
.badge.free { background: var(--gold); color: #1a1405; }
.card-body { display: flex; flex-direction: column; flex: 1; padding: 22px; }
.cat {
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.card h2 {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.25;
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card p {
  margin: 0 0 20px;
  flex: 1;
  color: var(--muted);
  font-size: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 18px;
  border-top: 2px solid var(--ink);
}
.price { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.price s { font-size: 12px; font-weight: 400; color: var(--faint); margin-left: 6px; }
.btn {
  display: inline-block;
  padding: 12px 18px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.card:hover .btn, .btn:hover { background: var(--gold); border-color: var(--gold); color: #1a1405; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* ── States ─────────────────────────────────────────── */
.state {
  text-align: center;
  padding: 72px 16px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.state.box { border: 2px dashed var(--line); max-width: 460px; margin: 0 auto; }
.state small { display: block; margin-top: 8px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--faint); font-size: 12px; }
.spinner {
  width: 30px;
  height: 30px;
  margin: 0 auto 16px;
  border: 2px solid var(--line);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Product page ───────────────────────────────────── */
.back {
  display: inline-block;
  margin-bottom: 24px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
}
.back:hover { color: var(--ink); }
.product {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}
.gallery { position: sticky; top: 88px; }
.stage {
  border: 2px solid var(--ink);
  background: var(--paper);
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.stage img { width: 100%; height: 100%; object-fit: contain; }
.strip { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; }
.strip button {
  flex: 0 0 76px;
  height: 58px;
  padding: 0;
  border: 2px solid var(--line);
  background: var(--paper);
  overflow: hidden;
}
.strip button[aria-current="true"] { border-color: var(--ink); }
.strip img { width: 100%; height: 100%; object-fit: cover; }

.info h1 { font-size: clamp(26px, 3.6vw, 36px); line-height: 1.18; }
.lead { margin: 14px 0 0; color: var(--muted); font-size: 13px; }
.buy {
  margin: 24px 0;
  padding: 20px;
  border: 2px solid var(--ink);
  background: var(--paper);
}
.buy .price { font-size: 26px; display: block; margin-bottom: 14px; }
.buy .price s { font-size: 14px; }
.buy .btn { display: block; padding: 15px 18px; }
.buy small { display: block; margin-top: 12px; color: var(--faint); font-size: 11px; line-height: 1.5; }

.desc h3 {
  margin: 26px 0 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}
.desc p { margin: 0 0 12px; font-size: 13px; color: #333; overflow-wrap: anywhere; }
.desc ul { margin: 0 0 12px; padding-left: 18px; font-size: 13px; color: #333; }
.desc li { margin-bottom: 5px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 24px; }
.tags span {
  padding: 3px 8px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 10px;
  color: var(--muted);
}

/* ── Footer ─────────────────────────────────────────── */
footer {
  position: relative;
  z-index: 1;
  background: #0c0c0c;
  color: rgba(255, 255, 255, 0.45);
  padding: 44px 0 32px;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 28px; }
footer .brand { color: #fff; }
footer .brand img { filter: grayscale(1); }
footer p { margin: 10px 0 0; max-width: 320px; line-height: 1.7; letter-spacing: 0.08em; }
footer nav { display: flex; flex-wrap: wrap; gap: 10px 26px; align-items: flex-start; }
footer a { text-decoration: none; }
footer a:hover { color: #fff; }
footer .legal { flex-basis: 100%; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, 0.08); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
footer .legal img { height: 30px; width: auto; }
footer .legal div { display: flex; gap: 12px; align-items: center; }

@media (max-width: 820px) {
  main { padding: 36px 0 56px; }
  .product { grid-template-columns: 1fr; gap: 24px; }
  .gallery { position: static; }
  .brand small { display: none; }
}
@media (max-width: 420px) {
  .brand { letter-spacing: 0.2em; font-size: 12px; }
  .top-link { padding: 9px 10px; letter-spacing: 0.12em; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation-duration: 0s !important; }
}
