:root {
	color-scheme: light;
	font-family: system-ui, sans-serif;
	font-size: 14px;
	color: #1b1b1b;
	background: #fff;
}

body {
	margin: 0;
}

main {
	display: grid;
	justify-items: center;
	gap: 1.5rem;
	padding: 2rem 1rem 4rem;
}

.stage {
	position: relative;
	max-width: 100%;
	aspect-ratio: 1;
	touch-action: none;
	user-select: none;
	-webkit-user-select: none;
}

.stage canvas,
.stage .logo {
	position: absolute;
}

.stage canvas {
	inset: 0;
	width: 100%;
	height: 100%;
}

.stage .logo {
	left: 50%;
	top: 50%;
	width: 36%;
	translate: -50% -50%;
}

[data-mode="drag"] .stage {
	cursor: grab;
}

[data-mode="nudge"] .stage,
[data-mode="jump"] .stage,
[data-mode="turn"] .stage,
[data-mode="reveal"] .stage {
	cursor: pointer;
}

[data-mode="drag"] .stage.dragging {
	cursor: grabbing;
}

.modes {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem;
	border: 0;
	padding: 0;
	margin: 0;
}

.modes legend {
	position: absolute;
	clip-path: inset(50%);
}

.modes label {
	padding: 0.5rem 0.9rem;
	border: 1px solid #ddd;
	border-radius: 999px;
	cursor: pointer;
}

.modes label:has(:checked) {
	background: #1b1b1b;
	border-color: #1b1b1b;
	color: #fff;
}

.modes input {
	position: absolute;
	opacity: 0;
}

.modes label:has(:focus-visible) {
	outline: 2px solid #1b1b1b;
	outline-offset: 2px;
}

.hint {
	margin: 0;
	color: #777;
}

.controls {
	display: grid;
	gap: 1.5rem;
	width: min(600px, 100%);
}

.controls section {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
	gap: 1rem 1.5rem;
	align-items: end;
}

.controls section[hidden] {
	display: none;
}

.controls label {
	display: grid;
	gap: 0.35rem;
	color: #555;
}

.controls output {
	color: #1b1b1b;
	font-variant-numeric: tabular-nums;
}

.controls input[type="range"],
.controls select {
	width: 100%;
	accent-color: #1b1b1b;
}

.controls .toggle {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	accent-color: #1b1b1b;
}

button {
	font: inherit;
	padding: 0.5rem 0.9rem;
	border: 1px solid #1b1b1b;
	border-radius: 999px;
	background: #1b1b1b;
	color: #fff;
	cursor: pointer;
}
