:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --ink: #16202b;
  --muted: #5b6878;
  --line: #dde3ea;
  --brand: #1f3a5f;
  --brand-ink: #ffffff;
  --accent: #d97706;
  --input: #fffbe6;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(22, 32, 43, 0.06), 0 8px 24px rgba(22, 32, 43, 0.06);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1419; --surface: #171e26; --ink: #e8edf2; --muted: #9aa7b5; --line: #273240;
    --brand: #8fb3e0; --brand-ink: #0f1419; --accent: #f3a33a; --input: #2a2a1f;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  }
}
:root[data-theme="dark"] {
  --bg: #0f1419; --surface: #171e26; --ink: #e8edf2; --muted: #9aa7b5; --line: #273240;
  --brand: #8fb3e0; --brand-ink: #0f1419; --accent: #f3a33a; --input: #2a2a1f;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--brand); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
header.top { border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 5; }
header.top .wrap { display: flex; align-items: center; gap: 16px; height: 60px; }
.brand { font-weight: 700; letter-spacing: -0.01em; text-decoration: none; color: var(--ink); font-size: 18px; }
.brand span { color: var(--brand); }
nav.main { margin-left: auto; display: flex; gap: 18px; font-size: 14px; }
nav.main a { color: var(--muted); text-decoration: none; white-space: nowrap; }
.brand { white-space: nowrap; }
nav.main a:hover { color: var(--ink); }
.hero { padding: 40px 0 20px; }
.hero h1 { font-size: clamp(26px, 4vw, 38px); line-height: 1.15; margin: 0 0 8px; letter-spacing: -0.02em; }
.hero p { color: var(--muted); margin: 0 0 20px; max-width: 60ch; }
.search { display: flex; gap: 8px; }
.search input { flex: 1; font: inherit; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); }
.search input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; }
.chip { font: inherit; font-size: 13px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.count { color: var(--muted); font-size: 14px; margin: 10px 0 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; padding-bottom: 48px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: inherit; box-shadow: var(--shadow); transition: transform .12s ease; }
.card:hover { transform: translateY(-2px); }
.card img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--bg); border-bottom: 1px solid var(--line); }
.card .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card h3 { margin: 0; font-size: 16px; line-height: 1.3; }
.card .job { color: var(--muted); font-size: 14px; flex: 1; }
.card .meta { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 14px; }
.card .meta .buyer { color: var(--muted); }
.price { font-weight: 700; }
.empty { padding: 40px 0; color: var(--muted); }
/* product page */
.product { display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; padding: 28px 0 56px; }
.product img { width: 100%; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.product h1 { margin: 0 0 6px; font-size: clamp(24px, 3vw, 32px); letter-spacing: -0.02em; }
.product .lead { color: var(--muted); margin: 0 0 16px; }
.buy { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.buy .price { font-size: 28px; }
.buy small { color: var(--muted); display: block; margin: 4px 0 12px; }
.btn { display: inline-block; font: inherit; font-weight: 600; padding: 12px 18px; border-radius: var(--radius); border: 0; cursor: pointer; background: var(--brand); color: var(--brand-ink); text-decoration: none; width: 100%; text-align: center; }
.btn.secondary { background: transparent; color: var(--brand); border: 1px solid var(--brand); margin-top: 8px; }
.btn[disabled] { opacity: .6; cursor: wait; }
.inside { margin-top: 20px; }
.inside h2, .upsell h2 { font-size: 18px; margin: 0 0 8px; }
.inside ul { margin: 0; padding-left: 18px; color: var(--muted); }
.upsell { margin-top: 20px; padding: 14px 16px; border: 1px dashed var(--accent); border-radius: var(--radius); }
.upsell p { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.breadcrumb { font-size: 14px; color: var(--muted); padding-top: 18px; }
.breadcrumb a { text-decoration: none; }
.notice { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 28px 0; }
.downloads a { display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); margin: 8px 0; text-decoration: none; background: var(--surface); }
footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; padding: 20px 0 40px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; }
@media (max-width: 760px) {
  .product { grid-template-columns: 1fr; }
  .product aside { order: -1; }
  /* buyer chips become one swipeable row so the results stay near the top on a phone */
  .chips { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: 0 0 auto; }
  nav.main { gap: 12px; font-size: 13px; }
}
