/* AgentPunks: "agent terminal". Dark console ink, hairline rules, mono read-outs,
   one signal colour (lime) for anything live or pressable. */
:root {
  --ink: #0b0d10;
  --panel: #12151a;
  --panel-2: #181c23;
  --rule: #262c36;
  --rule-2: #333b48;
  --text: #eef1f5;
  --dim: #8b94a3;
  --lime: #c8f135;
  --lime-deep: #9fc41c;
  --warn: #ff7a59;
  --display: "Bricolage Grotesque", "Arial Narrow", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 8px;
  --gut: clamp(16px, 4vw, 48px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0; background: var(--ink); color: var(--text); font: 16px/1.6 var(--body); overflow-x: hidden;
  background-image: linear-gradient(var(--panel) 1px, transparent 1px), linear-gradient(90deg, var(--panel) 1px, transparent 1px);
  background-size: 48px 48px; background-position: -1px -1px;
}
a { color: inherit; }
img { max-width: 100%; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--dim); }
.small { font-size: 13px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }
code { font-family: var(--mono); font-size: .88em; }
h1, h2, h3 { font-family: var(--display); margin: 0; text-wrap: balance; }
h2 { font-size: clamp(22px, 2.6vw, 30px); font-weight: 800; letter-spacing: -.01em; }
h3 { font-size: 18px; }

/* header */
.bar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: flex; align-items: center; gap: 24px;
  padding: 12px var(--gut); background: color-mix(in srgb, var(--ink) 88%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 800 19px var(--display); }
.brand img { width: 28px; height: 28px; image-rendering: pixelated; border-radius: 4px; }
.nav { display: flex; gap: 20px; font: 13px var(--mono); }
.nav a { text-decoration: none; color: var(--dim); }
.nav a:hover { color: var(--lime); }
.lookup { margin-left: auto; }
.lookup input { width: 230px; background: var(--panel); border: 1px solid var(--rule); border-radius: 99px; padding: 7px 14px; font: 12px var(--mono); }

main { max-width: 1180px; margin: 0 auto; padding-inline: var(--gut); display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(40px, 6vw, 72px); }

/* hero */
.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(24px, 5vw, 64px); align-items: center; padding-block: clamp(36px, 6vw, 72px) 0; }
.hero-copy { min-width: 0; }
.kicker { flex-wrap: wrap; margin: 0 0 18px; font: 500 12px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); display: flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); flex: none; }
.dot.live { background: var(--lime); box-shadow: 0 0 0 0 var(--lime); animation: ping 2s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 8px transparent; } }
h1 { font-size: clamp(44px, 7.4vw, 92px); line-height: .95; font-weight: 800; letter-spacing: -.03em; text-transform: uppercase; }
h1 span { color: var(--lime); }
.lede { color: var(--dim); max-width: 56ch; font-size: 17px; margin: 22px 0 28px; }
.lede b { color: var(--text); }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 12px 20px; border-radius: var(--r); font: 700 14px var(--mono); text-decoration: none; cursor: pointer; border: 1px solid transparent; }
.btn-lime { background: var(--lime); color: #11150a; }
.btn-lime:hover { background: var(--lime-deep); }
.btn-line { border-color: var(--rule-2); background: var(--panel); }
.btn-line:hover { border-color: var(--lime); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; }
.hero-art { margin: 0; display: grid; gap: 8px; justify-items: center; }
.hero-art img { width: min(100%, 420px); height: auto; aspect-ratio: 1; image-rendering: pixelated; border: 1px solid var(--rule); border-radius: var(--r); background: var(--panel); }
.hero-art figcaption { font-size: 12px; color: var(--dim); }

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--rule); border-radius: var(--r); background: var(--panel); }
.stat { display: grid; gap: 2px; padding: 18px 20px; border-left: 1px solid var(--rule); min-width: 0; }
.stat:first-child { border-left: 0; }
.label { font: 500 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.value { font: 700 clamp(22px, 2.6vw, 32px)/1.15 var(--mono); }
#sStatus { color: var(--lime); }
.unit { font-size: 12px; color: var(--dim); }

/* curve */
.curve-card { border: 1px solid var(--rule); border-radius: var(--r); background: var(--panel); padding: clamp(16px, 3vw, 24px); display: grid; gap: 12px; }
.curve-head { display: flex; justify-content: space-between; align-items: baseline; }
.pct { color: var(--lime); font-size: 20px; font-weight: 700; }
.curve-wrap { height: 200px; }
.curve-wrap svg { width: 100%; height: 100%; display: block; overflow: visible; }
.curve-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--dim); }
.curve-foot span:nth-child(2) { color: var(--text); }

/* mint + live */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.panel { border: 1px solid var(--rule); border-radius: var(--r); background: var(--panel); padding: clamp(16px, 3vw, 24px); display: grid; gap: 16px; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; }
.pill { font: 600 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--lime); border: 1px solid var(--lime-deep); border-radius: 99px; padding: 2px 10px; }
.stepper { display: grid; grid-template-columns: 52px 1fr auto 52px; align-items: center; border: 1px solid var(--rule-2); border-radius: var(--r); overflow: hidden; background: var(--ink); }
.stepper button { height: 56px; background: var(--panel-2); border: 0; font-size: 24px; cursor: pointer; }
.stepper button:hover { color: var(--lime); }
.stepper input { min-width: 0; text-align: right; background: transparent; border: 0; font-size: 30px; font-weight: 700; padding: 0 8px; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.stepper-unit { color: var(--dim); font: 13px var(--mono); padding-right: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { background: var(--panel-2); border: 1px solid var(--rule); border-radius: 99px; padding: 4px 12px; font: 12px var(--mono); cursor: pointer; }
.chips button:hover, .chips button[aria-pressed="true"] { border-color: var(--lime); color: var(--lime); }
.rows { margin: 0; display: grid; gap: 6px; }
.rows div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--rule); padding-bottom: 6px; }
.rows dt { color: var(--dim); font: 13px var(--mono); }
.rows dd { margin: 0; font-size: 14px; }
#mCost { color: var(--lime); font-weight: 700; }
.say { display: grid; gap: 6px; }
.copyline { display: flex; align-items: center; gap: 8px; background: var(--ink); border: 1px solid var(--rule); border-radius: 6px; padding: 8px 10px; min-width: 0; }
.copyline code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; }
.copy { flex: none; background: none; border: 1px solid var(--rule-2); border-radius: 99px; padding: 2px 10px; font: 11px var(--mono); cursor: pointer; color: var(--dim); }
.copy:hover { color: var(--lime); border-color: var(--lime); }
.browser-mint summary { cursor: pointer; font: 13px var(--mono); color: var(--dim); }
.browser-mint[open] { display: grid; gap: 8px; }
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 560px; overflow-y: auto; }
.feed li { display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--rule); font-size: 13px; }
.feed li.muted { display: block; border: 0; }
.feed img { width: 36px; height: 36px; image-rendering: pixelated; border-radius: 4px; }
.feed .who { font-family: var(--mono); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed .who b { color: var(--lime); font-weight: 600; }
.feed .what { color: var(--dim); font-family: var(--mono); font-size: 12px; }
.feed .ago { color: var(--dim); font: 12px var(--mono); }

/* punks */
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.tabs { display: flex; gap: 6px; }
.tabs button { background: none; border: 1px solid var(--rule); border-radius: 99px; padding: 3px 12px; font: 12px var(--mono); cursor: pointer; color: var(--dim); }
.tabs button[aria-selected="true"] { color: var(--lime); border-color: var(--lime); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; margin-top: 14px; }
.card { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r); padding: 5px; cursor: pointer; text-align: left; display: grid; gap: 4px; }
.card:hover { border-color: var(--lime-deep); }
.card img { width: 100%; aspect-ratio: 1; image-rendering: pixelated; border-radius: 4px; display: block; }
.card .meta { display: flex; justify-content: space-between; gap: 4px; font: 11px var(--mono); padding: 0 2px; }
.card .meta span:last-child { color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.more { display: flex; justify-content: center; margin-top: 16px; }

/* rules / faq / agents */
.rule-table { margin: 0; border: 1px solid var(--rule); border-radius: var(--r); background: var(--panel); }
.rule-table div { display: grid; grid-template-columns: 220px 1fr; gap: 16px; padding: 12px 18px; border-top: 1px solid var(--rule); }
.rule-table div:first-child { border-top: 0; }
.rule-table dt { font: 13px var(--mono); color: var(--dim); }
.rule-table dd { margin: 0; font-weight: 600; display: grid; }
.rule-table small { font-weight: 400; color: var(--dim); font-size: 13px; }
.faq details { border: 1px solid var(--rule); border-radius: var(--r); background: var(--panel); padding: 2px 18px; margin-bottom: 8px; }
.faq summary { cursor: pointer; padding: 12px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::after { content: "+"; font-family: var(--mono); color: var(--lime); }
.faq details[open] summary::after { content: "−"; }
.faq p { margin: 0 0 14px; color: var(--dim); max-width: 70ch; }
.setup { margin: 0 0 28px; padding-left: 22px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.setup li { min-width: 0; }
.setup li::marker { font-family: var(--mono); color: var(--lime); }
.setup .copyline { margin-top: 6px; max-width: 560px; }
.cmds { margin: 0 0 12px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--panel); }
.cmds div { display: grid; grid-template-columns: minmax(0, 340px) 1fr; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--rule); }
.cmds div:first-child { border-top: 0; }
.cmds dt { min-width: 0; overflow-x: auto; white-space: nowrap; }
.cmds dd { margin: 0; color: var(--dim); font-size: 14px; }

.foot { max-width: 1180px; margin: 64px auto 0; padding: 24px var(--gut) calc(32px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--rule); display: grid; gap: 8px; }
.addrs { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12px; color: var(--dim); }
.addrs a { color: var(--dim); }
.addrs a:hover { color: var(--lime); }

/* modal / toast */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(4, 5, 8, .8); display: grid; place-items: center; padding: 16px; }
.modal-card { position: relative; display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 300px); gap: 22px; background: var(--panel); border: 1px solid var(--rule-2); border-radius: var(--r); padding: 22px; max-height: 92vh; overflow: auto; }
.modal-card img { width: 100%; image-rendering: pixelated; border-radius: 6px; }
.modal-x { position: absolute; top: 6px; right: 10px; background: none; border: 0; font-size: 26px; cursor: pointer; color: var(--dim); }
.modal-info h3 { font-size: 24px; }
.traits { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.traits li { display: flex; justify-content: space-between; gap: 8px; background: var(--ink); border-radius: 4px; padding: 6px 10px; font-size: 14px; }
.traits li span:first-child { color: var(--dim); font: 12px var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(22px + env(safe-area-inset-bottom, 0px)); z-index: 60; background: var(--panel-2); border: 1px solid var(--lime-deep); border-radius: 99px; padding: 8px 18px; font: 13px var(--mono); }

@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-art { justify-items: start; }
  .hero-art img { width: min(100%, 320px); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .split { grid-template-columns: 1fr; }
  .nav { display: none; }
  .lookup input { width: 170px; }
}
@media (max-width: 560px) {
  .rule-table div, .cmds div { grid-template-columns: 1fr; gap: 2px; }
  .modal-card { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
  .lookup { display: none; }
  .curve-foot span:nth-child(2) { order: 3; width: 100%; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .dot.live { animation: none; } }
