.music-page [hidden] {
  display: none !important;
}

.music-page .nav-links a[aria-current] {
  background: var(--ink);
  color: white;
}

.music-content {
  width: min(1220px, calc(100% - 48px));
  margin: 32px auto 76px;
}

.library-hero {
  display: grid;
  align-items: center;
  min-height: 286px;
  padding: clamp(24px, 5vw, 66px);
  border-radius: 28px;
  color: #fff8eb;
  background: linear-gradient(90deg, #120f0bf2, #120f0b5c 62%, #120f0b0d),
    #24170c url("/music/art/workshop.webp") center 51% / cover no-repeat;
}

.library-hero .kicker {
  color: #efbd93;
  margin-bottom: 14px;
}

.library-hero h1, .song-intro h1, .shelf-heading h2, .song-reading h2, .record-caption h3 {
  font-family: 'Archivo', system-ui, sans-serif;
  line-height: 1.05;
  letter-spacing: -.045em;
}

.library-hero h1, .song-intro h1 {
  margin: 0;
  font-size: clamp(2.5rem, 6vw, 5.4rem);
}

.library-hero p:last-child {
  max-width: 30ch;
  margin: 15px 0 0;
  color: #e4dbcd;
}

.record-shelf {
  margin-top: 37px;
}

.shelf-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.shelf-heading h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.75rem);
}

.library-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.library-tools label {
  display: grid;
  gap: 4px;
  color: #5d554c;
  font-size: .74rem;
  font-weight: 600;
}

.library-tools input, .library-tools select {
  min-height: 42px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid #cdc4b7;
  border-radius: 9px;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}

.library-tools input {
  width: min(36vw, 260px);
}

.music-page :focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.song-count {
  margin: 12px 0 16px;
  color: var(--muted);
  font-size: .84rem;
}

.record-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.record-card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.record-card a {
  display: block;
  height: 100%;
  padding: 8px;
  border-radius: inherit;
  text-decoration: none;
}

.record-card a:hover h3 {
  color: var(--accent);
}

.record-art {
  display: grid;
  place-items: center;
  overflow: hidden;
  aspect-ratio: 1;
  border-radius: 10px;
  background: #2f241c;
  color: #f4d8b9;
}

.record-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.record-monogram {
  font-family: 'Archivo', system-ui, sans-serif;
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -.07em;
}

.record-caption {
  padding: 12px 8px 14px;
}

.record-label {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.record-caption h3 {
  margin: 0;
  font-size: clamp(1rem, 2vw, 1.3rem);
  overflow-wrap: anywhere;
}

.more-songs {
  display: flex;
  margin: 24px auto 0;
  cursor: pointer;
}

.empty-library {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
}

.music-back {
  display: inline-block;
  margin-bottom: 22px;
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.music-back:hover {
  text-decoration: underline;
}

.song-lead {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(0, 1.8fr);
  align-items: center;
  gap: clamp(22px, 5vw, 64px);
}

.song-art {
  border-radius: 20px;
}

.song-intro .kicker {
  margin-bottom: 10px;
}

.song-intro h1 {
  font-size: clamp(2rem, 5vw, 4.7rem);
  overflow-wrap: anywhere;
}

.song-credits {
  margin: 10px 0 0;
  font-weight: 600;
}

.song-collections {
  margin: 4px 0 0;
  color: var(--muted);
}

.song-sources {
  margin-top: 18px;
}

.song-preview {
  max-width: 360px;
  margin-top: 18px;
}

.song-preview p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: .8rem;
}

.song-preview audio {
  display: block;
  width: 100%;
}

.song-text {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 16px;
  margin-top: 30px;
}

.song-reading {
  padding: clamp(16px, 3vw, 26px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.song-reading h2 {
  margin: 0 0 10px;
  font-size: 1.4rem;
}

.song-reading p {
  margin: 0;
  color: var(--muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .record-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 540px) {
  .music-content {
    width: calc(100% - 30px);
    margin: 20px auto 42px;
  }

  .library-hero {
    min-height: 218px;
    border-radius: 20px;
    background-position: 60% center;
  }

  .library-hero p:last-child {
    max-width: 22ch;
  }

  .record-shelf {
    margin-top: 26px;
  }

  .library-tools {
    width: 100%;
    flex-wrap: nowrap;
  }

  .library-tools label:first-child {
    flex: 1;
    min-width: 0;
  }

  .library-tools input {
    width: 100%;
  }

  .record-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .record-caption {
    padding-inline: 3px;
  }

  .song-lead, .song-text {
    grid-template-columns: 1fr;
  }

  .song-art {
    width: min(100%, 290px);
  }
}
