/* Spook — editorial marketplace styles.
   Sharp edges, paper background, one red accent. No gradients, no glow. */

:root {
  --paper: #f7f7f2;
  --surface: #ffffff;
  --ink: #101010;
  --muted: #5c5b57;
  --line: #d8d8d0;
  --soft: #ecece5;
  --accent: #ee3f1c;
  --accent-ink: #ffffff;
  --lime: #d9f44d;
  --sage: #dbe4d5;
  --blue: #dceaf2;
  --rose: #efdcd7;
  --shadow: 0 14px 40px rgba(20, 20, 16, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
::selection { background: var(--accent); color: #fff; }
body {
  margin: 0;
  min-width: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Archivo", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.shell { min-height: 100dvh; display: flex; flex-direction: column; }
#app { flex: 1; }

/* ---------- header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: grid;
  grid-template-columns: auto auto minmax(180px, 520px) auto;
  align-items: center; justify-content: center;
  gap: 26px;
  min-height: 68px;
  padding: 11px clamp(18px, 4vw, 64px);
  background: rgba(247, 247, 242, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.brand {
  font-family: "Young Serif", Georgia, serif;
  font-size: 26px; letter-spacing: -.02em;
  text-decoration: none;
}
.desktop-nav { display: flex; align-items: center; gap: 4px; }
.nav-btn {
  padding: 11px 10px; font-size: 13px; font-weight: 700;
  border: 0; border-bottom: 2px solid transparent;
  background: transparent; text-decoration: none;
  transition: border-color .15s ease, color .15s ease;
}
.nav-btn:hover { border-bottom-color: var(--line); }
.nav-btn[aria-current="page"] { border-bottom-color: var(--ink); }
.nav-btn[aria-current="page"]:hover { border-bottom-color: var(--ink); }
.search {
  display: grid; grid-template-columns: 20px 1fr auto;
  align-items: center; gap: 9px;
  min-height: 44px; padding: 0 6px 0 13px;
  background: var(--surface); border: 1px solid var(--line);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search:hover { border-color: #b9b9ae; }
.search:focus-within { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); outline: 0; }
.search input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 14px; }
.search button {
  border: 0; background: var(--ink); color: var(--paper);
  min-height: 32px; padding: 0 14px;
  font-size: 11px; font-weight: 800; letter-spacing: .08em;
  transition: background .15s ease;
}
.search button:hover { background: var(--accent); }
.top-actions { display: flex; align-items: center; gap: 8px; }
.auth-area { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; }
.hello { font-weight: 600; color: var(--ink); white-space: nowrap; }
.link-btn { border: 0; background: transparent; padding: 10px 8px; font-size: 13px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--accent); }
.sell-btn {
  display: inline-grid; place-items: center;
  height: 42px; padding: 0 18px;
  border: 1px solid var(--ink); background: var(--ink); color: var(--paper);
  font-size: 13px; font-weight: 800; letter-spacing: .04em; text-decoration: none;
  transition: background .15s ease, transform .15s ease;
}
.sell-btn:hover { background: #262622; transform: translateY(-1px); }

/* small uppercase label, Depop-style */
.kicker {
  margin: 0 0 10px;
  font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
}
.kicker::before { content: ""; display: inline-block; width: 18px; height: 2px; background: var(--accent); vertical-align: middle; margin-right: 8px; }

/* ---------- layout ---------- */
.wrap { width: min(1280px, calc(100% - 40px)); margin-inline: auto; }
.section { padding: 76px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.section-head h2 { margin: 0; font-family: "Young Serif", Georgia, serif; font-weight: 400; letter-spacing: -.025em; font-size: clamp(34px, 4vw, 54px); }
.section-head p { margin: 8px 0 0; color: var(--muted); line-height: 1.55; }
.text-link { border: 0; border-bottom: 1px solid currentColor; background: transparent; padding: 3px 0; font-weight: 700; text-decoration: none; display: inline-block; }

/* ---------- hero ---------- */
.hero { border-bottom: 1px solid var(--line); background: var(--lime); color: #11110d; }
.hero-copy {
  display: flex; flex-direction: column; justify-content: center;
  max-width: 1280px; margin-inline: auto;
  padding: clamp(64px, 9vw, 130px) clamp(20px, 4vw, 64px);
}
.hero-copy h1 {
  max-width: 900px; margin: 0;
  font-family: "Young Serif", Georgia, serif;
  font-size: clamp(52px, 7.4vw, 110px);
  line-height: .94; letter-spacing: -.045em; font-weight: 400;
}
.hero-copy p { max-width: 560px; margin: 28px 0 0; font-size: clamp(16px, 1.7vw, 20px); line-height: 1.55; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.cta { min-height: 48px; padding: 0 22px; border: 1px solid #11110d; background: #11110d; color: #fff; font-weight: 800; letter-spacing: .03em; text-decoration: none; display: inline-grid; place-items: center; transition: transform .15s ease, background .15s ease; }
.cta:hover { transform: translateY(-1px); }
.cta.alt { background: transparent; color: #11110d; }

.ticker { display: flex; justify-content: center; flex-wrap: wrap; gap: 9px 26px; padding: 18px 20px; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 800; }
.ticker span::before { content: "✦"; margin-right: 9px; color: var(--accent); }

/* ---------- product grid ---------- */
.product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(14px, 2.2vw, 30px); }
.product { min-width: 0; text-decoration: none; }
.product-image { position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: var(--soft); border: 1px solid var(--line); }
.product-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.product:hover .product-image img { transform: scale(1.03); }
.product-image .no-photo { width: 100%; height: 100%; display: grid; place-items: center; color: var(--muted); font-family: "Young Serif", Georgia, serif; font-size: 20px; padding: 20px; text-align: center; }
.sold-tag { position: absolute; left: 10px; top: 10px; padding: 7px 10px; background: var(--ink); color: var(--paper); font-size: 11px; font-weight: 800; letter-spacing: .06em; }
.product-info { padding: 12px 2px 0; }
.product-title { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.product-title h3 { margin: 0; font-size: 14px; line-height: 1.4; font-weight: 600; }
.product:hover .product-title h3 { text-decoration: underline; text-underline-offset: 3px; }
.product-title strong { white-space: nowrap; font-size: 15px; font-variant-numeric: tabular-nums; }
.product-meta { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; color: var(--muted); font-size: 12px; }

.empty { padding: 70px 20px; text-align: center; border: 1px solid var(--line); background: var(--surface); }
.empty h3 { margin: 0 0 10px; font-family: "Young Serif", Georgia, serif; font-size: 30px; font-weight: 400; }
.empty p { margin: 0 0 22px; color: var(--muted); line-height: 1.6; }

/* ---------- shop / filters ---------- */
.shop-layout { display: grid; grid-template-columns: 230px 1fr; gap: 44px; padding: 58px 0 90px; }
.shop-head { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: end; gap: 20px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.shop-head h1 { margin: 0; font-family: "Young Serif", Georgia, serif; font-weight: 400; letter-spacing: -.025em; font-size: clamp(42px, 6vw, 76px); }
.shop-count { color: var(--muted); font-size: 13px; }
.filters { align-self: start; position: sticky; top: 96px; }
.filter-group { padding: 21px 0; border-bottom: 1px solid var(--line); }
.filter-group:first-child { padding-top: 0; }
.filter-group > label { display: block; margin-bottom: 10px; font-weight: 800; font-size: 13px; }
.filter-group select, .filter-group input[type="text"], .filter-group input[type="number"] {
  width: 100%; height: 42px; padding: 0 10px; border: 1px solid var(--line); background: var(--surface);
}
.price-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { padding: 8px 10px; border: 1px solid var(--line); font-size: 12px; background: var(--surface); }
.chip.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.clear-btn { border: 0; background: transparent; text-decoration: underline; text-underline-offset: 3px; font-size: 12px; font-weight: 700; color: var(--muted); padding: 6px 0; }

/* ---------- forms ---------- */
.sell-page { padding: 64px 0 100px; }
.sell-intro { padding-bottom: 40px; border-bottom: 1px solid var(--line); }
.sell-intro h1, .page-title { margin: 0; font-family: "Young Serif", Georgia, serif; font-weight: 400; letter-spacing: -.025em; font-size: clamp(44px, 7vw, 84px); line-height: .98; }
.sell-intro p { margin: 16px 0 0; font-size: 17px; line-height: 1.65; color: var(--muted); max-width: 640px; }
.sell-workbench { display: grid; grid-template-columns: 1fr .8fr; gap: clamp(34px, 6vw, 90px); padding-top: 54px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: grid; gap: 8px; align-content: start; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12px; font-weight: 800; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); background: var(--surface); padding: 12px; outline: 0; }
.field input, .field select { height: 46px; }
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
/* keep browser autofill (saved passwords etc.) on-theme instead of its default paint */
.field input:-webkit-autofill,
.field input:-webkit-autofill:hover,
.field input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--surface) inset;
  -webkit-text-fill-color: var(--ink);
  caret-color: var(--ink);
}
.field .error { color: var(--accent); font-size: 12px; font-weight: 700; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.5; }
.workbench-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.primary-btn {
  min-height: 48px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper);
  padding: 0 22px; font-weight: 800; letter-spacing: .03em;
  transition: background .15s ease, transform .15s ease;
}
.primary-btn:hover:not(:disabled) { background: #262622; transform: translateY(-1px); }
.primary-btn:disabled { opacity: .5; cursor: wait; }
.primary-btn:active:not(:disabled) { transform: translateY(0); }
.ghost-btn { min-height: 48px; padding: 0 20px; border: 1px solid var(--line); background: transparent; font-weight: 700; transition: border-color .15s ease, background .15s ease; }
.ghost-btn:hover { border-color: var(--ink); background: var(--surface); }
.danger-btn { min-height: 44px; padding: 0 16px; border: 1px solid var(--accent); background: transparent; color: var(--accent); font-weight: 800; transition: background .15s ease, color .15s ease; }
.danger-btn:hover { background: var(--accent); color: #fff; }

/* image uploader */
.uploader { border: 1px dashed var(--line); background: var(--surface); padding: 18px; }
.uploader input[type="file"] { display: block; margin-top: 10px; }
.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.thumb { position: relative; aspect-ratio: 1/1; overflow: hidden; background: var(--soft); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; right: 6px; top: 6px; width: 30px; height: 30px; border: 0; border-radius: 50%; background: rgba(16,16,16,.8); color: #fff; font-size: 15px; line-height: 1; }
.thumb .cover-badge { position: absolute; left: 6px; bottom: 6px; padding: 4px 7px; background: var(--ink); color: var(--paper); font-size: 10px; font-weight: 800; }

.preview-card { align-self: start; position: sticky; top: 98px; padding: 22px; background: var(--surface); border: 1px solid var(--line); }
.preview-label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; font-size: 12px; font-weight: 800; }
.preview-art { aspect-ratio: 1/1; display: grid; place-items: center; background: var(--soft); overflow: hidden; }
.preview-art img { width: 100%; height: 100%; object-fit: cover; }
.preview-art .placeholder { color: var(--muted); font-family: "Young Serif", Georgia, serif; font-size: 22px; padding: 30px; text-align: center; }
.preview-details { padding-top: 15px; }
.preview-details h3 { margin: 0 0 7px; font-size: 18px; }
.preview-price { font-size: 21px; font-weight: 800; }
.preview-meta { margin-top: 11px; color: var(--muted); font-size: 13px; line-height: 1.6; }

/* ---------- listing detail ---------- */
.detail-layout { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(30px, 5vw, 70px); padding: 56px 0 90px; }
.gallery { display: grid; gap: 12px; align-content: start; }
.gallery-main { aspect-ratio: 1/1; background: var(--soft); overflow: hidden; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.gallery-thumbs button { aspect-ratio: 1/1; padding: 0; border: 1px solid var(--line); background: var(--soft); overflow: hidden; }
.gallery-thumbs button[aria-current="true"] { outline: 2px solid var(--ink); outline-offset: 1px; }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.detail-copy .price { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.detail-copy h1 { margin: 10px 0 8px; font-family: "Young Serif", Georgia, serif; font-size: clamp(30px, 4vw, 44px); font-weight: 400; letter-spacing: -.02em; }
.detail-meta { color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.detail-desc { padding: 22px 0; border-block: 1px solid var(--line); line-height: 1.65; white-space: pre-wrap; }
.seller-row { display: flex; align-items: center; gap: 12px; margin-top: 22px; text-decoration: none; }
.avatar { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: var(--paper); font-weight: 800; flex: none; }
.seller-row strong, .seller-row span { display: block; }
.seller-row span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.detail-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 28px; }
.buy-btn { min-height: 52px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); font-weight: 800; font-size: 15px; letter-spacing: .03em; transition: background .15s ease, transform .15s ease; }
.buy-btn:hover { background: #262622; transform: translateY(-1px); }
.owner-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }

/* ---------- account ---------- */
.account-page { padding: 64px 0 100px; }
.account-head { padding-bottom: 36px; border-bottom: 1px solid var(--line); margin-bottom: 36px; }
.account-head h1 { margin: 0 0 8px; font-family: "Young Serif", Georgia, serif; font-weight: 400; font-size: clamp(40px, 6vw, 68px); letter-spacing: -.025em; }
.account-head p { margin: 0; color: var(--muted); }
.my-listings { display: grid; gap: 14px; }
.my-listing { display: grid; grid-template-columns: 96px 1fr auto; gap: 18px; align-items: center; padding: 14px; background: var(--surface); border: 1px solid var(--line); }
.my-listing img { width: 96px; height: 96px; object-fit: cover; background: var(--soft); }
.my-listing h3 { margin: 0 0 6px; font-size: 16px; }
.my-listing .meta { color: var(--muted); font-size: 12px; }
.my-listing .row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.status-pill { display: inline-block; padding: 5px 9px; font-size: 11px; font-weight: 800; letter-spacing: .04em; border: 1px solid var(--line); }
.status-pill.sold { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- floating action button ---------- */
.fab {
  position: fixed; z-index: 50;
  right: 28px; bottom: 28px;
  width: 62px; height: 62px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ink); color: var(--paper);
  font-size: 32px; font-weight: 300; line-height: 1;
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(20, 20, 16, .28);
  transition: transform .15s ease, background .15s ease;
}
.fab:hover { transform: scale(1.07); background: var(--accent); color: #fff; }
.fab span { transform: translateY(-2px); }

/* ---------- settings ---------- */
.settings-card {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: clamp(24px, 4vw, 44px);
  margin-bottom: 8px;
}
.settings-card h2 {
  margin: 0 0 6px;
  font-family: "Young Serif", Georgia, serif; font-weight: 400;
  font-size: clamp(26px, 3vw, 34px); letter-spacing: -.02em;
}
.settings-card h3 {
  margin: 0 0 16px;
  font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
}
.settings-card .sub { margin: 0 0 24px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.settings-divider { border-top: 1px solid var(--line); margin: 34px 0; }
.field input:disabled { background: var(--soft); color: var(--muted); cursor: not-allowed; }

/* ---------- modal / toast ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 80; display: none; background: rgba(0,0,0,.64); padding: 22px; }
.modal-backdrop.open { display: grid; place-items: center; }
.modal { position: relative; width: min(560px, 100%); max-height: min(760px, 92dvh); overflow: auto; background: var(--surface); box-shadow: var(--shadow); padding: clamp(28px, 5vw, 48px); }
.modal h2 { margin: 0 0 6px; font-family: "Young Serif", Georgia, serif; font-weight: 400; font-size: 34px; letter-spacing: -.02em; }
.modal .sub { margin: 0 0 24px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.modal .field { margin-bottom: 16px; }
.modal-close { position: absolute; right: 12px; top: 12px; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); }
.form-error { color: var(--accent); font-size: 13px; font-weight: 700; margin: 0 0 16px; }
.soon-box { text-align: center; padding: 10px 0; }
.soon-box .big { font-family: "Young Serif", Georgia, serif; font-size: 52px; }

.toast { position: fixed; z-index: 100; left: 50%; bottom: 84px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 12px 16px; background: var(--ink); color: var(--paper); font-size: 13px; font-weight: 700; transition: .2s ease; max-width: calc(100vw - 40px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

footer { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 28px max(20px, calc((100% - 1280px)/2)); border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
footer span:first-child { color: var(--ink); font-weight: 800; }

.bottom-nav { display: none; }
.loading { padding: 80px 20px; text-align: center; color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .topbar { grid-template-columns: auto 1fr auto; gap: 12px; padding-inline: 18px; }
  .desktop-nav { display: none; }
  .brand { font-size: 22px; }
  .top-actions .sell-btn { display: none; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 36px; }
  .shop-layout { grid-template-columns: 1fr; gap: 28px; }
  .filters { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
  .sell-workbench { grid-template-columns: 1fr; }
  .preview-card { position: static; }
  .detail-layout { grid-template-columns: 1fr; }
  .account-page, .sell-page { padding-top: 44px; }
}
@media (max-width: 640px) {
  body { padding-bottom: 67px; }
  .hello { display: none; }
  .fab { right: 18px; bottom: 86px; }
  .search button { display: none; }
  .wrap { width: min(100% - 28px, 1280px); }
  .hero-copy { padding: 64px 24px; }
  .hero-copy h1 { font-size: clamp(52px, 15vw, 76px); }
  .section { padding: 54px 0; }
  .form-grid { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr; }
  .my-listing { grid-template-columns: 72px 1fr; }
  .my-listing .row-actions { grid-column: 1 / -1; }
  .my-listing img { width: 72px; height: 72px; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal { width: 100%; max-height: 92dvh; }
  .detail-actions { grid-template-columns: 1fr; }
  .bottom-nav {
    position: fixed; z-index: 60; inset: auto 0 0 0;
    display: grid; grid-template-columns: repeat(4, 1fr);
    padding: 7px 8px max(7px, env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .96);
    border-top: 1px solid var(--line); backdrop-filter: blur(12px);
  }
  .bottom-nav a { min-height: 51px; display: grid; place-items: center; align-content: center; gap: 3px; color: var(--muted); font-size: 10px; text-decoration: none; }
  .bottom-nav a[aria-current="page"] { color: var(--accent); font-weight: 800; }
  .bottom-nav svg { width: 20px; height: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .001ms !important; animation-duration: .001ms !important; }
}
