/* ============================================
   Agraris — the registry for AI agents
   Design tokens: deep green / cream / earth
   ============================================ */

:root {
  --green: #2f6b3f;
  --green-dark: #1f4a2c;
  --cream: #e8dcc8;
  --panel: #efe9df;
  --ink: #4a3320;
  --line: #c9bda3;
  --line-soft: #d9cfba;
  --line-strong: rgba(74, 51, 32, 0.3);
  --danger: #8a3324;

  --font-display: "Fraunces", Georgia, serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --max-width: 880px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--cream);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Faint technical/blueprint grid, pinned to the viewport so it never scrolls
   with the page. `background-attachment: fixed` is unreliable on mobile
   (notably older iOS Safari, and it can jank on Chrome Android too), so the
   pattern lives on a fixed pseudo-element instead — this renders consistently
   across mobile browsers. Negative z-index keeps it under all real content;
   it relies on the root element's stacking context (no positioning needed
   on body/html) so it can never cover text, buttons, or the sticky header. */
html::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(
      to right,
      rgba(47, 107, 63, 0.05) 0,
      rgba(47, 107, 63, 0.05) 1px,
      transparent 1px,
      transparent 28px
    ),
    repeating-linear-gradient(
      to bottom,
      rgba(47, 107, 63, 0.05) 0,
      rgba(47, 107, 63, 0.05) 1px,
      transparent 1px,
      transparent 28px
    );
  background-repeat: repeat;
}

img {
  max-width: 100%;
}

a {
  color: var(--green-dark);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- layout shell ---------- */

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 12px 0;
  background-color: var(--cream);
  border-bottom: 1px solid var(--line);
}

.brand-block {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.header-tagline {
  margin: 0;
  font-size: 11px;
  color: var(--ink);
  opacity: 0.6;
  line-height: 1.3;
}

.chain-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  margin-top: 5px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.4;
  color: var(--green-dark);
  text-decoration: none;
  white-space: nowrap;
}

.chain-badge:hover {
  border-color: var(--green);
}

.chain-badge-dot {
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--green);
  animation: chain-badge-pulse 2.2s ease-in-out infinite;
}

@keyframes chain-badge-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(47, 107, 63, 0.45);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(47, 107, 63, 0);
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  min-width: 0;
}

.brand img {
  width: 40px;
  height: 40px;
  display: block;
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.nav {
  display: flex;
  gap: 18px;
}

.nav a {
  text-decoration: none;
  color: var(--ink);
  font-size: 13px;
  border-bottom: 1px solid transparent;
  padding: 8px 0 6px;
  white-space: nowrap;
}

.nav a:hover,
.nav a.active {
  border-bottom-color: var(--green);
}

/* ---------- hamburger menu ---------- */

.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}

.menu-toggle:hover {
  border-color: var(--green);
}

.menu-toggle-bars {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 18px;
}

.menu-toggle-bars span {
  display: block;
  height: 2px;
  background: var(--ink);
  border-radius: 1px;
}

body.menu-open {
  overflow: hidden;
}

.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(31, 74, 44, 0.35);
  z-index: 40;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.menu-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.menu-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(280px, 82vw);
  background: var(--panel);
  border-left: 1px solid var(--line);
  z-index: 41;
  display: flex;
  flex-direction: column;
  padding: 18px 20px 24px;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  box-shadow: -8px 0 24px rgba(31, 74, 44, 0.15);
  overflow-y: auto;
}

.menu-panel.is-open {
  transform: translateX(0);
}

.menu-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.menu-panel-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
}

.menu-close {
  border: none;
  background: transparent;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: var(--ink);
  padding: 4px;
}

.menu-close:hover {
  color: var(--green);
}

.menu-panel a {
  text-decoration: none;
  color: var(--ink);
  font-size: 14px;
  padding: 13px 4px;
  border-bottom: 1px solid var(--line-soft);
}

.menu-panel a:hover,
.menu-panel a.active {
  color: var(--green-dark);
  font-weight: 500;
}

.menu-sep {
  border: none;
  border-top: 1px solid var(--line);
  margin: 6px 0;
}

.menu-social {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 13px 4px 4px;
}

.menu-social a {
  display: inline-flex;
  color: var(--ink);
  opacity: 0.7;
  padding: 0;
  border-bottom: none;
}

.menu-social svg {
  width: 28px;
  height: 28px;
  display: block;
}

.menu-social a:hover {
  color: var(--green-dark);
  opacity: 1;
}

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 60px;
  padding: 28px 0 24px;
  font-size: 12px;
  color: var(--ink);
}

.footer-top {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.footer-brand-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 32px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}

.footer-brand img {
  width: 32px;
  height: 32px;
  display: block;
  flex-shrink: 0;
}

.footer-brand-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.footer-tagline {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--ink);
  opacity: 0.55;
}

.footer-social {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
}

.footer-social a {
  display: inline-flex;
  color: var(--ink);
  opacity: 0.7;
}

.footer-social svg {
  width: 28px;
  height: 28px;
  display: block;
}

.footer-social a:hover {
  color: var(--green-dark);
  opacity: 1;
}

.footer-col {
  margin-bottom: 36px;
}

.footer-col:last-child {
  margin-bottom: 0;
}

.footer-col-title {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.55;
  margin: 0 0 12px;
}

.footer-col a {
  display: block;
  color: var(--ink);
  opacity: 0.7;
  text-decoration: none;
  font-size: 13px;
  margin-bottom: 10px;
}

.footer-col a:last-child {
  margin-bottom: 0;
}

.footer-col a:hover {
  color: var(--green-dark);
  opacity: 1;
}

.footer-bottom {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
  font-size: 11px;
  opacity: 0.6;
}

/* ---------- reusable page bits ---------- */

.loading-text {
  font-size: 13px;
  opacity: 0.7;
  padding: 8px 0;
}

.loading-text--standalone {
  padding-top: 36px;
}

.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;
}

.page-lead {
  font-size: 13px;
  opacity: 0.8;
  max-width: 52ch;
  margin: -8px 0 24px;
}

.section-head--first {
  border-top: none;
  padding-top: 8px;
}

/* Major topic sections (About / Privacy / Terms) — needs a much stronger
   break than the sub-headings (h3) inside each .content-page, so a reader
   scrolling fast can tell a new topic started without reading the text. */
.section-head--topic {
  margin-top: 64px;
  padding-top: 44px;
  border-top: 4px solid var(--green);
}

.section-head--topic h2 {
  font-size: 30px;
  color: var(--green-dark);
}

/* ---------- hero ---------- */

.hero {
  padding: 56px 0 40px;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 42px;
  line-height: 1.1;
  margin: 0 0 14px;
  max-width: 12ch;
}

.hero p.tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 19px;
  color: var(--green-dark);
  margin: 0 0 26px;
  max-width: 50ch;
}

.hero-cta {
  display: flex;
  justify-content: center;
  margin: 4px 0 20px;
}

.btn-cta {
  min-height: 56px;
  padding: 16px 44px;
  font-size: 15px;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 16px rgba(31, 74, 44, 0.22);
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------- hero banner (SVG illustration) ---------- */

.hero-banner {
  max-width: 480px;
  margin: 0 auto 20px;
}

.hero-banner svg {
  display: block;
  width: 100%;
  height: auto;
}

.hb-node {
  transform-box: fill-box;
  transform-origin: center;
}

.hb-animate .hb-logo {
  opacity: 0;
  transform: scale(0.8);
  transform-origin: 300px 140px;
  animation: hb-logo-in 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) 0.05s forwards;
}

.hb-animate .hb-node {
  opacity: 0;
  transform: scale(0.35);
  animation-name: hb-node-in, hb-idle;
  animation-duration: 0.45s, var(--did, 4s);
  animation-timing-function: ease-out, ease-in-out;
  animation-fill-mode: forwards, none;
  animation-iteration-count: 1, infinite;
  animation-delay: var(--d, 0s), var(--di, 2s);
}

.hb-animate .hb-line {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: hb-line-draw 0.5s ease-out var(--ld, 0s) forwards;
}

@keyframes hb-logo-in {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes hb-node-in {
  from {
    opacity: 0;
    transform: scale(0.35);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes hb-idle {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes hb-line-draw {
  to {
    stroke-dashoffset: 0;
  }
}

/* ---------- stats bar ---------- */

.stats-bar {
  display: flex;
  justify-content: space-around;
  gap: 16px;
  padding: 22px 4px;
}

.stats-bar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stats-bar-value {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 28px;
  color: var(--green-dark);
  line-height: 1.2;
}

.stats-bar-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: lowercase;
  color: var(--ink);
  opacity: 0.65;
  margin-top: 4px;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  min-height: 44px;
  padding: 11px 18px;
  border-radius: 3px;
  border: 1px solid var(--green);
  cursor: pointer;
  text-decoration: none;
  background: transparent;
  color: var(--green-dark);
}

.btn-solid {
  background: var(--green);
  color: var(--cream);
}

.btn-solid:hover {
  background: var(--green-dark);
  border-color: var(--green-dark);
}

.btn:not(.btn-solid):hover {
  background: rgba(47, 107, 63, 0.08);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-sm {
  min-height: 32px;
  padding: 6px 14px;
  font-size: 12px;
}

/* ---------- section headings ---------- */

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 8px 0 18px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  margin: 0;
}

.section-count {
  font-size: 12px;
  color: var(--ink);
  opacity: 0.65;
}

/* Smaller variant for secondary sections (e.g. "Similar agents" on the
   agent detail page) that shouldn't compete with the page's main heading. */
.section-head--sub h2 {
  font-size: 17px;
}

.similar-agents-section {
  margin-top: 8px;
}

/* ---------- how it works ---------- */

.how-it-works {
  display: flex;
  margin: 8px 0 40px;
}

.how-step {
  flex: 1 1 0;
  padding: 0 28px;
  border-left: 1px solid var(--line);
}

.how-step:first-child {
  padding-left: 0;
  border-left: none;
}

.how-step-num {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 44px;
  line-height: 1;
  color: var(--green-dark);
  margin-bottom: 12px;
}

.how-step-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  margin: 0 0 8px;
  color: var(--ink);
}

.how-step-desc {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
  opacity: 0.7;
  margin: 0;
}

/* ---------- trending ---------- */

.trending-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 8px 0 18px;
}

.trending-card {
  padding-right: 54px;
}

.trending-rank {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 0 7px 0 8px;
  background: var(--green);
  color: var(--cream);
}

/* ---------- listing panel ---------- */

/* Wraps a listing's heading + list in its own shaded block so it reads as
   one bounded unit against the cream body, rather than a border-top rule
   floating in open space. */
.listing-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  margin: 8px 0 18px;
  padding: 26px 22px 20px;
}

.listing-panel .section-head {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

/* ---------- agent ledger rows ---------- */

.agent-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.listing-panel-actions {
  display: flex;
  justify-content: center;
  margin-top: 26px;
}

.agent-row {
  position: relative;
  display: block;
  text-decoration: none;
  color: var(--ink);
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px 18px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

/* Invisible full-cover link that makes the whole card clickable
   without nesting a real <a> (the tags below) inside another <a>.
   z-index: 1 because .agent-desc/.github-stat use opacity < 1, which
   (per spec) gives them their own stacking context at level 0 too —
   without this they'd paint above the overlay and swallow its clicks. */
.agent-row-link {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.agent-row:hover {
  border-color: var(--green);
  box-shadow: 0 4px 10px rgba(74, 51, 32, 0.12);
  transform: translateY(-2px);
}

.agent-row:active {
  border-color: var(--green);
  box-shadow: 0 1px 4px rgba(74, 51, 32, 0.15);
  transform: translateY(0);
}

.agent-row-top {
  margin-bottom: 4px;
}

.agent-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.agent-meta-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  row-gap: 6px;
  column-gap: 14px;
  margin-bottom: 8px;
}

.agent-version {
  font-size: 12px;
  color: var(--green-dark);
  white-space: nowrap;
}

.github-badge {
  display: contents;
}

.github-stat,
.github-updated {
  font-size: 11px;
  opacity: 0.6;
  white-space: nowrap;
}

.github-stat {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.github-star-icon {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
}

/* ---------- watchlist bookmark ---------- */

/* Small icon-only bookmark button pinned to an agent-row card's
   top-right corner, aligned with the version number below it.
   z-index: 2 keeps it clickable above .agent-row-link (z-index: 1). */
.watchlist-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  opacity: 0.4;
  cursor: pointer;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.watchlist-btn svg {
  width: 15px;
  height: 15px;
}

.watchlist-btn:hover {
  opacity: 1;
  background: rgba(47, 107, 63, 0.08);
}

.watchlist-btn.is-active {
  opacity: 1;
  color: var(--green);
}

/* Trending cards already reserve their top-right corner for the
   #1/#2/#3 ranking ribbon, so the bookmark sits just below it. */
.trending-card .watchlist-btn {
  top: 32px;
}

/* Larger, labeled variant used on the agent detail page next to
   "View repo" / "View demo" — inherits .btn's border/padding. */
.watchlist-btn-lg.is-active {
  background: var(--green);
  border-color: var(--green);
  color: var(--cream);
}

.watchlist-btn-lg svg {
  width: 14px;
  height: 14px;
}

.agent-desc {
  font-size: 13px;
  line-height: 1.55;
  margin: 4px 0 8px;
  opacity: 0.9;
}

.agent-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  position: relative;
  z-index: 2;
  font-size: 11px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--ink);
  background: var(--panel);
  text-decoration: none;
}

.empty-state {
  padding: 40px 16px;
  border: 1px dashed var(--line);
  text-align: left;
  font-size: 13px;
}

.empty-state strong {
  display: block;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 6px;
}

.empty-state-cta {
  display: flex;
  width: fit-content;
  margin-top: 18px;
}

.empty-state-cta:not(.btn-solid) {
  min-height: 36px;
  padding: 8px 14px;
  font-size: 12px;
}

/* ---------- skeleton loading ---------- */

@keyframes skeleton-pulse {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

.skeleton-block {
  background: var(--line-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-row {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px 18px;
}

.skeleton-name {
  width: 40%;
  height: 17px;
  margin-bottom: 12px;
}

.skeleton-line {
  width: 100%;
  height: 11px;
  margin-bottom: 8px;
}

.skeleton-line--short {
  width: 65%;
  margin-bottom: 14px;
}

.skeleton-tags {
  display: flex;
  gap: 8px;
}

.skeleton-tag {
  width: 64px;
  height: 20px;
}

.skeleton-row:nth-child(2) .skeleton-block,
.skeleton-row:nth-child(2n) .skeleton-block {
  animation-delay: 0.15s;
}

.skeleton-row:nth-child(3) .skeleton-block {
  animation-delay: 0.3s;
}

.skeleton-row:nth-child(4) .skeleton-block {
  animation-delay: 0.45s;
}

/* ---------- skeleton — agent detail ---------- */

.skeleton-detail-head {
  padding: 40px 0 20px;
  border-bottom: 1px solid var(--line);
}

.skeleton-detail-name {
  width: 55%;
  height: 30px;
  margin-bottom: 14px;
}

.skeleton-detail-line {
  width: 100%;
  height: 13px;
  margin-bottom: 10px;
}

.skeleton-detail-btn {
  width: 130px;
  height: 44px;
  border-radius: 3px;
}

/* ---------- forms ---------- */

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 12px;
  margin-bottom: 6px;
  color: var(--ink);
}

.field .hint {
  display: block;
  font-size: 11px;
  opacity: 0.65;
  margin-top: 5px;
}

.field input[type="text"],
.field input[type="url"],
.field textarea,
.field select {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fff;
  color: var(--ink);
}

.field textarea {
  resize: vertical;
  min-height: 90px;
}

.required-mark {
  color: var(--danger);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 26px;
}

.form-msg {
  font-size: 12px;
}

.form-msg.error {
  color: var(--danger);
}

.form-msg.success {
  color: var(--green-dark);
}

/* ---------- search ---------- */

.search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.search-bar input[type="text"] {
  flex: 1 1 220px;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fff;
  color: var(--ink);
}

.search-bar select {
  flex: 1 1 auto;
  min-width: 140px;
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fff;
  color: var(--ink);
}

.category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.category-chip {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.4;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
}

.category-chip:hover {
  border-color: var(--green);
}

.category-chip.is-active {
  background: var(--green);
  border-color: var(--green);
  color: var(--cream);
}

/* ---------- agent detail ---------- */

.detail-head {
  padding: 40px 0 20px;
  border-bottom: 1px solid var(--line);
}

.detail-head .agent-row-top {
  margin-bottom: 10px;
}

.detail-head .agent-name {
  font-size: 30px;
}

.detail-head .agent-version {
  font-size: 13px;
}

.detail-desc {
  font-size: 15px;
  line-height: 1.7;
  margin: 18px 0;
  max-width: 60ch;
  overflow-wrap: anywhere;
}

.detail-links {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.detail-row {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.detail-row-label {
  font-size: 11px;
  opacity: 0.65;
  margin-bottom: 6px;
}

/* ---------- report agent ---------- */

.report-agent-block {
  margin-top: 26px;
  padding-top: 16px;
}

.report-link {
  font-size: 13px;
  color: var(--green-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.report-link:hover {
  color: var(--ink);
}

.report-form {
  max-width: 320px;
  margin-top: 12px;
}

.report-form .field {
  margin-bottom: 10px;
}

.report-form .field label {
  font-size: 11px;
  margin-bottom: 4px;
}

.report-form .field select,
.report-form .field textarea {
  font-size: 13px;
  padding: 7px 9px;
}

.report-form .field textarea {
  min-height: 56px;
}

.report-form .form-actions {
  margin-top: 8px;
  gap: 10px;
}

.report-confirm {
  font-size: 11px;
  color: var(--green-dark);
  margin-top: 12px;
  opacity: 0.85;
}

/* ---------- static content pages ---------- */

.content-page {
  max-width: 60ch;
  padding-bottom: 40px;
}

.content-page p {
  font-size: 14px;
  line-height: 1.7;
  margin: 0 0 16px;
}

.content-page ul {
  margin: 0 0 16px;
  padding-left: 20px;
}

.content-page li {
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 8px;
}

.content-page h3 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  margin: 28px 0 10px;
}

.content-note {
  font-size: 12px;
  opacity: 0.65;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}

/* ---------- docs page ---------- */

.docs-content {
  max-width: 720px;
  padding-bottom: 40px;
}

.docs-content p {
  font-size: 14px;
  line-height: 1.7;
  margin: 0 0 16px;
}

.docs-content code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: var(--panel);
  padding: 1px 5px;
  border-radius: 2px;
}

.docs-content h3 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  margin: 32px 0 10px;
}

.docs-content h3:first-child {
  margin-top: 0;
}

.code-block {
  display: block;
  margin: 0 0 16px;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink);
  overflow-x: auto;
  white-space: pre;
  -webkit-overflow-scrolling: touch;
}

.code-block code {
  background: none;
  padding: 0;
}

.docs-table-wrap {
  overflow-x: auto;
  margin: 0 0 16px;
}

.docs-table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-size: 13px;
}

.docs-table th,
.docs-table td {
  text-align: left;
  padding: 8px 12px;
  border: 1px solid var(--line);
  vertical-align: top;
}

.docs-table th {
  background: var(--panel);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.75;
}

/* ---------- scroll reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.65s ease-out, transform 0.65s ease-out;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ---------- responsive ---------- */

@media (max-width: 560px) {
  .wrap {
    padding: 0 16px;
  }

  .hero {
    padding: 36px 0 28px;
  }

  .hero h1 {
    font-size: 28px;
    max-width: none;
  }

  .hero p.tagline {
    font-size: 16px;
    max-width: none;
  }

  .hero-actions .btn {
    flex: 1 1 auto;
  }

  .hero-banner {
    margin-bottom: 14px;
  }

  .btn-cta {
    width: 100%;
    padding: 14px 24px;
  }

  .stats-bar {
    padding: 16px 0;
    gap: 8px;
  }

  .stats-bar-value {
    font-size: 22px;
  }

  .nav {
    display: none;
  }

  .section-head {
    padding-top: 22px;
  }

  .listing-panel {
    padding: 20px 16px 16px;
  }

  .section-head h2 {
    font-size: 19px;
  }

  .section-head--topic {
    margin-top: 44px;
    padding-top: 30px;
    border-top-width: 3px;
  }

  .section-head--topic h2 {
    font-size: 23px;
  }

  .how-it-works {
    flex-direction: column;
    gap: 28px;
    margin-bottom: 32px;
  }

  .how-step {
    padding: 22px 0 0;
    border-left: none;
    border-top: 1px solid var(--line);
  }

  .how-step:first-child {
    padding-top: 0;
    border-top: none;
  }

  .how-step-num {
    font-size: 38px;
  }

  .agent-row {
    padding: 18px 12px;
  }

  .trending-card {
    padding-right: 46px;
  }

  .detail-head {
    padding: 28px 0 18px;
  }

  .detail-head .agent-name {
    font-size: 23px;
  }

  .form-actions {
    flex-wrap: wrap;
  }

  .form-actions .btn {
    width: 100%;
  }
}

@media (max-width: 380px) {
  .brand-name {
    font-size: 18px;
  }

  .brand img {
    width: 34px;
    height: 34px;
  }

  .chain-badge {
    font-size: 9px;
    padding: 2px 7px;
  }
}

@media (max-width: 340px) {
  .header-tagline {
    display: none;
  }
}
