/* ═══════════════════════════════════════════════════════════════════════════
   LUITOR XUR — the player
   ───────────────────────────────────────────────────────────────────────────
   The plain one. Light, generous, nothing to decode: a cover, a title, three
   buttons, and a list you can read at a glance. Assamese sits under the roman
   title rather than above it, because this design is for the first-time
   visitor who does not yet know what any of it is.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --bg: #ffffff;
  --bg-2: #f6f5f3;
  --bg-3: #eeece8;
  --line: #e3e0da;

  --ink: #171512;
  --ink-2: #55504a;
  --ink-3: #8a837a;

  --accent: #b8402c;
  --accent-2: #96311f;
  --accent-wash: rgba(184, 64, 44, 0.09);

  --yt: #ff0033;

  --sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --as: 'Noto Serif Bengali', Georgia, serif;

  --gutter: clamp(1rem, 4vw, 2.4rem);
  --radius: 14px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131211;
    --bg-2: #1b1a18;
    --bg-3: #24221f;
    --line: #302d29;

    --ink: #f4f2ee;
    --ink-2: #b8b2a9;
    --ink-3: #857e74;

    --accent: #e6614a;
    --accent-2: #f07a63;
    --accent-wash: rgba(230, 97, 74, 0.14);

    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(15px, 0.35vw + 13.8px, 16px);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection {
  background: var(--accent);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── top bar ─────────────────────────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.85rem var(--gutter);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
}

.brand__dot {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
  background: var(--accent);
  align-self: center;
}

.brand__name {
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}

.brand__as {
  font-family: var(--as);
  font-size: 0.9rem;
  color: var(--ink-3);
}

.onair {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.28rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-2);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-2);
}

.onair__lamp {
  width: 0.44rem;
  height: 0.44rem;
  border-radius: 50%;
  background: var(--ink-3);
  transition: background 0.35s ease, box-shadow 0.35s ease;
}

.onair__lamp[data-state='playing'] {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
  animation: pulse 3s ease-in-out infinite;
}

.onair__lamp[data-state='seeking'] {
  background: #d8a13a;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.onair__clock {
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
}

/* ── app ─────────────────────────────────────────────────────────────────── */

.app {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(1.4rem, 4vw, 2.6rem) var(--gutter) 4rem;
  display: grid;
  gap: clamp(1.6rem, 4vw, 2.6rem);
}

/* ── the deck ────────────────────────────────────────────────────────────── */

.deck {
  display: grid;
  gap: clamp(1.2rem, 3.5vw, 2.2rem);
  align-items: center;
  padding: clamp(1.1rem, 3vw, 1.8rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
}

@media (min-width: 780px) {
  .deck {
    grid-template-columns: 17rem 1fr;
  }
}

.cover {
  margin: 0;
  aspect-ratio: 16 / 9;
  width: min(78vw, 17rem);
  justify-self: center;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-3);
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.4);
}

.cover__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.deck__body {
  min-width: 0;
}

.deck__tag {
  margin: 0 0 0.6rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.55rem;
}

.deck__tag span:first-child {
  font-family: var(--as);
  font-size: 0.92rem;
  color: var(--accent);
}

.deck__tag-en {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.deck__title {
  margin: 0;
  font-size: clamp(1.5rem, 3.6vw, 2.15rem);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

.deck__native {
  margin: 0.3rem 0 0;
  font-family: var(--as);
  font-size: 1.02rem;
  line-height: 1.5;
  color: var(--ink-2);
}

.deck__native:empty {
  display: none;
}

.deck__artist {
  margin: 0.7rem 0 0;
  font-size: 1rem;
  font-weight: 600;
}

.deck__meta {
  margin: 0.1rem 0 0;
  font-size: 0.84rem;
  color: var(--ink-3);
}

.deck__meta:empty {
  display: none;
}

/* progress */

.bar {
  margin-top: 1.2rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.7rem;
}

/* the engine writes a width here; nothing draws it */
.bar__source {
  display: none;
}

.bar__wave {
  display: block;
  height: 2.4rem;
}

.wave {
  display: block;
  width: 100%;
  height: 100%;
}

.wave__ahead rect {
  fill: var(--bg-3);
}

.wave__played rect {
  fill: var(--accent);
}

.bar__time {
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
  min-width: 2.8rem;
}

.bar__time:last-child {
  text-align: right;
}

/* transport */

.transport {
  margin-top: 1.1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
}

.btn {
  display: inline-grid;
  place-items: center;
  width: 2.9rem;
  height: 2.9rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg);
  cursor: pointer;
  color: var(--ink);
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.btn svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: currentColor;
}

.btn:hover,
.btn:focus-visible {
  background: var(--bg-3);
  border-color: var(--ink-3);
}

.btn:active {
  transform: scale(0.94);
}

.btn--play {
  width: 3.6rem;
  height: 3.6rem;
  border: 0;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 20px -8px var(--accent);
}

.btn--play svg {
  width: 1.4rem;
  height: 1.4rem;
}

.btn--play:hover,
.btn--play:focus-visible {
  background: var(--accent-2);
}

.ytbtn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink-2);
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.18s ease, color 0.18s ease;
}

.ytbtn svg {
  width: 1.4rem;
  height: 1rem;
}

.ytbtn svg rect {
  fill: var(--yt);
}

.ytbtn__play {
  fill: #fff;
}

.ytbtn:hover,
.ytbtn:focus-visible {
  border-color: var(--yt);
  color: var(--ink);
}

.offair {
  margin: 0.9rem 0 0;
  font-size: 0.82rem;
  color: var(--ink-3);
}

.offair button {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── lists ───────────────────────────────────────────────────────────────── */

.lists {
  display: grid;
  gap: clamp(1.6rem, 4vw, 2.4rem);
}

@media (min-width: 780px) {
  .lists {
    grid-template-columns: 1.15fr 1fr;
  }
}

.list__label {
  margin: 0 0 0.8rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.list__label--gap {
  margin-top: 1.9rem;
}

.list__note {
  margin: 0.9rem 0 0;
  font-size: 0.8rem;
  color: var(--ink-3);
}

.queue {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: q;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.queue li {
  display: grid;
  grid-template-columns: 1.6rem 1fr auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.7rem 0.9rem;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}

.queue li:last-child {
  border-bottom: 0;
}

.queue li::before {
  counter-increment: q;
  content: counter(q);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.queue__title {
  display: grid;
  gap: 0.05rem;
  min-width: 0;
}

.queue__as {
  font-family: var(--as);
  font-weight: 500;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue__who {
  font-size: 0.76rem;
  color: var(--ink-3);
}

.queue__len {
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
}

.programmes {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.2rem;
}

.prog {
  display: grid;
  grid-template-columns: 4.2rem 1fr;
  gap: 0.8rem;
  align-items: center;
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid transparent;
  border-radius: 9px;
  background: none;
  cursor: pointer;
  font: inherit;
  text-align: left;
  color: var(--ink-2);
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.prog:hover {
  background: var(--bg-2);
  border-color: var(--line);
  color: var(--ink);
}

.prog[data-on='true'] {
  background: var(--accent-wash);
  border-color: transparent;
  color: var(--ink);
}

.prog__hours {
  font-size: 0.74rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink-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.76rem;
  color: var(--ink-3);
}

.voices {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.voices li {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.26rem 0.66rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--ink-2);
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.voices li span {
  font-size: 0.7rem;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

/* initials, so eleven names are eleven shapes rather than a wall of text */
.voices__mark {
  display: inline-grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  margin-right: 0.1rem;
  align-self: center;
  border-radius: 50%;
  background: var(--bg-3);
  font-size: 0.6rem !important;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink-2) !important;
}

.voices li[data-on='true'] .voices__mark {
  background: rgba(255, 255, 255, 0.22);
  color: #fff !important;
}

.voices li[data-on='true'] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.voices li[data-on='true'] span {
  color: rgba(255, 255, 255, 0.72);
}

/* ── source ──────────────────────────────────────────────────────────────── */

.source {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: start;
  padding: clamp(1rem, 3vw, 1.5rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
}

.source__mark {
  width: 2.4rem;
  height: 1.7rem;
  margin-top: 0.15rem;
}

.source__mark rect {
  fill: var(--yt);
}

.source__play {
  fill: #fff;
}

.source__head {
  margin: 0 0 0.35rem;
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.source__body {
  margin: 0;
  font-size: 0.87rem;
  line-height: 1.65;
  color: var(--ink-2);
}

.foot {
  margin: 0 auto;
  max-width: 46rem;
  text-align: center;
  font-size: 0.8rem;
  line-height: 1.65;
  color: var(--ink-3);
}

/* ── the curtain ─────────────────────────────────────────────────────────── */

.curtain {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: var(--gutter);
  background: var(--bg);
  transition: opacity 0.7s ease, visibility 0.7s;
}

.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: 30rem;
}

.curtain__dot {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 8px var(--accent-wash);
  margin-bottom: 1rem;
}

.curtain__title {
  margin: 0;
  font-size: clamp(1.7rem, 6vw, 2.4rem);
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.curtain__body {
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
  color: var(--ink-2);
}

.curtain__key {
  margin-top: 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.8rem 2.1rem;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: 0 10px 26px -10px var(--accent);
  transition: background 0.2s ease, transform 0.2s ease;
}

.curtain__key svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.curtain__key:hover,
.curtain__key:focus-visible {
  background: var(--accent-2);
  transform: translateY(-1px);
}

.curtain__fine {
  margin: 0.9rem 0 0;
  font-size: 0.76rem;
  color: var(--ink-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 ───────────────────────────────────────────────────────────────── */

.vol {
  --vol-track: var(--line);
  --vol-fill: var(--accent);
  --vol-thumb: var(--accent);
  --vol-ink: var(--ink-2);

  padding-left: 0.25rem;
}

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

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