:root {
	--highlight: rgba(255, 255, 255, 0.6);
}

* {
	box-sizing: border-box;
	-webkit-tap-highlight-color: transparent;
}

html {
	overflow-y: scroll;
	scrollbar-width: none;
}

html::-webkit-scrollbar {
	display: none;
}

body {
	margin: 0;
	background: #fff;
	font-family: Helvetica, Arial, sans-serif;
	color: #222;
}

.container {
	width: 100%;
	max-width: 884px;
	margin: 0 auto;
	padding: clamp(12px, 3vw, 24px) clamp(12px, 3vw, 24px) clamp(18px, 4.5vw, 36px);
}

.intro {
	user-select: none;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
	grid-template-areas:
		"cassette title"
		"cassette text";
	column-gap: clamp(16px, 3vw, 34px);
	align-items: start;
	margin-bottom: clamp(16px, 4vw, 32px);
}

.intro h1 {
	grid-area: title;
	margin: 0 0 0.2em 0;
	padding-top: 6px;
	font-size: clamp(44px, 9vw, 74px);
	font-weight: bold;
	letter-spacing: 1px;
	line-height: 1;
}

.intro .cassette {
	grid-area: cassette;
	max-width: 360px;
}

.intro p {
	grid-area: text;
	margin: -6px 0 0 0;
	font-size: 20px;
	line-height: 1.3;
	color: #222;
	overflow-wrap: break-word;
}

.cassette img {
	width: 100%;
	height: auto;
	display: block;
	padding-top: 5px;
	-webkit-user-drag: none;
	user-select: none;
	pointer-events: none;
}

.intro a, .song-link, .action-link, .panel a:not(.song-link) {
	text-decoration: underline;
	text-decoration-thickness: 1.5px;
	text-underline-offset: 2px;
}

.intro a {
	color: #000;
}

@media (hover: hover) {
	.intro a:hover {
		background: #000;
		color: #fff;
		text-decoration: none;
	}
}

@media (max-width: 880px) {
	.intro {
		display: block;
	}
	.intro .cassette {
		float: left;
		width: 45%;
		max-width: 280px;
		margin: 0 16px 8px 0;
	}
	.intro::after {
		content: "";
		display: block;
		clear: both;
	}
	.cassette img {
		padding-top: 0;
	}
}

.artists {
	list-style: none;
	margin: 0;
	padding: 0;
	position: relative;
	overflow: hidden;
	overflow-anchor: none;
}

.artists::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	height: var(--cover-height);
	background: #fff;
	z-index: 100000;
	transform: translateY(var(--list-bottom));
	transition: transform .25s ease-in-out;
}

.artists.no-anim,
.artists.no-anim li,
.artists.no-anim::after {
	transition: none;
}

.artists li {
	font-size: 30px;
	font-weight: 500;
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	/* opaque so a lower card paints over the panel of the card above it
	   (z-index increases down the stack) — without this the open panel
	   bleeds through the transparent area below each row */
	background: #fff;
	transition: transform .25s ease-in-out;
}

.artists li.collapsed .panel {
	position: absolute;
	left: 0;
	right: 0;
}

.artists .row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 14px;
	/* fixed integer height — a fractional one drifts the stacked offsets */
	height: 58px;
	padding: 0 clamp(10px, 1.6vw, 14px);
	cursor: pointer;
	user-select: none;
}

.artists .name {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.plus_box {
	display: flex;
	justify-content: center;
	align-items: center;
	width: 30px;
	height: 30px;
	flex-shrink: 0;
	cursor: pointer;
	transition: transform .15s ease-in-out;
}

.plus {
	background: currentColor;
	height: 20px;
	position: relative;
	width: 4px;
	transition: transform .15s ease-in-out, background .15s ease-in-out;
}

.plus::after {
	background: currentColor;
	content: "";
	height: 4px;
	left: -8px;
	position: absolute;
	top: 8px;
	width: 20px;
	transition: transform .15s ease-in-out, background .15s ease-in-out;
}


.artists li.open .plus_box {
	transform: rotate(-45deg);
}

.artists .panel {
	font-size: 20px;
	font-weight: 400;
	line-height: 1.3;
	overflow-anchor: none;
	background: #fff;
	color: #222;
	/* hidden unless the card is open — keeps a closed panel from poking
	   past the container's clip while rows slide during the close anim.
	   on close, stay visible through the .25s slide, then snap hidden */
	visibility: hidden;
	transition: visibility 0s linear .25s;
}

.artists li.open .panel {
	visibility: visible;
	transition: visibility 0s;
}

.artists.no-anim .panel {
	transition: none;
}

.artists .album {
	display: flex;
	align-items: flex-start;
	gap: 0;
	background: #fff;
}

.artists .album.flipped {
	flex-direction: row-reverse;
}

.artists .album .art {
	flex: 0 0 50%;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	align-self: flex-start;
}

.artists .album .art img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.artists .album .bio {
	flex: 0 0 50%;
	aspect-ratio: 1 / 1;
	padding: clamp(8px, 1.4vw, 14px) clamp(14px, 2.4vw, 24px) clamp(14px, 2.4vw, 24px);
	background: #f4f4f4;
	overflow-y: scroll;
	scrollbar-color: #c4c4c4 #f4f4f4;
}

.artists .album .bio::-webkit-scrollbar {
	width: 12px;
}

.artists .album .bio::-webkit-scrollbar-track {
	background: #fff;
}

.artists .album .bio::-webkit-scrollbar-thumb {
	background: #c4c4c4;
	border: 3px solid #fff;
	border-radius: 6px;
}

.artists .album .bio p {
	margin: 0;
}

/* gap between blank-line-separated description paragraphs */
.artists .album .bio p:not(.action-wrap) + p:not(.action-wrap) {
	margin-top: 1em;
}

.song-link,
.panel a:not(.action-link):not(.song-link) {
	color: inherit;
	text-decoration-color: var(--accent);
}

.song-link {
	cursor: pointer;
	white-space: nowrap;
}

.song-link-label {
	white-space: normal;
}

.song-link::before {
	content: "";
	display: inline-block;
	width: 0.7em;
	height: 0.7em;
	margin-right: 0.2em;
	vertical-align: -0.04em;
	background: currentColor;
	-webkit-mask: url("play-icon.svg") center / 90% no-repeat, url("pause-icon.svg") -9999px -9999px / 90% no-repeat;
	mask: url("play-icon.svg") center / 90% no-repeat, url("pause-icon.svg") -9999px -9999px / 90% no-repeat;
}

.song-link.playing {
	background: var(--accent);
	color: var(--accent-fg);
}

@media (hover: hover) {
	.song-link:hover {
		background: var(--accent);
		color: var(--accent-fg);
	}
	.song-link.playing.fading:hover {
		transition: none;
		background: var(--accent);
		color: var(--accent-fg);
	}
	.panel a:not(.action-link):not(.song-link):hover {
		background: var(--accent);
		color: var(--accent-fg);
	}
}

.song-link.playing:not(.fading)::before {
	-webkit-mask: url("play-icon.svg") -9999px -9999px / 90% no-repeat, url("pause-icon.svg") center / 90% no-repeat;
	mask: url("play-icon.svg") -9999px -9999px / 90% no-repeat, url("pause-icon.svg") center / 90% no-repeat;
}

.song-link.playing.fading {
	transition: background var(--fade-duration, 1.5s) linear, color var(--fade-duration, 1.5s) linear;
	background: transparent;
	color: inherit;
}

.artists .album .bio p.action-wrap {
	text-align: center;
	margin-top: 1em;
	margin-bottom: 1em;
}

.artists .album .bio p.action-wrap + p.action-wrap {
	margin-top: -0.5em;
}

.artists .album .bio p:not(.action-wrap) + p.action-wrap {
	margin-top: 1.75em;
}

.artists .album .bio p.action-wrap:last-child {
	margin-bottom: 2em;
}

.action-link {
	color: inherit;
}

@media (hover: hover) {
	.action-link:hover:not(.dev-save-disabled) {
		background: var(--accent);
		color: var(--accent-fg);
		text-decoration-color: var(--accent);
	}
}

/* save button when there are no unsaved changes */
.action-link.dev-save-disabled {
	color: #aaa;
	text-decoration-color: #aaa;
	cursor: default;
}

@media (max-width: 500px) {
	.artists .panel {
		height: 75vw;
		overflow-y: scroll;
	}
	.container {
		padding-bottom: 0;
	}
	.artists {
		margin-left: calc(0px - clamp(12px, 3vw, 24px));
		margin-right: calc(0px - clamp(12px, 3vw, 24px));
	}
	.artists .album {
		display: block;
	}
	.artists .album .art {
		float: left;
		width: 50vw;
		margin-right: clamp(10px, 3vw, 16px);
		shape-outside: inset(0 0 clamp(6px, 1.5vw, 10px) 0);
	}
	.artists .album.flipped .art {
		float: right;
		margin-right: 0;
		margin-left: clamp(10px, 3vw, 16px);
	}
	.artists .album .bio {
		flex: none;
		aspect-ratio: auto;
		overflow-y: visible;
		scrollbar-gutter: auto;
		background: #fff;
	}
	.artists .album:has(+ .album) .bio {
		padding-bottom: clamp(22px, 4vw, 46px);
	}
	.artists .album + .album .bio {
		padding-top: 0;
	}
	.artists .album + .album .bio > p:first-child {
		margin-top: -6px;
	}
	.artists .album::after {
		content: "";
		display: block;
		clear: both;
	}
}

.artists li .panel ::selection {
	background: var(--accent);
	color: #fff;
}

/* ---------- dev mode ---------- */

.dev-add-artist {
	cursor: pointer;
}

.dev-artist-name {
	flex: 1 1 auto;
	min-width: 0;
	background: transparent;
	border: none;
	color: inherit;
	font: inherit;
	line-height: inherit;
	padding: 0;
	margin: 0;
	height: auto;
	outline: none;
}

.dev-artist-name::placeholder {
	color: var(--highlight);
}

.artists li.open .plus_box.dev-row-delete {
	background: #000;
	cursor: pointer;
	transform: none;
}

.plus_box.dev-row-delete .plus {
	transform: rotate(-45deg);
}

.plus_box.dev-row-delete .plus,
.plus_box.dev-row-delete .plus::after {
	background: #FF0000;
	transition: background .1s ease-in-out;
}

.dev-art {
	position: relative;
}

.artists li.open .plus_box.dev-delete.dev-delete-album {
	position: absolute;
	top: 0;
	right: 0;
	width: 36px;
	height: 36px;
	background: #000;
	z-index: 2;
	transform: none;
}

.plus_box.dev-delete.dev-delete-album .plus {
	transform: rotate(-45deg);
}

.plus_box.dev-delete.dev-delete-album .plus,
.plus_box.dev-delete.dev-delete-album .plus::after {
	background: #FF0000;
}

.dev-art-placeholder {
	background: #e8e8e8;
	display: flex;
	align-items: center;
	justify-content: center;
}

.dev-art-q {
	font-size: clamp(60px, 16vw, 140px);
	font-weight: bold;
	color: #888;
	line-height: 1;
	user-select: none;
}

.dev-bio {
	display: flex;
	flex-direction: column;
}

/* no trailing space below the last edit-mode control */
.artists .album .dev-bio p.action-wrap:last-child {
	margin-bottom: 0;
}

.dev-remove-album-wrap {
	display: none;
}

.artists .album .dev-bio p.dev-add-album-wrap {
	margin-bottom: 0;
}

@media (max-width: 500px) {
	.artists .album.dev-editing .art {
		display: none;
	}
	.dev-remove-album-wrap {
		display: block;
	}
	.artists .album .dev-bio p.dev-add-album-wrap {
		margin-bottom: 1em;
	}
	.dev-color-thumb {
		background: #fff;
	}
}

.dev-album-title {
	background: transparent;
	border: none;
	font: inherit;
	font-weight: bold;
	color: inherit;
	padding: 0;
	margin: 0;
	outline: none;
	width: 100%;
}

.dev-album-desc {
	background: transparent;
	border: 1.5px solid #c4c4c4;
	border-radius: 0;
	font: inherit;
	color: inherit;
	padding: 6px 8px;
	margin-top: 10px;
	resize: none;
	min-height: 100px;
	height: 220px;
	width: 100%;
	outline: none;
	flex: 0 0 auto;
}

.dev-album-desc:focus {
	border-color: #222;
}

.dev-album-title::placeholder,
.dev-album-desc::placeholder {
	color: #999;
}

.dev-color {
	width: 30px;
	height: 30px;
	padding: 0;
	border: 2px solid var(--highlight);
	background: none;
	cursor: pointer;
	flex-shrink: 0;
	-webkit-appearance: none;
	appearance: none;
	border-radius: 12px;
}

.dev-bio.dev-picking > :not(.dev-color-picker) {
	display: none;
}

.dev-color-picker {
	display: grid;
	grid-template-columns: max-content 1fr;
	align-items: center;
	column-gap: 12px;
	row-gap: 8px;
	user-select: none;
}

.dev-color-picker > .action-wrap {
	grid-column: 1 / -1;
}

.dev-color-wheel {
	grid-column: 1 / -1;
	position: relative;
	width: 160px;
	height: 160px;
	margin: 0 auto 8px;
}

.dev-color-wheel canvas {
	display: block;
	width: 100%;
	height: 100%;
	cursor: grab;
	touch-action: none;
}

.dev-color-wheel canvas:active {
	cursor: grabbing;
}

.dev-color-marker {
	position: absolute;
	width: 12px;
	height: 12px;
	border: 2px solid #fff;
	border-radius: 50%;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);
	transform: translate(-50%, -50%);
	pointer-events: none;
}

.dev-color-slider {
	position: relative;
	height: 20px;
	cursor: grab;
	touch-action: none;
}

.dev-color-slider:active {
	cursor: grabbing;
}

.dev-color-thumb {
	position: absolute;
	top: -2px;
	width: 6px;
	height: 24px;
	transform: translateX(-50%);
	background: #f4f4f4;
	border: 1px solid rgba(0, 0, 0, 0.3);
	border-radius: 1px;
	pointer-events: none;
}
