:root {
  --paper: #EFE6D3;
  --paper-dark: #E4D8BE;
  --ink: #1F2B23;
  --crate: #C1652B;
  --steel: #56706B;
  --stamp-red: #A93226;
  --line: #C9BB9C;

  --font-display: 'Oswald', sans-serif;
  --font-body: 'IBM Plex Sans', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* ---------- Header ---------- */
.site-header {
  border-bottom: 2px solid var(--ink);
  padding: 18px 0;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.brand-mark { font-size: 1.2rem; color: var(--crate); }

.stamp-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  border: 1.5px solid var(--stamp-red);
  color: var(--stamp-red);
  padding: 4px 10px;
  transform: rotate(-2deg);
  border-radius: 2px;
}

/* ---------- Hero ---------- */
.hero {
  padding: 56px 0 40px;
  border-bottom: 2px dashed var(--line);
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--steel);
  margin: 0 0 12px;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.1;
  margin: 0 0 16px;
  max-width: 720px;
}
.hero-sub {
  max-width: 560px;
  color: #3a453d;
  line-height: 1.5;
  margin: 0 0 28px;
}

.search-bar {
  display: flex;
  max-width: 520px;
  border: 2px solid var(--ink);
  background: var(--paper-dark);
}
.search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--ink);
  outline: none;
}
.search-bar input::placeholder { color: #7c7261; }
.search-bar button {
  border: none;
  border-left: 2px solid var(--ink);
  background: var(--crate);
  color: var(--paper);
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  padding: 0 22px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.search-bar button:hover { background: var(--stamp-red); }
.search-bar button:focus-visible,
.search-bar input:focus-visible {
  outline: 2px solid var(--steel);
  outline-offset: -2px;
}

/* ---------- Manifest list header ---------- */
.manifest-header {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--steel);
  padding: 28px 4px 10px;
}
.manifest-header span:not(:first-child) { text-align: right; }

.status-line {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--steel);
  padding: 4px 4px 16px;
}

/* ---------- Product grid ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 20px;
  padding-bottom: 60px;
}

.crate-card {
  position: relative;
  background: var(--paper-dark);
  border: 1.5px solid var(--ink);
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.crate-card::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px dashed var(--line);
  pointer-events: none;
}
.crate-card:hover {
  transform: translateY(-3px);
  box-shadow: 4px 4px 0 var(--ink);
}

.crate-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--steel);
  display: flex;
  justify-content: space-between;
}

.crate-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #fff;
}

.crate-title {
  font-size: 0.85rem;
  line-height: 1.35;
  margin: 0;
  min-height: 2.7em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.crate-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.crate-price {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--stamp-red);
}

.crate-cta {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  background: var(--ink);
  color: var(--paper);
  border: none;
  padding: 8px 12px;
  cursor: pointer;
  text-decoration: none;
}
.crate-cta:hover { background: var(--crate); }

.empty-state, .error-state {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--steel);
  padding: 30px 4px;
}
.error-state { color: var(--stamp-red); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 2px solid var(--ink);
  padding: 18px 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--steel);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 640px) {
  .manifest-header { display: none; }
  .stamp-tag { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .crate-card { transition: none; }
}
