/* cs2pricecheck: dark, flat, CS2 material.
   Ground charcoal-blue, ink near-white, accent CS2 orange, rarity hues as data color.
   No gradients, no glass, no shadows on resting surfaces. */

:root {
  --bg: #0d1017;
  --panel: #131824;
  --panel-2: #1a2130;
  --panel-3: #222b3d;
  --line: #242e40;
  --ink: #e9edf3;
  --muted: #8b95a7;
  --accent: #f0a441;
  --accent-hi: #ffb95c;
  --accent-ink: #191006;
  --pos: #46c88c;
  --neg: #ef5350;
  --hue-none: #5c6577;
  --font-display: "Chakra Petch", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15.5px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: var(--accent-ink); }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-hi); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

img { display: block; }

code {
  background: var(--panel-2);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

.wrap { max-width: 1140px; margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */

.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
}
.header-row { display: flex; align-items: center; justify-content: space-between; height: 60px; }

.brand { display: flex; align-items: center; gap: 10px; color: var(--accent); }
.brand:hover { color: var(--accent-hi); }
.brand-mark { flex: none; }
.brand-word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.brand-word em { font-style: normal; color: var(--accent); }

.site-nav { display: flex; gap: 26px; align-items: center; font-size: 15px; }
.site-nav > a, .site-nav summary { color: var(--muted); cursor: pointer; }
.site-nav > a:hover, .site-nav summary:hover { color: var(--ink); }

.nav-markets { position: relative; }
.nav-markets summary { list-style: none; }
.nav-markets summary::-webkit-details-marker { display: none; }
.nav-markets-panel {
  position: absolute;
  right: 0;
  top: 30px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 170px;
  z-index: 50;
}
.nav-markets-panel a { padding: 7px 16px; color: var(--ink); }
.nav-markets-panel a:hover { background: var(--panel-2); color: var(--accent-hi); }

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  align-items: start;
  padding: 56px 0 8px;
}
.hero > * { min-width: 0; }
.hero-copy { position: relative; }
.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}
.hero-sub { color: var(--muted); font-size: 17px; margin: 0 0 26px; max-width: 46ch; }

.search { display: flex; gap: 10px; min-width: 0; }
.search input {
  flex: 1;
  min-width: 0;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px 16px;
  font: 16px var(--font-body);
}
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.search button, .filters button, .token-form button {
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: 6px;
  padding: 13px 22px;
  font: 600 15px var(--font-body);
  cursor: pointer;
}
.search button:hover, .filters button:hover, .token-form button:hover { background: var(--accent-hi); }

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  display: none;
}
.search-results:not(:empty) { display: block; }
.search-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  margin-top: -1px;
  padding: 9px 14px;
}
.search-row:first-child { border-radius: 6px 6px 0 0; }
.search-row:last-child { border-radius: 0 0 6px 6px; }
.search-row:hover { background: var(--panel-2); color: var(--ink); }
.search-results:not(:empty) { box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5); border-radius: 6px; }
.search-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-price { color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }

.search-static { margin-top: 16px; }
.search-static .search-row { position: static; }

.hero-venues {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 20px;
  font-size: 13.5px;
}
.hero-venues .vchip { color: var(--muted); }
.hero-venues .vchip:hover { color: var(--ink); }

.spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.8s linear infinite;
}
.htmx-indicator { opacity: 0; transition: opacity 200ms; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }

/* hero fragment: the product performing */

.hero-fragment {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}
.fragment-label {
  margin: 0 0 10px;
  color: var(--muted);
  font: 600 13px var(--font-body);
}
.ticker-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  grid-template-areas: "thumb name spread" "thumb pair spread";
  gap: 2px 12px;
  align-items: center;
  padding: 10px 8px;
  border-radius: 6px;
}
.ticker-row:hover { background: var(--panel-2); }
.ticker-thumb {
  grid-area: thumb;
  width: 52px; height: 40px;
  background: var(--panel-2);
  border-top: 3px solid var(--hue-none);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.ticker-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.ticker-name {
  grid-area: name;
  font-weight: 500;
  font-size: 14px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ticker-pair { grid-area: pair; display: flex; gap: 6px; align-items: center; }
.ticker-pair .arrow { color: var(--muted); }
.ticker-spread { grid-area: spread; font-size: 17px; font-family: var(--font-display); font-weight: 600; }
.ticker-more {
  display: block;
  margin-top: 10px;
  padding: 8px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
  border-radius: 6px;
}
.ticker-more:hover { background: var(--panel-2); color: var(--accent-hi); }
.fragment-empty { color: var(--muted); margin: 8px 0; }

/* ---------- figures band ---------- */

.figures {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 48px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px 24px;
  margin: 28px 0 8px;
}
.figure { display: flex; flex-direction: column; gap: 2px; }
.figure .num {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.figure span:last-child { color: var(--muted); font-size: 13px; }

/* ---------- sections ---------- */

.section { margin-top: 56px; }
.section-head { margin-bottom: 18px; }
.section-head h2 {
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 2px;
}
.section-head p { color: var(--muted); margin: 0; font-size: 14.5px; }
.section-note { color: var(--muted); font-size: 13px; margin-top: 12px; }
.empty { color: var(--muted); padding: 12px 0; }
.flag-suspect {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border: 1px solid var(--neg);
  border-radius: 4px;
  color: var(--neg);
  font: 600 10.5px var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  vertical-align: middle;
}

/* ---------- item grid ---------- */

.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}
.item-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 150ms ease, background 150ms ease;
}
.item-card:hover { background: var(--panel-2); transform: translateY(-2px); color: var(--ink); }
.item-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--panel-2);
  border-top: 3px solid var(--hue-none);
  border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.item-media img { max-width: 100%; max-height: 100%; object-fit: contain; }
.item-name {
  font-weight: 500;
  font-size: 14px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
}
.item-meta { display: flex; justify-content: space-between; align-items: baseline; }
.item-meta .price { color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }
.item-meta .muted { font-size: 12.5px; }

.ph { position: relative; }
.ph-letter {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--hue-none);
}

/* ---------- tables ---------- */

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 12.5px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.num-strong { font-weight: 600; }
tbody tr { background: var(--panel); }
tbody tr:hover { background: var(--panel-2); }
tbody tr:last-child td { border-bottom: 0; }

.cell-item { max-width: 380px; }
.item-link { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.item-link:hover { color: var(--accent-hi); }
.item-link { color: var(--ink); }
.row-thumb {
  width: 44px; height: 33px; flex: none;
  background: var(--panel-2);
  border-top: 3px solid var(--hue-none);
  border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.row-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ---------- venue chips ---------- */

.vchip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--ink);
}
.vchip i { width: 8px; height: 8px; border-radius: 2px; background: var(--hue-none); }
.vchip-link:hover { color: var(--accent-hi); }

/* ---------- misc shared ---------- */

.pos { color: var(--pos); font-weight: 600; }
.neg { color: var(--neg); font-weight: 600; }
.muted { color: var(--muted); }

.crumbs { color: var(--muted); font-size: 13px; margin: 20px 0 6px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent-hi); }

.badges { display: flex; gap: 8px; align-items: center; margin: 0 0 8px; flex-wrap: wrap; }
.badge {
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 999px;
}
.badge-st { color: var(--accent); border-color: rgba(240, 164, 65, 0.45); }

/* ---------- skin page ---------- */

.skin-hero {
  display: grid;
  grid-template-columns: 440px 1fr;
  gap: 36px;
  align-items: start;
  padding: 16px 0 0;
}
.skin-media {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 3px solid var(--hue-none);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  min-height: 240px;
}
.skin-media img { max-width: 100%; height: auto; }
.rarity-tag {
  position: absolute;
  right: 10px; bottom: 10px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid var(--hue-none);
  color: var(--muted);
  padding: 2px 8px;
  border-radius: 999px;
}
.skin-info h1 {
  font-family: var(--font-display);
  font-size: clamp(24px, 3.4vw, 38px);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.12;
  margin: 4px 0 10px;
}
.best-figures {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 44px;
  margin-top: 20px;
}
.best-figure { display: flex; flex-direction: column; gap: 3px; }
.best-label { color: var(--muted); font-size: 13px; }
.best-value {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.best-venue { color: var(--muted); font-size: 13px; }

.buy-btn {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 5px;
  padding: 6px 13px;
  font: 600 13px var(--font-body);
}
.buy-btn:hover { background: var(--accent-hi); color: var(--accent-ink); }

/* ---------- weapon browse ---------- */

.weapon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}
.weapon-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 13px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  transition: background 150ms ease;
}
.weapon-card:hover { background: var(--panel-2); color: var(--ink); }
.weapon-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16.5px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.weapon-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.weapon-meta .price { color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }
.weapon-meta .muted { font-size: 12.5px; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 18px; }
.chip {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  white-space: nowrap;
}
.chip:hover { color: var(--ink); background: var(--panel-2); }
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.chip-sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }

.st-flag {
  position: absolute;
  top: 6px; left: 6px;
  background: var(--accent);
  color: var(--accent-ink);
  font: 700 10.5px var(--font-display);
  border-radius: 3px;
  padding: 1px 5px;
  letter-spacing: 0.04em;
}

.souv-flag {
  left: auto; right: 6px;
  background: #3c4356;
  color: var(--ink);
}

/* ---------- chart ---------- */

.chart-wrap {
  position: relative;
  height: 340px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}
.chart-buttons { display: flex; gap: 8px; margin-bottom: 12px; }
.chart-toggle {
  background: var(--panel);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 7px 16px;
  cursor: pointer;
  font: 500 13.5px var(--font-body);
}
.chart-toggle:hover { color: var(--ink); }
.chart-toggle.active { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }

/* ---------- arb ---------- */

.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.filters input {
  background: var(--panel-2);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 8px 10px;
  font: 14px var(--font-body);
  width: 150px;
}
.filters .button {
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 6px;
  padding: 10px 16px;
  font-size: 14px;
}
.filters .button:hover { background: var(--panel-3); color: var(--accent-hi); }
.token-form { display: flex; gap: 10px; margin-top: 12px; }
.token-form input {
  flex: 1;
  background: var(--panel-2);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 13px;
  font: 15px var(--font-body);
}

/* ---------- market page ---------- */

.market-head { padding-top: 12px; }
.market-head h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  margin: 4px 0 6px;
}

/* ---------- about / prose ---------- */

.prose h2 { font-family: var(--font-display); font-size: 19px; margin: 24px 0 6px; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  margin: 16px 0;
}
.card.narrow { max-width: 480px; }
.card h2 { margin: 0 0 6px; font-size: 18px; }
.card-sub { color: var(--muted); font-size: 13px; margin: 0 0 12px; }

/* ---------- footer ---------- */

.site-footer { border-top: 1px solid var(--line); margin-top: 72px; padding: 32px 0 44px; }
.footer-word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.01em;
}
.footer-word em { font-style: normal; color: var(--accent); }
.footer-note { color: var(--muted); font-size: 13px; max-width: 68ch; }
.footer-links { color: var(--muted); font-size: 13px; display: flex; gap: 8px; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--accent-hi); }

/* ---------- responsive ---------- */

@media (max-width: 940px) {
  .hero { grid-template-columns: 1fr; padding-top: 36px; }
  .hero-fragment { order: 2; }
}
@media (max-width: 820px) {
  .skin-hero { grid-template-columns: 1fr; }
  .skin-media { max-width: 460px; }
}
@media (max-width: 560px) {
  .site-nav { gap: 16px; }
  .nav-home { display: none; }  /* brand already links home */
  .figures { gap: 10px 28px; }
  .best-figures { gap: 14px 28px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
