/* /musex (musex.html): the Muse Index, $MUSEX. The intro beside the ring
   (the four tokens as arcs sized by weight, swept in by one spark, a chip on
   each), the four as cards, how it works in three steps with the fee split
   as a bar, and the address. Pointing at a token's arc, chip or card lifts
   it, dims the rest and shows its weight in the middle of the ring. Each
   token keeps one hue: META bone, MUSEBOOK bright gold,
   MUSEGOD gold and AGRIPPA a deep gold. The shell is site.css; this is the
   page's own. No script. */

main {
	max-width: 1080px;
	margin: 0 auto;
	padding: 28px var(--pad) calc(56px + env(safe-area-inset-bottom));
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 72px;
	overflow-x: clip;
}
main > section {
	display: grid;
	gap: 22px;
	min-width: 0;
}
section h2 {
	margin: 0;
	font: italic 600 clamp(28px, 6.5vw, 42px) / 1.08 var(--serif);
	letter-spacing: -0.02em;
	color: var(--bone);
}
section h2 em {
	color: var(--cool);
}
.sec-head p:not(.label) {
	max-width: 40em;
	color: var(--soft);
}
.go {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0;
}
.meta {
	--hue: var(--bone);
}
.book {
	--hue: var(--gold-hi);
}
.god {
	--hue: var(--gold);
}
.house {
	--hue: color-mix(in srgb, var(--gold) 72%, var(--void));
}

/* The intro: the words, and the ring beside them where there's room. */
.intro {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 28px;
	align-items: center;
}
.intro-copy {
	display: grid;
	gap: 12px;
	min-width: 0;
}
:where(.intro-copy) > * {
	margin: 0;
}
.intro h1 em {
	display: block;
}
.intro .lede {
	max-width: 30em;
}
.intro .go {
	margin-top: 8px;
}
@media (min-width: 900px) {
	.intro {
		grid-template-columns: minmax(0, 1fr) auto;
		gap: 40px;
	}
}

/* The ring: an SVG circle per token, each a dash of its weight (out of a
   pathLength of 100, one short for the gap) moved round by the weights
   before it (--o) and turned so META starts 40° past the top. The arcs sit
   under one mask whose dash grows from nothing to the whole circle, so they
   draw in as a single sweep, with a spark riding its leading edge on the
   same timing. Over them, a wider transparent circle per token (.hit) takes
   the pointer across its arc and half of each gap, so moving between arcs
   never drops the hover. The chips sit on the ring at each arc's middle
   angle (--a), on a circle 31.5% of the figure out from its middle, each
   pushed a fifth of its own width outward so it clears the name in the
   middle, and slide out from the ring as the sweep passes them (--d). */
.ring {
	--sweep: cubic-bezier(0.55, 0, 0.2, 1);
	--spring: cubic-bezier(0.34, 1.56, 0.64, 1);
	position: relative;
	justify-self: center;
	width: 460px;
	max-width: 100%;
	aspect-ratio: 1;
	margin: 0;
	container-type: inline-size;
	background: radial-gradient(circle at 50% 50%, rgba(var(--gold-rgb), 0.18), transparent 46%);
	cursor: default;
	user-select: none;
	-webkit-user-select: none;
}
.ring svg {
	position: absolute;
	inset: 8%;
	width: 84%;
	height: 84%;
	transform: rotate(-50deg);
	overflow: visible;
}
.ring circle {
	fill: none;
	stroke-width: 26;
}
.track {
	stroke: rgba(var(--gold-rgb), 0.08);
}
.sweep {
	stroke: #fff;
	stroke-width: 160;
	stroke-dasharray: 100 0;
	animation: sweep 1.6s var(--sweep) 0.2s backwards;
}
@keyframes sweep {
	from {
		stroke-dasharray: 0 100;
	}
}
.spark {
	stroke: var(--gold-hi);
	stroke-width: 18;
	stroke-linecap: round;
	stroke-dasharray: 0.01 99.99;
	opacity: 0;
	filter: drop-shadow(0 0 6px var(--gold-hi)) drop-shadow(0 0 22px rgba(var(--gold-rgb), 0.9));
	pointer-events: none;
	animation: spark 1.6s var(--sweep) 0.2s;
}
@keyframes spark {
	from {
		stroke-dashoffset: 0;
		opacity: 1;
	}
	85% {
		opacity: 1;
	}
	to {
		stroke-dashoffset: -100;
		opacity: 0;
	}
}
.arc {
	stroke: var(--hue);
	stroke-dasharray: var(--w) 100;
	stroke-dashoffset: var(--o);
	filter: brightness(1) drop-shadow(0 0 14px rgba(var(--gold-rgb), 0.25));
	pointer-events: none;
	transform-origin: 200px 200px;
	transition:
		opacity 0.4s var(--ease) 0.08s,
		scale 0.4s var(--ease),
		stroke-width 0.4s var(--ease),
		filter 0.4s var(--ease);
}
.ring .hit {
	stroke: transparent;
	stroke-width: 72;
	stroke-dasharray: var(--w) 100;
	stroke-dashoffset: var(--o);
	pointer-events: stroke;
}
.core {
	position: absolute;
	inset: 0;
	display: grid;
	place-content: center;
	text-align: center;
	pointer-events: none;
}
.core > p {
	grid-area: 1 / 1;
	display: grid;
	gap: 6px;
	margin: 0;
	transition:
		opacity 0.3s var(--ease),
		scale 0.45s var(--ease),
		filter 0.3s var(--ease);
}
.sum {
	animation: rise 0.9s var(--ease) 1.1s backwards;
}
@keyframes rise {
	from {
		opacity: 0;
		translate: 0 10px;
		filter: blur(6px);
	}
}
.say {
	opacity: 0;
	scale: 0.88;
	filter: blur(4px);
}
.core .say b {
	color: var(--hue);
	font-variant-numeric: lining-nums tabular-nums;
}
.core b {
	font: 600 min(64px, 10.5cqi) / 1 var(--serif);
	letter-spacing: -0.01em;
	color: var(--gold-hi);
	text-shadow: 0 0 40px rgba(var(--gold-rgb), 0.35);
}
.core small {
	font: 400 var(--t-xs) var(--mono);
	letter-spacing: 0.24em;
	text-transform: uppercase;
	color: var(--dim);
}
.node {
	position: absolute;
	left: calc(50% + 31.5% * cos(var(--a)));
	top: calc(50% + 31.5% * sin(var(--a)));
	translate: calc(-50% + 20% * cos(var(--a))) calc(-50% + 20% * sin(var(--a)));
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px 6px 8px;
	border-radius: var(--r-pill);
	background: color-mix(in srgb, var(--card-hi) 80%, transparent);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	box-shadow:
		0 0 0 1px var(--line-hi),
		0 10px 30px -10px rgba(var(--void-rgb), 0.9);
	font: 700 var(--t-sm) / 1 var(--sans);
	letter-spacing: 0.04em;
	color: var(--bone);
	white-space: nowrap;
	animation: out 0.7s var(--spring) var(--d) backwards;
	transition:
		opacity 0.4s var(--ease) 0.08s,
		scale 0.45s var(--spring),
		background 0.3s var(--ease),
		box-shadow 0.3s var(--ease);
}
.node i,
.four .t i {
	flex: none;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--hue);
}
.node img {
	flex: none;
	width: 22px;
	height: 22px;
	margin: -2px 0;
	border-radius: 50%;
	box-shadow: 0 0 0 1.5px var(--gold);
}
.node em {
	font-style: normal;
	font-variant-numeric: tabular-nums;
	color: var(--gold-hi);
}
@keyframes out {
	from {
		opacity: 0;
		scale: 0.6;
		translate: -50% -50%;
	}
}
@media (max-width: 420px) {
	.node {
		gap: 5px;
		padding: 5px 10px 5px 7px;
		font-size: var(--t-xs);
	}
}

/* Pointing at a token, on the ring, its chip or its card: its arc grows
   out from the ring's middle, keeping its full angle, and glows; its chip
   fills with its hue and its card lights; the others dim; and the middle of
   the ring trades $MUSEX for its weight. The dimming comes back after a
   short delay so a pointer crossing between two tokens never flashes the
   whole ring. */
@media (hover: hover) {
	main:has(.meta:hover) .arc:not(.meta),
	main:has(.book:hover) .arc:not(.book),
	main:has(.god:hover) .arc:not(.god),
	main:has(.house:hover) .arc:not(.house) {
		opacity: 0.14;
		transition-delay: 0s;
	}
	main:has(.meta:hover) .node:not(.meta),
	main:has(.book:hover) .node:not(.book),
	main:has(.god:hover) .node:not(.god),
	main:has(.house:hover) .node:not(.house) {
		opacity: 0.45;
		transition-delay: 0s;
	}
	main:has(.meta:hover) .arc.meta,
	main:has(.book:hover) .arc.book,
	main:has(.god:hover) .arc.god,
	main:has(.house:hover) .arc.house {
		scale: 1.03;
		stroke-width: 29;
		filter: brightness(1.3) drop-shadow(0 0 22px rgba(var(--gold-rgb), 0.6));
	}
	main:has(.meta:hover) .node.meta,
	main:has(.book:hover) .node.book,
	main:has(.god:hover) .node.god,
	main:has(.house:hover) .node.house {
		scale: 1.06;
		background: color-mix(in srgb, var(--hue) 16%, var(--card-hi));
		box-shadow:
			0 0 0 1px color-mix(in srgb, var(--hue) 40%, transparent),
			0 12px 34px -10px rgba(var(--void-rgb), 0.9),
			0 0 32px -8px color-mix(in srgb, var(--hue) 70%, transparent);
	}
	main:has(.meta:hover) .card.meta,
	main:has(.book:hover) .card.book,
	main:has(.god:hover) .card.god,
	main:has(.house:hover) .card.house {
		background: var(--card-hi);
	}
	main:has(.meta:hover) .say.meta,
	main:has(.book:hover) .say.book,
	main:has(.god:hover) .say.god,
	main:has(.house:hover) .say.house {
		opacity: 1;
		scale: 1;
		filter: blur(0);
	}
	main:has(:is(.meta, .book, .god, .house):hover) .sum {
		opacity: 0;
		scale: 0.9;
		filter: blur(4px);
	}
}

/* The four: a card each, its share of the basket as a bar under its line. */
.four {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.four .card {
	position: relative;
	display: grid;
	grid-template-rows: auto auto 1fr auto;
	gap: 8px;
	padding: 22px 20px;
	transition: background 0.3s;
}
:where(.four .card) > p {
	margin: 0;
}
.four .card > p:not(.t, .role) {
	color: var(--soft);
}
.four .t {
	display: flex;
	align-items: center;
	gap: 8px;
	font: 700 var(--t-ui) var(--sans);
	letter-spacing: 0.06em;
	color: var(--bone);
}
.four .t img {
	flex: none;
	border-radius: 50%;
	box-shadow: 0 0 0 1.5px var(--gold);
}
.four .t span {
	margin-left: auto;
	font: 700 var(--d-2) / 1 var(--sans);
	font-variant-numeric: tabular-nums;
	letter-spacing: 0;
	color: var(--gold-hi);
}
.role {
	font: italic 600 var(--d-2) / 1.1 var(--serif);
	color: var(--hue);
}
.weight {
	height: 6px;
	margin-top: 6px;
	border-radius: var(--r-pill);
	background:
		linear-gradient(var(--hue), var(--hue)) 0 0 / calc(var(--w) * 1%) 100% no-repeat,
		rgba(var(--gold-rgb), 0.1);
}

/* How it works: three steps side by side where there's room. */
.steps {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.steps li {
	display: grid;
	align-content: start;
	gap: 8px;
	padding: 22px 20px;
	border-radius: var(--r-xl);
	background: var(--card);
	box-shadow: var(--e-1);
}
:where(.steps li) > * {
	margin: 0;
}
.steps b {
	font: 600 var(--t-lead) / 1.3 var(--sans);
	color: var(--bone);
}
.steps p {
	color: var(--soft);
}
.s-i {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	margin-bottom: 4px;
	border-radius: 50%;
	background: rgba(var(--cool-rgb), 0.14);
	color: var(--cool);
}
.s-i .i {
	width: 20px;
	height: 20px;
}

/* The fee as a bar: what stays in the basket, and Bankr's share. */
.fee {
	display: flex;
	gap: 3px;
	margin-top: 6px;
	font: 600 var(--t-xs) / 1.2 var(--sans);
}
.fee span {
	flex: var(--f) 1 0;
	display: grid;
	gap: 2px;
	padding: 8px 10px;
	border-radius: var(--r-sm);
	min-width: 0;
}
.fee b {
	font: 700 var(--t-note) / 1 var(--sans);
	font-variant-numeric: tabular-nums;
}
.f-in {
	background: var(--gold);
	color: var(--ink);
}
.f-in b {
	color: var(--ink);
}
.f-out {
	background: rgba(var(--gold-rgb), 0.12);
	color: var(--soft);
}
.f-out b {
	color: var(--bone);
}

/* The address. */
.addr {
	padding: 28px 20px;
	background:
		radial-gradient(circle at 100% 0, rgba(var(--cool-rgb), 0.12), transparent 55%), var(--card);
}
.ca {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 12px;
	padding: 12px 12px 12px 16px;
	border-radius: var(--r-md);
	background: rgba(var(--void-rgb), 0.5);
	box-shadow: inset 0 0 0 1px var(--line-hi);
}
.ca code {
	flex: 1 1 16em;
	min-width: 0;
	font: 500 var(--t-ui) / 1.4 var(--mono);
	color: var(--cool);
	overflow-wrap: anywhere;
}
.ca .btn .i {
	width: 15px;
	height: 15px;
}
@media (min-width: 700px) {
	.addr {
		padding: 36px 32px;
	}
}

main > .foot-note {
	max-width: 46em;
	margin: -40px 0 0;
}
