/* Song pages (brandonparrell.com/<song>/) and the list of every song (/music/).
   Both are written by tools/build-song-pages.mjs. Type, buttons, chips and the sign-up box come from the site's own
   style.css; this file adds the layout. */

.sp-top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: var(--max); margin: 0 auto; padding: 22px var(--pad);
}
.sp-brand { display: inline-flex; align-items: center; gap: 12px; font-family: var(--serif); font-size: 1.12rem; }
.sp-brand img { border-radius: 50%; box-shadow: 0 0 0 1px rgba(var(--red-rgb), .45), 0 0 18px rgba(var(--red-rgb), .3); }
.sp-back { font-size: .68rem; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--text-2); transition: color .3s; }
@media (hover: hover) { .sp-back:hover { color: var(--text); } }

/* ---------- one song: cover on the left, everything about it on the right (stacked on phones) ---------- */
.sp {
  position: relative; z-index: 0;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: center; gap: clamp(28px, 6vw, 100px);
  max-width: var(--max); margin: 0 auto; padding: clamp(14px, 3.4vw, 56px) var(--pad) clamp(56px, 7vw, 104px);
}
.sp::before {
  content: ""; position: absolute; left: 24%; top: 46%; z-index: -1; width: min(110vw, 980px); aspect-ratio: 1;
  transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(var(--red-rgb), .17), rgba(var(--red-rgb), .04) 58%, transparent 74%);
}
.sp__art { position: relative; justify-self: end; width: min(100%, 560px); aspect-ratio: 1; }
.sp__cover {
  width: 100%; height: 100%; object-fit: cover; border-radius: 14px; background: var(--bg-3);
  box-shadow: 0 40px 90px -30px #000, 0 0 0 1px var(--line), 0 0 90px -30px rgba(var(--red-rgb), .6);
}
/* "Watch the visualizer": a round button on the cover's corner */
.sp__watch {
  position: absolute; right: 14px; bottom: 14px;
  display: inline-flex; align-items: center; gap: 9px; height: 42px; padding: 0 18px 0 14px; border-radius: 999px;
  background: rgba(8, 8, 10, .82); border: 1px solid var(--line-2);
  font-size: .64rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  transition: border-color .3s, background-color .3s;
}
.sp__watch svg { width: 14px; height: 14px; color: var(--red); }
@media (hover: hover) { .sp__watch:hover { border-color: var(--red); background: rgba(8, 8, 10, .95); } }

.sp__info { display: grid; justify-items: start; gap: 18px; min-width: 0; }
.sp__title {
  font-family: var(--serif); font-weight: 400; font-size: clamp(3rem, 7.2vw, 7rem); line-height: .94; letter-spacing: -.025em;
  overflow-wrap: anywhere;
}
.sp__title small { font-size: max(.36em, .9rem); letter-spacing: 0; color: var(--text-2); white-space: nowrap; }
.sp__by { margin-top: -4px; }

/* the 30-second preview */
.sp__preview {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px;
  width: min(100%, 460px); margin-top: 6px; padding: 9px 20px 9px 9px;
  border: 1px solid var(--line-2); border-radius: 999px; background: rgba(236, 231, 223, .025);
}
.sp__toggle {
  position: relative; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
  background: var(--red); color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16), 0 8px 26px -8px rgba(var(--red-rgb), .95);
  transition: scale .25s var(--ease), background-color .3s;
}
@media (hover: hover) { .sp__toggle:hover { background: #ff3b4b; } }
.sp__toggle:active { scale: .92; }
.sp__toggle svg { grid-area: 1 / 1; width: 20px; height: 20px; transition: opacity .2s; }
.sp__toggle .i-pause { opacity: 0; }
.sp.is-playing .sp__toggle .i-play { opacity: 0; }
.sp.is-playing .sp__toggle .i-pause { opacity: 1; }
.sp__track { display: grid; gap: 7px; min-width: 0; text-align: left; }
.sp__say { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .64rem; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--text-2); }
.sp.is-ended .sp__say { color: var(--red); }
.sp__bar { position: relative; height: 3px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.sp__bar b { position: absolute; inset: 0; border-radius: 3px; background: var(--red); transform: scaleX(var(--p, 0)); transform-origin: 0 50%; }
.sp__time { font-size: .72rem; color: var(--text-3); font-variant-numeric: tabular-nums; }

.sp__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
/* the preview just ended: the way to the full song gets a glow */
.sp.is-ended .sp__actions .btn--red { animation: sp-pulse 1.5s var(--ease) 3; }
@keyframes sp-pulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(var(--red-rgb), .6), 0 12px 36px -12px rgba(var(--red-rgb), .8); }
  50% { box-shadow: 0 0 0 5px rgba(var(--red-rgb), .35), 0 12px 46px -6px rgba(var(--red-rgb), 1); }
}
.sp .release__extras { margin-top: 0; }
.sp__also { margin-top: 2px; }
.sp__note { max-width: 46ch; font-size: .95rem; color: var(--text-2); }

@media (max-width: 860px) {
  .sp { grid-template-columns: minmax(0, 1fr); gap: 30px; padding-top: 6px; }
  .sp::before { left: 50%; top: 22%; }
  .sp__art { justify-self: center; width: min(100%, 440px); }
  .sp__info { justify-items: center; text-align: center; }
  .sp__actions, .sp .release__extras, .sp__also { justify-content: center; }
  .sp__title { font-size: clamp(2.9rem, 14vw, 5.4rem); }
}
@media (max-width: 520px) {
  .sp__actions { align-self: stretch; width: 100%; }
  .sp__actions .btn { flex: 1 1 auto; }
  .sp-back span { display: none; }
}

/* ---------- more songs (on a song page) and every song (/music/) ---------- */
.sp-more { max-width: var(--max); margin: 0 auto; padding: clamp(48px, 6vw, 96px) var(--pad) clamp(56px, 7vw, 110px); }
.sp-more__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px 24px; margin-bottom: clamp(22px, 3vw, 36px); }
.sp-more__title { font-family: var(--serif); font-weight: 400; font-size: clamp(1.9rem, 3.4vw, 3rem); line-height: 1.02; letter-spacing: -.02em; }
.sp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(46%, 168px), 1fr)); gap: clamp(20px, 2.6vw, 34px) clamp(14px, 2vw, 26px); }
.sp-card { display: grid; gap: 11px; align-content: start; }
.sp-card__art { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--bg-3); box-shadow: 0 0 0 1px var(--line); }
.sp-card__art img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
@media (hover: hover) { .sp-card:hover .sp-card__art img { transform: scale(1.05); } }
.sp-card__title { font-family: var(--serif); font-size: 1.22rem; line-height: 1.12; transition: color .3s; }
@media (hover: hover) { .sp-card:hover .sp-card__title { color: #fff; text-shadow: var(--glow); } }
.sp-card__meta { margin-top: -6px; font-size: .64rem; letter-spacing: .18em; text-transform: uppercase; color: var(--text-3); }
.sp-card__meta.is-new { color: var(--red); }

/* the list of every song: a heading above the grid */
.sp-index { max-width: var(--max); margin: 0 auto; padding: clamp(28px, 5vw, 80px) var(--pad) 0; }
.sp-index__title { font-family: var(--serif); font-weight: 400; font-size: clamp(3rem, 8vw, 7rem); line-height: .94; letter-spacing: -.025em; }
.sp-index__note { max-width: 52ch; margin-top: 18px; color: var(--text-2); }
.sp-index + .sp-more { padding-top: clamp(30px, 4vw, 56px); }

.sp-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 28px;
  max-width: var(--max); margin: clamp(56px, 7vw, 110px) auto 0; padding: 24px var(--pad) 30px; border-top: 1px solid var(--line);
  font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; color: var(--text-3);
}
.sp-foot nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.sp-foot a { transition: color .3s; }
@media (hover: hover) { .sp-foot a:hover { color: var(--text); } }
@media (max-width: 520px) { .sp-foot { justify-content: center; text-align: center; } .sp-foot nav { justify-content: center; } .sp-foot a { padding: 8px 0; } }
