/* The DJ set mini player with the crossfader: the live stream of a club on black. The card is dark smoked glass with a
   1px edge that catches the light from above, a fine grain and a sheen that follows the pointer; under it a soft glow
   takes the colour of the record you hear. Each record has its own colour (--c0, --c1 come from the script). */
:root {
  --page: #000000;          /* the page */
  --card: #0e0e11;          /* the body of the card */
  --card-top: #17171c;      /* its top, a little lighter */
  --ink: #f1f0f4;           /* the words */
  --muted: #85848f;         /* the small words */
  --faint: rgba(255, 255, 255, 0.08); /* rules and slots */
  --track-a: #ffad5a;       /* the colour of the first record */
  --track-b: #a07cff;       /* the colour of the second record */
  --track-c: #3fd6bd;       /* the colour of the third record */
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

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

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.stage {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: hidden;
}

.mix {
  --c0: var(--track-a);
  --c1: var(--track-b);
  --mixc: var(--track-a);
  --mx: 50%;
  --my: 0%;
  position: relative;
  width: min(88vw, 340px);
  opacity: 0;
}

/* the light under the card, in the colour of what you hear */
.mix__glow {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -6%;
  height: 46%;
  border-radius: 50%;
  background: var(--mixc);
  filter: blur(38px);
  opacity: 0.4;
  pointer-events: none;
}

.mix__card {
  position: relative;
  border-radius: 22px;
  padding: clamp(12px, 3.4vh, 18px) clamp(14px, 4.6vw, 18px) clamp(11px, 3vh, 15px);
  background: linear-gradient(180deg, var(--card-top), var(--card) 42%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.11),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 1px 1px rgba(0, 0, 0, 0.6),
    0 12px 24px -10px rgba(0, 0, 0, 0.8),
    0 40px 80px -30px rgba(0, 0, 0, 0.9);
  overflow: hidden;
  isolation: isolate;
}

.mix__grain {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
}

/* the sheen: a wide soft light that follows the pointer, plus the edge that lights up nearest to it */
.mix__sheen {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(220px 160px at var(--mx) var(--my), color-mix(in srgb, var(--mixc) 14%, transparent), transparent 70%);
  pointer-events: none;
}

.mix__sheen::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(160px 90px at var(--mx) var(--my), color-mix(in srgb, var(--mixc) 70%, white), transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0.55;
}

/* ---------------------------------------------------------------- header */
.mix__head {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11.5px;
  color: var(--muted);
}

.mix__live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px 3px 7px;
  border-radius: 999px;
  color: var(--ink);
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-variation-settings: 'wdth' 112;
  background: color-mix(in srgb, var(--mixc) 16%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mixc) 34%, transparent);
}

.mix__eq {
  width: 10px;
  height: 10px;
  fill: var(--mixc);
  overflow: visible;
}

.mix__eq rect {
  transform-box: fill-box;
  transform-origin: 50% 100%;
}

.mix__room {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.mix__clock {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* ---------------------------------------------------------------- now playing */
.mix__now {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: clamp(10px, 3vh, 16px);
}

.mix__art {
  position: relative;
  flex: none;
  width: clamp(40px, 12vh, 48px);
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 6px 14px -6px rgba(0, 0, 0, 0.9);
}

.mix__cover {
  --c: var(--track-a);
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.75) 0 11%, transparent 12%),
    radial-gradient(circle at 50% 50%, transparent 0 30%, rgba(255, 255, 255, 0.16) 31% 32%, transparent 33% 44%, rgba(255, 255, 255, 0.1) 45% 46%, transparent 47%),
    conic-gradient(from 210deg at 30% 30%, var(--c), color-mix(in srgb, var(--c) 40%, #0b0b10), color-mix(in srgb, var(--c) 80%, white), var(--c));
}

.mix__cover[data-cover='0'] {
  --c: var(--c0);
}

.mix__cover[data-cover='1'] {
  --c: var(--c1);
}

.mix__titles {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 40px;
}

.mix__track {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  line-height: 1.3;
  white-space: nowrap;
}

.mix__track b {
  font-size: 15px;
  font-weight: 600;
  font-variation-settings: 'wdth' 104;
  letter-spacing: -0.005em;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mix__track span {
  font-size: 12.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
}

.mix__bpm {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}

.mix__bpm b {
  font-size: 15px;
  font-weight: 560;
  font-variation-settings: 'wdth' 92;
}

.mix__bpm span {
  font-size: 9.5px;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-variation-settings: 'wdth' 112;
}

/* ---------------------------------------------------------------- the two waves */
.mix__wave {
  position: relative;
  margin: clamp(10px, 2.8vh, 14px) -4px 0;
  height: clamp(54px, 17vh, 84px);
}

.mix__wave canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---------------------------------------------------------------- the crossfader */
.mix__deck {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: clamp(8px, 2.4vh, 12px);
}

.mix__letter {
  flex: none;
  width: 14px;
  text-align: center;
  font-size: 11px;
  font-weight: 650;
  font-variation-settings: 'wdth' 112;
  color: var(--muted);
}

.mix__fader {
  --f: 0;
  position: relative;
  flex: 1;
  height: 40px;
  cursor: grab;
  touch-action: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.mix__fader.is-held {
  cursor: grabbing;
}

.mix__fader:focus-visible .mix__cap-face {
  outline: 2px solid color-mix(in srgb, var(--mixc) 80%, white);
  outline-offset: 3px;
}

.mix__ticks {
  position: absolute;
  left: 13px;
  right: 13px;
  top: 5px;
  height: 4px;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.13) 0 1px, transparent 1px 10%);
  border-right: 1px solid rgba(255, 255, 255, 0.13);
}

/* the longer tick in the middle, where both records play at the same level */
.mix__ticks::after {
  content: '';
  position: absolute;
  left: calc(50% - 0.5px);
  top: -2px;
  width: 1px;
  height: 7px;
  background: rgba(255, 255, 255, 0.34);
}

.mix__slot {
  position: absolute;
  left: 13px;
  right: 13px;
  top: 50%;
  height: 4px;
  margin-top: 0;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.7);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.9), 0 1px 0 rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.mix__fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--c0), var(--c1));
  opacity: 0.55;
  transform-origin: 0 50%;
}

.mix__cap {
  position: absolute;
  left: 13px;
  top: 50%;
  width: 0;
  height: 0;
}

.mix__cap-face {
  position: absolute;
  left: -13px;
  top: -16px;
  width: 26px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: linear-gradient(180deg, #4a4a52, #26262c 48%, #1b1b20 52%, #2c2c33);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(0, 0, 0, 0.7),
    0 2px 3px rgba(0, 0, 0, 0.7),
    0 10px 16px -6px rgba(0, 0, 0, 0.9);
}

.mix__cap-face i {
  display: block;
  width: 14px;
  height: 1px;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
}

/* the middle groove takes the colour of what you hear */
.mix__cap-face i:nth-child(2) {
  height: 2px;
  background: var(--mixc);
  box-shadow: 0 0 6px color-mix(in srgb, var(--mixc) 70%, transparent);
}

/* ---------------------------------------------------------------- footer */
.mix__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: clamp(6px, 1.8vh, 10px);
  padding-top: clamp(8px, 2.2vh, 11px);
  border-top: 1px solid var(--faint);
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}

.mix__foot b {
  color: var(--ink);
  font-weight: 560;
  font-variant-numeric: tabular-nums;
}

.mix__next {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mix__next b {
  display: inline-block;
  margin-left: 4px;
}
