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.

13.2 KB
Raw Blame
/*
 * /derivative/:venue/:symbol - one perpetual futures contract in full.
 * Builds on the shared coin-pages design system (src/coin-pages.css): same
 * tokens, same surfaces, same mono numerals. Everything here is the structure
 * that page needs and the others do not: the contract hero, the funding-cost
 * calculator, the cross-venue comparison callouts, and the share meters.
 */

/* ── Hero ───────────────────────────────────────────────────────────────── */

.dc-hero {
	display: grid;
	gap: 1.5rem;
	grid-template-columns: 1fr;
	align-items: start;
	margin-bottom: 2rem;
}
@media (min-width: 900px) {
	.dc-hero {
		grid-template-columns: minmax(0, 1fr) auto;
	}
}

.dc-hero-id {
	display: flex;
	gap: 1rem;
	align-items: flex-start;
	min-width: 0;
}

.dc-logo {
	width: 56px;
	height: 56px;
	border-radius: var(--cv-radius-lg);
	object-fit: cover;
	background: var(--cv-surface-3);
	flex-shrink: 0;
}
.dc-logo-fallback {
	display: block;
}

.dc-title-row {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	flex-wrap: wrap;
}
.dc-symbol {
	font-family: var(--cv-font-mono);
	font-size: 1.625rem;
	line-height: 1.15;
	font-weight: 700;
	letter-spacing: -0.01em;
	margin: 0;
	color: var(--cv-text);
	word-break: break-word;
}
@media (min-width: 768px) {
	.dc-symbol {
		font-size: 2rem;
	}
}

.dc-venue-line {
	margin: 0.375rem 0 0;
	font-size: 0.9375rem;
	color: var(--cv-text-2);
}
.dc-venue-line a {
	color: var(--cv-text);
	font-weight: 600;
	text-decoration: none;
	border-bottom: 1px solid var(--cv-border-hover);
	transition: color var(--duration-fast);
}
.dc-venue-line a:hover,
.dc-venue-line a:focus-visible {
	color: var(--cv-accent);
}

.dc-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.375rem;
	margin-top: 0.75rem;
}
.dc-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	padding: 0.25rem 0.5rem;
	border-radius: 999px;
	border: 1px solid var(--cv-border);
	background: var(--cv-surface-2);
	color: var(--cv-text-2);
}
/* --cv-accent-solid is the accent darkened for text that has to clear AA;
   --cv-accent on its own 10% tint reads 3.28:1 in light. Dark maps the two to
   the same value, so only light moves. */
.dc-chip-perp {
	border-color: color-mix(in srgb, var(--cv-accent) 40%, var(--cv-border));
	color: var(--cv-accent-solid);
	background: color-mix(in srgb, var(--cv-accent) 10%, transparent);
}

/* Price block, right of the identity on wide screens. */
.dc-price-box {
	min-width: 0;
}
.dc-price {
	font-family: var(--cv-font-mono);
	font-variant-numeric: tabular-nums;
	font-size: 2rem;
	font-weight: 700;
	line-height: 1.1;
	margin: 0;
	color: var(--cv-text);
}
@media (min-width: 900px) {
	.dc-price-box {
		text-align: right;
	}
	.dc-price {
		font-size: 2.5rem;
	}
}
.dc-price-delta {
	margin: 0.25rem 0 0;
	font-size: 1rem;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}
.dc-price-note {
	margin: 0.375rem 0 0;
	font-size: 0.75rem;
	color: var(--cv-text-3);
}

.dc-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 0.875rem;
}
@media (min-width: 900px) {
	.dc-actions {
		justify-content: flex-end;
	}
}
.dc-trade {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	padding: 0.5rem 0.875rem;
	border-radius: var(--cv-radius-md);
	background: var(--cv-accent-solid);
	color: var(--cv-on-accent);
	font-size: 0.875rem;
	font-weight: 600;
	text-decoration: none;
	transition:
		transform var(--duration-fast),
		filter var(--duration-fast);
}
.dc-trade:hover {
	filter: brightness(1.08);
}
.dc-trade:active {
	transform: translateY(1px);
}
.dc-trade:focus-visible {
	outline: 2px solid var(--cv-accent);
	outline-offset: 2px;
}

/* ── Stat grid ──────────────────────────────────────────────────────────── */

/* Eight cards read as two rows of four, not seven and a widow. auto-fit does
   whatever the viewport allows and stranded a single card on its own line at
   desktop width, so the column count is set explicitly per breakpoint. */
.dc-stats {
	display: grid;
	gap: 0.75rem;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	margin-bottom: 2.5rem;
}
@media (min-width: 680px) {
	.dc-stats {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}
@media (min-width: 960px) {
	.dc-stats {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}
/* The info affordance sits inside the label text, so a two-line label keeps it
   beside the last word instead of pushing it to the far edge of the card. */
.dc-stat .label {
	display: block;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	font-size: 0.6875rem;
	font-weight: 600;
}
.dc-stat .value {
	font-family: var(--cv-font-mono);
	font-variant-numeric: tabular-nums;
}

/* An inline "why this matters" affordance on a stat label. */
.dc-info {
	cursor: help;
	color: var(--cv-text-3);
	font-size: 0.75rem;
	border-radius: 50%;
}
.dc-info:focus-visible {
	outline: 2px solid var(--cv-accent);
	outline-offset: 2px;
}

/* ── Funding panel ──────────────────────────────────────────────────────── */

.dc-panel {
	background: var(--cv-surface-2);
	border: 1px solid var(--cv-border);
	border-radius: var(--cv-radius-xl);
	padding: 1.25rem;
	margin-bottom: 2.5rem;
}
@media (min-width: 768px) {
	.dc-panel {
		padding: 1.5rem;
	}
}
.dc-panel-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.75rem;
	flex-wrap: wrap;
	margin-bottom: 0.75rem;
}
.dc-panel-head h2 {
	margin: 0;
}
.dc-panel-note {
	margin: 0;
	font-size: 0.8125rem;
	color: var(--cv-text-3);
}

.dc-fund-verdict {
	font-size: 1rem;
	line-height: 1.55;
	color: var(--cv-text);
	margin: 0 0 1rem;
}
.dc-fund-verdict strong {
	font-weight: 700;
}

.dc-calc {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 0.75rem 1rem;
}
.dc-calc label {
	display: block;
	font-size: 0.75rem;
	color: var(--cv-text-3);
	margin-bottom: 0.25rem;
}
.dc-calc-field {
	position: relative;
	display: flex;
	align-items: center;
}
.dc-calc-field .prefix {
	position: absolute;
	left: 0.625rem;
	color: var(--cv-text-3);
	font-family: var(--cv-font-mono);
	pointer-events: none;
}
.dc-calc input {
	font-family: var(--cv-font-mono);
	font-variant-numeric: tabular-nums;
	font-size: 0.9375rem;
	padding: 0.5rem 0.75rem 0.5rem 1.5rem;
	width: 11rem;
	max-width: 100%;
	border-radius: var(--cv-radius-md);
	border: 1px solid var(--cv-border);
	background: var(--cv-surface);
	color: var(--cv-text);
	transition:
		border-color var(--duration-fast),
		box-shadow var(--duration-fast);
}
.dc-calc input:hover {
	border-color: var(--cv-border-hover);
}
.dc-calc input:focus-visible {
	outline: none;
	border-color: var(--cv-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--cv-accent) 25%, transparent);
}
.dc-calc-cap {
	margin: 0 0 0.375rem;
	font-size: 0.75rem;
	color: var(--cv-text-3);
}
.dc-calc-out {
	display: flex;
	flex-wrap: wrap;
	gap: 1.5rem;
}
.dc-calc-out .k {
	font-size: 0.75rem;
	color: var(--cv-text-3);
	margin: 0 0 0.125rem;
}
.dc-calc-out .v {
	font-family: var(--cv-font-mono);
	font-variant-numeric: tabular-nums;
	font-size: 1.125rem;
	font-weight: 700;
	margin: 0;
}

/* ── Cross-venue callouts ───────────────────────────────────────────────── */

.dc-callouts {
	display: grid;
	gap: 0.75rem;
	grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
	margin-bottom: 1.25rem;
}
.dc-callout {
	background: var(--cv-surface-2);
	border: 1px solid var(--cv-border);
	border-radius: var(--cv-radius-lg);
	padding: 1rem;
}
.dc-callout .k {
	font-size: 0.6875rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	font-weight: 600;
	color: var(--cv-text-3);
	margin: 0 0 0.375rem;
}
.dc-callout .v {
	font-size: 1rem;
	font-weight: 700;
	margin: 0;
	color: var(--cv-text);
}
.dc-callout .v a {
	color: inherit;
	text-decoration: none;
	border-bottom: 1px solid var(--cv-border-hover);
}
.dc-callout .v a:hover,
.dc-callout .v a:focus-visible {
	color: var(--cv-accent);
}
.dc-callout .s {
	font-family: var(--cv-font-mono);
	font-variant-numeric: tabular-nums;
	font-size: 0.8125rem;
	margin: 0.25rem 0 0;
	color: var(--cv-text-2);
}

/* ── Share meters ───────────────────────────────────────────────────────── */

.dc-shares {
	display: grid;
	gap: 1rem;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.dc-share .top {
	display: flex;
	justify-content: space-between;
	gap: 0.5rem;
	font-size: 0.8125rem;
	margin-bottom: 0.375rem;
}
.dc-share .top .k {
	color: var(--cv-text-2);
}
.dc-share .top .v {
	font-family: var(--cv-font-mono);
	font-variant-numeric: tabular-nums;
	font-weight: 700;
	color: var(--cv-text);
}
.dc-share-track {
	height: 8px;
	border-radius: 999px;
	background: var(--cv-surface-3);
	overflow: hidden;
}
.dc-share-fill {
	height: 100%;
	border-radius: 999px;
	background: var(--cv-accent);
	transition: width var(--duration-slow) var(--ease-standard);
}
.dc-share .cap {
	margin: 0.375rem 0 0;
	font-size: 0.75rem;
	color: var(--cv-text-3);
}

/* ── Tables ─────────────────────────────────────────────────────────────── */

.dc-table th,
.dc-table td {
	white-space: nowrap;
}
.dc-table td.left,
.dc-table th.left {
	text-align: left;
}
.dc-venue-cell {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	min-width: 0;
}
.dc-venue-cell img {
	width: 20px;
	height: 20px;
	border-radius: 4px;
	flex-shrink: 0;
}
.dc-table a {
	color: var(--cv-text);
	text-decoration: none;
}
.dc-table a:hover,
.dc-table a:focus-visible {
	color: var(--cv-accent);
	text-decoration: underline;
}
.dc-table a:focus-visible,
.dc-venue-line a:focus-visible,
.dc-callout .v a:focus-visible {
	outline: 2px solid var(--cv-accent);
	outline-offset: 2px;
	border-radius: 2px;
}
.dc-table tbody tr:hover {
	background: var(--cv-surface-2);
}
.dc-table tr.dc-current:hover {
	background: color-mix(in srgb, var(--cv-accent) 16%, transparent);
}
.dc-table tr.dc-current {
	background: color-mix(in srgb, var(--cv-accent) 10%, transparent);
}
.dc-table tr.dc-current td {
	font-weight: 600;
}
.dc-here {
	display: inline-block;
	margin-left: 0.375rem;
	font-size: 0.625rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	padding: 0.0625rem 0.3125rem;
	border-radius: 999px;
	background: var(--cv-accent-solid);
	color: var(--cv-on-accent);
	vertical-align: middle;
}

.dc-table-note {
	margin: 0.625rem 0 0;
	font-size: 0.8125rem;
	color: var(--cv-text-3);
}

/* ── Underlying asset card ──────────────────────────────────────────────── */

.dc-asset {
	display: flex;
	gap: 1rem;
	align-items: center;
	flex-wrap: wrap;
	background: var(--cv-surface-2);
	border: 1px solid var(--cv-border);
	border-radius: var(--cv-radius-lg);
	padding: 1rem 1.25rem;
	text-decoration: none;
	color: inherit;
	transition:
		border-color var(--duration-base),
		box-shadow var(--duration-base);
	margin-bottom: 1rem;
}
.dc-asset:hover,
.dc-asset:focus-visible {
	border-color: var(--cv-border-hover);
	box-shadow: var(--cv-shadow-card-hover);
}
.dc-asset:focus-visible {
	outline: 2px solid var(--cv-accent);
	outline-offset: 2px;
}
.dc-asset:active {
	transform: translateY(1px);
}
.dc-asset img {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	flex-shrink: 0;
}
.dc-asset .nm {
	font-weight: 700;
	font-size: 1rem;
	margin: 0;
}
.dc-asset .sub {
	margin: 0.125rem 0 0;
	font-size: 0.8125rem;
	color: var(--cv-text-3);
}
.dc-asset .spot {
	margin-left: auto;
	text-align: right;
	font-family: var(--cv-font-mono);
	font-variant-numeric: tabular-nums;
}
.dc-asset .spot .p {
	margin: 0;
	font-size: 1.125rem;
	font-weight: 700;
}
.dc-asset .spot .d {
	margin: 0;
	font-size: 0.8125rem;
	font-weight: 600;
}

/* ── Related links ──────────────────────────────────────────────────────── */

.dc-related {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0 0 1.5rem;
}

/* ── Error / retry ──────────────────────────────────────────────────────── */

.dc-retry {
	font: inherit;
	font-weight: 600;
	padding: 0.5rem 0.875rem;
	border-radius: var(--cv-radius-md);
	border: 1px solid var(--cv-border);
	background: var(--cv-surface-2);
	color: var(--cv-text);
	cursor: pointer;
	transition:
		border-color var(--duration-fast),
		background var(--duration-fast);
}
.dc-retry:hover {
	border-color: var(--cv-border-hover);
	background: var(--cv-surface-3);
}
.dc-retry:focus-visible {
	outline: 2px solid var(--cv-accent);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.dc-share-fill,
	.dc-trade,
	.dc-asset {
		transition: none;
	}
}