/* The setlist on ruled lines: tonight's songs on a white page, in a minimal style. A title, a hairline, one song on
   each thin line and nothing else. The lines, the springs and the start times are the script's; the vermilion is
   only ever the space where the song in hand would land. Bricolage Grotesque is a variable sans with weight (200 to
   800), width (75 to 100) and optical size axes: a song takes weight when it is held and narrows as it runs. */
:root {
  --page: #ffffff;                     /* the page, and the card a song is carried on */
  --ink: #141414;                      /* the songs, the title and the line under it */
  --muted: #8e8a82;                    /* the start times, the count and the hint */
  --line: #dedad2;                     /* the thin line every song sits on */
  --line-near: #a9a49b;                /* the line under the song the pointer is on, or the finger is pressing */
  --accent: #e8461f;                   /* the space where the song in hand would land */
  --shade: rgba(20, 20, 20, 0.2);      /* the faint shadow under the song in hand */
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  overflow-x: clip;
}

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--ink);
  font-family: 'Bricolage Grotesque Variable', 'Helvetica Neue', Arial, sans-serif;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

/* the list stands alone in the middle of the page (in a real page it sits in its column) */
.stage {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 48px 16px;
}

.set {
  --pad: 14px;                         /* how far the card of a song in hand reaches out past the words */
  position: relative;
  width: min(440px, 100%);
}

/* ---------------------------------------------------------------- the head */
.set__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
}

.set__title {
  margin: 0;
  font-size: 30px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.012em;
  font-variation-settings: 'wght' 660, 'wdth' 78;
  white-space: nowrap;
}

.set__meta {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-variation-settings: 'wght' 430, 'wdth' 92;
  white-space: nowrap;
}

/* ---------------------------------------------------------------- the sheet */
.sheet {
  position: relative;
}

.sheet__rule {
  display: block;
  height: 1px;
  background: var(--ink);
  transform-origin: 0 50%;
}

.songs {
  --pitch: 50px;                       /* the space between two lines */
  position: relative;
  height: calc(var(--n, 8) * var(--pitch));
  margin: 0;
  padding: 0;
  list-style: none;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* the script moves every song on its spring: one element for the script (the row), its child for the lift (the card) */
.song {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1;
  height: var(--pitch);
  cursor: grab;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.song.is-held {
  z-index: 3;
  cursor: grabbing;
}

.song__card {
  position: absolute;
  top: 0;
  bottom: 1px;
  left: calc(-1 * var(--pad));
  right: calc(-1 * var(--pad));
  display: flex;
  align-items: flex-end;
  gap: 16px;
  padding: 0 var(--pad) 12px;
  border-radius: 3px;
  background: var(--page);
}

/* the faintest shadow, there only while the song is in hand */
.song__card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 1px 1px rgba(20, 20, 20, 0.05), 0 9px 20px -12px var(--shade);
  opacity: var(--shadow, 0);
  pointer-events: none;
}

.song__title {
  position: relative;
  min-width: 0;
  font-size: 19px;
  line-height: 1;
  letter-spacing: -0.005em;
  white-space: nowrap;
  font-variation-settings: 'wght' 430, 'wdth' 100;
}

.song__time {
  position: relative;
  display: flex;
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  font-variation-settings: 'wght' 430, 'wdth' 92;
}

/* every figure of a time rolls on its own when it changes */
.song__digit {
  display: block;
  height: 1.2em;
  overflow: hidden;
}

.song__digit > span {
  display: block;
}

/* the line the song sits on: an SVG path, so that it can give under a song put down on it */
.song__rule {
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 12px;
  overflow: visible;
  pointer-events: none;
}

.song__rule path {
  fill: none;
  stroke: var(--line);
  stroke-width: 1;
  transition: stroke 0.25s ease;
}

@media (hover: hover) {
  .song:hover .song__rule path {
    stroke: var(--line-near);
  }
}

/* a finger pressing, before the song lifts: the same as the pointer over it */
.song.is-pressing .song__rule path {
  stroke: var(--line-near);
}

/* the keys: a thin frame round the card */
.song:focus-visible .song__card {
  outline: 1px solid var(--ink);
  outline-offset: -1px;
}

.gaps {
  position: absolute;
  top: 1px;
  left: 0;
  z-index: 2;
  width: 100%;
  height: calc(100% - 1px);
  overflow: visible;
  pointer-events: none;
}

.gaps path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-linecap: round;
}

/* ---------------------------------------------------------------- the hint */
.set__hint {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.3;
  font-variation-settings: 'wght' 420, 'wdth' 92;
}

.set__hint-touch {
  display: none;
}

@media (hover: none) {
  .set__hint-mouse {
    display: none;
  }

  .set__hint-touch {
    display: inline;
  }
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------------- a phone */
@media (max-width: 520px) {
  .set {
    --pad: 10px;
  }

  .set__title {
    font-size: 26px;
  }

  .songs {
    --pitch: 47px;
  }

  .song__card {
    padding-bottom: 11px;
  }

  .song__title {
    font-size: 17.5px;
  }
}
