/* Hunt Product Hunt — a research console.
   Dark, typographic, one accent. Chrome stays out of the way of the data. */

:root {
  --bg:        #0c0d10;
  --surface:   #131519;
  --raised:    #191c22;
  --line:      #24272f;
  --line-soft: #1c1f26;
  --text:      #e9eaee;
  --muted:     #9096a3;
  --faint:     #666c7a;
  --accent:    #ff6154;   /* Product Hunt orange */
  --accent-dim:#3a1e1c;
  --radius:    10px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

.topbar {
  display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap;
  padding: 22px 32px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand h1 {
  margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.01em;
}
.dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-dim);
}
.brand-sub { margin: 0; color: var(--faint); font-size: 13px; }

/* ----------------------------------------------------------------- console */

.console { padding: 26px 32px 6px; }

.field { display: flex; gap: 10px; max-width: 860px; }

input[type=text], input[type=search], select {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: var(--radius);
  padding: 11px 14px;
  font: inherit;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input[type=text] { flex: 1; font-family: var(--mono); font-size: 13px; }
input[type=text]:focus, input[type=search]:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

button#run {
  background: var(--accent); color: #fff; border: 0;
  border-radius: var(--radius); padding: 0 22px;
  font: inherit; font-weight: 600; cursor: pointer;
  transition: filter .15s ease, transform .1s ease;
}
button#run:hover:not(:disabled) { filter: brightness(1.08); }
button#run:active:not(:disabled) { transform: translateY(1px); }
button#run:disabled { opacity: .5; cursor: progress; }


/* ----------------------------------------------------------------- library */

.library { padding: 22px 32px 6px; }
.library-head {
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 13px;
}
.library-head h2 {
  margin: 0; font-size: 11px; font-weight: 600;
  letter-spacing: .07em; text-transform: uppercase; color: var(--faint);
}

.cards {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
}

/* Cards earn their box here: each is a discrete, clickable saved search. */
.card {
  display: flex; align-items: center; gap: 11px;
  padding: 12px 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  font: inherit; color: inherit;
  transition: border-color .15s ease, background .15s ease, transform .1s ease;
}
.card:hover { border-color: var(--accent); background: var(--raised); }
.card:active { transform: translateY(1px); }
.card.active { border-color: var(--accent); }

.card img, .card .ph {
  width: 34px; height: 34px; border-radius: 8px; flex: none;
  object-fit: cover; background: var(--raised);
}
.card .ph {
  display: grid; place-items: center;
  color: var(--faint); font-size: 14px; font-weight: 600;
}
.card .cmeta { min-width: 0; flex: 1; }
.card .ctitle {
  font-size: 13.5px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Launches sit between the title and the profile count, slightly stronger than
   .csub: it is the line that tells two scrapes of one product apart. */
.card .claunch {
  color: var(--muted); font-size: 11.5px; margin-top: 2px;
  font-variant-numeric: tabular-nums;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card .csub {
  color: var(--faint); font-size: 11.5px; margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------------------------------------------------------------- progress */

.progress { padding: 20px 32px 4px; }
.progress-head {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--text);
}
.spin {
  width: 12px; height: 12px; flex: none;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.bar {
  height: 2px; background: var(--line-soft);
  border-radius: 2px; overflow: hidden; margin: 12px 0;
  max-width: 860px;
}
#bar-fill {
  height: 100%; width: 0%;
  background: var(--accent);
  transition: width .4s ease;
}

.log {
  margin: 0; max-height: 148px; overflow-y: auto;
  font-family: var(--mono); font-size: 11.5px; line-height: 1.75;
  color: var(--faint); white-space: pre-wrap;
}

.error {
  margin: 18px 32px;
  padding: 13px 16px;
  border: 1px solid #4a2422;
  background: #1b1210;
  border-radius: var(--radius);
  color: #ffb4ac; font-size: 13px;
}

/* ----------------------------------------------------------------- results */

main { padding: 8px 32px 80px; }

.summary {
  display: flex; gap: 34px; flex-wrap: wrap;
  padding: 20px 0 22px;
  border-bottom: 1px solid var(--line-soft);
}
.stat { display: flex; flex-direction: column; gap: 3px; }
.stat b {
  font-size: 25px; font-weight: 600; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat span { color: var(--faint); font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; }
.stat.warn b { color: var(--accent); }

.countbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 16px 0 12px;
}

/* Individual pills: each network is its own button, fully rounded and spaced. */
.pills { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 16px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font: inherit; font-size: 12.5px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.pill:hover { background: var(--raised); color: var(--text); border-color: var(--faint); }
.pill:active { transform: translateY(1px); }
.pill svg { flex: none; opacity: .85; }
.pill b {
  font-weight: 500; font-size: 11px; color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.pill.on {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}
.pill.on b { color: var(--accent); }

/* Download: an icon button in the site's own palette — a bare <a> would render
   in the browser's default link blue, which belongs to no theme here. */
.dl {
  margin-left: auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--muted); text-decoration: none;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.dl:hover { color: var(--accent); border-color: var(--accent); background: var(--raised); }
.dl:active { transform: translateY(1px); }

.count { color: var(--faint); font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------- the table */

.tablewrap { overflow-x: auto; }

table.grid {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

table.grid th {
  text-align: left;
  font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--faint);
  padding: 10px 16px 10px 0;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--bg); z-index: 2;
}
.col-person   { width: 34%; min-width: 250px; }
.col-comments { width: 66%; min-width: 340px; }

table.grid td {
  vertical-align: top;
  padding: 16px 16px 16px 0;
  border-bottom: 1px solid var(--line-soft);
}
table.grid tbody tr { animation: rise .3s ease backwards; }
table.grid tbody tr:hover { background: #101217; }

/* person cell */
.who { display: flex; gap: 11px; }
.who .avatar { width: 34px; height: 34px; }
.who .wmeta { min-width: 0; }
.who .wname { font-size: 13.5px; font-weight: 600; }
.who .wname a { color: var(--text); text-decoration: none; }
.who .wname a:hover { color: var(--accent); }
.who .whandle {
  display: block; color: var(--faint); font-size: 12px;
  font-family: var(--mono); margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis;
}
.who .whead { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* links, stacked under the person block.
   The avatar's width plus its gap (34 + 11) keeps them aligned with the name
   above rather than with the avatar's left edge. */
.links { display: flex; flex-wrap: wrap; gap: 6px; margin: 9px 0 0 45px; }
.links a {
  font-size: 11.5px; text-decoration: none; color: var(--muted);
  border: 1px solid var(--line); border-radius: 5px; padding: 3px 8px;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: border-color .15s ease, color .15s ease;
}
.links a:hover { color: var(--accent); border-color: var(--accent); }
.links .plat { color: var(--faint); }
.nolinks { color: var(--faint); font-size: 12px; }
.who + .nolinks { display: inline-block; margin: 9px 0 0 45px; }

/* comments cell.
   A prolific commenter (13 on one launch) would otherwise make a single row
   taller than the viewport and strand the other columns in whitespace, so the
   stack scrolls inside its own cell past a few comments. */
.saidwrap { max-height: 340px; overflow-y: auto; padding-right: 8px; }
.saidwrap::-webkit-scrollbar { width: 6px; }
.saidwrap::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.saidwrap::-webkit-scrollbar-track { background: transparent; }

.said { padding-bottom: 13px; margin-bottom: 13px; border-bottom: 1px dashed var(--line-soft); }
.said:last-child { padding-bottom: 0; margin-bottom: 0; border-bottom: 0; }
.said-meta {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 4px;
}
.said-meta time { color: var(--faint); font-size: 11.5px; }
.said-body { color: #cfd3db; font-size: 13.5px; white-space: pre-wrap; word-break: break-word; }
.said-body.clamped {
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical;
  overflow: hidden;
}
.more {
  background: none; border: 0; padding: 3px 0 0; cursor: pointer;
  color: var(--faint); font: inherit; font-size: 11.5px;
}
.more:hover { color: var(--accent); }

.badge {
  font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 4px;
  background: var(--accent-dim); color: var(--accent);
}
.badge.hunter { background: #1d2530; color: #7fb0ff; }
.votes { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.votes.has { color: var(--accent); }
.reply-of { color: var(--faint); font-size: 11.5px; margin-top: 5px; }

.empty { color: var(--faint); padding: 46px 0; text-align: center; font-size: 13px; }

@media (max-width: 680px) {
  .topbar, .console, .progress, main { padding-left: 18px; padding-right: 18px; }
  .error { margin-left: 18px; margin-right: 18px; }
  .field { flex-direction: column; }
  .summary { gap: 22px; }
  table.grid { table-layout: auto; min-width: 860px; }
}
