:root {
  color: #0c0a09;
  background: #f9f7f5;
  font-family: Geist, "Helvetica Neue", Arial, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  min-height: 100%;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  display: flex;
  flex-direction: column;
  background: #f9f7f5;
}

main { flex: 1; }

a { color: inherit; text-decoration: none; }
p, h1, h2, h3 { margin: 0; }

.skip-link {
  position: fixed;
  z-index: 10;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  background: #0c0a09;
  color: #fff;
  font-size: 0.875rem;
  transform: translateY(calc(-100% - 1rem));
}

.skip-link:focus { transform: translateY(0); }

a:focus-visible,
button:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 3px;
}

.shell {
  width: min(100%, 42rem);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.site-header { padding-top: 0.5rem; }

.header-inner {
  display: flex;
  min-height: 2.5rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.75rem;
  line-height: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.brand-mark {
  display: block;
  width: 1.5rem;
  height: 1.5rem;
}
.submit-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: rgb(12 10 9 / 58%);
  cursor: pointer;
  font: inherit;
}

.submit-link:hover {
  color: #0c0a09;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: rgb(12 10 9 / 46%);
}

.auth-status:empty { display: none; }

.hero { padding-block: 3rem 2rem; }

.eyebrow {
  margin-bottom: 1rem;
  color: rgb(12 10 9 / 46%);
  font-size: 0.75rem;
  line-height: 1rem;
}

.hero-title {
  max-width: 31rem;
  font-size: 1.75rem;
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 2.25rem;
}

.hero-copy {
  max-width: 34rem;
  margin-top: 1rem;
  color: rgb(12 10 9 / 58%);
  font-size: 0.875rem;
  line-height: 1.4rem;
}

.stats {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.5rem;
  font-size: 0.75rem;
}

.stats p {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: #f0eeea;
}

.stats strong {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.stats span { color: rgb(12 10 9 / 48%); }
.search-form { margin-top: 2.25rem; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.search-row {
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgb(12 10 9 / 15%);
  transition: border-color 150ms ease;
}

.search-row:focus-within { border-color: rgb(12 10 9 / 70%); }

.search-input {
  min-width: 0;
  height: 2.75rem;
  flex: 1;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.875rem;
}

.search-input::placeholder { color: rgb(12 10 9 / 34%); }

.search-count {
  flex-shrink: 0;
  color: rgb(12 10 9 / 38%);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.submission-dialog {
  width: min(calc(100% - 2rem), 32rem);
  padding: 0;
  border: 0;
  border-radius: 0.75rem;
  background: #f9f7f5;
  color: #0c0a09;
  box-shadow: 0 1.25rem 4rem rgb(12 10 9 / 24%);
  font-size: 0.75rem;
}

.submission-dialog::backdrop {
  background: rgb(12 10 9 / 32%);
  backdrop-filter: blur(2px);
}

.submission-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.25rem 0;
}

.submission-dialog-header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4rem;
}

.submission-close {
  display: grid;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgb(12 10 9 / 5%);
  color: rgb(12 10 9 / 58%);
  cursor: pointer;
  font: inherit;
  font-size: 1.1rem;
  line-height: 1;
  place-items: center;
}

.submission-close:hover {
  background: rgb(12 10 9 / 9%);
  color: #0c0a09;
}

.submission-close svg {
  display: block;
  width: 0.9rem;
  height: 0.9rem;
}

.submission-form {
  position: relative;
  padding: 1rem 1.25rem 1.25rem;
}

.submission-form > p:first-child {
  max-width: 31rem;
  margin-bottom: 1rem;
  color: rgb(12 10 9 / 52%);
  line-height: 1.15rem;
}

.submission-form label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.35rem;
  color: rgb(12 10 9 / 70%);
}

.submission-row {
  display: flex;
  gap: 0.75rem;
}

.submission-row input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgb(12 10 9 / 15%);
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: #0c0a09;
  font: inherit;
}

.submission-row input { min-width: 0; height: 2.25rem; }

.submission-row input:focus { border-color: rgb(12 10 9 / 70%); }

.submission-row input::placeholder { color: rgb(12 10 9 / 32%); }

.submission-row button {
  flex: none;
  padding: 0.55rem 0.8rem;
  border: 0;
  border-radius: 0.375rem;
  background: #0c0a09;
  color: #fff;
  cursor: pointer;
  font: inherit;
}

.submission-row button:hover { background: rgb(12 10 9 / 82%); }
.submission-row button:disabled { cursor: wait; opacity: 0.55; }

.submission-trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.submission-feedback {
  margin-top: 0.75rem;
  color: rgb(12 10 9 / 58%);
  line-height: 1rem;
}

.submission-feedback.is-error { color: #b91c1c; }

.directory { padding-bottom: 6rem; }

.tool-count,
.footer-inner {
  color: #0c0a09;
  font-size: 0.6875rem;
  line-height: 1rem;
}

.site-grid {
  display: block;
  border-top: 1px solid rgb(12 10 9 / 10%);
}

.ranking-status {
  border-top: 1px solid rgb(12 10 9 / 10%);
}

.ranking-skeleton-row {
  display: grid;
  grid-template-columns: minmax(9rem, 1fr) minmax(0, 1.8fr) 2.5rem;
  gap: 1rem;
  align-items: center;
  min-height: 6.25rem;
  border-bottom: 1px solid rgb(12 10 9 / 8%);
}

.ranking-skeleton-row i {
  display: block;
  height: 0.625rem;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgb(12 10 9 / 5%) 25%,
    rgb(12 10 9 / 10%) 50%,
    rgb(12 10 9 / 5%) 75%
  );
  background-size: 200% 100%;
  animation: ranking-shimmer 1.2s ease-in-out infinite;
}

.ranking-skeleton-row i:first-child { width: 62%; }
.ranking-skeleton-row i:nth-child(2) { width: 88%; }
.ranking-skeleton-row i:last-child {
  width: 1.5rem;
  justify-self: end;
}

@keyframes ranking-shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .ranking-skeleton-row i { animation: none; }
}

.agent-entry {
  position: relative;
  display: grid;
  grid-template-columns: minmax(9rem, 1fr) minmax(0, 1.8fr) auto;
  gap: 1rem;
  align-items: start;
  padding-block: 1.05rem;
  border-bottom: 1px solid rgb(12 10 9 / 8%);
  content-visibility: auto;
  contain-intrinsic-size: auto 100px;
}

.agent-heading { display: contents; }
.agent-title { min-width: 0; }

.agent-title h3 {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.15rem;
}

.site-favicon {
  flex: none;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 2px;
  opacity: 0;
  object-fit: contain;
  transition: opacity 120ms ease;
}

.site-favicon.is-loaded { opacity: 1; }

.agent-title [data-agent-name] {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-title [data-agent-name]:hover {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
.tool-count { margin-top: 0.15rem; }

.vote-control {
  position: relative;
  display: flex;
  grid-column: 3;
  grid-row: 1 / 3;
  align-self: center;
  align-items: center;
  justify-content: end;
  white-space: nowrap;
}

.v {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.4rem;
  border: 0;
  border-radius: 0.375rem;
  background: rgb(12 10 9 / 5%);
  color: #0c0a09;
  cursor: pointer;
  font: inherit;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  line-height: 1rem;
  transition: background-color 150ms ease, color 150ms ease;
}

.v svg {
  width: 0.875rem;
  height: 0.875rem;
  transition: transform 150ms ease;
}

.v:not(:disabled):not([aria-disabled="true"]):hover {
  background: rgb(12 10 9 / 8%);
  color: #2563eb;
}

.v.is-voted {
  background: rgb(37 99 235 / 9%);
  color: #2563eb;
}

.v.is-voted:not(:disabled):hover,
.v.is-voted:focus-visible {
  background: rgb(220 38 38 / 9%);
  color: #dc2626;
}

.v.is-voted:not(:disabled):hover svg,
.v.is-voted:focus-visible svg {
  transform: rotate(180deg);
}

.v:disabled {
  cursor: default;
  opacity: 1;
}

.v.is-voted:disabled { opacity: 1; }

.v[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.45;
}

.v.is-shaking { animation: vote-shake 260ms ease-in-out; }
.v.is-confirming { animation: vote-confirm 320ms ease-out; }

.vote-tooltip {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: calc(100% + 0.5rem);
  width: max-content;
  max-width: 10rem;
  padding: 0.35rem 0.5rem;
  border-radius: 0.35rem;
  background: #0c0a09;
  color: #fff;
  font-size: 0.6875rem;
  line-height: 1rem;
  box-shadow: 0 0.25rem 0.8rem rgb(12 10 9 / 16%);
}

.vote-tooltip::after {
  position: absolute;
  top: 100%;
  right: 0.75rem;
  border: 0.25rem solid transparent;
  border-top-color: #0c0a09;
  content: "";
}

@keyframes vote-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-0.2rem); }
  50% { transform: translateX(0.2rem); }
  75% { transform: translateX(-0.1rem); }
}

@keyframes vote-confirm {
  0%, 100% { transform: scale(1); }
  45% { transform: scale(1.12); }
}

@media (prefers-reduced-motion: reduce) {
  .v.is-shaking,
  .v.is-confirming { animation: none; }
}

.v b { font-weight: inherit; }

.v:focus-visible {
  outline-offset: -2px;
}

.vote-feedback {
  margin-top: 0.65rem;
  color: rgb(12 10 9 / 48%);
  font-size: 0.6875rem;
  line-height: 1rem;
}

.auth-status a {
  color: rgb(12 10 9 / 64%);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.agent-description {
  display: -webkit-box;
  grid-column: 2;
  grid-row: 1;
  overflow: hidden;
  color: rgb(12 10 9 / 56%);
  font-size: 0.75rem;
  line-height: 1.15rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.tool-list {
  grid-column: 2;
  margin-top: -0.35rem;
  color: rgb(12 10 9 / 36%);
  font-size: 0.6875rem;
  line-height: 1rem;
}

.tool-list > span:first-child { color: rgb(12 10 9 / 48%); }
footer { border-top: 1px solid rgb(12 10 9 / 10%); }

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.5rem 2.5rem;
}

@media (max-width: 39.999rem) {
  .hero { padding-block: 2.5rem 2rem; }

  .hero-title {
    font-size: 1.5rem;
    line-height: 2rem;
  }

  .submission-row { align-items: stretch; flex-direction: column; }
  .submission-row button { align-self: flex-start; }

  .agent-entry {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.4rem 1rem;
  }

  .agent-title { grid-column: 1; }
  .vote-control {
    grid-column: 2;
    grid-row: 1;
  }

  .agent-description,
  .tool-list { grid-column: 1 / 3; }

  .agent-description { grid-row: 2; }

  .tool-list {
    grid-row: 3;
    margin-top: 0.2rem;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.25rem;
  }
}
