:root {
  --bg: #e9e8e6;
  --surface: #ffffff;
  --ink: #141414;
  --ink-2: #2b2b2b;
  --muted: #6f6f6f;
  --line: #e3e1de;
  --accent: #141414;
  --accent-soft: #f0efed;
  --gold: #f59e0b;
  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 1px 2px rgb(20 20 20 / 0.04), 0 16px 40px -20px rgb(20 20 20 / 0.18);
  --shadow-lg: 0 24px 56px -20px rgb(20 20 20 / 0.3);
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.55; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: var(--ink); text-decoration: none; }
a:hover { text-decoration: underline; }
main { max-width: 1200px; margin: 0 auto; padding: 20px 20px 64px; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -0.03em; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 24px;
  background: rgb(233 232 230 / 0.85);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid rgb(20 20 20 / 0.06);
}
.brand { font-weight: 800; font-size: 1.25rem; letter-spacing: -0.04em; color: var(--ink); }
.brand:hover { text-decoration: none; }
.tagline { color: var(--muted); font-size: 0.78rem; }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: 18px; font-size: 0.92rem; font-weight: 500; }
.inline-form { display: inline; margin: 0; }
.link-btn { background: none; border: none; padding: 0; color: var(--ink); font: inherit; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.nav-cta {
  background: var(--ink); color: #fff !important; padding: 9px 20px; border-radius: 999px; font-weight: 600;
}
.nav-cta:hover { background: #000; text-decoration: none; }

/* ---------- buttons / forms ---------- */
.btn, button {
  display: inline-block; background: var(--ink); color: #fff; border: none;
  padding: 13px 24px; border-radius: 999px; font-size: 0.98rem; font-weight: 600;
  cursor: pointer; transition: background 0.15s, transform 0.1s;
}
.btn:hover, button:hover { background: #000; text-decoration: none; }
.btn:active, button:active { transform: translateY(1px); }
.form label { display: block; margin-bottom: 14px; font-weight: 600; font-size: 0.9rem; }
.form input, .form textarea {
  display: block; width: 100%; margin-top: 4px; font-size: 1rem;
  padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface);
}
.form input:focus, .form textarea:focus { outline: none; border-color: var(--ink); }
.errorlist { list-style: none; margin: 0 0 6px; padding: 0; color: #991b1b; font-weight: 500; font-size: 0.85rem; }
.errorlist li { margin-bottom: 2px; }
.form input[aria-invalid="true"], .form textarea[aria-invalid="true"] { border-color: #dc2626; }
.helptext { display: block; margin-top: 4px; color: var(--muted); font-size: 0.8rem; font-weight: 400; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; text-align: center;
  border-radius: 28px; padding: 72px 24px 40px;
  background: linear-gradient(180deg, #f4f3f1 0%, #ebeae7 100%);
  box-shadow: var(--shadow);
}
.hero h1 { font-size: 2.8rem; font-weight: 800; margin: 0 0 14px; }
.hero .sub { color: var(--muted); font-size: 1.08rem; margin: 0 auto 30px; max-width: 520px; }
.hero-pill {
  display: inline-block; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line);
  font-size: 0.8rem; font-weight: 600; padding: 7px 16px; border-radius: 999px;
  margin: 0 0 18px;
}

/* ---------- search card ---------- */
.search-card {
  background: var(--surface); border-radius: 22px;
  box-shadow: var(--shadow-lg);
  padding: 10px 18px 18px; max-width: 720px; margin: 0 auto;
  text-align: left;
}
.search-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab-btn {
  background: none; color: var(--muted); border-radius: 0; padding: 12px 16px;
  font-size: 0.92rem; font-weight: 600; border-bottom: 2px solid transparent;
}
.tab-btn:hover { background: none; color: var(--ink); }
.tab-btn.active { color: var(--ink); border-bottom-color: var(--ink); }
.paste-form { display: flex; flex-direction: column; gap: 10px; }
.paste-form input {
  padding: 15px 16px; font-size: 1.05rem; border: 1.5px solid var(--line);
  border-radius: 999px; width: 100%;
}
.paste-form input:focus { outline: none; border-color: var(--ink); }
.photo-drop {
  border: 2px dashed var(--line); border-radius: var(--radius-sm); padding: 28px;
  text-align: center; color: var(--muted); cursor: pointer;
}
.photo-drop:hover { border-color: var(--ink); color: var(--ink); }
.photo-drop input { display: none; }
.spinner { color: var(--muted); text-align: center; padding: 14px; }
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: block; }
.htmx-request.htmx-indicator { display: block; }

/* ---------- chips & trust ---------- */
.chips { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; }
.chips-label { color: var(--muted); font-size: 0.85rem; }
.chip {
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  padding: 9px 18px; border-radius: 999px; font-size: 0.88rem; font-weight: 500;
}
.chip:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.trust-bar { margin: 30px auto 0; display: flex; flex-wrap: wrap; gap: 18px 28px; justify-content: center; }
.trust-item {
  font-size: 0.88rem; font-weight: 600; color: var(--ink-2);
  display: flex; gap: 8px; align-items: center;
}
.trust-item span { font-size: 1.05rem; }

/* ---------- product cards ---------- */
.cards { display: grid; grid-template-columns: 1fr; gap: 20px; margin-top: 18px; }
.card {
  background: var(--surface); border: none; border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
.cards .card {
  padding: 0; overflow: hidden; display: flex; flex-direction: column; position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}
.cards .card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card-media { position: relative; overflow: hidden; aspect-ratio: 1; background: #f0efed; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s ease; display: block; }
.cards .card:hover .card-media img { transform: scale(1.05); }
.price-pill {
  position: absolute; left: 12px; bottom: 12px;
  background: var(--surface); color: var(--ink);
  font-weight: 700; font-size: 0.95rem; padding: 7px 14px; border-radius: 999px;
  box-shadow: 0 4px 14px rgb(20 20 20 / 0.18);
}
.card .badge {
  position: absolute; z-index: 2; margin: 12px; background: var(--surface); color: var(--ink);
  font-size: 0.72rem; font-weight: 700; padding: 6px 12px; border-radius: 999px;
  box-shadow: 0 4px 14px rgb(20 20 20 / 0.15);
}
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-body h3 { margin: 0; font-size: 0.98rem; font-weight: 600; }
.price { color: var(--ink); font-weight: 800; font-size: 1.15rem; margin: 0; }
.card .btn { margin-top: auto; text-align: center; }
.variant-label { display: block; margin: 8px 0; font-size: 0.85rem; color: var(--muted); }
.variant-label select { width: 100%; margin-top: 4px; padding: 10px; border-radius: 10px; border: 1px solid var(--line); font-size: 0.95rem; background: var(--surface); }

/* ---------- sections ---------- */
.results h2, .trending h2 { margin-top: 44px; }
.section-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-top: 44px; }
.section-head h2 { margin: 0; font-size: 1.5rem; }
.empty { background: #fdf6e3; border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.alert-error { background: #fef2f2; color: #991b1b; padding: 12px 16px; border-radius: var(--radius-sm); margin-top: 16px; }
.alert-info { background: #eff6ff; color: #1e40af; padding: 12px 16px; border-radius: var(--radius-sm); }
.alert-success { background: #ecfdf5; color: #065f46; padding: 12px 16px; border-radius: var(--radius-sm); }

/* ---------- checkout / orders ---------- */
.checkout .card, .status .card { margin-bottom: 18px; }
.checkout .order-summary { display: flex; gap: 14px; align-items: center; }
.checkout .order-summary img, .status .card img { width: 96px; height: 96px; flex: none; border-radius: var(--radius-sm); object-fit: cover; }
.shipping-option { display: flex; gap: 10px; align-items: center; padding: 11px 4px; border-bottom: 1px solid var(--line); font-weight: 400; cursor: pointer; }
.shipping-option:last-of-type { border-bottom: none; }
.shipping-option input { flex: none; width: auto; margin: 0; }
.shipping-option span { flex: 1; }
.shipping-option strong { white-space: nowrap; }
.instructions ul { padding-left: 18px; }
.order-list { list-style: none; padding: 0; display: grid; gap: 12px; }

/* ---------- inner pages ---------- */
.auth { max-width: 480px; margin: 0 auto; }
.auth h1, .payment h1, .status h1, .checkout h1 { font-size: 1.7rem; margin: 12px 0 18px; }
.auth .card { padding: 22px; margin-bottom: 20px; }
.auth h3 { margin-top: 0; }
.checkout-grid { display: grid; grid-template-columns: 1fr; gap: 20px; align-items: start; }
.checkout-side { position: sticky; top: 84px; }
.checkout-side .price-line { display: flex; justify-content: space-between; padding: 6px 0; font-size: 0.95rem; }
.checkout-side .price-line.total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; font-weight: 800; font-size: 1.1rem; }
.status-pill {
  display: inline-block; background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
  font-weight: 700; font-size: 0.85rem; padding: 7px 16px; border-radius: 999px; margin-bottom: 14px;
}
.timeline { list-style: none; padding: 0 0 0 22px; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px;
  background: var(--line); border-radius: 2px;
}
.timeline li { position: relative; padding: 8px 0 8px 14px; margin: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -21px; top: 14px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--surface); border: 3px solid var(--ink);
}
.timeline li:first-child::before { background: var(--ink); }
.timeline .muted { font-size: 0.82rem; }
  .tagline { display: none; }
.instructions { border-left: 4px solid var(--ink); padding: 20px 22px; }
.instructions h2 { margin-top: 0; font-size: 1.15rem; }
.instructions ul { padding-left: 18px; margin-bottom: 0; }
.instructions li { margin-bottom: 8px; }
.payment .btn { width: 100%; text-align: center; margin-top: 18px; padding: 16px; font-size: 1.05rem; }

/* ---------- footer ---------- */
.site-footer {
  margin-top: 48px; padding: 44px 24px 26px; text-align: left;
  background: var(--surface); color: var(--muted);
  border-radius: 28px 28px 0 0; box-shadow: var(--shadow);
}
.footer-grid { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 1fr; gap: 26px; }
.footer-grid a { display: block; color: var(--muted); margin-bottom: 8px; font-size: 0.9rem; }
.footer-grid a:hover { color: var(--ink); text-decoration: none; }
.footer-brand { font-weight: 800; font-size: 1.2rem; color: var(--ink); margin: 0 0 6px; letter-spacing: -0.03em; }
.footer-head { font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink); margin: 0 0 10px; }
.footer-fine { max-width: 1200px; margin: 30px auto 0; padding-top: 18px; border-top: 1px solid var(--line); text-align: center; font-size: 0.82rem; }

@media (min-width: 720px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .paste-form { flex-direction: row; }
  .paste-form input { flex: 1; }
  .paste-form button { width: auto; }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1.2fr; }
}
@media (min-width: 900px) {
  .checkout-grid { grid-template-columns: 1.5fr 1fr; }
}
@media (min-width: 1024px) {
  .cards { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 719px) {
  .tagline { display: none; }
  .hero h1 { font-size: 2.1rem; }
}

/* ---------- premium polish ---------- */
::selection { background: var(--ink); color: #fff; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.announce {
  background: var(--ink); color: rgb(255 255 255 / 0.85);
  text-align: center; font-size: 0.78rem; font-weight: 500;
  padding: 8px 16px; letter-spacing: 0.02em;
}

/* bento hero */
.hero-grid { display: grid; grid-template-columns: 1fr; gap: 24px; text-align: left; align-items: center; }
.hero-main { text-align: center; }
.hero-main .search-card, .hero-main .chips, .hero-main .trust-bar { text-align: center; }
.hero h1 em { font-style: italic; letter-spacing: -0.04em; }
.hero-side { display: none; }

@media (min-width: 1024px) {
  .hero-grid { grid-template-columns: 1.6fr 1fr; }
  .hero-main { text-align: left; }
  .hero-main .chips, .hero-main .trust-bar { justify-content: flex-start; }
  .hero-main .search-card { margin: 0; }
  .hero-side { display: block; }
}
.hero-side-label {
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted); margin: 0 0 10px;
}
.hero-feature {
  position: relative; display: block; border-radius: var(--radius); overflow: hidden;
  background: var(--surface); box-shadow: var(--shadow-lg);
}
.hero-feature:hover { text-decoration: none; }
.hero-feature img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; transition: transform 0.4s ease; }
.hero-feature:hover img { transform: scale(1.04); }
.hero-feature-info {
  position: absolute; left: 14px; bottom: 14px; right: 70px;
  display: flex; flex-direction: column; gap: 2px;
  background: rgb(255 255 255 / 0.92); backdrop-filter: blur(8px);
  padding: 12px 16px; border-radius: 14px; font-size: 0.9rem;
}
.hero-feature-price { font-weight: 800; }
.hero-feature-cta {
  position: absolute; right: 14px; bottom: 14px; width: 46px; height: 46px;
  background: var(--ink); color: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
  transition: transform 0.2s;
}
.hero-feature:hover .hero-feature-cta { transform: translateX(4px); }

/* sliding arrow buttons */
.btn-arrow::after { content: "→"; display: inline-block; margin-left: 8px; transition: transform 0.15s; }
.btn-arrow:hover::after { transform: translateX(4px); }

/* skeleton shimmer */
.skeleton-row { margin-top: 24px; }
.skeleton-card { padding: 0; overflow: hidden; }
.skeleton-media { aspect-ratio: 1; background: linear-gradient(100deg, #ecebe9 40%, #f6f5f3 50%, #ecebe9 60%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.skeleton-lines { padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.skeleton-lines span { height: 12px; border-radius: 6px; background: linear-gradient(100deg, #ecebe9 40%, #f6f5f3 50%, #ecebe9 60%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.skeleton-lines span:nth-child(2) { width: 60%; }
.skeleton-lines span:nth-child(3) { width: 40%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* staggered card entrance */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.cards .card { animation: fadeUp 0.45s cubic-bezier(0.2, 0.6, 0.3, 1) both; }
.cards .card:nth-child(2) { animation-delay: 0.05s; }
.cards .card:nth-child(3) { animation-delay: 0.1s; }
.cards .card:nth-child(4) { animation-delay: 0.15s; }
.cards .card:nth-child(5) { animation-delay: 0.2s; }
.cards .card:nth-child(6) { animation-delay: 0.25s; }
.cards .card:nth-child(7) { animation-delay: 0.3s; }
.cards .card:nth-child(8) { animation-delay: 0.35s; }
@media (prefers-reduced-motion: reduce) {
  .cards .card, .skeleton-media, .skeleton-lines span { animation: none; }
  .hero-feature img, .card-media img { transition: none; }
}

/* mobile snap-scroll rows */
@media (max-width: 719px) {
  .trending .cards {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
    gap: 14px; padding-bottom: 8px; margin-left: -20px; margin-right: -20px; padding-left: 20px; padding-right: 20px;
  }
  .trending .cards .card { flex: 0 0 74%; scroll-snap-align: start; }
  .trending .cards::-webkit-scrollbar { display: none; }
}

/* ---------- brand & alignment system ---------- */
.brand { display: flex; align-items: center; gap: 9px; }
.brand-mark { border-radius: 8px; flex: none; }

/* consistent page scaffold for inner pages */
.page { max-width: 720px; margin: 0 auto; }
.page.wide { max-width: 1080px; }
.page-head { margin: 8px 0 22px; }
.page-head h1 { font-size: 1.7rem; margin: 0 0 6px; }
.page-head .muted { margin: 0; }
.page .card { padding: 22px; margin-bottom: 18px; }
.page .card h3 { margin-top: 0; }

.btn-block { width: 100%; text-align: center; }

/* results section head */
.results-head { display: flex; align-items: center; gap: 12px; margin: 44px 0 4px; flex-wrap: wrap; }
.results-head h2 { margin: 0; font-size: 1.5rem; }
.count-pill {
  background: var(--surface); box-shadow: var(--shadow);
  font-weight: 700; font-size: 0.82rem; padding: 5px 13px; border-radius: 999px;
}

/* trust grid: always balanced */
.trust-bar { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 20px; margin-top: 28px; }
@media (min-width: 720px) {
  .trust-bar { grid-template-columns: repeat(4, 1fr); }
}
