@font-face {
  font-family: "Legend Serif";
  src: url(art/legend-serif.woff2) format("woff2");
  font-weight: 400 800;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --page: #101016;
  --panel: #15151e;
  --line: #454047;
  --subtle: #272630;
  --gold: #e5bd82;
  --text: #f7f0e6;
  --muted: #bcb3bc;
  --quiet: #9c939e;
  --serif: "Legend Serif", "Songti SC", "Microsoft YaHei", serif;
  --sans: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--page); color: var(--text); font: 15px/1.6 var(--sans); }
[hidden] { display: none !important; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; color: inherit; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid #f3cf99; outline-offset: 4px; }
nav { display: flex; gap: clamp(16px, 3vw, 35px); align-items: center; font-size: 13px; color: var(--muted); }
nav a:hover, .download:hover, .programme-actions a:hover { color: var(--text); }

.topbar, .foot {
  max-width: 1360px;
  padding-inline: clamp(20px, 5vw, 76px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
}
.topbar { border-bottom: 1px solid var(--subtle); }
.brand {
  font: 700 15px/1 Georgia, serif;
  letter-spacing: .16em;
  color: #f1dfc8;
  white-space: nowrap;
}
.brand span { color: var(--gold); }
.playtest-link { border: 1px solid var(--line); border-radius: 5px; padding: 7px 14px; color: var(--gold); }
.playtest-link span, .download span, .programme-actions span { margin-left: 5px; }

.content { max-width: 1050px; margin: 0 auto; padding: 39px clamp(20px, 4vw, 44px) 65px; }
.intro { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
h1, h2, h3, p { margin: 0; }
h1 { font: 600 clamp(29px, 4.2vw, 50px)/1.18 var(--serif); letter-spacing: .014em; }
#collection-meta { color: var(--muted); margin-top: 8px; font-size: 13px; font-variant-numeric: tabular-nums; }
.download, .programme-actions a { color: var(--gold); font-size: 13px; }
.download { margin-bottom: 4px; }

.player { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.player-head {
  min-height: clamp(238px, 32vw, 330px);
  position: relative;
  isolation: isolate;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: clamp(22px, 4vw, 38px);
  gap: 15px;
  overflow: hidden;
}
.player-head::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(0deg, #15151ef5 0%, #15151e7a 54%, #15151e14 100%),
    linear-gradient(90deg, #181521a9 1%, transparent 72%);
}
.player-head img { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 57%; }
.track-pace { color: #ebcfaa; font-size: 12px; letter-spacing: .14em; margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.track-title h2 { font: 600 clamp(27px, 4.4vw, 50px)/1.16 var(--serif); text-shadow: 0 3px 18px #0b0915; }
.track-title p { margin-top: 9px; color: #e2d6d9; font-size: clamp(12px, 1.6vw, 14px); }
.main-control {
  flex: none;
  display: grid;
  place-content: center;
  width: clamp(58px, 7vw, 71px);
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  color: #261d19;
  background: #f1c98e;
  box-shadow: 0 4px 22px #100e18a8;
}
.main-control:hover { background: #ffdcaa; }
.play-mark { display: block; width: 0; height: 0; margin-left: 5px; border-block: 10px solid transparent; border-left: 16px solid currentColor; }
[data-playing="true"] .play-mark { width: 16px; height: 19px; margin: 0; border-block: 0; border-inline: 5px solid currentColor; }

.player-console { padding: 7px clamp(17px, 4vw, 38px) 25px; }
.transport-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); }
.current-chapter { color: var(--gold); letter-spacing: .04em; }
.timecode { white-space: nowrap; font-variant-numeric: tabular-nums; }
.wave { position: relative; height: clamp(46px, 6vw, 63px); margin-top: 5px; }
.wave-bars { display: flex; align-items: center; gap: 2px; height: 100%; overflow: hidden; }
.wave-bars i { display: block; flex: 1 0 0; height: var(--amp); min-height: 3px; background: #57515e; border-radius: 3px; }
.wave-bars i.played { background: var(--gold); }
.seek { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; touch-action: pan-y; }
.wave:focus-within { outline: 2px solid #f3cf99; outline-offset: 5px; }
.audio-controls { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 8px 0 19px; }
.text-controls { display: flex; gap: 8px; align-items: center; }
.text-controls button, .layers button {
  border: 1px solid var(--line);
  padding: 4px 10px;
  background: transparent;
  color: var(--muted);
  border-radius: 4px;
  font-size: 12px;
  min-height: 34px;
}
.text-controls button:hover, .layers button:hover { border-color: var(--gold); color: var(--text); }
.text-controls [aria-pressed="true"], .layers [aria-pressed="true"] { background: #e7bd861c; color: var(--gold); border-color: #96764c; }
.volume { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.volume input { width: clamp(55px, 13vw, 104px); accent-color: var(--gold); cursor: pointer; }
.chapters { display: grid; grid-template-columns: repeat(var(--count), minmax(0, 1fr)); gap: 8px; }
.chapter {
  display: grid;
  align-content: start;
  gap: 4px;
  min-height: 90px;
  padding: 12px;
  text-align: left;
  background: #191921;
  border: 1px solid #35323d;
  border-radius: 5px;
}
.chapter:hover { background: #222029; border-color: #9b7c57; }
.chapter[aria-current="true"] { border-color: #b58e60; background: #2a2329; }
.chapter .seconds { color: var(--gold); font-size: 12px; font-variant-numeric: tabular-nums; }
.chapter .label { font-weight: 610; line-height: 1.4; }
.chapter small { color: var(--muted); font-size: 12px; line-height: 1.5; }
.layers { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 17px; color: var(--muted); font-size: 12px; }
.layers > span { margin-right: 5px; color: var(--quiet); }
.status { color: #ffc98c; margin-top: 10px; font-size: 13px; }

.tracklist, .programme { margin-top: 37px; }
.section-top { display: flex; justify-content: space-between; align-items: baseline; gap: 15px; padding: 0 12px 9px; }
.section-top h2, .programme h2 { font: 600 25px/1.35 var(--serif); }
.section-top span { color: var(--quiet); font-size: 12px; }
.tracklist ul { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--subtle); }
.track-row {
  width: 100%;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  text-align: left;
  padding: 9px 12px;
  min-height: 57px;
  border: 0;
  border-bottom: 1px solid var(--subtle);
  background: transparent;
}
.track-row:hover { background: #1d1b24; }
.track-row[aria-current="true"] { background: #211d25; }
.track-row[aria-current="true"] .song-name { color: var(--gold); }
.track-row img { width: 40px; height: 38px; border-radius: 4px; object-fit: cover; }
.song-name, .song-meta { display: block; }
.song-name { font-weight: 620; font-size: 14px; }
.song-meta, .duration { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

.programme-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; margin: 14px 0 21px; }
.programme article { min-width: 0; border: 1px solid var(--subtle); border-radius: 6px; padding: 16px; }
.programme h3 { font: 600 17px/1.4 var(--serif); margin-bottom: 6px; }
.programme p { font-size: 13px; color: var(--muted); }
.programme-actions { display: flex; flex-wrap: wrap; gap: 15px 28px; }
.foot { border-top: 1px solid var(--subtle); color: var(--quiet); font-size: 12px; }

@media (max-width: 680px) {
  .brand { font-size: 12px; letter-spacing: .12em; }
  .topbar { min-height: 61px; }
  nav { gap: 12px; font-size: 12px; }
  .playtest-link { padding: 7px 9px; }
  .content { padding-top: 28px; }
  .intro { display: grid; gap: 8px; }
  .player-head { min-height: 227px; }
  .chapters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chapter:only-child { grid-column: 1/-1; }
  .wave-bars { gap: 1px; }
  .wave-bars i:nth-child(even) { display: none; }
  .programme-grid { grid-template-columns: 1fr; gap: 8px; }
}
@media (max-width: 370px) {
  nav a:first-child { display: none; }
  .chapter { padding: 9px; }
  .text-controls { gap: 5px; }
  .text-controls button { padding-inline: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
