:root {
  --paper: #f5efe4;
  --card: #fffaf2;
  --ink: #251f1a;
  --muted: #5e5349;
  --line: #d9cdb9;
  --field-line: #9c8d77;
  --accent: #a4482a;
  --accent-deep: #7d3219;
  --sage: #4f6247;
  --focus: #1d4f7c;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

* {
  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%;
}

img {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
}

p {
  margin: 0;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

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

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

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

.skip-link {
  position: absolute;
  top: -60px;
  left: 12px;
  z-index: 10;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
}

.skip-link:focus {
  top: 12px;
}

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

.header-inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-block: 18px;
}

.brand {
  font-family: var(--serif);
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-decoration: none;
}

.brand::after {
  content: "";
  display: inline-block;
  width: 0.42em;
  height: 0.42em;
  margin-left: 0.2em;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: 0.3em;
}

.tagline {
  color: var(--muted);
  font-size: 0.9rem;
}

.intro {
  padding-block: 56px 40px;
}

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

.eyebrow {
  margin-bottom: 16px;
  color: var(--accent-deep);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.intro h1 {
  max-width: 14ch;
  font-size: clamp(2.4rem, 5.2vw, 4rem);
}

.lede {
  max-width: 46ch;
  margin-top: 20px;
  color: var(--muted);
  font-size: 1.125rem;
}

.intro-photo {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 20px;
  background: #e2d6c1;
}

.intro-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px auto;
  gap: 14px;
  align-items: end;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field label {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.field input,
.field select {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--field-line);
  border-radius: 10px;
  background: #fff;
  font-size: 1rem;
}

.toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  padding: 0 18px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

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

.count {
  min-width: 1.8em;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eadfcc;
  color: var(--ink);
  font-size: 0.85rem;
  text-align: center;
}

.toggle[aria-pressed="true"] .count {
  background: var(--accent);
  color: #fff;
}

.status {
  margin: 22px 0 16px;
  color: var(--muted);
  font-size: 0.95rem;
}

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

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

.card-media {
  aspect-ratio: 4 / 3;
  background: #e2d6c1;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 26px;
}

.card-title {
  font-size: 1.6rem;
}

.facts {
  color: var(--muted);
  font-size: 0.95rem;
}

.price-line {
  font-size: 1rem;
}

.summary {
  color: #3d342c;
}

.card .open-item {
  align-self: flex-start;
  margin-top: auto;
}

.tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tag-baking {
  background: #f2e2bf;
  color: #6b4306;
}

.tag-ceramics {
  background: #f3d9cb;
  color: #7a2f15;
}

.tag-floristry {
  background: #dbe7d2;
  color: #2f4d2b;
}

.tag-painting {
  background: #d8e4ef;
  color: #21476b;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: #ebe3d4;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-saved {
  background: var(--sage);
  color: #fff;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  font-weight: 600;
  cursor: pointer;
}

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

.btn-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  border-color: var(--accent-deep);
  background: var(--accent-deep);
}

.empty {
  margin-bottom: 64px;
  padding: 56px 24px;
  border: 1px dashed #b9aa92;
  border-radius: 18px;
  background: var(--card);
  text-align: center;
}

.empty h2 {
  margin-bottom: 8px;
  font-size: 1.6rem;
}

.empty p {
  margin-bottom: 20px;
  color: var(--muted);
}

.detail {
  width: min(820px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 40px 90px -30px rgba(37, 31, 26, 0.6);
  overflow: auto;
}

.detail::backdrop {
  background: rgba(37, 31, 26, 0.6);
}

.detail-inner {
  position: relative;
}

.detail-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 1;
  min-height: 44px;
  padding: 8px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--card);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  font-weight: 600;
  cursor: pointer;
}

.detail-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.detail-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px 32px 34px;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-title {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
}

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

.facts-grid dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.facts-grid dd {
  margin: 4px 0 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.detail-body {
  font-size: 1.125rem;
  line-height: 1.65;
}

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

.btn-save {
  min-height: 48px;
}

.btn-save.is-saved {
  border-color: var(--ink);
  background: transparent;
  color: var(--ink);
}

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

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

  .intro {
    padding-block: 36px 28px;
  }

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

  .intro-photo {
    aspect-ratio: 16 / 10;
  }

  .controls {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .toggle {
    width: 100%;
  }

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

  .detail {
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    border-radius: 0;
  }

  .detail-content {
    padding: 22px 20px 32px;
  }
}

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