:root {
  --paper: #faf6f0;
  --paper-deep: #f2ece2;
  --ink: #1f1b17;
  --muted: #6f665b;
  --line: #e2d9cc;
  --accent: #7b5c3c;
  --accent-soft: #efe6d9;
  --radius: 3px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand {
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin: 0 0 0.4em;
}

h1 { font-size: clamp(2rem, 5vw, 3.1rem); line-height: 1.08; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.05rem; }

p { margin: 0 0 1em; }

a { color: inherit; }
a:hover { color: var(--accent); }

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

.muted { color: var(--muted); }

/* ------------------------------------------------------------- structure */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-size: 1.25rem;
  text-decoration: none;
  letter-spacing: 0.02em;
}
.brand em { font-style: normal; color: var(--accent); }
.brand.small { font-size: 1rem; margin: 0 0 6px; }

.site-nav { display: flex; align-items: center; gap: 20px; font-size: 0.9rem; }
.site-nav a { text-decoration: none; color: var(--muted); }
.site-nav a:hover { color: var(--ink); }
.count {
  display: inline-block;
  min-width: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.72rem;
  line-height: 20px;
  text-align: center;
  vertical-align: 1px;
}

main { max-width: 1120px; margin: 0 auto; padding: 0 22px 80px; }

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--paper-deep);
  padding: 40px 22px 26px;
  font-size: 0.9rem;
  color: var(--muted);
}
.foot-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 28px;
  max-width: 1120px;
  margin: 0 auto 26px;
}
.foot-grid h3 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.09em; color: var(--ink); }
.foot-grid p { margin: 0 0 6px; }
.legal {
  max-width: 1120px;
  margin: 0 auto;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
}

/* ------------------------------------------------------------------ hero */

.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  padding: 56px 0 64px;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  color: var(--accent);
  margin-bottom: 14px;
}
.lede { font-size: 1.06rem; color: var(--muted); max-width: 42ch; }
.hero-image { margin: 0; }
.hero-image img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: var(--paper-deep);
}

/* ------------------------------------------------------------- storefront */

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}
.section-head h2 { margin: 0; }
.section-head p { margin: 0; font-size: 0.85rem; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 34px 22px;
}
.card { text-decoration: none; color: inherit; display: block; }
.card-media {
  margin: 0 0 12px;
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--paper-deep);
  overflow: hidden;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 500ms ease; }
.card:hover .card-media img { transform: scale(1.03); }
.card.sold-out .card-media img { opacity: 0.55; }
.no-photo {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--muted);
  font-size: 0.8rem;
}
.card-meta { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.card-meta h3 { font-size: 0.98rem; margin: 0; }
.card-meta span { font-size: 0.9rem; color: var(--muted); white-space: nowrap; }
.card-category {
  margin: 2px 0 0;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
}
.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 8px;
}

/* -------------------------------------------------------------- product */

.product-view { padding-top: 26px; }
.crumbs { font-size: 0.8rem; color: var(--muted); padding: 0 0 26px; }
.crumbs a { text-decoration: none; }

.product-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 56px;
  align-items: start;
}
.product-media { margin: 0; background: var(--paper-deep); }
.product-media img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.product-price { font-size: 1.15rem; margin-bottom: 18px; }
.product-description { color: #443d35; white-space: pre-line; }
.product-actions { margin: 26px 0 22px; display: flex; gap: 12px; flex-wrap: wrap; }
.product-notes {
  margin: 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--line);
  font-size: 0.86rem;
  color: var(--muted);
  list-style: none;
}
.product-notes li { padding: 5px 0; }
.product-notes strong { color: var(--ink); font-weight: 600; }

/* --------------------------------------------------------------- buttons */

.btn {
  display: inline-block;
  appearance: none;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 13px 24px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}
.btn:hover { background: transparent; color: var(--ink); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); }
.btn.wide { width: 100%; text-align: center; }

/* ------------------------------------------------------------------ cart */

.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 48px; align-items: start; }
.cart-line {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.cart-line img { width: 88px; height: 88px; object-fit: cover; background: var(--paper-deep); }
.cart-line h3 { font-size: 0.95rem; margin: 0 0 4px; }
.cart-line .line-price { font-size: 0.85rem; color: var(--muted); }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius); }
.qty button {
  appearance: none; border: 0; background: none; font: inherit; font-size: 1rem;
  width: 32px; height: 32px; cursor: pointer; color: var(--ink);
}
.qty span { min-width: 24px; text-align: center; font-size: 0.85rem; }
.remove { appearance: none; border: 0; background: none; font: inherit; font-size: 0.78rem; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 0; }

.summary {
  background: var(--paper-deep);
  padding: 24px;
  border-radius: var(--radius);
}
.summary-row { display: flex; justify-content: space-between; font-size: 0.9rem; padding: 6px 0; }
.summary-total { display: flex; justify-content: space-between; font-size: 1.05rem; padding: 14px 0; margin-top: 8px; border-top: 1px solid var(--line); }
.summary .btn { margin-top: 14px; }
.summary .fineprint { font-size: 0.76rem; color: var(--muted); margin-top: 14px; }

.notice {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  background: #fffdf9;
  padding: 14px 16px;
  font-size: 0.88rem;
  margin: 0 0 22px;
}
.notice.error { border-left-color: #a33; }

/* ----------------------------------------------------------------- about */

.prose { max-width: 68ch; }
.prose h2 { margin-top: 44px; }
.prose p { color: #443d35; }
.prose h2:first-of-type { margin-top: 0; }

/* ----------------------------------------------------------------- admin */

.admin-shell { max-width: 980px; margin: 0 auto; padding: 32px 22px 80px; }
.admin-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.admin-bar h1 { font-size: 1.6rem; margin: 0; }
.admin-bar .actions { display: flex; gap: 10px; }
.admin-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 28px; align-items: start; }

.admin-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.admin-list li { border-bottom: 1px solid var(--line); }
.admin-list button {
  appearance: none; border: 0; background: none; font: inherit;
  width: 100%; text-align: left; padding: 12px 8px; cursor: pointer;
  display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: center;
}
.admin-list button:hover { background: var(--accent-soft); }
.admin-list li.active button { background: var(--accent-soft); }
.admin-list img, .admin-list .thumb-gap { width: 44px; height: 44px; object-fit: cover; background: var(--paper-deep); }
.admin-list .t { font-size: 0.9rem; line-height: 1.3; }
.admin-list .s { font-size: 0.75rem; color: var(--muted); }
.admin-list .draft { color: var(--accent); font-weight: 600; }

.editor { background: #fffdf9; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.editor label { display: block; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 16px; }
.editor input[type="text"], .editor input[type="number"], .editor input[type="password"], .editor textarea, .editor input[type="file"], .login input {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px;
  font: inherit; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius);
}
.editor textarea { resize: vertical; line-height: 1.5; }
.editor .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.editor .check { text-transform: none; letter-spacing: 0; font-size: 0.9rem; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.editor .check input { width: auto; margin: 0; }
.editor .buttons { display: flex; gap: 10px; margin-top: 8px; }
.photo-preview { margin: -6px 0 16px; }
.photo-preview img { width: 140px; height: 140px; object-fit: cover; border: 1px solid var(--line); }
.status { font-size: 0.82rem; margin: 12px 0 0; min-height: 1.2em; }
.status.ok { color: #2f6b43; }
.status.error { color: #a33; }

.login { max-width: 340px; margin: 80px auto; }
.login p.error { color: #a33; font-size: 0.85rem; }

/* ------------------------------------------------------------ responsive */

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 28px; padding: 32px 0 40px; }
  .hero-image { order: -1; }
  .hero-image img { aspect-ratio: 4 / 3; }
  .product-layout, .cart-layout, .admin-layout { grid-template-columns: 1fr; gap: 28px; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .cart-line { grid-template-columns: 64px 1fr; }
  .cart-line img { width: 64px; height: 64px; }
  .cart-line .line-actions { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; }
  .admin-list { max-height: 300px; overflow-y: auto; }
}

@media (max-width: 520px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 14px; }
  .card-meta { flex-direction: column; gap: 2px; }
  .site-nav { gap: 14px; }
}
