:root {
  color-scheme: light;
  --ground: #eeeae3;
  --paper: #f8f5ef;
  --ink: #292522;
  --soft-ink: #665b56;
  --rule: #d7cdc1;
  --rose: #7c303e;
  --rose-dark: #601d2a;
  --rose-wash: #f0e2df;
  --serif: Georgia, 'Times New Roman', serif;
  --reading-size: clamp(1.04rem, 1.58vw, 1.34rem);
  --progress: 0%;
}

* {
  box-sizing: border-box;
}

body {
  width: min(100% - 6.5rem, 75rem);
  margin: 0 auto;
  padding-bottom: 2.5rem;
  background: var(--ground);
  color: var(--ink);
  font-family: system-ui, sans-serif;
}

button, input {
  color: inherit;
  font: inherit;
}

button:enabled, input:enabled {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--rose);
  outline-offset: 3px;
}

.masthead {
  min-height: 5.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--soft-ink);
  font-size: .75rem;
  font-weight: 650;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.masthead-title {
  display: flex;
  align-items: center;
  gap: .7rem;
  color: var(--ink);
}

.record {
  width: 1.35rem;
  height: 1.35rem;
  border: 1px solid var(--rose);
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.record::before {
  width: .66rem;
  height: .66rem;
  border: 1px solid var(--rose);
  border-radius: inherit;
  background: radial-gradient(circle, var(--rose) 1px, transparent 1.5px);
  content: '';
}

.spread {
  display: grid;
  grid-template-areas: "cover lyrics" "player player";
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  border: 1px solid var(--rule);
  background: var(--paper);
}

.cover {
  grid-area: cover;
  position: relative;
  display: grid;
  min-height: 34rem;
  overflow: hidden;
  isolation: isolate;
  background: #201a23;
  color: #ffeedc;
}

.art, .cover::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.art {
  background: radial-gradient(ellipse at 64% 52%, #482530 0%, #2b202b 47%, transparent 75%);
}

.cover::after {
  background: linear-gradient(180deg, #201a2370, transparent 35%, transparent 68%, #201a23e8);
  content: '';
}

.orbit, .disc, .portal {
  position: absolute;
  top: 51%;
  left: 58%;
  translate: -50% -50%;
}

.orbit {
  width: 97%;
  height: 24%;
  border: 1px solid #b16e7f8a;
  border-radius: 50%;
}

.orbit-outer {
  transform: rotate(-32deg);
}

.orbit-inner {
  top: 54%;
  width: 85%;
  height: 27%;
  border-color: #a2738673;
  transform: rotate(27deg);
}

.disc {
  width: min(60%, 24rem);
  aspect-ratio: 1;
  border: 1px solid #b1798b95;
  border-radius: 50%;
  background: #2d222f;
}

.grooves, .disc-label {
  position: absolute;
  border-radius: 50%;
}

.grooves {
  inset: 0;
  background:
    repeating-radial-gradient(circle closest-side, transparent 0 5.5%, #e2a7aa50 5.8%, transparent 6.15% 8.3%),
    conic-gradient(from -45deg, #221c26, #835263, #302331 29%, #251e2a 55%, #533348 68%, #221c26 89%);
}

.disc-label {
  inset: 36%;
  border: 1px solid #c58b9a8a;
  background: #392834;
}

.portal {
  z-index: 1;
  width: 18%;
  min-width: 3.5rem;
  max-width: 7.4rem;
  aspect-ratio: .62;
  perspective: 19rem;
}

.doorframe, .door {
  position: absolute;
  inset: 0;
  border: 1px solid #e79f9b;
}

.doorframe {
  background: linear-gradient(145deg, #d7837c22, #2b151ccc 68%), #532b38;
  box-shadow: 0 0 2.6rem #d1626647;
}

.door {
  transform-origin: left center;
  transform: rotateY(28deg);
  background: linear-gradient(157deg, #d67476, #a74757 48%, #6d2e46);
  box-shadow: .4rem .55rem 1.4rem #22121e69;
}

.door::after {
  position: absolute;
  inset: 7%;
  border: 1px solid #ffc3b76b;
  content: '';
}

.horizon {
  position: absolute;
  top: 77%;
  left: 19%;
  width: 81%;
  height: 1px;
  background: linear-gradient(90deg, transparent, #c6828b9e 54%, transparent);
  transform-origin: center;
}

.cover-ink {
  z-index: 2;
  display: grid;
  align-content: space-between;
  padding: clamp(1.8rem, 3.4vw, 3.35rem);
}

h1 {
  margin: 0;
  font: normal clamp(3.3rem, 7.2vw, 7.15rem)/.99 var(--serif);
  letter-spacing: -.078em;
}

.cover-line {
  margin: 0;
  max-width: 22ch;
  min-height: 2.36em;
  font: italic clamp(1.42rem, 2.38vw, 2.12rem)/1.16 var(--serif);
  text-wrap: pretty;
}

.cover-line .word {
  display: inline-block;
}

.cover-line::before {
  display: block;
  width: 1.8rem;
  height: 2px;
  margin-bottom: .8rem;
  background: #d57c82;
  content: '';
}

.lyrics {
  grid-area: lyrics;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.4rem clamp(1.6rem, 3vw, 3.15rem);
}

.lyrics-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .45rem 1rem;
  padding-bottom: 1.05rem;
  border-bottom: 1px solid var(--rule);
}

.lyrics-heading h2, .lyrics-heading p {
  margin: 0;
}

.lyrics-heading h2 {
  font: normal 2rem/1.05 var(--serif);
  letter-spacing: -.045em;
}

.lyrics-heading p {
  color: var(--soft-ink);
  font-size: .79rem;
}

.lyric-list {
  list-style: none;
  padding: 0;
  margin: .95rem 0 0;
}

.lyric-list li:first-child {
  margin-bottom: .7rem;
}

.lyric-list button {
  width: 100%;
  min-height: 2.65rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: .7rem;
  padding: .55rem .7rem .53rem .78rem;
  text-align: left;
  border: 0;
  border-inline-start: 2px solid transparent;
  background: transparent;
  font: normal var(--reading-size)/1.21 var(--serif);
  letter-spacing: -.025em;
  transition: background-color 150ms, color 150ms, border-color 150ms;
}

.lyric-list button:enabled:hover:not([aria-current="true"]) {
  background: #eee8de;
}

.lyric-list button:enabled:active,
.lyric-list button[aria-current="true"] {
  border-inline-start-color: var(--rose);
  background: var(--rose-wash);
  color: var(--rose-dark);
}

.lyric-list time {
  color: var(--soft-ink);
  font: 500 .75rem/1.3 system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.lyric-list button[aria-current="true"] time {
  color: inherit;
}

.player {
  grid-area: player;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(.7rem, 2.3vw, 1.8rem);
  padding: 1.05rem clamp(.9rem, 2.6vw, 2.1rem);
  border-top: 1px solid var(--rule);
  background: var(--paper);
}

.play, .utility {
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
}

.play {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: var(--rose);
  color: #fff8ee;
}

.play:enabled:hover {
  background: var(--rose-dark);
}

.play:enabled:active, .utility:enabled:active {
  transform: scale(.94);
}

.play-icon {
  width: 0;
  height: 0;
  margin-left: .18em;
  border-block: .52rem solid transparent;
  border-left: .8rem solid currentColor;
}

.play[data-playing="true"] .play-icon {
  width: .79rem;
  height: .92rem;
  margin-left: 0;
  border: 0;
  border-inline: .25rem solid currentColor;
}

.timeline {
  min-width: 0;
}

.timeline-top {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  color: var(--soft-ink);
  font-size: .75rem;
  font-weight: 600;
}

.timecodes {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.time-divider {
  margin-inline: .37em;
}

.scrubber {
  position: relative;
  height: 2.1rem;
}

.waveform, .wave-bars, #seek {
  position: absolute;
  inset: 0;
}

.waveform {
  top: .3rem;
  pointer-events: none;
  container-type: inline-size;
}

.wave-bars {
  display: flex;
  align-items: center;
  gap: clamp(.6px, .37cqw, 4px);
  color: #968479;
}

.wave-bars i {
  flex: 1;
  height: var(--level);
  border-radius: 8px;
  background: currentColor;
}

.wave-fill {
  clip-path: inset(0 calc(100% - var(--progress)) 0 0);
  color: var(--rose);
}

#seek {
  appearance: none;
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

#seek::-webkit-slider-runnable-track {
  background: transparent;
}

#seek::-moz-range-track {
  background: transparent;
}

#seek::-webkit-slider-thumb {
  appearance: none;
  width: .48rem;
  height: .48rem;
  border: 0;
  border-radius: 50%;
  background: transparent;
}

#seek::-moz-range-thumb {
  width: .48rem;
  height: .48rem;
  border: 0;
  border-radius: 50%;
  background: transparent;
}

#seek:is(:hover, :focus-visible)::-webkit-slider-thumb {
  background: var(--rose);
}

#seek:is(:hover, :focus-visible)::-moz-range-thumb {
  background: var(--rose);
}

.player-actions {
  display: flex;
  gap: .2rem;
}

.utility {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  color: var(--soft-ink);
}

.utility:enabled:hover {
  background: var(--rose-wash);
  color: var(--rose-dark);
}

.player button:disabled, #seek:disabled {
  opacity: .6;
}

.sound-off, #mute[data-muted="true"] .sound-on {
  display: none;
}

#mute[data-muted="true"] .sound-off {
  display: inline;
}

.player-error {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--rose-dark);
  font-size: .88rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 60rem) {
  body {
    width: calc(100% - 3rem);
  }

  .cover {
    min-height: 33rem;
  }
}

@media (max-width: 46rem) {
  body {
    width: calc(100% - 1.5rem);
    padding-bottom: 1rem;
  }

  .masthead {
    min-height: 3.75rem;
  }

  .spread {
    grid-template-areas: "cover" "player" "lyrics";
    grid-template-columns: minmax(0, 1fr);
  }

  .cover {
    min-height: clamp(22rem, 110vw, 35rem);
    container-type: inline-size;
  }

  .cover-ink {
    padding: 1.55rem;
  }

  h1 {
    font-size: clamp(2.65rem, 14cqw, 6.2rem);
  }

  .cover-line {
    font-size: clamp(1.25rem, 5.6cqw, 1.8rem);
  }

  .lyrics {
    padding: 1.6rem .85rem 1.35rem;
    border-top: 1px solid var(--rule);
  }

  .lyrics-heading {
    margin-inline: .55rem;
  }

  .lyric-list button {
    min-height: 2.8rem;
    font-size: clamp(1rem, 4.5vw, 1.35rem);
  }

  .player {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: .72rem .65rem;
  }

  .play {
    width: 2.85rem;
    height: 2.85rem;
  }

  .player-actions {
    gap: 0;
  }
}

@media (max-width: 25rem) {
  .wave-bars i:nth-child(even) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lyric-list button {
    transition: none;
  }
}
