/* Home page. Tokens, header and tab bar come from app.css. */

.home { display: grid; gap: 28px; max-width: 1180px; }

/* ---------- Hero ---------- */
.home-hero {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 44px 20px 30px;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(90% 120% at 50% -10%, color-mix(in srgb, var(--chart) 32%, transparent) 0%, transparent 60%),
    radial-gradient(60% 80% at 100% 100%, color-mix(in srgb, var(--chart) 12%, transparent) 0%, transparent 70%),
    var(--surface);
  text-align: center;
}
.home-hero h1 { max-width: 18ch; font-size: clamp(30px, 6vw, 52px); font-weight: 800; line-height: 1.04; letter-spacing: -0.02em; }
.home-hero h1 span {
  background: linear-gradient(90deg, #C4B5FD, var(--chart) 60%, #F0ABFC);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.home-sub { max-width: 54ch; color: var(--ink-2); font-size: 16px; }

.home-search { position: relative; width: min(100%, 640px); margin-top: 6px; z-index: 5; }
.home-search-icon { position: absolute; left: 18px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.home-search input {
  width: 100%;
  height: 58px;
  padding: 0 18px 0 50px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 17px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  -webkit-appearance: none;
  appearance: none;
}
.home-search input:focus { outline: none; border-color: var(--chart); box-shadow: 0 0 0 4px color-mix(in srgb, var(--chart) 25%, transparent), 0 10px 30px rgba(0, 0, 0, 0.3); }
.home-suggest {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--pop-shadow, 0 18px 40px rgba(0, 0, 0, 0.5));
  text-align: left;
}
.home-suggest-option { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px 10px; border-radius: 10px; color: var(--ink); text-decoration: none; }
[aria-selected="true"] > .home-suggest-option, .home-suggest-option:hover { background: var(--surface-2); }
.home-suggest-option img { width: 38px; border-radius: 3px; }
.home-suggest-option span { display: grid; min-width: 0; }
.home-suggest-option strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-suggest-option small { color: var(--ink-2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-suggest-all { display: block; margin-top: 4px; padding: 11px 12px; border-top: 1px solid var(--line); color: var(--chart); font-weight: 650; text-decoration: none; }

.home-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 6px; }
.home-action {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 16px 10px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  color: var(--ink);
  font-weight: 650;
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}
.home-action:hover { border-color: var(--chart); transform: translateY(-1px); }
.home-action-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: color-mix(in srgb, var(--chart) 22%, transparent); color: var(--chart); }
.home-action-icon svg { width: 17px; height: 17px; }
.home-trust { max-width: 52ch; margin: 4px auto 0; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.home-trust a { color: var(--chart); font-weight: 650; white-space: nowrap; }

/* ---------- Panels ---------- */
.home-grid { display: grid; gap: 16px; }
@media (min-width: 760px) { .home-grid { grid-template-columns: 1.4fr 1fr; } }
.home-grid:not(:has(> :not([hidden]))) { display: none; }
.home-panel {
  position: relative;
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 170px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}
.home-panel[hidden] { display: none; }
.home-panel:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.home-label { color: var(--ink-2); font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.home-value { font-family: var(--font-num, "DM Mono", monospace); font-size: clamp(30px, 5vw, 42px); font-weight: 500; color: var(--price, var(--ink)); letter-spacing: -0.02em; }
.home-change { font-size: 14px; font-weight: 650; color: var(--ink-2); }
.home-change.is-up { color: var(--up); }
.home-change.is-down { color: var(--down); }
.home-meta { color: var(--ink-2); font-size: 13.5px; position: relative; z-index: 1; }
.home-spark { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 70px; opacity: 0.9; }
.home-portfolio { padding-bottom: 84px; }
.home-latest { justify-items: start; background: radial-gradient(100% 120% at 100% 0%, color-mix(in srgb, var(--chart) 18%, transparent), transparent 60%), var(--surface); }
.home-latest img { max-width: 220px; max-height: 80px; margin: 8px 0 4px; object-fit: contain; }
.home-latest strong { font-size: 22px; font-weight: 800; }

/* ---------- Sections ---------- */
.home-section { display: grid; gap: 14px; }
.home-section[hidden] { display: none; }
.home-section-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.home-section-head h2 { font-size: 22px; font-weight: 800; }
.home-note { color: var(--ink-3, var(--ink-2)); font-size: 13px; }

/* Recently viewed: a swipeable strip */
.home-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 118px;
  gap: 12px;
  margin: 0 calc(var(--gutter, 16px) * -1);
  padding: 2px var(--gutter, 16px) 8px;
  overflow-x: auto;
  list-style: none;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.home-strip::-webkit-scrollbar { display: none; }
.home-tile { display: grid; gap: 4px; scroll-snap-align: start; color: var(--ink); text-decoration: none; }
.home-tile img { width: 100%; aspect-ratio: 63 / 88; object-fit: cover; border-radius: 6px; background: var(--surface-2); transition: transform 0.15s; }
.home-tile:hover img { transform: translateY(-3px); }
.home-tile strong { font-size: 13px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-tile small { color: var(--ink-2); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Recent sales */
.home-sales { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 900px) { .home-sales { grid-template-columns: 1fr 1fr; } }
.home-sale {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 14px 10px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s;
}
.home-sale:hover { border-color: var(--line-strong); }
.home-sale img { width: 44px; border-radius: 3px; }
.home-sale-body { display: grid; min-width: 0; }
.home-sale-body strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-sale-body small { color: var(--ink-2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-sale-price { display: grid; justify-items: end; }
.home-sale-price strong { font-family: var(--font-num, "DM Mono", monospace); font-weight: 500; color: var(--price, var(--ink)); }
.home-sale-price small { color: var(--ink-3, var(--ink-2)); font-size: 12px; }

/* Most valuable */
.home-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (max-width: 520px) { .home-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
.home-card { display: grid; gap: 4px; color: var(--ink); text-decoration: none; }
.home-card-art { position: relative; display: block; }
.home-card-art img { width: 100%; aspect-ratio: 63 / 88; object-fit: cover; border-radius: 8px; background: var(--surface-2); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35); transition: transform 0.2s ease; }
.home-card:hover .home-card-art img { transform: translateY(-4px) rotate(-0.6deg); }
.home-rank {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(14, 16, 21, 0.82);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}
.home-card strong { margin-top: 4px; font-size: 14px; line-height: 1.2; }
.home-card small { color: var(--ink-2); font-size: 12px; line-height: 1.3; }
.home-card-price { font-family: var(--font-num, "DM Mono", monospace); font-size: 16px; color: var(--price, var(--ink)); }

@media (max-width: 560px) {
  .home { gap: 22px; }
  .home-hero { padding: 30px 14px 18px; border-radius: 20px; }
  .home-search input { height: 54px; font-size: 16px; }
  .home-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; gap: 8px; }
  .home-action { flex-direction: column; gap: 6px; padding: 10px 4px; border-radius: 14px; font-size: 12.5px; text-align: center; }
}
