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.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
/* Agora — the Commons. Styling for the 3D world shell: loading, HUD, designed
empty/error states, the accessible citizen roster, and the passport panel.
Built on the City substrate's visual language (see src/city/city.css). */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
/* The Commons is a full-bleed canvas with four independent layers competing for
the bottom of a phone screen: the job board panel, the humans dock, the "Enter
the Commons" button, and the platform's language switcher. They each used to
pin themselves to `bottom: ~10px` in their own stylesheet, so on a 320px
viewport all four landed on the same 90 pixels and the primary call to action
ended up underneath two other controls. These tokens are the shared vocabulary
that stacks them instead:
--agora-corner-band : the strip the global language switcher owns in the
bottom-right corner (src/i18n.js pins it 16px up).
--agora-pop-band : the strip the population chip owns in the bottom-left
corner. It only applies above 560px, where the chip is
still pinned to the bottom (below that it moves under
the title, see the responsive block at the end).
--agora-dock-floor : where the humans dock's bottom edge sits. Bottom-left
above the population chip on a wide screen; on a phone
the dock spans the full width, so it clears the
language switcher's corner instead.
--agora-dock-h : the humans dock's live measured height, published by
src/agora/me-hud.js as its content changes.
Everything that sits at the bottom of the world is positioned against these,
bottom up, so a state change in one layer moves the others instead of hiding
them. */
:root {
--agora-corner-band: 52px;
--agora-pop-band: 67px;
--agora-dock-floor: var(--agora-pop-band);
}
@media (max-width: 640px) {
:root { --agora-dock-floor: calc(var(--agora-corner-band) + 4px); }
}
html, body {
width: 100%; height: 100%;
overflow: hidden;
background: #060607;
font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
-webkit-font-smoothing: antialiased;
color: #fff;
}
/* ── Canvas ─────────────────────────────────────────────────────────────────── */
#agora-canvas {
position: fixed; inset: 0;
width: 100%; height: 100%;
display: block;
outline: none;
cursor: grab;
}
#agora-canvas:active { cursor: grabbing; }
#agora-canvas:focus-visible { box-shadow: inset 0 0 0 2px rgba(120, 170, 255, 0.6); }
/* ── Loading screen ─────────────────────────────────────────────────────────── */
#agora-loading {
position: fixed; inset: 0;
display: flex; align-items: center; justify-content: center;
background: #060607;
z-index: 100;
transition: opacity var(--duration-slow) var(--ease-standard);
}
#agora-loading.hidden { opacity: 0; pointer-events: none; }
.agora-loading-card {
display: flex; flex-direction: column; align-items: center;
gap: 14px;
}
.agora-loading-title {
font-size: 11px; font-weight: 700;
letter-spacing: 0.34em;
/* 0.42 alpha over #060607 measures 3.97:1, under the 4.5:1 AA floor for text
this size (axe flags it for as long as the loader is up). 0.58 lands at
~6.9:1 and still reads dimmer than the .agora-loading-sub beneath it, so
the visual hierarchy is unchanged. */
color: rgba(255, 255, 255, 0.58);
text-transform: uppercase;
}
.agora-loading-sub {
font-size: 12px;
color: rgba(255, 255, 255, 0.62);
letter-spacing: 0.06em;
min-height: 18px;
}
.agora-boot-bar {
width: 170px; height: 2px;
background: rgba(255, 255, 255, 0.06);
border-radius: 2px;
overflow: hidden;
}
.agora-boot-bar span {
display: block; height: 100%; width: 0%;
background: linear-gradient(90deg, #6da1ff, #9b8cff);
border-radius: 2px;
transition: width var(--duration-slow) var(--ease-standard);
}
/* ── HUD ─────────────────────────────────────────────────────────────────────── */
#agora-hud {
position: fixed; inset: 0;
pointer-events: none;
z-index: 10;
}
#agora-hud-tl {
position: absolute; top: 18px; left: 20px;
display: flex; align-items: center; gap: 8px;
font-size: 11px; font-weight: 700;
letter-spacing: 0.25em;
color: rgba(255, 255, 255, 0.5);
text-transform: uppercase;
user-select: none;
}
#agora-hud-sub {
letter-spacing: 0.12em;
font-weight: 500;
color: rgba(255, 255, 255, 0.6);
text-transform: none;
}
#agora-pop {
position: absolute; bottom: 18px; left: 20px;
display: flex; align-items: baseline; gap: 6px;
padding: 8px 14px;
background: rgba(10, 12, 16, 0.55);
border: 1px solid rgba(255, 255, 255, 0.08);
border-radius: 10px;
backdrop-filter: blur(8px);
user-select: none;
}
#agora-count { font-size: 18px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
#agora-pop-label { font-size: 11px; letter-spacing: 0.08em; color: rgba(255, 255, 255, 0.4); text-transform: uppercase; }
/* Enter the Commons — the play-mode toggle (agora-world.js lazy-mounts
player-mode.js on first press). Bottom-centre so it reads as the world's
primary invitation without covering the citizen crowd. */
#agora-enter {
position: absolute; bottom: 18px; left: 50%;
transform: translateX(-50%);
pointer-events: auto;
font-size: 13px;
padding: 10px 22px;
box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}
#agora-enter:disabled { opacity: 0.6; cursor: progress; }
#agora-enter[aria-pressed="true"] { background: rgba(255, 255, 255, 0.08); }
@media (max-width: 640px) {
/* Clear the touch stick + action cluster in play mode, and ride above the
humans dock so the world's primary invitation is never buried under it. */
#agora-enter {
bottom: calc(var(--agora-dock-floor, 56px) + var(--agora-dock-h, 0px) + 10px);
font-size: 12px; padding: 9px 16px;
}
}
#agora-controls-hint {
position: absolute; top: 18px; right: 20px;
font-size: 10px;
color: rgba(255, 255, 255, 0.6);
letter-spacing: 0.05em;
user-select: none;
line-height: 1.6;
text-align: right;
}
#agora-controls-hint kbd {
font-family: ui-monospace, monospace;
font-size: 9px;
background: rgba(255, 255, 255, 0.06);
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 3px;
padding: 1px 4px;
margin-right: 2px;
}
/* ── State overlays (empty / error / fatal) ──────────────────────────────────── */
#agora-state {
position: fixed; inset: 0;
display: flex; align-items: center; justify-content: center;
z-index: 40;
padding: 24px;
background: radial-gradient(ellipse at center, rgba(6, 6, 7, 0.4), rgba(6, 6, 7, 0.78));
pointer-events: none;
}
.agora-state-card {
pointer-events: auto;
max-width: 440px;
text-align: center;
background: rgba(14, 16, 22, 0.82);
border: 1px solid rgba(255, 255, 255, 0.09);
border-radius: 18px;
padding: 36px 32px;
backdrop-filter: blur(16px);
box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
animation: agora-rise 0.4s ease both;
}
@keyframes agora-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.agora-state-glyph {
width: 56px; height: 56px;
margin: 0 auto 18px;
display: grid; place-items: center;
font-size: 26px;
border-radius: 16px;
background: rgba(109, 161, 255, 0.12);
color: #8fb4ff;
border: 1px solid rgba(109, 161, 255, 0.25);
}
.agora-state-glyph-error {
background: rgba(255, 120, 120, 0.1);
color: #ff9a9a;
border-color: rgba(255, 120, 120, 0.25);
font-weight: 700;
}
.agora-state-card h2 { font-size: 20px; font-weight: 700; margin-bottom: 10px; letter-spacing: -0.01em; }
.agora-state-card p { font-size: 14px; line-height: 1.6; color: rgba(255, 255, 255, 0.62); }
.agora-state-actions {
margin-top: 22px;
display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
}
.agora-btn {
display: inline-flex; align-items: center; justify-content: center;
padding: 9px 16px;
font-size: 13px; font-weight: 600;
color: rgba(255, 255, 255, 0.82);
text-decoration: none;
background: rgba(255, 255, 255, 0.06);
border: 1px solid rgba(255, 255, 255, 0.12);
border-radius: 10px;
cursor: pointer;
transition: background var(--duration-fast) var(--ease-standard), border-color var(--duration-fast) var(--ease-standard), transform var(--duration-instant) var(--ease-standard);
}
.agora-btn:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.2); }
.agora-btn:active { transform: translateY(1px); }
.agora-btn:focus-visible { outline: 2px solid #7aa6ff; outline-offset: 2px; }
.agora-btn-primary {
color: #fff;
background: linear-gradient(135deg, #5d8bff, #8a6dff);
border-color: transparent;
}
.agora-btn-primary:hover { filter: brightness(1.08); background: linear-gradient(135deg, #5d8bff, #8a6dff); }
/* ── Accessible roster (visually hidden, focus-revealed) ──────────────────────── */
.agora-roster { position: fixed; z-index: 60; }
.agora-roster-list { list-style: none; }
.agora-sr-only,
.agora-roster-btn {
position: absolute;
width: 1px; height: 1px;
padding: 0; margin: -1px;
overflow: hidden;
clip: rect(0 0 0 0);
white-space: nowrap;
border: 0;
}
/* When a roster button is focused by keyboard, surface it as a visible chip so
sighted keyboard users see where they are. */
.agora-roster-btn:focus-visible {
position: fixed;
top: 16px; left: 50%;
transform: translateX(-50%);
width: auto; height: auto;
clip: auto; margin: 0;
padding: 9px 16px;
font: 600 13px/1 'Inter', system-ui, sans-serif;
color: #fff;
background: rgba(14, 16, 22, 0.92);
border: 1px solid #7aa6ff;
border-radius: 10px;
box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
outline: 2px solid #7aa6ff;
outline-offset: 2px;
cursor: pointer;
z-index: 70;
}
/* ── Passport panel ───────────────────────────────────────────────────────────── */
.agora-passport {
position: fixed;
top: 14px; right: 14px; bottom: 14px;
width: 372px; max-width: calc(100vw - 28px);
z-index: 50;
display: flex; flex-direction: column;
background: rgba(13, 15, 20, 0.9);
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 18px;
backdrop-filter: blur(20px);
box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
overflow: hidden;
transform: translateX(24px);
opacity: 0;
transition: transform var(--duration-base) var(--ease-standard), opacity var(--duration-base) var(--ease-standard);
}
.agora-passport.open { transform: none; opacity: 1; }
.agora-passport-head {
display: flex; align-items: center; justify-content: space-between;
padding: 16px 18px;
border-bottom: 1px solid rgba(255, 255, 255, 0.07);
flex-shrink: 0;
}
.agora-passport-head h2 {
font-size: 15px; font-weight: 700;
letter-spacing: -0.01em;
white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.agora-passport-close {
display: grid; place-items: center;
width: 30px; height: 30px;
color: rgba(255, 255, 255, 0.55);
background: rgba(255, 255, 255, 0.05);
border: 1px solid rgba(255, 255, 255, 0.08);
border-radius: 8px;
cursor: pointer;
flex-shrink: 0;
transition: background var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard);
}
.agora-passport-close:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.agora-passport-close:focus-visible { outline: 2px solid #7aa6ff; outline-offset: 2px; }
.agora-passport-body {
padding: 18px;
overflow-y: auto;
flex: 1;
outline: none;
}
.agora-pp-hero {
display: flex; align-items: center; gap: 12px;
margin-bottom: 18px;
}
.agora-pp-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 12px currentColor; }
.agora-pp-name { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.agora-pp-prof { font-size: 12px; color: rgba(255, 255, 255, 0.5); margin-top: 2px; }
.agora-pp-status {
margin-left: auto;
font-size: 10px; font-weight: 700;
letter-spacing: 0.08em; text-transform: uppercase;
padding: 4px 9px;
border-radius: 999px;
background: rgba(255, 255, 255, 0.08);
color: rgba(255, 255, 255, 0.7);
white-space: nowrap;
}
.agora-pp-status-active { background: rgba(54, 211, 153, 0.16); color: #5fe3ad; }
.agora-pp-status-busy { background: rgba(255, 209, 102, 0.16); color: #ffd166; }
.agora-pp-status-idle { background: rgba(159, 180, 204, 0.14); color: #b6c6da; }
.agora-pp-status-suspended,
.agora-pp-status-inactive { background: rgba(255, 120, 120, 0.14); color: #ff9a9a; }
.agora-pp-stats {
display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
margin-bottom: 16px;
}
.agora-pp-stat {
padding: 12px 14px;
background: rgba(255, 255, 255, 0.04);
border: 1px solid rgba(255, 255, 255, 0.06);
border-radius: 12px;
}
.agora-pp-stat-value { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.agora-pp-stat-label { font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(255, 255, 255, 0.42); margin-top: 3px; }
.agora-pp-identity { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.agora-pp-chip {
font-size: 11px; font-weight: 500;
padding: 4px 10px;
border-radius: 999px;
background: rgba(120, 160, 255, 0.1);
border: 1px solid rgba(120, 160, 255, 0.2);
color: #aac4ff;
}
.agora-pp-section {
font-size: 11px; font-weight: 700;
letter-spacing: 0.1em; text-transform: uppercase;
color: rgba(255, 255, 255, 0.4);
margin: 6px 0 12px;
}
.agora-pp-empty { font-size: 13px; line-height: 1.6; color: rgba(255, 255, 255, 0.5); }
.agora-pp-feed { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.agora-pp-feed-item { display: flex; gap: 10px; }
.agora-pp-feed-kind {
width: 8px; height: 8px; margin-top: 5px; border-radius: 50%;
flex-shrink: 0;
background: rgba(255, 255, 255, 0.3);
}
.agora-pp-feed-kind[data-kind="completed_task"], .agora-pp-feed-kind[data-kind="earned"] { background: #5fe3ad; }
.agora-pp-feed-kind[data-kind="claimed_task"] { background: #ffd166; }
.agora-pp-feed-kind[data-kind="posted_task"] { background: #6da1ff; }
.agora-pp-feed-kind[data-kind="slashed"] { background: #ff7878; }
.agora-pp-feed-main { min-width: 0; }
.agora-pp-feed-title { font-size: 13px; line-height: 1.45; color: rgba(255, 255, 255, 0.86); }
.agora-pp-feed-meta { font-size: 11px; color: rgba(255, 255, 255, 0.42); margin-top: 2px; }
.agora-pp-rep { color: #5fe3ad; }
/* Loading skeleton */
.agora-pp-skel { display: flex; flex-direction: column; gap: 8px; }
.agora-pp-skel-row { height: 56px; border-radius: 12px; }
.agora-pp-skel-line { height: 14px; border-radius: 6px; width: 100%; }
.agora-pp-skel-line:nth-child(2) { width: 80%; }
.agora-pp-skel-line:nth-child(3) { width: 60%; }
.agora-pp-skel-row, .agora-pp-skel-line {
background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 37%, rgba(255,255,255,0.04) 63%);
background-size: 400% 100%;
animation: agora-shimmer 1.4s ease infinite;
}
@keyframes agora-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.agora-pp-state { text-align: center; padding: 32px 8px; }
.agora-pp-state-icon {
width: 44px; height: 44px; margin: 0 auto 14px;
display: grid; place-items: center;
font-size: 22px; font-weight: 700;
border-radius: 12px;
background: rgba(255, 120, 120, 0.1);
color: #ff9a9a;
}
.agora-pp-state-title { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.agora-pp-state-detail { font-size: 13px; color: rgba(255, 255, 255, 0.5); line-height: 1.5; margin-bottom: 16px; }
.agora-pp-retry {
font: 600 13px/1 'Inter', system-ui, sans-serif;
color: #fff; cursor: pointer;
padding: 9px 18px; border-radius: 10px;
background: rgba(255, 255, 255, 0.08);
border: 1px solid rgba(255, 255, 255, 0.14);
transition: background var(--duration-fast) var(--ease-standard);
}
.agora-pp-retry:hover { background: rgba(255, 255, 255, 0.14); }
.agora-pp-retry:focus-visible { outline: 2px solid #7aa6ff; outline-offset: 2px; }
.agora-pp-srhint { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
/* ── Responsive ───────────────────────────────────────────────────────────────── */
@media (max-width: 560px) {
.agora-passport {
top: auto; left: 10px; right: 10px; bottom: 10px;
width: auto;
max-height: 64vh;
transform: translateY(24px);
}
.agora-passport.open { transform: none; }
#agora-controls-hint { display: none; }
.agora-state-card { padding: 28px 22px; }
/* The bottom-left population chip (146px) and the bottom-centre CTA (169px)
collide below ~500px viewport width: at 320px they overlap by 86px. The
hint is already hidden at this breakpoint, so the top-left column is free.
Stack the chip under the title there and leave the whole bottom edge to the
CTA and play mode's touch stick. */
#agora-pop { top: 48px; bottom: auto; }
}
@media (max-width: 380px) {
.agora-pp-stats { grid-template-columns: 1fr; }
}
/* ── Reduced motion ───────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
#agora-loading,
.agora-passport,
.agora-state-card,
.agora-boot-bar span,
.agora-pp-skel-row, .agora-pp-skel-line { transition: none !important; animation: none !important; }
.agora-passport { transform: none; }
}