.cover {
	--keys-spill-x: 84px;
	--keys-spill-y: 40px;
	background-color: var(--crimson);
	color: var(--black);
	min-height: 66vh;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	/* A touch that starts on the keys must not select the cover text above. */
	-webkit-user-select: none;
	user-select: none;
	/* The keyboard is wider than the cover and drops below it, so the page
	   cannot clip its children and the bottom padding stays at zero: the keys'
	   negative margin is the spill. The margin reserves it on the dark page. */
	overflow: visible;
	padding-bottom: 0;
	margin-bottom: calc(var(--keys-spill-y) + 14px);
}

.cover .page-grain {
	opacity: 0.28;
}

.cover-head {
	text-align: center;
	margin-top: 14px;
}

/* Two quiet controls at the bottom-right of the cover foot, just above the
   keyboard. They stay hidden until the 3D scene is ready. */
.cover-tools {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 16px;
	min-height: 24px;
	margin: 4px 0 0;
}

/* One 24px box per control, so icons and labels share the same baseline and
   the same gap: the row reads as a single line of type. */
.cover-tool {
	display: grid;
	place-items: center;
	width: 24px;
	height: 24px;
	padding: 0;
	color: var(--black);
	background: transparent;
	border: 0;
	opacity: 0.5;
	cursor: pointer;
	transition: opacity 0.2s ease;
}

.cover-tool[hidden] {
	display: none;
}

.cover-tool:hover {
	opacity: 0.9;
}

.cover-tool:focus-visible {
	opacity: 0.9;
	outline: 1px solid var(--black);
	outline-offset: 2px;
}

.cover-tool[aria-pressed="true"] {
	opacity: 0.8;
}

.cover-tool:disabled,
.cover-tool:disabled:hover {
	opacity: 0.25;
	cursor: default;
}

.cover-tool svg {
	display: block;
	width: 15px;
	height: 15px;
}

.cover-tool .icon-stop {
	display: none;
}

.cover-tool[aria-pressed="true"] .icon-play {
	display: none;
}

.cover-tool[aria-pressed="true"] .icon-stop {
	display: block;
}

/* The label is the control: a native select wearing the cover's type, so the
   current sound and piece are readable without a chevron or a hidden menu. */
.cover-select {
	display: inline-flex;
	flex: none;
	align-items: center;
}

.cover-select[hidden] {
	display: none;
}

.cover-select select {
	height: 24px;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	/* A select is as wide as its longest option, so the label is pushed to the
	   right edge to keep the gap to the next control even. */
	text-align: right;
	text-align-last: right;
	opacity: 0.5;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	color-scheme: dark;
}

.cover-select select:hover,
.cover-select select:focus-visible {
	opacity: 0.95;
}

/* Chrome marks a select as :focus-visible even on click, and the ring would
   draw the box, which is wider than the label: focus shows as full opacity. */
.cover-select select:focus {
	outline: none;
}

.cover-select select:focus-visible {
	opacity: 1;
}

.kicker {
	font-family: var(--mono);
	font-size: 0.66rem;
	letter-spacing: 0.32em;
	text-transform: uppercase;
	opacity: 0.72;
}

.wordmark {
	font-weight: 900;
	text-transform: uppercase;
	letter-spacing: -0.04em;
	line-height: 0.88;
	font-size: clamp(3rem, 12vw, 8.5rem);
	margin: 16px 0 14px;
}

.rule {
	width: 100%;
	height: 1px;
	background: var(--black);
	opacity: 0.22;
	margin: 16px 0;
}

.tagline {
	font-weight: 800;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	font-size: clamp(0.7rem, 1.6vw, 0.95rem);
}


.collage {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 8px;
	margin: 34px 0;
}

@media (min-width: 768px) {
	.collage {
		grid-template-columns: repeat(7, 1fr);
		gap: 9px;
		margin: 46px 12px;
	}
}

.fig {
	position: relative;
	aspect-ratio: 3 / 4;
	background: var(--black);
	overflow: hidden;
}

.fig .procedural-visual {
	width: 100%;
	height: 100%;
	object-fit: cover;
	filter: grayscale(1) contrast(1.04);
	transition:
		filter 0.4s ease,
		transform 0.6s ease;
}

.fig:hover .procedural-visual {
	filter: grayscale(0);
	transform: scale(1.06);
}

.fig span {
	position: absolute;
	bottom: 4px;
	left: 5px;
	font-family: var(--mono);
	font-size: 8px;
	color: var(--white);
	opacity: 0;
	transition: opacity 0.3s ease;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.fig:hover span {
	opacity: 1;
}

.cover-foot {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	border-top: 1px solid rgba(0, 0, 0, 0.22);
	padding-top: 16px;
	font-family: var(--mono);
	font-size: 0.66rem;
	text-transform: uppercase;
	line-height: 1.5;
}

.cover-foot .right {
	text-align: right;
}

/* The keybed is a little wider than the cover on each side and drops below it,
   so the keys spill onto the dark page without becoming a full-width band. */
.cover-keys {
	position: relative;
	flex-shrink: 0;
	aspect-ratio: var(--keys-aspect, 4.07);
	min-height: 64px;
	--keys-bleed-x: min(var(--keys-spill-x), (100vw - 100%) / 2);
	margin: 28px calc(-1 * var(--keys-bleed-x)) calc(-1 * var(--keys-spill-y));
	overflow: hidden;
	background: transparent;
	touch-action: pan-y;
	-webkit-user-select: none;
	user-select: none;
	-webkit-touch-callout: none;
	-webkit-tap-highlight-color: transparent;
}

/* With the 3D keyboard the container stops clipping: the keys spill out of the
   cover on both sides and below, so the canto rests on the dark page. */
.cover-keys.is-3d {
	overflow: visible;
}

.cover-keys img {
	display: block;
	width: 100%;
	height: auto;
}

.cover-keys.is-3d img {
	display: none;
}

/* The hero keyboard is a three.js scene: procedural ink-block keys on a
   transparent canvas, so the crimson cover shows behind the keybed and the
   dark page behind the part that spills below it. */
.cover-keys canvas {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: block;
	width: 100%;
	height: 100%;
	cursor: pointer;
	touch-action: pan-y;
	-webkit-user-select: none;
	user-select: none;
	-webkit-touch-callout: none;
	-webkit-tap-highlight-color: transparent;
}

/* The grain stays on the raster fallback only: the 3D keys are flat colour. */
.cover-keys::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 2;
	pointer-events: none;
	background-image: var(--noise);
	mix-blend-mode: multiply;
	opacity: 0.28;
}

.cover-keys.is-3d::after {
	display: none;
}

@media (min-width: 768px) {
	.cover-keys {
		margin-top: 34px;
	}
}

