/* ==========================================================================
   B2B Highlights — a categorized index of shipped sites
   ========================================================================== */

:root {
  --paper:      #fbfaf8;
  --ink:        #14161a;
  --ink-soft:   #5a6069;
  --rule:       #e3e0da;
  --card:       #ffffff;
  --accent:     #b5361f;
  --accent-dim: #f3e6e2;
  --shadow:     0 1px 2px rgba(20,22,26,.05), 0 8px 24px -12px rgba(20,22,26,.16);

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --wrap: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #101216;
    --ink:        #e9e7e3;
    --ink-soft:   #979da6;
    --rule:       #262a31;
    --card:       #171a1f;
    --accent:     #e8735a;
    --accent-dim: #2a1b17;
    --shadow:     0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.7);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 24px;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Masthead ---------- */

.masthead {
  border-bottom: 1px solid var(--rule);
  padding: 56px 0 28px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.mark {
  color: var(--accent);
  font-size: 20px;
  line-height: 1;
}

.brand-name {
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 700;
  letter-spacing: -.025em;
}

.brand-name em {
  font-style: normal;
  font-weight: 300;
  color: var(--ink-soft);
}

.lede {
  margin: 10px 0 0 32px;
  max-width: 56ch;
  color: var(--ink-soft);
  font-size: 17px;
}

/* ---------- Controls ---------- */

.controls { margin: 32px 0 0 32px; }

.search input {
  width: 100%;
  max-width: 460px;
  padding: 11px 14px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
}

.search input::placeholder { color: var(--ink-soft); }

.search input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: color .12s, border-color .12s, background .12s;
}

.chip:hover { color: var(--ink); border-color: var(--ink-soft); }

.chip.is-active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.chip .count {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  opacity: .65;
}

/* ---------- Groups ---------- */

.group { padding: 44px 0 8px; }
.group[hidden] { display: none; }

.group-head {
  border-top: 1px solid var(--rule);
  padding-top: 18px;
  margin-bottom: 22px;
}

.group:first-of-type .group-head { border-top: 0; padding-top: 0; }

.group-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
}

.group-head p {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 15px;
}

/* ---------- Cards ---------- */

.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 16px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--card);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}

.card[hidden] { display: none; }

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--ink-soft);
}

.card-link {
  text-decoration: none;
  color: inherit;
}

/* Make the whole card clickable while keeping one real link for a11y. */
.card-link::after {
  content: "";
  position: absolute;
  inset: 0;
}

.card { position: relative; }

.card-link h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -.01em;
}

.card-link:hover h3 { color: var(--accent); }

.card-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 4px;
}

.domain {
  display: inline-block;
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.domain::after {
  content: " ↗";
  opacity: .5;
}

.card > p {
  margin: 0;
  flex: 1;
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.6;
}

.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 2px 0 0;
  padding: 0;
}

.tags li {
  padding: 3px 9px;
  border: 1px solid var(--rule);
  border-radius: 5px;
  color: var(--ink-soft);
  font-size: 11.5px;
  letter-spacing: .03em;
  text-transform: uppercase;
}

/* ---------- Empty state ---------- */

.empty {
  margin: 48px 0 0;
  padding: 28px;
  border: 1px dashed var(--rule);
  border-radius: 12px;
  text-align: center;
  color: var(--ink-soft);
}

.empty[hidden] { display: none; }

/* ---------- Footer ---------- */

.site-footer {
  margin-top: 64px;
  border-top: 1px solid var(--rule);
  padding: 28px 0 56px;
  color: var(--ink-soft);
  font-size: 14px;
}

.site-footer p { margin: 0; }
.site-footer .fine { margin-top: 4px; opacity: .75; }

/* ---------- Small screens ---------- */

@media (max-width: 640px) {
  .masthead { padding-top: 36px; }
  .lede,
  .controls { margin-left: 0; }
  .grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .card:hover { transform: none; }
}
