:root {
  --paper: #f4f2ec;
  --ink: #111111;
  --muted: #65645f;
  --line: #cbc9c1;
  --blue: #001e8d;
  --white: #ffffff;
  --wrap: min(1360px, calc(100% - 64px));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; scroll-padding-top: 196px; }
body {
  margin: 0;
  min-width: 320px;
  overflow-x: clip;
  color: var(--ink);
  background: var(--paper);
  font-family: "Manrope", sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

/* ---------- header ---------- */
.site-header {
  width: var(--wrap);
  margin-inline: auto;
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 30;
}
.site-header::before {
  content: "";
  position: absolute;
  inset: 0 calc((100vw - 100%) / -2);
  z-index: -1;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 242, 236, .96);
  backdrop-filter: blur(8px);
}
.logo { font-size: 22px; font-weight: 800; letter-spacing: -.06em; text-decoration: none; }
.logo span { color: var(--blue); }
.site-header nav { display: flex; align-items: center; gap: 28px; }
.site-header nav a { font-size: 13px; font-weight: 700; text-decoration: none; }
.header-cta {
  padding: 10px 15px;
  color: var(--white);
  background: var(--ink);
  transition: background .18s ease;
}
.header-cta:hover { background: var(--blue); }

/* ---------- hero ---------- */
.hero {
  width: var(--wrap);
  margin-inline: auto;
  padding: 76px 0 44px;
  max-width: 1360px;
}
.label {
  margin: 0 0 18px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--blue);
}
.hero h1 {
  margin: 0;
  font-size: clamp(38px, 6.2vw, 76px);
  font-weight: 800;
  letter-spacing: -.045em;
  line-height: 1.02;
}
.lede {
  margin: 18px 0 0;
  max-width: 46ch;
  font-size: 17px;
  color: var(--muted);
}

/* ---------- filter bar ---------- */
.bar {
  position: sticky;
  top: 77px;
  z-index: 20;
  border-block: 1px solid var(--line);
  background: rgba(244, 242, 236, .97);
  backdrop-filter: blur(8px);
}
.bar-in {
  width: var(--wrap);
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 0;
}
.search {
  position: relative;
  flex: 0 0 320px;
  display: flex;
  align-items: center;
}
.search svg {
  position: absolute;
  left: 12px;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}
.search input {
  width: 100%;
  padding: 11px 34px 11px 35px;
  font: 500 14px "Manrope", sans-serif;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 0;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.search input::-webkit-search-cancel-button { display: none; }
.search input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 30, 141, .12); }
.search input::placeholder { color: #9a9891; }
#clear {
  position: absolute;
  right: 6px;
  width: 24px;
  height: 24px;
  padding: 0;
  font-size: 17px;
  line-height: 1;
  color: var(--muted);
  background: none;
  border: 0;
  cursor: pointer;
  opacity: 0;
  transform: scale(.8);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease, color .15s ease;
}
#clear:hover { color: var(--ink); }
.search.has-v #clear { opacity: 1; transform: scale(1); pointer-events: auto; }

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.pills::-webkit-scrollbar { display: none; }
.pill {
  flex: 0 0 auto;
  padding: 7px 13px;
  font: 700 12px "Manrope", sans-serif;
  white-space: nowrap;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: color .18s ease, background .18s ease, border-color .18s ease;
}
.pill:hover { color: var(--ink); border-color: #a9a79f; }
.pill.is-on { color: var(--white); background: var(--ink); border-color: var(--ink); }

/* ---------- groups ---------- */
#list { width: var(--wrap); margin-inline: auto; padding-bottom: 20px; }

.grp {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows .34s ease, opacity .24s ease, margin .34s ease;
  margin-top: 58px;
}
.grp > * { min-height: 0; }
.grp.is-out {
  grid-template-rows: 0fr;
  opacity: 0;
  margin-top: 0;
  pointer-events: none;
}
.grp-inner { overflow: hidden; }

.grp-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ink);
}
.grp-head h2 {
  margin: 0;
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: 800;
  letter-spacing: -.035em;
}
.grp-n {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--muted);
}
.grp-note {
  margin: 12px 0 0;
  max-width: 60ch;
  font-size: 14px;
  color: var(--muted);
}
.grp-empty {
  display: none;
  margin: 16px 0 0;
  font-size: 14px;
  color: var(--muted);
}
.grp.is-thin .grp-empty { display: block; }

.rows { margin: 8px 0 0; padding: 0; list-style: none; }

/* ---------- rows ---------- */
.row {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows .3s ease, opacity .22s ease;
}
.row > * { min-height: 0; }
.row.is-out { grid-template-rows: 0fr; opacity: 0; pointer-events: none; }

.row-in {
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(0, 1.75fr) 152px 282px 22px;
  align-items: center;
  gap: 6px 24px;
  padding: 16px 14px 16px 16px;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  position: relative;
  transition: background .18s ease;
}
.row-in::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 1px;
  width: 2px;
  background: var(--blue);
  transform: scaleY(0);
  transform-origin: 50% 50%;
  transition: transform .22s ease;
}
.row-in:hover,
.row-in:focus-visible {
  background: var(--white);
  outline: none;
}
.row-in:hover::before,
.row-in:focus-visible::before { transform: scaleY(1); }

.row-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.015em;
  transition: transform .2s ease;
}
.row-in:hover .row-name,
.row-in:focus-visible .row-name { transform: translateX(4px); }
.row-blurb {
  font-size: 14px;
  color: var(--muted);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.row-meta { display: contents; }
.row-tag {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: .02em;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-host {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11.5px;
  color: #8d8b84;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color .18s ease;
}
.row-in:hover .row-host { color: var(--blue); }
.row-arrow {
  justify-self: end;
  font-size: 14px;
  color: var(--blue);
  opacity: 0;
  transform: translate(-3px, 3px);
  transition: opacity .2s ease, transform .2s ease;
}
.row-in:hover .row-arrow,
.row-in:focus-visible .row-arrow { opacity: 1; transform: none; }

/* ---------- empty state ---------- */
.noresult {
  display: none;
  width: var(--wrap);
  margin: 60px auto 0;
  padding-bottom: 20px;
  font-size: 15px;
  color: var(--muted);
}
.noresult button {
  padding: 0;
  font: 700 15px "Manrope", sans-serif;
  color: var(--blue);
  background: none;
  border: 0;
  border-bottom: 1px solid currentColor;
  cursor: pointer;
}
body.is-empty .noresult { display: block; }

/* ---------- footer ---------- */
footer {
  width: var(--wrap);
  margin: 80px auto 0;
  padding: 26px 0 46px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px 24px;
}
footer p { margin: 0; font-size: 13px; font-weight: 700; }
footer a { text-decoration: none; }
footer a:hover { color: var(--blue); }
.foot-note { font-weight: 400; color: var(--muted); max-width: 52ch; }

/* ---------- entrance ---------- */
.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .5s ease, transform .5s ease;
}
.reveal.in { opacity: 1; transform: none; }
.grp-inner.reveal { transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .row-in {
    grid-template-columns: minmax(170px, 1fr) minmax(0, 1.5fr) 138px 262px 20px;
    gap: 6px 16px;
  }
  .row-tag { font-size: 10.5px; }
  .row-host { font-size: 11px; }
  .row-blurb { -webkit-line-clamp: 3; }
}
@media (max-width: 1120px) {
  .row-in { grid-template-columns: minmax(0, 1fr) 138px 262px 20px; }
  .row-name { grid-column: 1 / -1; }
  .row-blurb { grid-column: 1; grid-row: 2; }
  .row-tag { grid-column: 2; grid-row: 2; }
  .row-host { grid-column: 3; grid-row: 2; }
  .row-arrow { grid-column: 4; grid-row: 2; }
}
@media (max-width: 860px) {
  :root { --wrap: calc(100% - 36px); }
  html { scroll-padding-top: 196px; }
  .site-header nav { gap: 18px; }
  .site-header nav a:not(.header-cta) { display: none; }
  .hero { padding: 52px 0 34px; }
  .bar-in { flex-direction: column; align-items: stretch; gap: 12px; }
  .search { flex: 1 1 auto; }
  .pills { margin-inline: -18px; padding-inline: 18px; }
  .grp { margin-top: 44px; }
  .row-in {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 3px 12px;
    padding: 15px 4px 15px 12px;
  }
  .row-name { grid-column: 1; grid-row: 1; }
  .row-blurb { grid-column: 1 / -1; grid-row: 2; -webkit-line-clamp: 3; }
  .row-tag { grid-column: 1 / -1; grid-row: 3; margin-top: 5px; }
  .row-host { grid-column: 1 / -1; grid-row: 4; }
  .row-arrow { grid-column: 2; grid-row: 1; opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
