/* ═══════════════════════════════════════════════════════════════════════════
   LUITOR XUR — cinema
   ───────────────────────────────────────────────────────────────────────────
   Near-black, and the artwork of the song now playing does the colouring. The
   accent hue is pulled off that image at runtime, so the page warms and cools
   with the record rather than sitting on one fixed brand colour.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --night: #0b0a0c;
  --night-2: #131215;
  --night-3: #1c1a1f;

  --paper: #f4f0ea;
  --paper-2: rgba(244, 240, 234, 0.72);
  --paper-3: rgba(244, 240, 234, 0.44);
  --paper-4: rgba(244, 240, 234, 0.14);

  /* set from the artwork by cinema.js; these are the opening chord */
  --glow: 22;
  --glow-sat: 62%;
  --accent: hsl(var(--glow) var(--glow-sat) 62%);
  --accent-soft: hsl(var(--glow) var(--glow-sat) 62% / 0.22);

  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --as: 'Noto Serif Bengali', 'Instrument Serif', Georgia, serif;

  --gutter: clamp(1.1rem, 4vw, 3rem);

  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--night);
  color: var(--paper);
  font-family: var(--sans);
  font-size: clamp(15px, 0.4vw + 13.6px, 16.5px);
  line-height: 1.6;
  overflow-x: hidden;
}

::selection {
  background: var(--accent);
  color: var(--night);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ── the backdrop ────────────────────────────────────────────────────────── */

.backdrop {
  position: fixed;
  inset: -12%;
  z-index: 0;
  background-position: center;
  background-size: cover;
  filter: blur(76px) saturate(135%);
  opacity: 0.38;
  transform: scale(1.12);
  transition: background-image 0.9s ease, opacity 1.2s ease;
  pointer-events: none;
}

.backdrop__veil {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 0%, transparent 10%, rgba(11, 10, 12, 0.62) 62%, var(--night) 100%),
    linear-gradient(180deg, rgba(11, 10, 12, 0.42), rgba(11, 10, 12, 0.88));
}

.backdrop__grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    repeating-linear-gradient(0deg, transparent 0 2px, rgba(255, 255, 255, 0.014) 2px 3px);
}

/* ── the hall ────────────────────────────────────────────────────────────── */

.hall {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(1.3rem, 3.5vw, 2.4rem) var(--gutter) 5rem;
}

/* ── crown ───────────────────────────────────────────────────────────────── */

.crown {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding-bottom: clamp(1.6rem, 5vw, 3rem);
}

.crown__mark {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
}

.crown__as {
  font-family: var(--as);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--paper);
}

.crown__en {
  font-family: var(--sans);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--paper-3);
}

.crown__live {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.32rem 0.9rem;
  border: 1px solid var(--paper-4);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--paper-3);
}

.crown__lamp {
  width: 0.46rem;
  height: 0.46rem;
  border-radius: 50%;
  background: var(--paper-3);
  transition: background 0.4s ease, box-shadow 0.4s ease;
}

.crown__lamp[data-state='playing'] {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  animation: pulse 3s ease-in-out infinite;
}

.crown__lamp[data-state='seeking'] {
  background: var(--paper-2);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.crown__clock {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.16em;
}

/* ── the feature ─────────────────────────────────────────────────────────── */

.feature {
  display: grid;
  gap: clamp(1.6rem, 4vw, 3.4rem);
  align-items: center;
}

@media (min-width: 900px) {
  .feature {
    grid-template-columns: minmax(18rem, 26rem) 1fr;
  }
}

.art {
  position: relative;
  margin: 0;
  width: 100%;
  max-width: 28rem;
  justify-self: center;
  isolation: isolate;
}

/* the record, turning out from behind the still */
.art__vinyl {
  position: absolute;
  z-index: 0;
  top: 50%;
  right: -13%;
  width: 62%;
  height: auto;
  aspect-ratio: 1;
  transform: translateY(-50%);
  transform-origin: 50% 50%;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.65));
  opacity: 0.92;
}

body[data-playing='true'] .art__vinyl {
  animation: revolve 4.2s linear infinite;
}

@keyframes revolve {
  to {
    transform: translateY(-50%) rotate(360deg);
  }
}

.art__vinyl-body {
  fill: #14120f;
  stroke: rgba(255, 240, 220, 0.22);
  stroke-width: 1.6;
}

.art__vinyl-groove {
  fill: none;
  stroke: rgba(255, 246, 232, 0.16);
  stroke-width: 0.6;
}

.art__vinyl-label {
  fill: var(--accent);
  opacity: 0.9;
}

.art__vinyl-hole {
  fill: var(--night);
}

.art__frame {
  position: relative;
  z-index: 1;
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: var(--night-3);
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.6),
    0 0 90px -20px var(--accent-soft);
  transition: box-shadow 1s ease, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

body[data-playing='true'] .art__frame {
  transform: scale(1.015);
}

.art__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.7s ease;
}

.art__ring {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

/* the words */

.lead {
  min-width: 0;
}

.lead__programme {
  margin: 0 0 0.9rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.7rem;
}

.lead__programme span:first-child {
  font-family: var(--as);
  font-size: 1rem;
  color: var(--accent);
}

.lead__programme span:last-child {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--paper-3);
}

.lead__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.3rem, 6.4vw, 4.4rem);
  line-height: 1.04;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.lead__native {
  margin: 0.5rem 0 0;
  font-family: var(--as);
  font-weight: 300;
  font-size: clamp(1.05rem, 2.6vw, 1.5rem);
  line-height: 1.45;
  color: var(--paper-2);
}

.lead__native:empty {
  display: none;
}

.lead__artist {
  margin: 1.1rem 0 0;
  font-size: 1.02rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--paper);
}

.lead__meta {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
  color: var(--paper-3);
}

.lead__meta:empty {
  display: none;
}

/* the scrubber */

.scrub {
  margin-top: 1.6rem;
  display: grid;
  gap: 0.45rem;
  max-width: 30rem;
}

/* the engine writes a width here; nothing draws it */
.scrub__source {
  display: none;
}

.scrub__wave {
  height: 3.4rem;
}

.wave {
  display: block;
  width: 100%;
  height: 100%;
}

.wave__ahead rect {
  fill: rgba(255, 255, 255, 0.17);
}

.wave__played rect {
  fill: var(--accent);
}

.scrub__times {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  color: var(--paper-3);
}

/* transport */

.transport {
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.tkey {
  display: inline-grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 1px solid var(--paper-4);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  color: var(--paper);
  text-decoration: none;
  transition: background 0.22s ease, border-color 0.22s ease, transform 0.22s ease;
}

.tkey svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: currentColor;
}

.tkey:hover,
.tkey:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}

.tkey:active {
  transform: scale(0.95);
}

.tkey--play {
  width: 4.1rem;
  height: 4.1rem;
  border: 0;
  background: var(--accent);
  color: #14110f;
  box-shadow: 0 12px 34px -8px var(--accent);
}

.tkey--play svg {
  width: 1.6rem;
  height: 1.6rem;
}

.tkey--play:hover,
.tkey--play:focus-visible {
  background: var(--accent);
  filter: brightness(1.12);
}

.tkey--out {
  margin-left: auto;
  width: auto;
  padding: 0 1rem;
  border-radius: 999px;
  gap: 0.5rem;
}

.tkey--out svg {
  width: 1.5rem;
  height: 1.1rem;
  fill: #ff3d33;
}

.tkey__play {
  fill: var(--night);
}

.tkey__hidden {
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  color: var(--paper-3);
}

@media (max-width: 560px) {
  .tkey--out {
    padding: 0;
    width: 3rem;
  }

  .tkey__hidden {
    display: none;
  }
}

.offair {
  margin: 1rem 0 0;
  font-size: 0.8rem;
  color: var(--paper-3);
}

.offair button {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── the strip ───────────────────────────────────────────────────────────── */

.strip {
  margin-top: clamp(2.8rem, 7vw, 5rem);
  padding-top: clamp(1.6rem, 4vw, 2.4rem);
  border-top: 1px solid var(--paper-4);
  display: grid;
  gap: clamp(1.8rem, 4vw, 3rem);
}

@media (min-width: 820px) {
  .strip {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.strip__label {
  margin: 0 0 1rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--paper-3);
}

.programmes {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.1rem;
}

.prog {
  display: grid;
  grid-template-columns: 4rem 1fr;
  gap: 0.7rem;
  align-items: center;
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 0;
  border-radius: 6px;
  background: none;
  cursor: pointer;
  font: inherit;
  text-align: left;
  color: var(--paper-2);
  transition: background 0.22s ease, color 0.22s ease;
}

.prog:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--paper);
}

.prog[data-on='true'] {
  background: var(--accent-soft);
  color: var(--paper);
}

.prog__hours {
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  color: var(--paper-3);
}

.prog[data-on='true'] .prog__hours {
  color: var(--accent);
}

.prog__name {
  display: grid;
}

.prog__as {
  font-family: var(--as);
  font-size: 0.95rem;
  line-height: 1.35;
}

.prog__en {
  font-size: 0.74rem;
  color: var(--paper-3);
}

.queue {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: q;
}

.queue li {
  display: grid;
  grid-template-columns: 1.3rem 1fr auto;
  gap: 0.7rem;
  align-items: baseline;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 0.9rem;
}

.queue li::before {
  counter-increment: q;
  content: counter(q);
  font-size: 0.7rem;
  color: var(--paper-3);
  font-variant-numeric: tabular-nums;
}

.queue__title {
  display: grid;
  gap: 0.05rem;
  min-width: 0;
}

.queue__as {
  font-family: var(--as);
  font-weight: 400;
  line-height: 1.35;
  color: var(--paper);
}

.queue__who {
  font-size: 0.75rem;
  color: var(--paper-3);
}

.queue__len {
  font-size: 0.73rem;
  font-variant-numeric: tabular-nums;
  color: var(--paper-3);
}

.voices {
  margin: 0 0 1.6rem;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.voices li {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.22rem 0.6rem;
  border: 1px solid var(--paper-4);
  border-radius: 999px;
  font-size: 0.79rem;
  color: var(--paper-2);
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.voices li span {
  font-size: 0.68rem;
  color: var(--paper-3);
  font-variant-numeric: tabular-nums;
}

.voices li[data-on='true'] {
  background: var(--accent);
  border-color: var(--accent);
  color: #14110f;
}

.voices li[data-on='true'] span {
  color: rgba(20, 17, 15, 0.62);
}

.source {
  margin: 0;
  padding-left: 0.9rem;
  border-left: 2px solid var(--accent);
  font-size: 0.8rem;
  line-height: 1.65;
  color: var(--paper-3);
}

.source strong {
  color: var(--paper-2);
  font-weight: 600;
}

/* ── the curtain ─────────────────────────────────────────────────────────── */

.curtain {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: var(--gutter);
  background:
    radial-gradient(70% 55% at 50% 38%, #1a1720, var(--night) 72%);
  transition: opacity 0.9s ease, visibility 0.9s;
}

.curtain[hidden] {
  display: grid;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.curtain__inner {
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  text-align: center;
  max-width: 32rem;
}

.curtain__as {
  margin: 0;
  font-family: var(--as);
  font-size: 1.35rem;
  color: var(--accent);
}

.curtain__title {
  margin: 0.4rem 0 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.1rem, 8vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
}

.curtain__body {
  margin: 0.6rem 0 0;
  font-size: 0.94rem;
  color: var(--paper-3);
}

.curtain__key {
  margin-top: 1.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 2.3rem;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  background: var(--paper);
  color: #14110f;
  font-family: var(--sans);
  font-size: 0.94rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.curtain__key svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: currentColor;
}

.curtain__key:hover,
.curtain__key:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px -10px rgba(255, 255, 255, 0.5);
}

.curtain__fine {
  margin: 1rem 0 0;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--paper-3);
}

/* heard, never seen */
.player {
  position: fixed;
  width: 1px;
  height: 1px;
  left: -100vw;
  top: -100vh;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── volume ───────────────────────────────────────────────────────────────── */

/* --accent is pulled from the record's own artwork by cinema.js, so the filled
   part of the slider changes colour with every song like everything else here. */
.vol {
  --vol-track: var(--paper-4);
  --vol-fill: var(--accent);
  --vol-thumb: var(--paper);
  --vol-ink: var(--paper-2);
}

.vol__key:hover {
  color: var(--accent);
}

.vol__value {
  font-family: var(--sans);
}
