:root {
  --bg: #070814;
  --bg-2: #0e1024;
  --surface: rgba(255, 255, 255, 0.08);
  --surface-strong: rgba(255, 255, 255, 0.12);
  --surface-light: #ffffff;
  --text: #f8fafc;
  --muted: #a8b3cf;
  --ink: #101828;
  --ink-muted: #667085;
  --line: rgba(255, 255, 255, 0.16);
  --line-light: #e7e9f1;
  --gold: #f7c948;
  --gold-2: #ffd978;
  --blue: #70a5ff;
  --green: #16a34a;
  --danger: #ef4444;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(circle 520px at 20% 0%, rgba(247, 201, 72, 0.20), transparent),
    radial-gradient(circle 540px at 80% 10%, rgba(112, 165, 255, 0.18), transparent),
    linear-gradient(180deg, #070814 0%, #101221 780px, #f4f6fb 880px, #eef1f8 100%);
  color: var(--text);
}

button, input, select { font: inherit; }

button, a, select { transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(247, 201, 72, 0.42);
  outline-offset: 3px;
}

.page-shell { overflow: hidden; }

.hero {
  position: relative;
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px clamp(18px, 4vw, 42px) 108px;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 18% -20% auto auto;
  width: 440px;
  height: 440px;
  background: conic-gradient(from 130deg, rgba(247, 201, 72, 0.28), rgba(112, 165, 255, 0.06), rgba(247, 201, 72, 0.20));
  filter: blur(38px);
  border-radius: 999px;
  pointer-events: none;
}

.topbar,
.hero-grid,
main {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(247, 201, 72, 0.62);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(247, 201, 72, 0.22), rgba(255, 255, 255, 0.06));
  color: var(--gold-2);
  font-weight: 900;
  letter-spacing: -0.05em;
  box-shadow: 0 18px 38px rgba(247, 201, 72, 0.12);
}

.brand strong { display: block; font-size: 15px; letter-spacing: 0.01em; }
.brand small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }

.topbar-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.nav-links {
  display: flex;
  gap: 8px;
}

.nav-links a {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.07);
  color: #dce5ff;
  text-decoration: none;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 800;
  backdrop-filter: blur(14px);
}

.nav-links a:hover {
  border-color: rgba(247, 201, 72, 0.58);
  background: rgba(247, 201, 72, 0.12);
  color: white;
}

.trust-row span,
.hero-pills button,
.preview-badge {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.07);
  color: #dce5ff;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  backdrop-filter: blur(14px);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: clamp(24px, 5vw, 70px);
  align-items: center;
  padding-top: clamp(58px, 8vw, 100px);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold-2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(42px, 7.5vw, 82px);
  line-height: 0.94;
  letter-spacing: -0.075em;
}

.hero-text {
  max-width: 690px;
  margin: 24px 0 0;
  color: #c2cae0;
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.65;
}

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.hero-pills button {
  cursor: pointer;
}

.hero-pills button:hover {
  transform: translateY(-2px);
  border-color: rgba(247, 201, 72, 0.58);
  background: rgba(247, 201, 72, 0.12);
}

.hero-card {
  display: grid;
  place-items: center;
}

.preview-card {
  width: min(100%, 360px);
  min-height: 420px;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 34px;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05)),
    linear-gradient(180deg, rgba(247, 201, 72, 0.18), rgba(112, 165, 255, 0.08));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.shimmer-card { position: relative; }
.shimmer-card::after {
  content: "";
  position: absolute;
  inset: -60% auto auto -40%;
  width: 120%;
  height: 120%;
  transform: rotate(24deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.14), transparent);
  animation: sweep 5.5s infinite;
}

@keyframes sweep {
  0%, 35% { transform: translateX(-30%) rotate(24deg); opacity: 0; }
  50% { opacity: 1; }
  75%, 100% { transform: translateX(110%) rotate(24deg); opacity: 0; }
}

.preview-card strong {
  display: block;
  margin-top: 84px;
  font-size: 58px;
  letter-spacing: -0.07em;
}

.preview-card small {
  display: block;
  color: #cdd6ee;
  margin-top: 8px;
}

.mini-bars {
  display: flex;
  align-items: end;
  gap: 10px;
  height: 118px;
  margin-top: 66px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 22px;
  background: rgba(0,0,0,0.18);
}

.mini-bars span {
  flex: 1;
  height: var(--h);
  min-height: 18px;
  border-radius: 999px 999px 6px 6px;
  background: linear-gradient(180deg, var(--gold-2), rgba(112,165,255,0.78));
}

main {
  max-width: 1180px;
  margin: -70px auto 70px;
  padding: 0 clamp(16px, 4vw, 32px);
  color: var(--ink);
}

.search-panel,
.summary,
.status,
.results-header,
.card {
  box-shadow: 0 18px 45px rgba(16, 24, 40, 0.10);
}

.search-panel {
  padding: clamp(18px, 3vw, 30px);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(18px);
}

.search-label-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.search-label-row label {
  font-weight: 900;
  font-size: 15px;
  color: var(--ink);
}

.search-label-row span {
  color: var(--ink-muted);
  font-size: 13px;
  text-align: right;
}

.search-control {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid #dce2ef;
  border-radius: 22px;
  background: #f8faff;
}

.search-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #667085;
  font-size: 24px;
}

#q {
  width: 100%;
  min-width: 0;
  padding: 14px 4px;
  color: var(--ink);
  background: transparent;
  border: 0;
  font-size: 16px;
}

#q::placeholder { color: #98a2b3; }
#q:focus { outline: none; }

.search-control:focus-within {
  border-color: rgba(247, 201, 72, 0.92);
  box-shadow: 0 0 0 5px rgba(247, 201, 72, 0.14);
}

.search-control button,
.filters button {
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, #111827, #273248 52%, #b98412);
  color: white;
  padding: 14px 22px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 14px 25px rgba(17, 24, 39, 0.20);
}

.search-control button:hover,
.filters button:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 35px rgba(17, 24, 39, 0.27);
}

.search-control button:disabled,
.filters button:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}

.filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.filters label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.filters select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  color: var(--ink);
  border: 1px solid #dce2ef;
  border-radius: 15px;
  background: white;
  cursor: pointer;
}

.filters select:hover { border-color: #b8c1d5; }

.status {
  margin: 18px 0;
  padding: 16px 18px;
  border: 1px solid rgba(247, 201, 72, 0.38);
  border-radius: 18px;
  background: #fff8df;
  color: #8a6110;
  font-weight: 700;
}

.status.error {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #be123c;
}

.status.loading::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 10px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: spin 800ms linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.summary {
  margin: 20px 0;
  padding: clamp(18px, 3vw, 28px);
  background: white;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-xl);
}

.summary-header,
.results-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.summary h2,
.results-header h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -0.045em;
}

.summary .eyebrow,
.results-header .eyebrow { color: #9a6700; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.stat {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 116px;
  padding: 18px;
  border: 1px solid #e6eaf2;
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff, #f8faff);
}

.stat.primary {
  border-color: rgba(247, 201, 72, 0.55);
  background: linear-gradient(135deg, #101828, #25304a 58%, #9b6a10);
  color: white;
}

.stat.primary::after {
  content: "";
  position: absolute;
  right: -35px;
  bottom: -45px;
  width: 130px;
  height: 130px;
  border-radius: 999px;
  background: rgba(247, 201, 72, 0.22);
}

.stat .label {
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stat.primary .label { color: #ffe7a4; }

.stat .value {
  position: relative;
  z-index: 1;
  color: var(--ink);
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 950;
  letter-spacing: -0.045em;
}

.stat.primary .value { color: white; }

.trimmed {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #e6eaf2;
  border-radius: 18px;
  background: #f8faff;
  color: var(--ink-muted);
  line-height: 1.55;
}

.trimmed strong { color: var(--ink); }
.trimmed-icon { color: #b7791f; }

.actions { margin-left: auto; }
.actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid #dce2ef;
  border-radius: 999px;
  color: #344054;
  background: white;
  text-decoration: none;
  font-size: 13px;
  font-weight: 900;
}

.actions a:hover {
  transform: translateY(-2px);
  border-color: rgba(247, 201, 72, 0.72);
  box-shadow: 0 12px 25px rgba(16, 24, 40, 0.08);
}

.results-header {
  margin: 28px 0 14px;
  padding: 18px 20px;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(255,255,255,0.9);
  border-radius: 22px;
}

.results-header p:last-child {
  max-width: 420px;
  margin: 0;
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.5;
  text-align: right;
}

#results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 18px;
  padding-bottom: 40px;
}

.card {
  position: relative;
  overflow: hidden;
  display: flex;
  min-height: 390px;
  background: white;
  border: 1px solid var(--line-light);
  border-radius: 24px;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--gold), var(--blue));
  opacity: 0;
  transition: opacity 180ms ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 26px 60px rgba(16, 24, 40, 0.16);
}

.card:hover::before { opacity: 1; }

.card a {
  display: flex;
  width: 100%;
  min-height: 100%;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
}

.card img,
.card .image-fallback {
  width: 100%;
  height: 214px;
  object-fit: contain;
  background:
    radial-gradient(circle at 40% 0%, rgba(247, 201, 72, 0.12), transparent 35%),
    linear-gradient(180deg, #f7f9fe, #eef2fa);
}

.card .image-fallback {
  display: grid;
  place-items: center;
  color: #98a2b3;
  font-weight: 800;
}

.card .body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 16px;
}

.card .title {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.42;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card:hover .title { color: #1d4ed8; }

.card .price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
}

.card .price {
  color: var(--green);
  font-size: 24px;
  font-weight: 950;
  letter-spacing: -0.055em;
}

.card .open-cue {
  color: #667085;
  font-size: 12px;
  font-weight: 900;
}

.card .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px solid #eef1f6;
  color: #667085;
  font-size: 11px;
}

.card .meta span,
.card .meta .badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f2f5fa;
  color: #475467;
  font-weight: 800;
}

.card .meta .badge.grade {
  background: #fff4cc;
  color: #8a6110;
}

.card .meta .badge.condition {
  background: #eaf3ff;
  color: #1d4ed8;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 34px;
  border: 1px dashed #ccd3e1;
  border-radius: 24px;
  background: rgba(255,255,255,0.72);
  color: var(--ink-muted);
  text-align: center;
}

.empty-state strong {
  display: block;
  color: var(--ink);
  font-size: 20px;
  margin-bottom: 6px;
}

.hidden { display: none !important; }

@media (max-width: 860px) {
  .hero { padding-bottom: 88px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-card { display: none; }
  .trust-row { display: none; }
  main { margin-top: -58px; }
  .filters, .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-header, .results-header { align-items: flex-start; flex-direction: column; }
  .results-header p:last-child { text-align: left; }
}

@media (max-width: 620px) {
  .hero h1 { font-size: 42px; }
  .search-label-row { align-items: flex-start; flex-direction: column; }
  .search-label-row span { text-align: left; }
  .search-control { grid-template-columns: auto 1fr; }
  .search-control button { grid-column: 1 / -1; width: 100%; }
  .filters, .stat-grid { grid-template-columns: 1fr; }
  #results { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
