/*
Theme Name: Kawaii Music
Theme URI: https://kawaiimusicsessions.com/
Author: Kawaii Music
Author URI: https://kawaiimusicsessions.com/
Description: Classic PHP theme for the Kawaii Music library. Track pages, a card grid with character and genre filters, the credit box with copy buttons, and built in SEO output. Needs the "KMS Music Library" plugin.
Version: 1.0.2
Requires at least: 6.5
Tested up to: 7.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: kawaii-music
Tags: custom-menu, featured-images, translation-ready, custom-logo
*/

/* ------------------------------------------------------------------ *
 * 1. Colours
 *
 * Three sets. The owner picks one under Appearance > Customize >
 * Kawaii Music. Everything else in this file uses these variables.
 * ------------------------------------------------------------------ */

:root {
	/*
	 * Background. Three sets, and they differ only in the paper colour — the
	 * brand pink and the character colours stay the same in all of them, so
	 * switching never changes what the site "is", only what it is printed on.
	 *
	 * Default: Pink — a hint of pink on white.
	 */
	--kms-bg: #fffdfe;
	--kms-bg-tint: #fdf5f8;
	--kms-surface: #ffffff;
	--kms-ink: #3c2f35;
	--kms-ink-soft: #7c7079;
	--kms-border: #f0e4ea;

	--kms-primary: #ff5f9e;
	--kms-primary-dark: #e04481;
	--kms-primary-soft: #ffe4ef;
	--kms-accent: #7bd3d3;

	/*
	 * Character colours. Taken from the thumbnail bands so the site feels like
	 * the video the visitor just came from. Kept soft on purpose.
	 *
	 * Each character has two values: the pale tone used for fills, rings and
	 * washes, and an "ink" for text and icons on top of that tone. Every ink
	 * clears 4.5:1 against the strongest fill it ever sits on (the active
	 * filter tab), measured — pale gold on pale gold is otherwise unreadable.
	 *
	 * These stay the same in all three colour sets: the palette can change, a
	 * character's colour should not.
	 */
	--kms-yuna: #eb9aac;
	--kms-yuna-ink: #8c4359;
	--kms-karin: #f0d183;
	--kms-karin-ink: #7c631f;
	--kms-aria: #93accf;
	--kms-aria-ink: #465c82;

	--kms-ok: #2f9e6b;
	--kms-warn: #d98324;
	--kms-no: #d94f6d;

	--kms-radius: 18px;
	--kms-radius-sm: 10px;
	--kms-shadow: 0 8px 24px rgba(190, 150, 170, 0.13);
	--kms-shadow-lift: 0 14px 32px rgba(190, 150, 170, 0.2);
	--kms-max: 1140px;
	--kms-max-narrow: 760px;

	--kms-font: ui-rounded, "Hiragino Maru Gothic ProN", Quicksand, "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;

	/* Fallback for anything not tied to a character. */
	--kms-character: var(--kms-primary);
	--kms-character-ink: var(--kms-primary-dark);
}

/* Beige — a hint of cream. */
:root[data-kms-palette="beige"] {
	--kms-bg: #fffefb;
	--kms-bg-tint: #faf6ef;
	--kms-ink: #3a352c;
	--kms-ink-soft: #7a736a;
	--kms-border: #eee6da;
	--kms-shadow: 0 8px 24px rgba(180, 155, 120, 0.13);
	--kms-shadow-lift: 0 14px 32px rgba(180, 155, 120, 0.2);
}

/* Gray — plain neutral paper, no tint at all. */
:root[data-kms-palette="gray"] {
	--kms-bg: #fdfdfd;
	--kms-bg-tint: #f4f4f5;
	--kms-ink: #33333a;
	--kms-ink-soft: #71717a;
	--kms-border: #e5e5e8;
	--kms-shadow: 0 8px 24px rgba(90, 90, 105, 0.12);
	--kms-shadow-lift: 0 14px 32px rgba(90, 90, 105, 0.18);
}

/*
 * Anything inside one of these picks up that character's pair, so a card, a
 * track page, a home row and a filter tab all colour themselves the same way.
 */
.character-yuna,
.tab--yuna {
	--kms-character: var(--kms-yuna);
	--kms-character-ink: var(--kms-yuna-ink);
}

.character-karin,
.tab--karin {
	--kms-character: var(--kms-karin);
	--kms-character-ink: var(--kms-karin-ink);
}

.character-aria,
.tab--aria {
	--kms-character: var(--kms-aria);
	--kms-character-ink: var(--kms-aria-ink);
}

/* ------------------------------------------------------------------ *
 * 2. Base
 * ------------------------------------------------------------------ */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background-color: var(--kms-bg);
	color: var(--kms-ink);
	font-family: var(--kms-font);
	font-size: 17px;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
}

img,
svg,
iframe,
audio,
video {
	max-width: 100%;
}

img {
	height: auto;
	display: block;
}

a {
	color: var(--kms-primary-dark);
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
}

a:hover,
a:focus {
	color: var(--kms-primary);
}

h1, h2, h3, h4 {
	line-height: 1.25;
	letter-spacing: 0.01em;
	margin: 0 0 0.5em;
}

h1 { font-size: clamp(1.9rem, 1.4rem + 2vw, 2.7rem); }
h2 { font-size: clamp(1.4rem, 1.15rem + 1vw, 1.8rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; }

ul, ol { padding-left: 1.3em; }

code {
	font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
	font-size: 0.92em;
}

:focus-visible {
	outline: 3px solid var(--kms-primary);
	outline-offset: 2px;
	border-radius: 4px;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link:focus {
	position: fixed;
	top: 12px;
	left: 12px;
	z-index: 100;
	width: auto;
	height: auto;
	clip: auto;
	margin: 0;
	padding: 10px 18px;
	background: var(--kms-surface);
	border-radius: 999px;
	box-shadow: var(--kms-shadow);
	font-weight: 700;
}

.wrap {
	width: min(100% - 2.4rem, var(--kms-max));
	margin-inline: auto;
}

.wrap--narrow {
	width: min(100% - 2.4rem, var(--kms-max-narrow));
}

.site-main {
	display: block;
	padding-bottom: 4rem;
}

/* ------------------------------------------------------------------ *
 * 3. Header and navigation
 * ------------------------------------------------------------------ */

.site-header {
	position: sticky;
	top: 0;
	z-index: 20;
	background: rgba(255, 255, 255, 0.88);
	backdrop-filter: saturate(140%) blur(10px);
	border-bottom: 1px solid var(--kms-border);
}

.site-header__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.6rem 1.5rem;
	padding: 0.75rem 0;
}

.site-branding {
	display: flex;
	align-items: center;
	gap: 0.7rem;
}

.site-logo img {
	max-height: 44px;
	width: auto;
	border-radius: 50%;
}

.site-title {
	margin: 0;
	font-size: 1.3rem;
	font-weight: 800;
	letter-spacing: 0.02em;
}

.site-title a {
	color: var(--kms-ink);
	text-decoration: none;
}

.site-title a:hover {
	color: var(--kms-primary);
}

.site-nav .menu,
.footer-nav .menu {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.3rem 1.1rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-nav a {
	display: inline-block;
	padding: 0.3rem 0.1rem;
	color: var(--kms-ink-soft);
	font-weight: 700;
	font-size: 0.95rem;
	text-decoration: none;
}

.site-nav a:hover,
.site-nav .current-menu-item > a {
	color: var(--kms-primary);
}

/* ------------------------------------------------------------------ *
 * 4. Hero
 * ------------------------------------------------------------------ */

.hero {
	position: relative;
	overflow: hidden;
	background:
		radial-gradient(60% 90% at 12% 0%, color-mix(in srgb, var(--kms-primary-soft) 50%, transparent) 0%, transparent 62%),
		radial-gradient(50% 80% at 88% 10%, var(--kms-bg-tint) 0%, transparent 65%),
		var(--kms-bg);
	border-bottom: 1px solid var(--kms-border);
}

.hero__inner {
	padding: clamp(2.5rem, 1.5rem + 5vw, 5rem) 0;
	text-align: center;
}

.hero__title {
	margin-bottom: 0.35em;
	font-weight: 800;
}

.hero__text {
	max-width: 40ch;
	margin: 0 auto 1.6em;
	color: var(--kms-ink-soft);
	font-size: 1.08rem;
}

.hero__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.7rem;
	margin: 0;
}

/* ------------------------------------------------------------------ *
 * 5. Buttons, pills, tabs
 * ------------------------------------------------------------------ */

.button {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.7rem 1.5rem;
	border: 2px solid transparent;
	border-radius: 999px;
	font-weight: 700;
	font-size: 0.98rem;
	text-decoration: none;
	transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.button--primary {
	background: var(--kms-primary);
	color: #fff;
	box-shadow: var(--kms-shadow);
}

.button--primary:hover,
.button--primary:focus {
	background: var(--kms-primary-dark);
	color: #fff;
	transform: translateY(-1px);
	box-shadow: var(--kms-shadow-lift);
}

.button--ghost {
	background: var(--kms-surface);
	border-color: var(--kms-border);
	color: var(--kms-ink);
}

.button--ghost:hover,
.button--ghost:focus {
	border-color: var(--kms-primary);
	color: var(--kms-primary-dark);
}

.button-link-arrow {
	font-weight: 700;
	font-size: 0.95rem;
	text-decoration: none;
	white-space: nowrap;
}

.button-link-arrow::after {
	content: " →";
}

.pill {
	display: inline-block;
	padding: 0.22rem 0.75rem;
	border-radius: 999px;
	background: var(--kms-primary-soft);
	color: var(--kms-primary-dark);
	font-size: 0.85rem;
	font-weight: 700;
	line-height: 1.6;
	text-decoration: none;
	white-space: nowrap;
}

.pill:hover,
.pill:focus {
	background: var(--kms-primary);
	color: #fff;
}

.pill--sm {
	padding: 0.1rem 0.6rem;
	font-size: 0.78rem;
}

.pill--character {
	background: color-mix(in srgb, var(--kms-character) 26%, #fff);
	color: var(--kms-character-ink);
}

.pill--character:hover,
.pill--character:focus {
	background: color-mix(in srgb, var(--kms-character) 55%, #fff);
	color: var(--kms-character-ink);
}

.pill--bpm {
	background: var(--kms-bg-tint);
	color: var(--kms-ink-soft);
}

.filter-bar {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	margin-bottom: 1.6rem;
}

.filter-bar__row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
}

.tab {
	padding: 0.45rem 1.2rem;
	border: 2px solid var(--kms-border);
	border-radius: 999px;
	background: var(--kms-surface);
	color: var(--kms-ink);
	font-weight: 700;
	font-size: 0.95rem;
	text-decoration: none;
}

.tab:hover,
.tab:focus {
	border-color: var(--kms-primary);
	color: var(--kms-primary-dark);
}

.tab.is-active {
	background: color-mix(in srgb, var(--kms-primary) 26%, #fff);
	border-color: var(--kms-primary);
	color: var(--kms-primary-dark);
}

/* A character tab fills with its own colour instead of the brand pink. */
.tab--karin.is-active,
.tab--yuna.is-active,
.tab--aria.is-active {
	background: color-mix(in srgb, var(--kms-character) 45%, #fff);
	border-color: var(--kms-character);
	color: var(--kms-character-ink);
}

.tab--karin:hover,
.tab--yuna:hover,
.tab--aria:hover,
.tab--karin:focus,
.tab--yuna:focus,
.tab--aria:focus {
	border-color: var(--kms-character);
	color: var(--kms-character-ink);
}

.chip {
	padding: 0.28rem 0.85rem;
	border-radius: 999px;
	background: var(--kms-bg-tint);
	color: var(--kms-ink-soft);
	font-size: 0.88rem;
	font-weight: 700;
	text-decoration: none;
}

.chip:hover,
.chip:focus {
	background: var(--kms-primary-soft);
	color: var(--kms-primary-dark);
}

.chip.is-active {
	background: color-mix(in srgb, var(--kms-primary) 20%, #fff);
	color: var(--kms-primary-dark);
	box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--kms-primary) 55%, transparent);
}

/* ------------------------------------------------------------------ *
 * 6. Page headers and sections
 * ------------------------------------------------------------------ */

.page-header {
	padding: 2.4rem 0 1.2rem;
}

.page-title {
	margin-bottom: 0.2em;
}

.page-description {
	max-width: 60ch;
	margin: 0;
	color: var(--kms-ink-soft);
}

.page-header__search {
	margin-top: 1rem;
}

.result-count {
	margin: 0 0 0.9rem;
	color: var(--kms-ink-soft);
	font-size: 0.9rem;
}

.section-title {
	margin: 0;
	font-weight: 800;
}

.section-title--character {
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
}

.section-title--character::before {
	content: "";
	width: 0.75rem;
	height: 0.75rem;
	border-radius: 999px;
	background: var(--kms-character);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--kms-character) 22%, transparent);
}

/* "All Karin tracks →" takes the character's ink. */
.home-section .button-link-arrow {
	color: var(--kms-character-ink);
}

.home-section {
	margin: 3rem 0;
}

.home-section__head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.5rem 1rem;
	margin-bottom: 1.1rem;
}

.home-section__note {
	margin: -0.6rem 0 1rem;
	color: var(--kms-ink-soft);
	font-size: 0.95rem;
}

/* ------------------------------------------------------------------ *
 * 7. Track cards
 * ------------------------------------------------------------------ */

.track-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 1.4rem;
}

.track-card {
	display: flex;
	flex-direction: column;
	gap: 0.7rem;
}

.track-art {
	position: relative;
	border-radius: var(--kms-radius);
	background: linear-gradient(
		135deg,
		color-mix(in srgb, var(--kms-character) 32%, #fff),
		color-mix(in srgb, var(--kms-character) 10%, #fff)
	);
	box-shadow: var(--kms-shadow);
	overflow: hidden;
	aspect-ratio: 1 / 1;
}

.track-art::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--kms-character) 45%, transparent);
	pointer-events: none;
}

.track-art img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.35s ease;
}

.track-card:hover .track-art img {
	transform: scale(1.04);
}

.track-art__link {
	display: block;
	height: 100%;
}

.track-art__placeholder {
	display: grid;
	place-items: center;
	height: 100%;
	color: color-mix(in srgb, var(--kms-character-ink) 30%, #fff);
}

.track-art__placeholder svg {
	width: 42%;
	height: 42%;
	fill: currentColor;
}

.play-button {
	display: none;
	position: absolute;
	right: 0.6rem;
	bottom: 0.6rem;
	width: 44px;
	height: 44px;
	padding: 0;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	color: var(--kms-character-ink);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
	cursor: pointer;
	transition: transform 0.15s ease, background-color 0.15s ease;
}

.kms-js .play-button {
	display: flex;
}

.play-button:hover {
	transform: scale(1.07);
	background: #fff;
}

.play-button.is-playing {
	background: var(--kms-character-ink);
	color: #fff;
}

.play-button__icon {
	width: 0;
	height: 0;
	margin-left: 3px;
	border-style: solid;
	border-width: 7px 0 7px 12px;
	border-color: transparent transparent transparent currentColor;
}

.play-button.is-playing .play-button__icon {
	width: 12px;
	height: 14px;
	margin-left: 0;
	border: 0;
	background: linear-gradient(to right, currentColor 0 4px, transparent 4px 8px, currentColor 8px 12px);
}

.track-card__body {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

/*
 * The title is locked to one line so every card in a row is the same height.
 * A title that does not fit slides sideways while the card is hovered — the
 * measuring is done in JS, which adds .is-scrollable plus the exact distance,
 * so short titles never move.
 */
.track-card__title {
	margin: 0;
	font-size: 1.02rem;
	font-weight: 800;
	line-height: 1.35;
	white-space: nowrap;
	overflow: hidden;
}

.track-card__title a {
	display: block;
	color: var(--kms-ink);
	text-decoration: none;
}

.track-card__title a:hover {
	color: var(--kms-primary-dark);
}

.track-card__title-inner {
	display: inline-block;
}

/* Fade the cut edge so it reads as "there is more", not as a typo. */
.track-card__title.is-scrollable {
	-webkit-mask-image: linear-gradient(to right, #000 calc(100% - 22px), transparent 100%);
	mask-image: linear-gradient(to right, #000 calc(100% - 22px), transparent 100%);
}

.track-card:hover .track-card__title.is-scrollable .track-card__title-inner,
.track-card:focus-within .track-card__title.is-scrollable .track-card__title-inner {
	animation: kms-title-marquee var(--kms-marquee-duration, 4s) ease-in-out 0.25s infinite alternate;
}

@keyframes kms-title-marquee {
	from { transform: translateX(0); }
	to { transform: translateX(var(--kms-marquee-shift, 0)); }
}

.track-card__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.3rem;
}

/* ------------------------------------------------------------------ *
 * 8. Track page
 * ------------------------------------------------------------------ */

/*
 * A soft wash of the character's colour behind the top of a track page, and
 * behind the heading of a character archive. It fades out well before the
 * text starts, so it reads as atmosphere rather than a coloured block.
 */
.track,
body.tax-character .page-header {
	background-image:
		radial-gradient(80% 420px at 12% 0%, color-mix(in srgb, var(--kms-character) 20%, transparent) 0%, transparent 72%),
		radial-gradient(55% 300px at 92% 0%, color-mix(in srgb, var(--kms-character) 12%, transparent) 0%, transparent 72%);
	background-repeat: no-repeat;
}

.breadcrumb {
	padding: 1.4rem 0 0;
	color: var(--kms-ink-soft);
	font-size: 0.88rem;
}

.breadcrumb a {
	color: var(--kms-ink-soft);
	text-decoration: none;
}

.breadcrumb a:hover {
	color: var(--kms-primary);
}

.breadcrumb__sep {
	margin: 0 0.4rem;
	opacity: 0.6;
}

.track__top {
	display: grid;
	grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
	gap: 2rem;
	align-items: start;
	padding: 1.5rem 0 2.5rem;
}

.track__art {
	box-shadow: var(--kms-shadow-lift);
}

.track__title {
	margin-bottom: 0.4rem;
}

.track__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin-bottom: 1.3rem;
}

.track__player {
	width: 100%;
	margin-bottom: 1.2rem;
	border-radius: 999px;
}

.download-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	margin-bottom: 0.9rem;
}

.dl-button {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	min-width: 118px;
	padding: 0.6rem 1.4rem;
	border: 2px solid var(--kms-primary);
	border-radius: var(--kms-radius-sm);
	background: var(--kms-surface);
	color: var(--kms-primary-dark);
	text-decoration: none;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dl-button:hover,
.dl-button:focus {
	transform: translateY(-1px);
	box-shadow: var(--kms-shadow);
	color: var(--kms-primary-dark);
}

.dl-button--mp3 {
	background: var(--kms-primary);
	border-color: var(--kms-primary);
	color: #fff;
}

.dl-button--mp3:hover,
.dl-button--mp3:focus {
	background: var(--kms-primary-dark);
	border-color: var(--kms-primary-dark);
	color: #fff;
}

.dl-button__label {
	font-weight: 800;
	letter-spacing: 0.06em;
}

.dl-button__size {
	font-size: 0.75rem;
	font-weight: 600;
	opacity: 0.75;
}

.track__download-note {
	max-width: 46ch;
	margin: 0;
	color: var(--kms-ink-soft);
	font-size: 0.9rem;
}

.track__downloads-count {
	margin: 0.6rem 0 0;
	color: var(--kms-ink-soft);
	font-size: 0.85rem;
}

.track__facts {
	display: flex;
	flex-wrap: wrap;
	gap: 2rem;
	margin: 2.5rem 0;
}

.track__fact-title {
	margin: 0 0 0.5rem;
	font-size: 0.82rem;
	font-weight: 800;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--kms-ink-soft);
}

.track__fact-body {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
}

.track__about,
.track__video,
.related {
	margin: 3rem 0;
}

.track__about .entry-content,
.track__video {
	max-width: 68ch;
}

.section-title + * {
	margin-top: 1.1rem;
}

.video-frame {
	position: relative;
	aspect-ratio: 16 / 9;
	border-radius: var(--kms-radius);
	overflow: hidden;
	box-shadow: var(--kms-shadow);
}

.video-frame iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* ------------------------------------------------------------------ *
 * 9. Licence box and credits
 * ------------------------------------------------------------------ */

.license-box,
.license-teaser {
	padding: 1.6rem 1.8rem;
	border: 2px solid var(--kms-border);
	border-radius: var(--kms-radius);
	background: var(--kms-surface);
	box-shadow: var(--kms-shadow);
}

.license-box__title,
.license-teaser__title {
	margin-top: 0;
	font-size: 1.25rem;
}

.license-box__subtitle {
	margin: 1.6rem 0 0.7rem;
	font-size: 1rem;
	font-weight: 800;
}

.license-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.license-list__item {
	position: relative;
	padding: 0.28rem 0 0.28rem 2.1rem;
	font-size: 0.98rem;
}

.license-list__item::before {
	position: absolute;
	left: 0;
	top: 0.45rem;
	width: 1.4rem;
	height: 1.4rem;
	border-radius: 999px;
	color: #fff;
	font-size: 0.85rem;
	font-weight: 800;
	line-height: 1.4rem;
	text-align: center;
}

.license-list__item--yes::before {
	content: "✓";
	background: var(--kms-ok);
}

.license-list__item--require::before {
	content: "!";
	background: var(--kms-warn);
}

.license-list__item--no::before {
	content: "×";
	background: var(--kms-no);
}

.license-box__more {
	margin: 1.4rem 0 0;
}

.credit-block {
	display: flex;
	flex-direction: column;
	gap: 0.8rem;
}

.credit-row {
	display: grid;
	grid-template-columns: 1fr auto;
	grid-template-areas:
		"label label"
		"text button";
	gap: 0.35rem 0.8rem;
	align-items: center;
	padding: 0.8rem 1rem;
	border-radius: var(--kms-radius-sm);
	background: var(--kms-bg-tint);
}

.credit-row__label {
	grid-area: label;
	color: var(--kms-ink-soft);
	font-size: 0.78rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.credit-row__text {
	grid-area: text;
	min-width: 0;
	overflow-wrap: anywhere;
	line-height: 1.5;
}

.copy-button {
	grid-area: button;
	padding: 0.4rem 1rem;
	border: 2px solid var(--kms-primary);
	border-radius: 999px;
	background: var(--kms-surface);
	color: var(--kms-primary-dark);
	font-family: inherit;
	font-size: 0.85rem;
	font-weight: 800;
	cursor: pointer;
	white-space: nowrap;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.copy-button:hover {
	background: var(--kms-primary);
	color: #fff;
}

.copy-button.is-copied {
	background: var(--kms-ok);
	border-color: var(--kms-ok);
	color: #fff;
}

.copy-button.is-error {
	background: var(--kms-warn);
	border-color: var(--kms-warn);
	color: #fff;
}

.credit-row--example .credit-row__text {
	grid-column: 1 / -1;
	opacity: 0.85;
}

.license-page .license-box {
	margin-bottom: 2.5rem;
}

.license-section {
	margin: 2.5rem 0;
}

.license-note {
	color: var(--kms-ink-soft);
	font-size: 0.9rem;
}

.license-updated {
	margin-top: 3rem;
	color: var(--kms-ink-soft);
	font-size: 0.82rem;
}

.faq__item {
	padding: 1rem 0;
	border-bottom: 1px solid var(--kms-border);
}

.faq__q {
	margin: 0 0 0.3rem;
	font-size: 1rem;
	font-weight: 800;
}

.faq__a {
	margin: 0;
	color: var(--kms-ink-soft);
}

/* ------------------------------------------------------------------ *
 * 10. Content, lists, pagination, footer
 * ------------------------------------------------------------------ */

.entry-content > *:first-child {
	margin-top: 0;
}

.entry-content img {
	border-radius: var(--kms-radius);
}

.entry-content blockquote {
	margin: 1.5em 0;
	padding: 0.6em 1.2em;
	border-left: 4px solid var(--kms-primary-soft);
	color: var(--kms-ink-soft);
}

.page-thumbnail {
	margin: 0 0 2rem;
}

.page-thumbnail img {
	border-radius: var(--kms-radius);
}

.entry-list__item {
	padding: 1.2rem 0;
	border-bottom: 1px solid var(--kms-border);
}

.entry-list__title {
	margin: 0 0 0.2rem;
	font-size: 1.15rem;
}

.entry-list__title a {
	color: var(--kms-ink);
	text-decoration: none;
}

.entry-list__excerpt {
	margin: 0;
	color: var(--kms-ink-soft);
	font-size: 0.95rem;
}

.empty-state {
	padding: 3rem 0;
	text-align: center;
	color: var(--kms-ink-soft);
}

.empty-state__big {
	font-size: 1.4rem;
	font-weight: 800;
	color: var(--kms-ink);
}

.empty-state__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.7rem;
}

.empty-state__search {
	max-width: 380px;
	margin: 2rem auto 0;
}

.search-form {
	display: flex;
	gap: 0.5rem;
}

.search-form label {
	flex: 1;
}

.search-form .search-field {
	width: 100%;
	padding: 0.6rem 1rem;
	border: 2px solid var(--kms-border);
	border-radius: 999px;
	background: var(--kms-surface);
	color: var(--kms-ink);
	font-family: inherit;
	font-size: 0.95rem;
}

.search-form .search-submit {
	padding: 0.6rem 1.4rem;
	border: 0;
	border-radius: 999px;
	background: var(--kms-primary);
	color: #fff;
	font-family: inherit;
	font-weight: 800;
	cursor: pointer;
}

.pagination {
	margin-top: 2.5rem;
}

.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.4rem;
}

.pagination .page-numbers {
	display: inline-block;
	min-width: 2.5rem;
	padding: 0.45rem 0.8rem;
	border: 2px solid var(--kms-border);
	border-radius: 999px;
	background: var(--kms-surface);
	color: var(--kms-ink);
	font-weight: 700;
	text-align: center;
	text-decoration: none;
}

.pagination .page-numbers:hover {
	border-color: var(--kms-primary);
	color: var(--kms-primary-dark);
}

.pagination .page-numbers.current {
	background: var(--kms-primary);
	border-color: var(--kms-primary);
	color: #fff;
}

.pagination .page-numbers.dots {
	border-color: transparent;
	background: transparent;
}

.site-footer {
	padding: 2.5rem 0 3rem;
	border-top: 1px solid var(--kms-border);
	background: var(--kms-bg-tint);
}

.site-footer__inner {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	align-items: center;
	text-align: center;
}

.site-footer__name {
	margin: 0;
	font-size: 1.1rem;
	font-weight: 800;
}

.site-footer__note {
	max-width: 52ch;
	margin: 0;
	color: var(--kms-ink-soft);
	font-size: 0.92rem;
}

.footer-nav a {
	color: var(--kms-ink-soft);
	font-size: 0.92rem;
	font-weight: 700;
	text-decoration: none;
}

.footer-nav a:hover {
	color: var(--kms-primary);
}

.site-footer__social {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 0.6rem;
	font-size: 0.92rem;
}

.site-footer__social-label {
	color: var(--kms-ink-soft);
}

.social-link {
	font-weight: 700;
	text-decoration: none;
}

.site-footer__copy {
	margin: 0;
	color: var(--kms-ink-soft);
	font-size: 0.82rem;
}

/* ------------------------------------------------------------------ *
 * 11. Narrow screens
 * ------------------------------------------------------------------ */

@media (max-width: 900px) {
	.track__top {
		grid-template-columns: minmax(0, 1fr);
		gap: 1.5rem;
	}

	.track__art {
		max-width: 380px;
	}
}

@media (max-width: 640px) {
	body {
		font-size: 16px;
	}

	.wrap,
	.wrap--narrow {
		width: min(100% - 1.6rem, var(--kms-max));
	}

	.site-header__inner {
		justify-content: center;
	}

	.track-grid {
		grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
		gap: 1.1rem;
	}

	.license-box,
	.license-teaser {
		padding: 1.2rem 1.1rem;
	}

	.credit-row {
		grid-template-columns: 1fr;
		grid-template-areas:
			"label"
			"text"
			"button";
		justify-items: start;
	}

	.dl-button {
		flex: 1 1 auto;
		min-width: 96px;
	}

	.track__facts {
		gap: 1.4rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
	}

	/* Do not snap the title to its end position — leave it still. */
	.track-card__title-inner {
		animation: none !important;
		transform: none !important;
	}
}
