Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

21.1 KB
Raw Blame
/* Trading Swarms — directory + dashboard. All color/space/type from /tokens.css. */
@import './ui-juice.css';

body {
	font-family: var(--font-body, 'Inter', system-ui, sans-serif);
	-webkit-font-smoothing: antialiased;
}

.sw-shell {
	max-width: 1180px;
	margin: 0 auto;
	padding: var(--space-xl) var(--space-lg) var(--space-2xl);
	min-height: 70vh;
}
/* Below ~360px the lg inline padding costs more than a fifth of the viewport, which
   is what pushed the card grid past the right edge on a 320px phone. */
@media (max-width: 420px) {
	.sw-shell { padding-inline: var(--space-md); }
}

/* ── hero ─────────────────────────────────────────────────────────────────── */
.sw-hero {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-lg);
	align-items: flex-end;
	justify-content: space-between;
	margin-bottom: var(--space-xl);
}
.sw-hero h1 {
	font-family: var(--font-display, inherit);
	font-size: var(--text-2xl);
	line-height: 1.05;
	margin: 0 0 var(--space-xs);
	color: var(--ink-bright);
	letter-spacing: -0.02em;
}
.sw-hero p {
	margin: 0;
	max-width: 56ch;
	color: var(--ink-dim);
	font-size: var(--text-ui);
	line-height: 1.5;
}
.sw-hero-actions {
	display: flex;
	gap: var(--space-sm);
	align-items: center;
}

/* ── buttons ──────────────────────────────────────────────────────────────── */
.sw-btn {
	font: inherit;
	font-size: var(--text-md);
	font-weight: 600;
	padding: var(--space-xs) var(--space-md);
	border-radius: var(--radius-md);
	border: 1px solid var(--stroke-strong);
	background: var(--surface-2);
	color: var(--ink);
	cursor: pointer;
	transition: transform var(--duration-fast) var(--ease-standard),
		background var(--duration-fast) var(--ease-standard), border-color var(--duration-fast);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--space-2xs);
	text-decoration: none; /* the class is also worn by anchors (sign-in, create agent) */
}
.sw-btn:hover { background: var(--surface-3); transform: translateY(-1px); }
.sw-btn:active { transform: translateY(0); }
.sw-btn:focus-visible { outline: 2px solid var(--wallet-accent); outline-offset: 2px; }
.sw-btn--primary { background: var(--ink-bright); color: var(--on-accent); border-color: transparent; }
.sw-btn--primary:hover { background: #fff; }
.sw-btn--danger { background: rgba(248, 113, 113, 0.12); border-color: rgba(248, 113, 113, 0.4); color: var(--danger); }
.sw-btn--danger:hover { background: rgba(248, 113, 113, 0.2); }
.sw-btn--ghost { background: transparent; }
.sw-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.sw-btn--sm { font-size: var(--text-sm); padding: var(--space-3xs) var(--space-sm); }

/* ── directory grid ───────────────────────────────────────────────────────── */
.sw-toolbar {
	display: flex;
	gap: var(--space-sm);
	align-items: center;
	flex-wrap: wrap;
	margin-bottom: var(--space-lg);
}
.sw-seg {
	display: inline-flex;
	border: 1px solid var(--stroke);
	border-radius: var(--radius-pill);
	overflow: hidden;
	background: var(--surface-1);
}
.sw-seg button {
	font: inherit;
	font-size: var(--text-sm);
	padding: var(--space-2xs) var(--space-md);
	background: transparent;
	color: var(--ink-dim);
	border: 0;
	cursor: pointer;
	transition: color var(--duration-fast), background var(--duration-fast);
}
.sw-seg button:hover { color: var(--ink); background: var(--surface-2); }
.sw-seg button:focus-visible { outline: 2px solid var(--wallet-accent); outline-offset: -2px; }
.sw-seg button[aria-pressed='true'] { background: var(--surface-3); color: var(--ink-bright); }

.sw-grid {
	display: grid;
	/* min() so the track collapses with the viewport instead of forcing a fixed 310px
	   column (and a clipped card) inside a narrower container. */
	grid-template-columns: repeat(auto-fill, minmax(min(310px, 100%), 1fr));
	gap: var(--space-md);
}
.sw-card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: var(--space-sm);
	padding: var(--space-md);
	border: 1px solid var(--stroke);
	border-radius: var(--radius-lg);
	background: var(--surface-glass);
	cursor: pointer;
	text-decoration: none;
	color: inherit;
	transition: transform var(--duration-base) var(--ease-emphasized),
		border-color var(--duration-base), box-shadow var(--duration-base);
}
.sw-card:hover { transform: translateY(-3px); border-color: var(--stroke-strong); box-shadow: var(--shadow-2); }
.sw-card:focus-visible { outline: 2px solid var(--wallet-accent); outline-offset: 2px; }
.sw-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-sm); }
.sw-card-name { font-size: var(--text-lg); font-weight: 650; color: var(--ink-bright); margin: 0; line-height: 1.15; }
.sw-card-desc { font-size: var(--text-sm); color: var(--ink-dim); margin: 0; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sw-pill {
	font-size: var(--text-2xs);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	padding: 2px var(--space-xs);
	border-radius: var(--radius-pill);
	border: 1px solid var(--stroke);
	color: var(--ink-dim);
	white-space: nowrap;
}
.sw-pill--active { color: var(--success); border-color: rgba(74, 222, 128, 0.4); background: rgba(74, 222, 128, 0.08); }
.sw-pill--paused { color: var(--warn); border-color: rgba(251, 191, 36, 0.4); }
.sw-pill--killed { color: var(--danger); border-color: rgba(248, 113, 113, 0.4); }
.sw-pill--open { color: var(--wallet-accent); border-color: rgba(167, 139, 250, 0.4); }

.sw-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-xs); margin-top: auto; }
.sw-stat { display: flex; flex-direction: column; gap: 1px; }
.sw-stat-v { font-size: var(--text-md); font-weight: 650; color: var(--ink-bright); font-variant-numeric: tabular-nums; }
.sw-stat-l { font-size: var(--text-2xs); color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.04em; }
.pos { color: var(--success) !important; }
.neg { color: var(--danger) !important; }

/* ── dashboard ────────────────────────────────────────────────────────────── */
.sw-back { display: inline-flex; align-items: center; gap: var(--space-2xs); color: var(--ink-dim); text-decoration: none; font-size: var(--text-sm); margin-bottom: var(--space-md); }
.sw-back:hover { color: var(--ink); }

.sw-dash-head { display: flex; flex-wrap: wrap; gap: var(--space-md); align-items: flex-start; justify-content: space-between; margin-bottom: var(--space-lg); }
/* The status pill sits beside the heading, not inside it: a screen reader announcing
   the h1 should read the swarm's name, not "Test Funding". */
.sw-dash-title { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-xs); margin-bottom: var(--space-3xs); }
.sw-dash-head h1 { margin: 0; font-size: var(--text-xl); color: var(--ink-bright); overflow-wrap: anywhere; }
.sw-live { display: inline-flex; align-items: center; gap: var(--space-2xs); font-size: var(--text-2xs); color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.05em; }
.sw-live .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-faint); }
.sw-live[data-state='live'] .dot { background: var(--success); box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.18); }
.sw-live[data-state='live'] { color: var(--success); }

.sw-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: var(--space-sm); margin-bottom: var(--space-lg); }
.sw-tile { padding: var(--space-md); border: 1px solid var(--stroke); border-radius: var(--radius-lg); background: var(--surface-1); }
/* Directional flash when a live value moves: green up, red down, then settle. */
.sw-tile--up { animation: sw-tile-up 0.9s ease-out; }
.sw-tile--down { animation: sw-tile-down 0.9s ease-out; }
@keyframes sw-tile-up {
	0% { background: color-mix(in srgb, var(--success) 24%, var(--surface-1)); border-color: color-mix(in srgb, var(--success) 45%, var(--stroke)); }
	100% { background: var(--surface-1); border-color: var(--stroke); }
}
@keyframes sw-tile-down {
	0% { background: color-mix(in srgb, var(--danger) 22%, var(--surface-1)); border-color: color-mix(in srgb, var(--danger) 40%, var(--stroke)); }
	100% { background: var(--surface-1); border-color: var(--stroke); }
}
.sw-tile-v { font-size: var(--text-lg); font-weight: 700; color: var(--ink-bright); font-variant-numeric: tabular-nums; }
.sw-tile-l { font-size: var(--text-2xs); color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px; }
.sw-tile a { color: var(--wallet-accent); text-decoration: none; font-size: var(--text-sm); }
.sw-tile a:hover { text-decoration: underline; }

/* minmax(0, …) rather than a bare fr: an fr track floors at its content's min-content
   width, and the panel rows' min-content held the column open ~70px past a 320px
   viewport, clipping every panel's right edge. */
.sw-cols { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: var(--space-lg); align-items: start; }
@media (max-width: 880px) { .sw-cols { grid-template-columns: minmax(0, 1fr); } }

.sw-panel { border: 1px solid var(--stroke); border-radius: var(--radius-lg); background: var(--surface-1); overflow: hidden; margin-bottom: var(--space-lg); }
.sw-panel-h { display: flex; justify-content: space-between; align-items: center; padding: var(--space-sm) var(--space-md); border-bottom: 1px solid var(--stroke); }
.sw-panel-h h2 { margin: 0; font-size: var(--text-md); font-weight: 650; color: var(--ink); }
.sw-panel-h .count { font-size: var(--text-2xs); color: var(--ink-faint); }
.sw-panel-body { max-height: 420px; overflow-y: auto; }

.sw-row { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-xs) var(--space-md); border-bottom: 1px solid var(--surface-1); font-size: var(--text-sm); min-width: 0; overflow-wrap: anywhere; }
.sw-row:last-child { border-bottom: 0; }
.sw-row .grow { flex: 1; min-width: 0; }
.sw-row .mono { font-variant-numeric: tabular-nums; }
.sw-row .muted { color: var(--ink-dim); }
.sw-row .name { color: var(--ink-bright); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sw-bar { height: 5px; border-radius: var(--radius-pill); background: var(--surface-3); overflow: hidden; margin-top: 3px; }
.sw-bar > span { display: block; height: 100%; background: var(--wallet-accent-strong); border-radius: inherit; transition: width var(--duration-base) var(--ease-emphasized); }

/* ── members standings board ──────────────────────────────────────────────── */
.sw-member { position: relative; }
.sw-rank {
	flex: none;
	min-width: 2.2em;
	text-align: right;
	font-size: var(--text-2xs);
	font-weight: 700;
	color: var(--ink-faint);
	font-variant-numeric: tabular-nums;
}
.sw-member.is-lead {
	background: linear-gradient(90deg, var(--wallet-accent-soft), transparent 62%);
	box-shadow: inset 2px 0 0 var(--wallet-accent-strong);
}
.sw-member.is-lead .sw-rank { color: var(--wallet-accent); }
.sw-lead-mark { color: var(--wallet-accent); margin-right: 4px; font-size: 0.9em; }

.sw-member-meta { flex: none; text-align: right; }

/* Reputation = literal vote weight. Chip prominence scales with --rep (0..100):
   stronger members visibly carry more weight. data-tier gives discrete accent steps. */
.sw-rep {
	flex: none;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	line-height: 1.05;
	min-width: 2.7em;
	padding: calc(2px + var(--rep) * 0.02px) var(--space-2xs);
	border-radius: var(--radius-md);
	border: 1px solid var(--wallet-stroke);
	background: var(--wallet-accent-soft);
	font-variant-numeric: tabular-nums;
}
.sw-rep .sw-rep-v { font-weight: 800; color: var(--ink-bright); font-size: calc(var(--text-sm) + var(--rep) * 0.06px); }
.sw-rep .sw-rep-l { font-size: var(--text-2xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-faint); }
.sw-rep[data-tier='0'] { background: var(--surface-2); border-color: var(--stroke); }
.sw-rep[data-tier='0'] .sw-rep-v { color: var(--ink-dim); }
.sw-rep[data-tier='2'] { border-color: var(--wallet-stroke-strong); }
.sw-rep[data-tier='3'] {
	border-color: var(--wallet-stroke-strong);
	background: var(--wallet-accent-fill);
	box-shadow: 0 0 0 1px var(--wallet-stroke), 0 0 14px var(--wallet-glow);
}

/* Winning-side pulse: a green edge that lands then fades on a fired consensus. */
@keyframes swMemberWin {
	0%   { box-shadow: inset 3px 0 0 var(--success), 0 0 0 1px color-mix(in srgb, var(--success) 55%, transparent); background: color-mix(in srgb, var(--success) 14%, transparent); }
	100% { box-shadow: inset 0 0 0 0 transparent; background: transparent; }
}
.sw-member.sw-win { animation: swMemberWin 1.6s var(--ease-standard) forwards; }

@media (prefers-reduced-motion: reduce) {
	.sw-bar > span { transition: none; }
	.sw-member.sw-win { animation: none; }
}

.sw-vote { padding: var(--space-sm) var(--space-md); border-bottom: 1px solid var(--surface-1); font-size: var(--text-sm); min-width: 0; overflow-wrap: anywhere; }
.sw-vote-top .name { min-width: 0; }
.sw-vote:last-child { border-bottom: 0; }
.sw-vote-top { display: flex; align-items: center; gap: var(--space-xs); }
.sw-vote .verdict { font-size: var(--text-2xs); font-weight: 700; text-transform: uppercase; padding: 1px 6px; border-radius: var(--radius-pill); }
.sw-vote .verdict.fire { color: var(--success); background: rgba(74, 222, 128, 0.1); }
.sw-vote .verdict.skip { color: var(--ink-dim); background: var(--surface-2); }
.sw-vote .mint { font-family: var(--font-mono, monospace); font-size: var(--text-2xs); color: var(--ink-dim); }
.sw-vote .meter { display: flex; align-items: center; gap: var(--space-xs); margin-top: var(--space-2xs); }
.sw-meter-track { flex: 1; height: 6px; border-radius: var(--radius-pill); background: var(--surface-3); position: relative; overflow: hidden; }
.sw-meter-fill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--wallet-accent), var(--wallet-accent-strong)); border-radius: inherit; transition: width var(--duration-base) var(--ease-emphasized), background var(--duration-base) var(--ease-emphasized), box-shadow var(--duration-base) var(--ease-emphasized); }
.sw-meter-fill.fire { background: linear-gradient(90deg, var(--wallet-accent-strong), var(--success)); box-shadow: 0 0 8px var(--success); }
.sw-meter-thresh { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--ink-bright); opacity: 0.8; }
.sw-meter-thresh.glow { animation: swThreshGlow var(--duration-base) var(--ease-emphasized) var(--duration-base); }
.sw-vote .reason { color: var(--ink-faint); font-size: var(--text-2xs); margin-top: 2px; }

/* ── the firing moment ───────────────────────────────────────────────────── */
.sw-vote.sw-enter { animation: swVoteIn var(--duration-base) var(--ease-emphasized); }
.sw-vote .verdict.fire.sw-pulse { animation: swVerdictPulse var(--duration-base) var(--ease-emphasized) var(--duration-base); }

@keyframes swVoteIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes swThreshGlow {
	0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); opacity: 0.8; }
	45% { box-shadow: 0 0 10px 2px var(--success); background: var(--success); opacity: 1; }
	100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); opacity: 0.8; }
}
@keyframes swVerdictPulse {
	0%, 100% { transform: scale(1); box-shadow: none; }
	50% { transform: scale(1.16); box-shadow: 0 0 8px var(--success); }
}

/* whole-card signal: one accent ripple along the top edge of the votes header */
.sw-panel-h.sw-fired { position: relative; overflow: hidden; }
.sw-panel-h.sw-fired::after {
	content: ''; position: absolute; left: 0; top: 0; height: 2px; width: 100%;
	background: linear-gradient(90deg, transparent, var(--success), transparent);
	animation: swRipple var(--duration-base) var(--ease-emphasized);
}
@keyframes swRipple { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

@media (prefers-reduced-motion: reduce) {
	.sw-meter-fill { transition: none; }
	.sw-vote.sw-enter,
	.sw-meter-thresh.glow,
	.sw-vote .verdict.fire.sw-pulse,
	.sw-tile--up,
	.sw-tile--down,
	.sw-panel-h.sw-fired::after { animation: none; }
}

/* ── disclosure ───────────────────────────────────────────────────────────── */
.sw-disclose {
	border: 1px solid rgba(251, 191, 36, 0.3);
	background: rgba(251, 191, 36, 0.06);
	border-radius: var(--radius-md);
	padding: var(--space-sm) var(--space-md);
	font-size: var(--text-sm);
	color: var(--ink-dim);
	line-height: 1.5;
	margin-bottom: var(--space-md);
}
.sw-disclose strong { color: var(--warn); }

/* ── modal ────────────────────────────────────────────────────────────────── */
.sw-scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(var(--blur-md)); display: flex; align-items: center; justify-content: center; padding: var(--space-md); z-index: 90; animation: swFade var(--duration-fast) var(--ease-standard); }
@keyframes swFade { from { opacity: 0; } to { opacity: 1; } }
.sw-modal { width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; border: 1px solid var(--stroke-strong); border-radius: var(--radius-lg); background: var(--surface-glass); backdrop-filter: blur(var(--blur-lg)); box-shadow: var(--shadow-3); padding: var(--space-lg); }
.sw-modal h2 { margin: 0 0 var(--space-xs); font-size: var(--text-lg); color: var(--ink-bright); }
.sw-modal .sub { color: var(--ink-dim); font-size: var(--text-sm); margin: 0 0 var(--space-md); line-height: 1.45; }
.sw-field { display: flex; flex-direction: column; gap: var(--space-3xs); margin-bottom: var(--space-sm); }
.sw-field label { font-size: var(--text-sm); color: var(--ink); font-weight: 600; }
.sw-field .hint { font-size: var(--text-2xs); color: var(--ink-faint); }
.sw-field input, .sw-field select, .sw-field textarea {
	font: inherit; font-size: var(--text-md); padding: var(--space-xs) var(--space-sm);
	background: var(--surface-1); border: 1px solid var(--stroke); border-radius: var(--radius-md); color: var(--ink);
}
.sw-field input:focus, .sw-field select:focus, .sw-field textarea:focus { outline: none; border-color: var(--wallet-accent); }
.sw-grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-sm); }
@media (max-width: 460px) { .sw-grid2 { grid-template-columns: minmax(0, 1fr); } }
.sw-modal-actions { display: flex; justify-content: flex-end; gap: var(--space-sm); margin-top: var(--space-md); }
.sw-modal-err { color: var(--danger); font-size: var(--text-sm); margin-top: var(--space-xs); min-height: 1.2em; }

/* ── states ───────────────────────────────────────────────────────────────── */
.sw-msg { text-align: center; padding: var(--space-2xl) var(--space-md); color: var(--ink-dim); }
.sw-msg h3 { color: var(--ink); font-size: var(--text-lg); margin: 0 0 var(--space-xs); }
.sw-msg p { margin: 0 auto var(--space-md); max-width: 44ch; line-height: 1.5; }
.sw-skel { border: 1px solid var(--stroke); border-radius: var(--radius-lg); height: 168px; background: linear-gradient(100deg, var(--surface-1) 30%, var(--surface-3) 50%, var(--surface-1) 70%); background-size: 200% 100%; animation: swShimmer 1.4s ease infinite; }
/* The dashboard is not a card grid, so its placeholder mirrors the real layout
   (header strip, tile row, two panels) instead of stacking card-shaped blocks. */
.sw-dash-skel { display: grid; gap: var(--space-md); }
.sw-dash-skel .sw-skel { height: 64px; }
.sw-dash-skel .sw-skel--tiles { height: 92px; }
.sw-dash-skel .sw-skel--panel { height: 220px; }
@keyframes swShimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .sw-skel { animation: none; } .sw-card:hover { transform: none; } }

.sw-toast { position: fixed; bottom: var(--space-lg); left: 50%; transform: translateX(-50%); background: var(--surface-3); border: 1px solid var(--stroke-strong); border-radius: var(--radius-md); padding: var(--space-sm) var(--space-md); color: var(--ink-bright); font-size: var(--text-sm); box-shadow: var(--shadow-3); z-index: 95; animation: swToast var(--duration-base) var(--ease-emphasized); max-width: 90vw; }
.sw-toast.err { border-color: rgba(248, 113, 113, 0.5); }
@keyframes swToast { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }