/* Listen Together (/music/listen/): the full-screen 16:9 player. See js/listen.js.
   The stage is a 16:9 box, as big as the window allows (letterboxed on Ink). Type is sized in
   container units (cqmin), so the same slide reads the same on a laptop, a TV or a projector.
   On a phone held upright, the stage fills the screen instead. */
.is-stage .f39p { display: none; }               /* this page is the player */
.st-body { margin: 0; background: #0B0A09; color: var(--scroll); overflow: hidden; }
.st-page { position: fixed; inset: 0; display: grid; place-items: center; background: #0B0A09; }
.st-stage {
  position: relative; overflow: hidden; container-type: size;
  width: min(100vw, calc(100dvh * 16 / 9)); aspect-ratio: 16 / 9;
  background: var(--ink);
}
@media (max-aspect-ratio: 1 / 1) { .st-stage { width: 100vw; height: 100dvh; aspect-ratio: auto; } }

/* Background: the Scene (an ambient loop) or the Glow (a canvas of the song's colors, scaled up so
   the browser's smoothing blurs it; the extra blur and scale hide the edges) */
.st-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.st-bg[hidden], .st-btn[hidden], .st-glow[hidden], .st-flow[hidden], .st-slide[hidden] { display: none; }
.st-glow { position: absolute; inset: 0; width: 100%; height: 100%; filter: blur(3cqmin) saturate(1.15); transform: scale(1.12); }
.st-scrim {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(11, 10, 9, .82) 0%, rgba(11, 10, 9, .55) 46%, rgba(11, 10, 9, .18) 100%),
    linear-gradient(0deg, rgba(11, 10, 9, .85) 0%, rgba(11, 10, 9, 0) 34%),
    linear-gradient(180deg, rgba(11, 10, 9, .6) 0%, rgba(11, 10, 9, 0) 22%);
}
.is-glow .st-scrim { background: linear-gradient(0deg, rgba(11, 10, 9, .55) 0%, rgba(11, 10, 9, 0) 30%), rgba(11, 10, 9, .22); }
.is-flow:not(.is-glow) .st-scrim { background: linear-gradient(90deg, rgba(11, 10, 9, .8) 0%, rgba(11, 10, 9, .5) 60%, rgba(11, 10, 9, .3) 100%), linear-gradient(0deg, rgba(11, 10, 9, .8) 0%, rgba(11, 10, 9, 0) 34%); }
.no-lyrics .st-scrim { background: linear-gradient(0deg, rgba(11, 10, 9, .8) 0%, rgba(11, 10, 9, 0) 34%), linear-gradient(180deg, rgba(11, 10, 9, .55) 0%, rgba(11, 10, 9, 0) 22%); }

/* Top: back to Music, the song, the logo */
.st-top { position: absolute; inset: 0 0 auto; z-index: 3; display: flex; align-items: center; gap: var(--s-4); padding: max(1rem, 3cqmin) max(1rem, 4.5cqmin) 0; transition: opacity .5s; }
.st-exit { display: inline-flex; align-items: center; gap: .35rem; min-height: 44px; padding: 0 .9rem 0 .6rem; border-radius: var(--radius-pill); background: rgba(11, 10, 9, .55); color: var(--scroll); text-decoration: none; font: 600 .85rem var(--font-display); letter-spacing: .08em; text-transform: uppercase; }
.st-exit:hover { background: rgba(11, 10, 9, .8); }
.st-now { min-width: 0; flex: 1; }
.st-kicker { margin: 0; font: 600 .72rem var(--font-display); letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
.st-h1 { margin: 0; font: 700 1rem/1.2 var(--font-display); color: var(--scroll); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-logo { width: max(56px, 7cqmin); height: auto; opacity: .9; }

/* The slide: title card or one lyrics section */
.st-slide { position: absolute; z-index: 2; left: max(1.25rem, 7cqmin); right: max(1.25rem, 7cqmin); top: max(5rem, 14cqmin); bottom: max(9rem, 21cqmin); display: flex; align-items: center; }
.st-slide.is-in .st-card { animation: st-in .7s var(--ease) both; }
@keyframes st-in { from { opacity: 0; transform: translateY(1.6cqmin); } to { opacity: 1; transform: none; } }
.st-card { max-width: 62cqw; text-shadow: 0 2px 18px rgba(0, 0, 0, .55); }
.st-eyebrow { display: flex; align-items: center; gap: .8em; margin: 0 0 2.2cqmin; font: 600 max(.8rem, 1.9cqmin) var(--font-display); letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }
.st-eyebrow::before { content: ""; width: 2.4em; height: 3px; background: var(--gold); }
.st-title { margin: 0; font: 900 max(2.4rem, 11cqmin)/.88 var(--font-display); letter-spacing: -.035em; text-transform: uppercase; color: #fff; }
.st-passage { margin: 2.4cqmin 0 0; font: 600 max(1rem, 2.8cqmin) var(--font-display); letter-spacing: .06em; color: var(--scroll); }
.st-hook { margin: 4cqmin 0 0; padding-left: 2.4cqmin; border-left: 3px solid var(--gold); max-width: 52cqw; }
.st-hook p { margin: 0; font: italic 400 max(1.1rem, 3.4cqmin)/1.3 var(--font-scripture); color: #fff; }
.st-hook cite { display: block; margin-top: 1.2cqmin; font: 600 max(.8rem, 1.8cqmin) var(--font-display); font-style: normal; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.st-hint { margin: 4cqmin 0 0; font: 500 max(.8rem, 1.7cqmin) var(--font-body); color: var(--muted-on-dark); }
.st-hint kbd, .st-keys kbd { display: inline-block; min-width: 1.6em; padding: .05em .4em; border: 1px solid rgba(247, 243, 236, .35); border-radius: 4px; font: 600 .9em var(--font-body); text-align: center; color: var(--scroll); }
.st-card--lyrics { max-width: 78cqw; }
.st-label { margin: 0 0 2cqmin; font: 700 max(.8rem, 1.9cqmin) var(--font-display); letter-spacing: .26em; text-transform: uppercase; color: var(--gold); }
.st-lines span { display: block; padding-left: 1.1em; text-indent: -1.1em; }   /* a wrapped line hangs, so each line still reads as one */
/* Following the song: the line being sung is bright, the rest step back */
.st-lines span { transition: opacity .35s, color .35s; }
.is-following .st-lines span { opacity: .45; }
.is-following .st-lines span.is-past { opacity: .6; }
.is-following .st-lines span.is-now { opacity: 1; color: #fff; }
.st-lines { margin: 0; font: 700 max(1.15rem, calc(var(--fs) * 1cqmin))/1.32 var(--font-display); letter-spacing: -.005em; color: #fff; text-wrap: balance; }

/* The flow: every line in one column, the sung line about a third of the way down (Apple Music style).
   data-d is a line's distance from the sung one: 0 now, 1–4 coming, p1–p3 gone by. */
.st-flow { position: absolute; z-index: 2; left: max(1.25rem, 7cqmin); right: max(1.25rem, 7cqmin); top: max(4.5rem, 11cqmin); bottom: max(8.5rem, 19cqmin); overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 14%, #000 78%, transparent 100%); mask-image: linear-gradient(180deg, transparent 0, #000 14%, #000 78%, transparent 100%); }
.st-flow-list { list-style: none; margin: 0; padding: 0 0 60cqh; transition: transform .9s cubic-bezier(.22, .8, .24, 1); will-change: transform; }
.st-fl { max-width: 80cqw; margin: 0 0 2.6cqmin; cursor: pointer; transform-origin: 0 50%;
  font: 800 max(1.55rem, 5.6cqmin)/1.14 var(--font-display); letter-spacing: -.012em; color: #fff; text-wrap: balance;
  opacity: .3; filter: blur(.12cqmin); transform: scale(.97); transition: opacity .7s, filter .7s, transform .9s cubic-bezier(.22, .8, .24, 1); }
.st-fl--first { margin-top: 6cqmin; }
.st-fl:first-child { margin-top: 0; }
.st-fl-label { display: block; margin-bottom: 1.1cqmin; font: 700 max(.7rem, 1.6cqmin) var(--font-display); letter-spacing: .26em; text-transform: uppercase; color: var(--gold); opacity: .9; }
.st-fl[data-d="0"] { opacity: 1; filter: none; transform: none; text-shadow: 0 2px 24px rgba(0, 0, 0, .35); }
.st-fl[data-d="1"] { opacity: .5; filter: none; }
.st-fl[data-d="2"] { opacity: .4; filter: blur(.08cqmin); }
.st-fl[data-d="3"] { opacity: .3; filter: blur(.16cqmin); }
.st-fl[data-d="4"] { opacity: .22; filter: blur(.24cqmin); }
.st-fl[data-d="p1"] { opacity: .38; }
.st-fl[data-d="p2"] { opacity: .24; filter: blur(.14cqmin); }
.st-fl[data-d="p3"] { opacity: .14; filter: blur(.24cqmin); }
.st-fl:hover { opacity: .85; filter: none; }
/* A long instrumental gap: three dots that breathe while it's "sung" */
.st-fl--rest { display: flex; gap: 1.4cqmin; height: max(1.55rem, 5.6cqmin); align-items: center; cursor: default; }
.st-fl--rest span { width: 1.5cqmin; height: 1.5cqmin; min-width: 8px; min-height: 8px; border-radius: 50%; background: #fff; }
.st-fl--rest[data-d="0"] span { animation: st-breathe 2.4s ease-in-out infinite; }
.st-fl--rest[data-d="0"] span:nth-child(2) { animation-delay: .3s; }
.st-fl--rest[data-d="0"] span:nth-child(3) { animation-delay: .6s; }
@keyframes st-breathe { 0%, 100% { opacity: .35; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.15); } }
.st-fl--rest:not([data-d="0"]) { opacity: 0; }

/* Scene or Glow */
.st-seg { display: inline-flex; padding: 3px; border: 1px solid var(--line-on-dark); border-radius: 9px; }
.st-seg button { all: unset; box-sizing: border-box; cursor: pointer; min-height: 38px; padding: 0 .7rem; border-radius: 6px; font: 700 .74rem var(--font-display); letter-spacing: .1em; text-transform: uppercase; color: var(--muted-on-dark); }
.st-seg button:hover:not(:disabled) { color: var(--scroll); }
.st-seg button[aria-pressed="true"] { background: var(--scroll); color: var(--ink); }
.st-seg button:disabled { opacity: .45; cursor: default; }
.st-seg button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* Bottom: section dots, the control bar, shortcuts */
.st-bottom { position: absolute; inset: auto 0 0; z-index: 4; padding: 0 max(1rem, 4.5cqmin) max(1rem, 3cqmin); transition: opacity .5s; outline: none; }
.st-dots { list-style: none; display: flex; gap: 6px; margin: 0 0 var(--s-3); padding: 0; }
.st-dots li { width: 18px; height: 4px; border-radius: 2px; background: rgba(247, 243, 236, .25); transition: background .3s, width .3s; }
.st-dots li.is-title { width: 8px; }
.st-dots li.is-on { background: var(--gold); width: 30px; }
.no-lyrics .st-dots { visibility: hidden; }
.st-bar { display: flex; align-items: center; gap: var(--s-3) var(--s-5); flex-wrap: wrap; padding: var(--s-2) var(--s-3); background: rgba(11, 10, 9, .72); border: 1px solid var(--line-on-dark); border-radius: 10px; backdrop-filter: blur(8px); }
.st-group { display: flex; align-items: center; gap: var(--s-1); }
.st-group--end { margin-left: auto; }
.st-btn { all: unset; box-sizing: border-box; cursor: pointer; display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 .5rem; border-radius: 8px; color: var(--scroll); }
.st-btn:hover { background: rgba(247, 243, 236, .1); }
.st-btn:disabled { opacity: .35; cursor: default; background: none; }
.st-btn:focus-visible, .st-exit:focus-visible, .st-select:focus-visible, .st-seek input:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.st-btn--play { width: 52px; height: 52px; border-radius: 50%; background: var(--gold); color: var(--ink); }
.st-btn--play:hover { background: #CDA968; }
.st-btn--play .i-pause, .is-playing .st-btn--play .i-play { display: none; }
.is-playing .st-btn--play .i-pause { display: block; }
/* Lyrics: an on/off switch that lights up (gold track, knob right) when the lyrics are showing */
.st-switch { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; gap: .55rem; min-height: 44px; padding: 0 .7rem 0 .5rem; border-radius: 8px; color: var(--muted-on-dark); font: 700 .8rem var(--font-display); letter-spacing: .1em; text-transform: uppercase; }
.st-switch:hover { background: rgba(247, 243, 236, .1); }
.st-switch:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.st-switch-track { position: relative; width: 40px; height: 22px; border-radius: 11px; border: 2px solid var(--muted-on-dark); box-sizing: border-box; transition: background .2s, border-color .2s; }
.st-switch-knob { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted-on-dark); transition: transform .2s var(--ease), background .2s; }
.st-switch[aria-checked="true"] { color: var(--scroll); }
.st-switch[aria-checked="true"] .st-switch-track { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 12px rgba(186, 149, 84, .55); }
.st-switch[aria-checked="true"] .st-switch-knob { transform: translateX(18px); background: var(--ink); }
.st-hint--off { color: var(--scroll); }
.st-hint--off b { color: var(--gold); }
.st-btn--text { padding: 0 .8rem; font: 600 .8rem var(--font-display); letter-spacing: .1em; text-transform: uppercase; }
.st-btn--text[aria-pressed="true"] { background: rgba(247, 243, 236, .14); box-shadow: inset 0 -2px 0 var(--gold); }
.st-btn[data-motion] .i-mplay, .st-btn[data-motion][aria-pressed="true"] .i-mpause { display: none; }
.st-btn[data-motion][aria-pressed="true"] .i-mplay { display: block; }
.st-seek { flex: 1 1 14rem; display: flex; align-items: center; gap: var(--s-3); min-width: 10rem; font: 500 .8rem var(--font-body); font-variant-numeric: tabular-nums; color: var(--muted-on-dark); }
.st-seek input { flex: 1; min-width: 0; height: 44px; accent-color: var(--gold); background: none; cursor: pointer; }
.st-part { min-width: 9.5rem; padding: 0 .25rem; font: 500 .78rem var(--font-body); color: var(--muted-on-dark); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-select { min-height: 44px; max-width: 14rem; padding: 0 2rem 0 .75rem; border: 1px solid var(--line-on-dark); border-radius: 8px; background: rgba(11, 10, 9, .6) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%23F7F3EC' stroke-width='2'/%3E%3C/svg%3E") no-repeat right .7rem center / 11px 7px; color: var(--scroll); font: 500 .85rem var(--font-body); appearance: none; cursor: pointer; }
.st-select--top { max-width: 16rem; }
.st-select option { background: var(--ink); color: var(--scroll); }
.st-keys { position: absolute; right: max(1rem, 4.5cqmin); bottom: calc(100% + .5rem); width: min(22rem, calc(100% - 2rem)); padding: var(--s-4) var(--s-5); background: rgba(11, 10, 9, .92); border: 1px solid var(--line-on-dark); border-radius: 10px; font-size: .88rem; }
.st-keys-h { margin: 0 0 var(--s-2); color: var(--muted-on-dark); font-size: .82rem; }
.st-keys ul { margin: 0; padding: 0; list-style: none; display: grid; gap: .45rem; }
.st-noscript { position: absolute; inset: auto 0 2rem; text-align: center; }
.st-noscript a { color: var(--accent-on-dark); }

/* While a song plays and nobody moves: just the song */
.is-idle .st-bottom, .is-idle .st-top { opacity: 0; }
.is-idle, .is-idle * { cursor: none; }

/* Smaller windows: the bar wraps into two rows */
@media (max-width: 1023px) {
  .st-group--end { margin-left: 0; }
  .st-part { min-width: 7rem; }
}
@media (max-width: 767px) {
  .st-top { gap: var(--s-3); }
  .st-logo { display: none; }
  .st-bar { gap: var(--s-2) var(--s-3); padding: var(--s-2); }
  .st-seek { order: -1; flex-basis: 100%; }
  .st-part { display: none; }
  .st-select { max-width: 9.5rem; }
  .st-slide { bottom: 12.5rem; top: 5.5rem; }
  .st-card, .st-card--lyrics, .st-hook { max-width: none; }
}
@media (max-width: 479px) {
  .st-exit span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }   /* still the link’s name */
  .st-exit { padding: 0 .6rem; }
  .st-select { max-width: 7.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  .st-slide.is-in .st-card { animation: none; }
  .st-flow-list, .st-fl { transition: none; }
  .st-fl--rest[data-d="0"] span { animation: none; opacity: .8; }
}
@media (max-width: 767px) {
  .st-flow { bottom: 13rem; top: 5rem; }
  .st-fl { max-width: none; }
  .st-seg button { padding: 0 .5rem; }
}
