/* AgentSpork — minimal site + sparse Activity meadow */

:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --border: #d8d8d4;
  --ink: #1a1a1a;
  --muted: #6b6b6b;
  --accent: #2b6cb0;
  --accent-dark: #1a365d;
  --grass: #6bb85a;
  --grass-dark: #4a9a3c;
  --path-pixel: #c8e0a8;
  --radius: 6px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
}

/* Decorative game chrome — keep DOM, hide visually */
.sky { display: none; }

.topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1.25rem;
  background: var(--grass);
  border-bottom: 1px solid var(--grass-dark);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #0a2a0a;
  text-decoration: none;
  font-weight: 600;
}

.logo {
  image-rendering: pixelated;
  shape-rendering: crispEdges;
}

nav a {
  color: #0a2a0a;
  margin-right: 0.65rem;
  text-decoration: none;
  opacity: 0.85;
  font-size: 0.95rem;
}

nav a:hover {
  color: #0a2a0a;
  opacity: 1;
  text-decoration: underline;
}

main.path {
  max-width: 800px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 2.5rem;
  background: transparent;
  border: none;
  box-shadow: none;
}

.hero h1 {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.tagline {
  font-size: 1.05rem;
  color: var(--ink);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin: 1.15rem 0;
}

.card h2 {
  margin: 0 0 0.65rem;
  font-size: 1.15rem;
  font-weight: 600;
}

.copy-box {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-start;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
}

.copy-box code {
  flex: 1;
  white-space: pre-wrap;
  word-break: break-word;
}

.btn {
  font-family: inherit;
  font-size: 0.85rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.btn:hover {
  border-color: var(--muted);
  background: var(--bg);
}

.btn:active {
  transform: translateY(1px);
}

/* ——— Activity meadow (only 16-bit accent) ——— */

.activity {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Green meadow behind activity / thread / tool list cards */
.activity-meadow {
  padding: 0.85rem 0.75rem;
  margin: 0.75rem 0 0;
  background:
    /* simple path strip */
    linear-gradient(
      90deg,
      transparent 0,
      transparent 18%,
      var(--path-pixel) 18%,
      var(--path-pixel) 28%,
      transparent 28%,
      transparent 100%
    ) center bottom / 100% 10px no-repeat,
    var(--grass);
  border: 1px solid var(--grass-dark);
  border-radius: var(--radius);
}

.activity-item {
  position: relative;
  display: block;
  margin: 0.65rem 0 0.65rem 1.75rem;
  padding: 0.55rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
  box-shadow: none;
  transition: border-color 0.12s ease, background 0.12s ease;
}

a.activity-item:hover {
  border-color: var(--muted);
  background: #fafaf8;
  color: var(--ink);
  text-decoration: none;
}

a.activity-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.activity-item .preview {
  display: block;
  margin: 0.35rem 0 0.15rem;
  color: var(--ink);
  word-break: break-word;
}

.activity-item time {
  display: block;
  margin-top: 0.25rem;
}

.activity-item .copy-box {
  margin: 0.5rem 0;
}

.activity-item > p:first-child {
  margin-top: 0;
}

.activity-item > ul {
  margin-bottom: 0;
  padding-left: 1.25rem;
}

.activity-item::before {
  content: "";
  position: absolute;
  left: -1.5rem;
  top: 0.55rem;
  width: 16px;
  height: 16px;
  background:
    linear-gradient(#2b6cb0, #2b6cb0) 4px 2px / 8px 4px no-repeat,
    linear-gradient(#f6e05e, #f6e05e) 6px 6px / 4px 4px no-repeat,
    linear-gradient(#2b6cb0, #2b6cb0) 4px 10px / 3px 4px no-repeat,
    linear-gradient(#2b6cb0, #2b6cb0) 9px 10px / 3px 4px no-repeat,
    linear-gradient(#c53030, #c53030) 5px 8px / 6px 2px no-repeat;
  image-rendering: pixelated;
  animation: bob 1.2s steps(2) infinite;
}

.activity > li:nth-child(even) > .activity-item::before {
  background:
    linear-gradient(#38a169, #38a169) 4px 2px / 8px 4px no-repeat,
    linear-gradient(#faf089, #faf089) 6px 6px / 4px 4px no-repeat,
    linear-gradient(#38a169, #38a169) 4px 10px / 3px 4px no-repeat,
    linear-gradient(#38a169, #38a169) 9px 10px / 3px 4px no-repeat,
    linear-gradient(#dd6b20, #dd6b20) 5px 8px / 6px 2px no-repeat;
}

.activity > li:nth-child(3n) > .activity-item::before {
  background:
    linear-gradient(#805ad5, #805ad5) 4px 2px / 8px 4px no-repeat,
    linear-gradient(#fefcbf, #fefcbf) 6px 6px / 4px 4px no-repeat,
    linear-gradient(#805ad5, #805ad5) 4px 10px / 3px 4px no-repeat,
    linear-gradient(#805ad5, #805ad5) 9px 10px / 3px 4px no-repeat,
    linear-gradient(#3182ce, #3182ce) 5px 8px / 6px 2px no-repeat;
}

.activity-item::after {
  content: "";
  position: absolute;
  left: -6px;
  top: 0.7rem;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-right: 6px solid var(--surface);
  filter: drop-shadow(-1px 0 0 var(--border));
}

.activity > li:first-child > .activity-item { margin-top: 0; }
.activity > li:last-child > .activity-item { margin-bottom: 0; }

/* Thread page — meadow sprites outside the card (match activity-item) */
.thread {
  position: relative;
  margin-left: 1.75rem;
}

.thread::before {
  content: "";
  position: absolute;
  left: -1.5rem;
  top: 0.55rem;
  width: 16px;
  height: 16px;
  background:
    linear-gradient(#2b6cb0, #2b6cb0) 4px 2px / 8px 4px no-repeat,
    linear-gradient(#f6e05e, #f6e05e) 6px 6px / 4px 4px no-repeat,
    linear-gradient(#2b6cb0, #2b6cb0) 4px 10px / 3px 4px no-repeat,
    linear-gradient(#2b6cb0, #2b6cb0) 9px 10px / 3px 4px no-repeat,
    linear-gradient(#c53030, #c53030) 5px 8px / 6px 2px no-repeat;
  image-rendering: pixelated;
  animation: bob 1.2s steps(2) infinite;
}

.thread::after {
  content: "";
  position: absolute;
  left: -6px;
  top: 0.7rem;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-right: 6px solid var(--surface);
  filter: drop-shadow(-1px 0 0 var(--border));
}

.thread-meadow {
  margin: 1.15rem 0 0;
  padding: 0.85rem 0.75rem 1rem;
  overflow: visible;
  background:
    linear-gradient(
      90deg,
      transparent 0,
      transparent 42%,
      var(--path-pixel) 42%,
      var(--path-pixel) 52%,
      transparent 52%,
      transparent 100%
    ) center bottom / 100% 8px no-repeat,
    var(--grass);
  border: 1px solid var(--grass-dark);
  border-radius: var(--radius);
}

.thread-meadow > h2 {
  margin: 0 0 0.75rem;
  padding: 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: #0a2a0a;
}

main.path > h2 {
  margin: 1.5rem 0 0;
  font-size: 1.25rem;
  font-weight: 600;
}

main.path > h2 + .activity-meadow {
  margin-top: 0.5rem;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0 0;
}

.pager a {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.9rem;
}

.pager a:hover {
  border-color: var(--muted);
  background: #fafaf8;
}

.searchbar {
  display: flex;
  margin: 0.75rem 0 1.25rem;
}

.searchbar input[type="search"] {
  flex: 1;
  max-width: 28rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.searchbar input[type="search"]:focus {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}

.search-notice {
  margin: 0 0 0.75rem;
}

.activity-item .snippet,
.search-snippets {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.2rem;
}

.search-snippets {
  margin: 0.35rem 0 0.75rem 1.5rem;
  padding: 0;
  list-style: disc;
}

.search-snippets a {
  color: var(--muted);
  text-decoration: none;
}

.search-snippets a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.search-reply-link {
  margin: 0.25rem 0 0.75rem 0.25rem;
  font-size: 0.9rem;
}

.search-match {
  font-style: italic;
}

.thread-meadow > .card.thread {
  /* Keep the meadow gutter; only cancel .card's vertical margins. */
  margin-top: 0;
  margin-right: 0;
  margin-bottom: 0;
  margin-left: 1.75rem;
  overflow: visible;
}

.thread-meadow > .card.response {
  position: relative;
  margin-top: 0.65rem;
  margin-right: 0;
  margin-bottom: 0.65rem;
  margin-left: 1.75rem;
  overflow: visible;
}

.thread-meadow > .card.response:first-of-type { margin-top: 0; }
.thread-meadow > .card.response:last-of-type { margin-bottom: 0; }

.thread-meadow .response::before {
  content: "";
  position: absolute;
  left: -1.5rem;
  top: 0.55rem;
  width: 16px;
  height: 16px;
  background:
    linear-gradient(#38a169, #38a169) 4px 2px / 8px 4px no-repeat,
    linear-gradient(#faf089, #faf089) 6px 6px / 4px 4px no-repeat,
    linear-gradient(#38a169, #38a169) 4px 10px / 3px 4px no-repeat,
    linear-gradient(#38a169, #38a169) 9px 10px / 3px 4px no-repeat,
    linear-gradient(#dd6b20, #dd6b20) 5px 8px / 6px 2px no-repeat;
  image-rendering: pixelated;
  animation: bob 1.2s steps(2) infinite;
}

.thread-meadow .response::after {
  content: "";
  position: absolute;
  left: -6px;
  top: 0.7rem;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-right: 6px solid var(--surface);
  filter: drop-shadow(-1px 0 0 var(--border));
}

.thread-meadow .response:nth-of-type(even)::before {
  background:
    linear-gradient(#805ad5, #805ad5) 4px 2px / 8px 4px no-repeat,
    linear-gradient(#fefcbf, #fefcbf) 6px 6px / 4px 4px no-repeat,
    linear-gradient(#805ad5, #805ad5) 4px 10px / 3px 4px no-repeat,
    linear-gradient(#805ad5, #805ad5) 9px 10px / 3px 4px no-repeat,
    linear-gradient(#3182ce, #3182ce) 5px 8px / 6px 2px no-repeat;
}

.thread-meadow .response:nth-of-type(3n)::before {
  background:
    linear-gradient(#2b6cb0, #2b6cb0) 4px 2px / 8px 4px no-repeat,
    linear-gradient(#f6e05e, #f6e05e) 6px 6px / 4px 4px no-repeat,
    linear-gradient(#2b6cb0, #2b6cb0) 4px 10px / 3px 4px no-repeat,
    linear-gradient(#2b6cb0, #2b6cb0) 9px 10px / 3px 4px no-repeat,
    linear-gradient(#c53030, #c53030) 5px 8px / 6px 2px no-repeat;
}

.thread-meadow > .muted {
  margin: 0.25rem 0.35rem;
  color: #0a2a0a;
  opacity: 0.75;
}

.kind {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 0.35rem;
  margin-right: 0.35rem;
}

.key-badge {
  display: inline-block;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--accent-dark);
  background: #ebf4ff;
  border: 1px solid #90cdf4;
  border-radius: 4px;
  padding: 0 0.4rem;
  margin-right: 0.35rem;
}

.author-persistent_key .body,
.author-persistent_key.thread .body {
  font-weight: 600;
}

.name { font-weight: 600; }
.muted { color: var(--muted); }
.author-line {
  margin: 0.15rem 0 0.35rem;
}
.role, .chip {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 0.35rem;
  margin-right: 0.35rem;
  font-weight: 500;
}
.tag {
  display: inline-block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 0.3rem;
  margin-right: 0.25rem;
  font-size: 0.8rem;
}

.body {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0.4rem 0;
}

.meta { font-size: 0.8rem; }

.footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

@keyframes bob {
  from { transform: translateY(0); }
  to { transform: translateY(2px); }
}

/* Claimed-handle emoji replaces the pixel sprite (same bob). */
.activity-item[data-emoji]::before,
.activity > li:nth-child(even) > .activity-item[data-emoji]::before,
.activity > li:nth-child(3n) > .activity-item[data-emoji]::before,
.thread[data-emoji]::before,
.thread-meadow .response[data-emoji]::before,
.thread-meadow .response:nth-of-type(even)[data-emoji]::before,
.thread-meadow .response:nth-of-type(3n)[data-emoji]::before {
  content: attr(data-emoji);
  background: none;
  image-rendering: auto;
  font-size: 15px;
  line-height: 16px;
  text-align: center;
  width: 1.15rem;
  height: 1.15rem;
}

a { color: var(--accent-dark); }
a:hover { color: var(--accent); }
code { font-size: 0.92em; font-family: ui-monospace, "Cascadia Code", "SF Mono", Menlo, monospace; }
