/* ---------- Mixes: cassette shelf + boombox ---------- */

.mixes {
	--yellow: #F7D417;
	--cream: #f3ecd8;
	padding: 72px 0 80px;
}

.mixes__inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 460px;
	gap: 48px;
	align-items: start;
	max-width: 1440px;
	margin: 0 auto;
	padding: 0 32px;
}

/* ---------- shelf ---------- */

.mixes__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px 28px;
	margin-bottom: 32px;
}

.mixes__title {
	margin: 0;
	font-family: 'Archivo', sans-serif;
	font-weight: 900;
	font-stretch: 125%;
	font-size: clamp(36px, 5vw, 64px);
	line-height: 1;
	text-transform: uppercase;
}

.mix-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.mix-filter {
	border: 1px solid #333;
	background: transparent;
	color: #fff;
	border-radius: 999px;
	padding: 6px 14px;
	font-size: 13px;
	letter-spacing: .06em;
	text-transform: uppercase;
	transition: background .2s, color .2s, border-color .2s;
}

.mix-filter:hover {
	border-color: var(--yellow);
}

.mix-filter.is-active {
	background: var(--yellow);
	border-color: var(--yellow);
	color: #000;
}

.tapes {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: 36px 28px;
}

.tape[hidden] {
	display: none;
}

.tape__btn {
	container-type: inline-size; /* cassette parts are sized in cqw of this */
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	transition: transform .25s cubic-bezier(.2, .8, .2, 1);
}

.tape__btn:hover,
.tape__btn:focus-visible {
	transform: translateY(-6px) rotate(-1.5deg);
}

.tape__btn:focus-visible {
	outline: none;
}

.tape__btn:focus-visible .tape__shell {
	box-shadow: 0 0 0 3px var(--yellow), 0 14px 24px rgba(0,0,0,.6);
}

/* the cassette itself (sizes are in container units so it scales anywhere) */
.tape__shell {
	--p: 0;
	position: relative;
	display: block;
	aspect-ratio: 1.6;
	padding: 5cqw 5cqw 0;
	border-radius: 4cqw;
	background:
		radial-gradient(circle at 3.2cqw 3.2cqw, #4a4a4a 0 .7cqw, transparent .8cqw),
		radial-gradient(circle at calc(100% - 3.2cqw) 3.2cqw, #4a4a4a 0 .7cqw, transparent .8cqw),
		radial-gradient(circle at 3.2cqw calc(100% - 3.2cqw), #4a4a4a 0 .7cqw, transparent .8cqw),
		radial-gradient(circle at calc(100% - 3.2cqw) calc(100% - 3.2cqw), #4a4a4a 0 .7cqw, transparent .8cqw),
		linear-gradient(#2e2e2e, #181818);
	box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 12px 22px rgba(0,0,0,.55);
	transition: box-shadow .25s;
}

/* bottom tab */
.tape__shell::after {
	content: '';
	position: absolute;
	left: 20%;
	right: 20%;
	bottom: 0;
	height: 14cqw;
	background:
		radial-gradient(circle at 22% 55%, #0b0b0b 0 2cqw, transparent 2.1cqw),
		radial-gradient(circle at 78% 55%, #0b0b0b 0 2cqw, transparent 2.1cqw),
		linear-gradient(#262626, #1c1c1c);
	clip-path: polygon(7% 0, 93% 0, 100% 100%, 0 100%);
	border-top: 1px solid #3a3a3a;
}

.tape__label {
	position: relative;
	display: block;
	height: 40cqw;
	border-radius: 2cqw;
	overflow: hidden;
	background: var(--cream);
}

.tape__art {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.tape__title {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	z-index: 1;
	padding: 1.4cqw 3cqw 1cqw;
	background: var(--cream);
	border-bottom: .9cqw solid var(--yellow);
	color: #1a1a1a;
	font-family: 'Permanent Marker', cursive;
	font-size: 5.6cqw;
	line-height: 1.15;
	text-align: left;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.tape__window {
	position: absolute;
	z-index: 1;
	left: 20%;
	right: 20%;
	top: 47%;
	height: 15cqw;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 3cqw;
	border-radius: 999px;
	background: rgba(12, 12, 12, .88);
	box-shadow: inset 0 0 0 .6cqw rgba(255,255,255,.12);
}

/* --p = playback progress 0..1: tape winds from the left reel to the right */
.tape__reel {
	position: relative;
	width: 11cqw;
	height: 11cqw;
}

.tape__reel::before {
	content: '';
	position: absolute;
	left: 50%;
	top: 50%;
	width: calc(7cqw + 6cqw * var(--wound));
	height: calc(7cqw + 6cqw * var(--wound));
	transform: translate(-50%, -50%);
	border-radius: 50%;
	background: radial-gradient(circle, #6b4a2e 55%, #3d2a19 100%);
	transition: width .6s linear, height .6s linear;
}

.tape__reel--l { --wound: calc(1 - var(--p)); }
.tape__reel--r { --wound: var(--p); }

.tape__reel svg {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
	transform: scale(.62);
}

.is-playing .tape.is-current .tape__reel svg,
.is-playing .deck .tape__reel svg {
	animation: ss-reel 1.6s linear infinite;
}

.tape__badge {
	position: absolute;
	z-index: 2;
	top: -10px;
	right: -8px;
	padding: 3px 9px;
	border-radius: 999px;
	background: var(--yellow);
	color: #000;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	opacity: 0;
	transform: scale(.8);
	transition: opacity .2s, transform .2s;
}

.tape.is-current .tape__badge {
	opacity: 1;
	transform: scale(1);
}

.tape.is-current .tape__shell {
	box-shadow: 0 0 0 2px var(--yellow), 0 12px 22px rgba(0,0,0,.55);
}

.tape__meta {
	margin-top: 14px;
}

.tape__name {
	display: block;
	color: #fff;
	font-weight: 700;
	line-height: 1.25;
}

.tape__name:hover {
	color: var(--yellow);
}

.tape__info {
	display: block;
	margin-top: 2px;
	color: #8a8a8a;
	font-size: 13px;
}

/* load more */
.mixes__more {
	margin-top: 48px;
	text-align: center;
}

.mixes__more [hidden] {
	display: none;
}

.mixes__empty {
	color: #8a8a8a;
}

.tapes {
	transition: opacity .2s ease;
}

.tapes.is-swapping {
	opacity: .35;
	pointer-events: none;
}

/* new tapes slide up into place */
.tape {
	animation: ss-tape-in .45s cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes ss-tape-in {
	from { opacity: 0; transform: translateY(16px); }
	to { opacity: 1; transform: none; }
}

/* ---------- boombox ---------- */

.player {
	position: sticky;
	top: calc(var(--nav-h, 70px) + 20px); /* clears the sticky nav */
}

.player__close {
	display: none;
}

.boombox {
	position: relative;
	padding-top: 38px;
}

.boombox__handle {
	position: absolute;
	top: 0;
	left: 20%;
	right: 20%;
	height: 60px;
	border: 12px solid #2f2f2f;
	border-bottom: 0;
	border-radius: 30px 30px 0 0;
	box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}

.boombox__body {
	position: relative;
	padding: 18px;
	border-radius: 24px;
	background: linear-gradient(#3a3a3a, #1d1d1d);
	border: 1px solid #474747;
	box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 30px 60px rgba(0,0,0,.7);
}

/* display */
.boombox__lcd {
	padding: 10px 14px 12px;
	border-radius: 10px;
	background: #171300;
	box-shadow: inset 0 2px 10px rgba(0,0,0,.9), 0 1px 0 rgba(255,255,255,.08);
	color: var(--yellow);
	font-family: 'VT323', monospace;
	text-shadow: 0 0 6px rgba(247, 212, 23, .55);
}

.lcd__row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
}

.lcd__title {
	font-size: 26px;
	line-height: 1.1;
	text-transform: uppercase;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.lcd__time {
	font-size: 20px;
}

.lcd__stereo,
.lcd__rpm {
	font-size: 15px;
	opacity: .35;
	flex-shrink: 0;
}

.is-playing .lcd__stereo,
.is-playing .lcd__rpm {
	opacity: 1;
}

.lcd__progress {
	position: relative;
	height: 6px;
	margin-top: 8px;
	border-radius: 3px;
	background: rgba(247, 212, 23, .15);
	cursor: pointer;
}

.lcd__progress span,
.minibar__progress span {
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 0;
	border-radius: inherit;
	background: var(--yellow);
	box-shadow: 0 0 6px rgba(247, 212, 23, .6);
}

/* speakers + deck */
.boombox__main {
	display: grid;
	grid-template-columns: 1fr 1.25fr 1fr;
	gap: 14px;
	align-items: center;
	margin: 18px 0;
}

.speaker {
	position: relative;
	aspect-ratio: 1;
	border-radius: 50%;
	border: 6px solid #141414;
	background:
		radial-gradient(circle, #050505 1.3px, transparent 1.8px) 0 0 / 7px 7px,
		#2a2a2a;
	box-shadow: 0 0 0 2px #3c3c3c, inset 0 4px 12px rgba(0,0,0,.7);
}

.speaker__cone {
	position: absolute;
	inset: 22%;
	border-radius: 50%;
	background: radial-gradient(circle, #3a3a3a 0 14%, #0c0c0c 16%, #222 40%, #0b0b0b 72%);
	box-shadow: 0 0 0 3px #111, 0 0 0 4px #3a3a3a;
}

.is-playing .speaker__cone {
	animation: ss-thump .46s ease-out infinite;
}

.deck {
	padding: 8px;
	border-radius: 10px;
	background: #0e0e0e;
	box-shadow: inset 0 2px 8px rgba(0,0,0,.9), 0 1px 0 rgba(255,255,255,.08);
}

.deck__door {
	container-type: inline-size;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1.6;
	border-radius: 6px;
	background: linear-gradient(160deg, rgba(255,255,255,.07), rgba(255,255,255,0) 45%), #050505;
	overflow: hidden;
}

.deck__door::after {
	/* smoked glass reflection over the tape */
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(160deg, rgba(255,255,255,.1), rgba(255,255,255,0) 40%);
	pointer-events: none;
}

.deck__empty {
	color: #555;
	font-size: 11px;
	letter-spacing: .14em;
	text-transform: uppercase;
}

.deck .tape__shell {
	width: 100%;
	box-shadow: none;
	animation: ss-insert .5s cubic-bezier(.2, .8, .2, 1);
}

.deck .tape__badge {
	display: none;
}

/* piano keys */
.boombox__keys {
	display: grid;
	grid-template-columns: 1fr 1.6fr 1fr 1fr;
	gap: 8px;
}

.key {
	height: 46px;
	border: 0;
	border-radius: 4px 4px 9px 9px;
	background: linear-gradient(#efefef, #bcbcbc);
	color: #151515;
	font-size: 15px;
	box-shadow: 0 5px 0 #6d6d6d, 0 7px 10px rgba(0,0,0,.5);
	transition: transform .08s, box-shadow .08s, background .2s;
}

.key:active {
	transform: translateY(4px);
	box-shadow: 0 1px 0 #6d6d6d, 0 2px 4px rgba(0,0,0,.5);
}

.key--play {
	background: linear-gradient(#ffe35a, var(--yellow) 60%, #d6b70c);
	box-shadow: 0 5px 0 #8a7600, 0 7px 10px rgba(0,0,0,.5);
}

.is-playing .key--play {
	transform: translateY(3px);
	box-shadow: 0 2px 0 #8a7600, 0 3px 6px rgba(0,0,0,.5);
}

.player__mixcloud {
	margin-top: 22px;
	border-radius: 10px;
	overflow: hidden;
}

.player__mixcloud iframe {
	display: block;
	width: 100%;
	height: 60px;
	border: 0;
}

/* ---------- mini player bar (phones) ---------- */

.minibar {
	display: none;
}

@keyframes ss-reel {
	to { transform: scale(.62) rotate(-360deg); }
}

@keyframes ss-thump {
	0% { transform: scale(1.06); }
	100% { transform: scale(1); }
}

@keyframes ss-insert {
	from { transform: translateY(-60%); opacity: 0; }
	to { transform: none; opacity: 1; }
}

@media (max-width: 1199px) {
	.mixes__inner {
		grid-template-columns: minmax(0, 1fr) 400px;
		gap: 32px;
	}
}

/* ---------- tablet / phone ---------- */

@media (max-width: 991px) {
	.mixes {
		padding-top: 48px;
	}

	.mixes__inner {
		grid-template-columns: 1fr;
		padding: 0 16px;
	}

	.tapes {
		grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
		gap: 28px 16px;
	}

	.tape__meta {
		margin-top: 10px;
	}

	.tape__name {
		font-size: 14px;
	}

	.tape__info {
		font-size: 12px;
	}

	/* the boombox becomes a sheet that slides up over the page.
	   It stays rendered while closed so the Mixcloud player keeps playing. */
	.player {
		position: fixed;
		inset: 0;
		z-index: 1050;
		display: flex;
		flex-direction: column;
		justify-content: center;
		padding: 56px 16px 24px;
		background: rgba(0, 0, 0, .96);
		overflow-y: auto;
		transform: translateY(100%);
		visibility: hidden;
		transition: transform .45s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .45s;
	}

	.player.is-open {
		transform: none;
		visibility: visible;
		transition: transform .45s cubic-bezier(.2, .8, .2, 1);
	}

	.boombox,
	.player__mixcloud {
		width: 100%;
		max-width: 460px;
		margin-left: auto;
		margin-right: auto;
	}

	.player__close {
		display: block;
		position: absolute;
		top: 12px;
		right: 16px;
		width: 40px;
		height: 40px;
		border: 0;
		background: none;
		color: #fff;
		font-size: 34px;
		line-height: 1;
	}

	.boombox__body {
		padding: 14px;
	}

	.boombox__main {
		gap: 10px;
	}

	.lcd__title {
		font-size: 22px;
	}

	.minibar:not([hidden]) {
		display: flex;
		align-items: center;
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 1040;
		height: 64px;
		padding: 0 8px 0 12px;
		background: #111;
		border-top: 1px solid #262626;
		box-shadow: 0 -10px 30px rgba(0,0,0,.6);
	}

	.minibar__progress {
		position: absolute;
		left: 0;
		right: 0;
		top: -1px;
		height: 2px;
		background: #262626;
	}

	.minibar__open {
		flex: 1;
		min-width: 0;
		display: flex;
		align-items: center;
		gap: 12px;
		height: 100%;
		padding: 0;
		border: 0;
		background: none;
		color: #fff;
		text-align: left;
	}

	.minibar__reel {
		flex-shrink: 0;
		width: 40px;
		height: 40px;
		padding: 4px;
		border-radius: 8px;
		background: #222;
	}

	.minibar__reel svg {
		display: block;
		width: 100%;
		height: 100%;
	}

	.is-playing .minibar__reel svg {
		animation: ss-spin-plain 1.6s linear infinite;
	}

	.minibar__text {
		min-width: 0;
		display: flex;
		flex-direction: column;
	}

	.minibar__title {
		font-weight: 700;
		font-size: 14px;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.minibar__time {
		color: #8a8a8a;
		font-size: 12px;
	}

	.minibar__play {
		flex-shrink: 0;
		width: 46px;
		height: 46px;
		border: 0;
		border-radius: 50%;
		background: var(--yellow);
		color: #000;
		font-size: 16px;
	}

	body.has-minibar {
		padding-bottom: 64px;
	}
}

@keyframes ss-spin-plain {
	to { transform: rotate(-360deg); }
}

@media (prefers-reduced-motion: reduce) {
	.is-playing .tape__reel svg,
	.is-playing .speaker__cone,
	.is-playing .minibar__reel svg,
	.deck .tape__shell,
	.tape {
		animation: none !important;
	}
}
