:root {
  --paper: #f5efe4;
  --card: #fbf8f2;
  --ink: #221d17;
  --muted: #5c544a;
  --line: #d6c9b1;
  --field-line: #8d7f68;
  --accent: #9c4621;
  --sage: #55644a;
  --serif: ui-serif, Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
  -webkit-text-size-adjust: 100%;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}

.site-header {
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  padding-top: 22px;
  padding-bottom: 20px;
}

.brand {
  margin: 0;
  font: 700 30px/1 var(--serif);
  letter-spacing: -0.01em;
}

.tagline {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: center;
  gap: 56px;
  padding-top: 56px;
  padding-bottom: 48px;
}

.intro h1 {
  max-width: 14ch;
  margin: 0 0 20px;
  font: 600 clamp(2.4rem, 4.4vw, 3.6rem)/1.02 var(--serif);
  letter-spacing: -0.02em;
}

.lede {
  max-width: 52ch;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.intro-image {
  display: block;
  width: 100%;
  height: 260px;
  object-fit: cover;
  border-radius: 18px;
}

.browse-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
}

.browse-head h2 {
  margin: 0;
  font: 600 32px/1.1 var(--serif);
}

.results-status {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px auto;
  align-items: end;
  gap: 16px;
  margin: 24px 0 32px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
}

.field input,
.field select {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--field-line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
}

.toggle {
  height: 48px;
  padding: 0 20px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.toggle[aria-pressed="true"] {
  background: var(--ink);
  color: var(--card);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--card);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.button:not(.ghost):hover {
  background: var(--accent);
  border-color: var(--accent);
}

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

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

.button[aria-pressed="true"] {
  background: var(--sage);
  border-color: var(--sage);
  color: #fff;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.grid > li {
  display: flex;
}

.card {
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}

.card-media {
  position: relative;
}

.card-image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.saved-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--sage);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 22px 22px 20px;
}

.card-title {
  margin: 0 0 12px;
  font: 600 26px/1.15 var(--serif);
}

.meta {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.meta + .meta {
  margin-top: 4px;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 20px;
}

.price {
  font-size: 20px;
  font-weight: 700;
}

.empty {
  margin-top: 8px;
  padding: 48px 24px;
  border: 1px dashed var(--field-line);
  border-radius: 16px;
  text-align: center;
}

.empty p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 18px;
}

.site-footer {
  margin-top: 72px;
  padding: 28px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.site-footer p {
  margin: 0;
}

.detail {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: var(--card);
  color: var(--ink);
  overflow: auto;
  box-shadow: 0 24px 60px rgba(34, 29, 23, 0.35);
}

.detail::backdrop {
  background: rgba(34, 29, 23, 0.55);
}

.detail-image {
  display: block;
  width: 100%;
  height: 300px;
  object-fit: cover;
}

.detail-content {
  padding: 28px 32px 32px;
}

.detail-title {
  margin: 0 0 20px;
  font: 600 36px/1.1 var(--serif);
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px 24px;
  margin: 0 0 24px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.facts dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.facts dd {
  margin: 4px 0 0;
  font-size: 17px;
  font-weight: 500;
}

.detail-text {
  margin: 0 0 28px;
  font-size: 18px;
  line-height: 1.6;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

@media (max-width: 760px) {
  .wrap {
    padding: 0 20px;
  }

  .intro {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 36px;
  }

  .intro-image {
    height: 200px;
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

  .toggle {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .detail {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }

  .detail-image {
    height: 220px;
  }

  .detail-content {
    padding: 24px 20px 28px;
  }

  .detail-title {
    font-size: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
