:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --accent: #4f46e5;
  --accent-ink: #4338ca;
  --accent-soft: #eef2ff;
  --success: #15803d;
  --danger: #b91c1c;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 8px 24px -12px rgba(15, 23, 42, .15);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1020; --surface: #131a2e; --ink: #e5e9f5; --muted: #94a3b8; --line: #243049;
    --accent: #818cf8; --accent-ink: #a5b4fc; --accent-soft: #1e2140;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.55; font-size: 16px; }
img { max-width: 100%; display: block; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 3.5vw, 2.6rem); font-weight: 800; }
h2 { font-size: clamp(1.3rem, 2.4vw, 1.7rem); font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 600; }
p { margin: 0 0 1em; }
.container { width: min(1200px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.tiny { font-size: .78rem; }
.accent { color: var(--accent); }
.link { font-weight: 600; white-space: nowrap; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 60ch; }
.lead.small { font-size: 1rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; font-weight: 700; color: var(--accent); margin-bottom: .8rem; }

/* header */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 1.2rem; min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.25rem; color: var(--ink); letter-spacing: -.02em; }
.logo:hover { text-decoration: none; }
.search { flex: 1; display: flex; max-width: 460px; margin-left: auto; }
.search input, .hero-search input, .form input, .form textarea, .sort select {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .55rem .8rem; width: 100%;
}
.search input:focus, .hero-search input:focus, .form input:focus, .form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.search { position: relative; }
.search button { position: absolute; right: 4px; top: 4px; bottom: 4px; width: 36px; border: 0; background: transparent; color: var(--muted); cursor: pointer; border-radius: 8px; }
.search button:hover { background: var(--accent-soft); color: var(--accent); }
.nav { display: flex; gap: .2rem; }
.nav a { padding: .45rem .7rem; border-radius: 8px; color: var(--ink); font-weight: 500; font-size: .95rem; }
.nav a:hover, .nav a.active { background: var(--accent-soft); color: var(--accent-ink); text-decoration: none; }
.menu-toggle { display: none; width: 40px; height: 40px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; cursor: pointer; flex-direction: column; justify-content: center; gap: 4px; align-items: center; }
.menu-toggle span { width: 18px; height: 2px; background: var(--ink); border-radius: 2px; }

/* hero */
.hero { padding: clamp(2.5rem, 7vw, 5.5rem) 0 2rem; background: radial-gradient(1200px 400px at 50% -10%, var(--accent-soft), transparent); text-align: center; }
.hero h1 { max-width: 20ch; margin-inline: auto; font-size: clamp(2rem, 5vw, 3.4rem); }
.hero .lead { margin: 1rem auto 1.6rem; }
.hero-search { display: flex; gap: .5rem; max-width: 620px; margin: 0 auto 1.2rem; }
.hero-search input { padding: .85rem 1rem; font-size: 1.05rem; box-shadow: var(--shadow); }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }
.chip { display: inline-flex; gap: .4rem; align-items: center; padding: .35rem .8rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); font-size: .9rem; font-weight: 500; }
.chip span { color: var(--muted); font-weight: 400; }
.chip:hover { border-color: var(--accent); color: var(--accent-ink); text-decoration: none; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-top: 1rem; }
.stats div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; display: flex; flex-direction: column; }
.stats strong { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.stats span { color: var(--muted); font-size: .9rem; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .7rem 1.2rem; border-radius: 10px; font-weight: 600; border: 1px solid transparent; cursor: pointer; font: inherit; font-weight: 600; transition: transform .08s, box-shadow .15s; white-space: nowrap; }
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 16px -8px var(--accent); }
.btn-primary:hover { background: var(--accent-ink); color: #fff; }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-ink); }
.btn-block { width: 100%; }

/* sections & grid */
.section { padding: 2.5rem 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.2rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s; }
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-media { position: relative; aspect-ratio: 590 / 300; background: var(--accent-soft); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-placeholder { width: 100%; height: 100%; background: linear-gradient(135deg, var(--accent-soft), var(--line)); }
.card-placeholder.tall { aspect-ratio: 590/300; border-radius: var(--radius); }
.badge { position: absolute; top: .6rem; left: .6rem; font-size: .72rem; font-weight: 700; padding: .25rem .55rem; border-radius: 999px; background: var(--ink); color: var(--bg); letter-spacing: .02em; }
.badge-rank { background: #f59e0b; color: #1c1917; }
.card-body { padding: .9rem 1rem 1rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.card-top { display: flex; justify-content: space-between; align-items: center; }
.cat { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.price { font-weight: 700; }
.card h3 a { color: var(--ink); }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; }
.card-meta { margin-top: auto; padding-top: .5rem; display: flex; flex-wrap: wrap; gap: .8rem; font-size: .82rem; color: var(--ink); align-items: center; }
.card-meta span { display: inline-flex; align-items: center; gap: .3rem; }
.card-meta svg { color: var(--muted); }

/* why */
.why { display: grid; grid-template-columns: 1.2fr 1fr; gap: 2rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.checks li { padding-left: 1.7rem; position: relative; }
.checks li::before { content: "✓"; position: absolute; left: 0; color: var(--success); font-weight: 800; }

/* listing */
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 1rem; }
.crumbs a { color: var(--muted); }
.listing { display: grid; grid-template-columns: 240px 1fr; gap: 2rem; align-items: start; }
.filters { position: sticky; top: 80px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.filters h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .6rem; }
.filter { display: flex; justify-content: space-between; padding: .45rem .6rem; border-radius: 8px; color: var(--ink); font-size: .93rem; }
.filter span { color: var(--muted); font-size: .8rem; }
.filter.sub { padding-left: 1.4rem; font-size: .88rem; }
.filter:hover, .filter.active { background: var(--accent-soft); color: var(--accent-ink); text-decoration: none; }
.results-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.2rem; }
.results-head h1 { font-size: 1.6rem; margin-bottom: .1rem; }
.sort label { display: inline-flex; align-items: center; gap: .5rem; font-size: .9rem; color: var(--muted); }
.sort select { width: auto; padding-right: 2rem; }
.pagination { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; margin-top: 2rem; }
.pagination a { padding: .45rem .8rem; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--surface); }
.pagination a.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.empty { text-align: center; padding: 4rem 1rem; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }

/* detail */
.detail { display: grid; grid-template-columns: 1fr 360px; gap: 2rem; align-items: start; }
.detail-media img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); }
.detail-desc { margin-top: 2rem; }
.detail-side { position: sticky; top: 80px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; }
.detail-side .badge { position: static; display: inline-block; margin-bottom: .6rem; }
.detail-side h1 { font-size: 1.5rem; }
.price-box { border: 1px solid var(--line); border-radius: 12px; padding: 1rem; margin: 1rem 0; display: grid; gap: .6rem; background: var(--bg); }
.price-big { font-size: 1.8rem; font-weight: 800; letter-spacing: -.02em; }
.facts { margin: 0; display: grid; gap: .5rem; }
.facts div { display: flex; justify-content: space-between; gap: 1rem; font-size: .9rem; border-bottom: 1px solid var(--line); padding-bottom: .5rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: right; font-weight: 500; }
.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1.5rem; }
.tag { font-size: .8rem; padding: .25rem .6rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); }

/* prose / forms */
.prose { max-width: 760px; }
.prose.narrow { max-width: 620px; }
.prose h2 { margin-top: 2rem; font-size: 1.25rem; }
.prose ul { padding-left: 1.3rem; }
.prose li { margin-bottom: .4rem; }
.form { display: grid; gap: 1rem; }
.form label { display: grid; gap: .35rem; font-weight: 500; font-size: .93rem; }
.form textarea { resize: vertical; }
.hp { position: absolute; left: -9999px; }
.notice { padding: 1rem 1.2rem; border-radius: 12px; border: 1px solid; margin-bottom: 1rem; }
.notice.success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.notice.error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

/* footer */
.site-footer { margin-top: 3rem; border-top: 1px solid var(--line); background: var(--surface); padding: 2.5rem 0 1.5rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; }
.footer-grid h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .8rem; }
.footer-grid a { display: block; color: var(--ink); padding: .2rem 0; font-size: .93rem; }
.footer-grid .logo { display: inline-flex; margin-bottom: .6rem; }
.footer-bottom { margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }

/* responsive */
@media (max-width: 960px) {
  .listing, .detail, .why, .footer-grid { grid-template-columns: 1fr; }
  .filters, .detail-side { position: static; }
  .filters { display: flex; flex-wrap: wrap; gap: .3rem; }
  .filters h3 { width: 100%; }
  .filter.sub { padding-left: .6rem; }
}
@media (max-width: 720px) {
  .header-inner { flex-wrap: wrap; gap: .6rem; padding: .6rem 0; }
  .search { order: 3; width: 100%; max-width: none; margin: 0; }
  .nav { display: none; width: 100%; flex-direction: column; order: 4; }
  .nav.open { display: flex; }
  .menu-toggle { display: flex; margin-left: auto; }
  .hero-search { flex-direction: column; }
  .results-head { flex-direction: column; align-items: flex-start; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}
