/* ═══════════════════════════════════════════════════════════════════════════
   LUITOR XUR
   ───────────────────────────────────────────────────────────────────────────
   Dressed as a phulam gamosa: raw cotton ground, the woven red border top and
   bottom, muga gold for the fine threads. A japi turns in the middle where the
   record would be. Assamese leads and English follows, everywhere.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --cotton: #fbf7ef;
  --cotton-2: #f5eddf;
  --cotton-3: #ebdfc8;
  --cotton-edge: #ddcdb0;

  --gamosa: #b3231d;
  --gamosa-deep: #8a1712;
  --gamosa-wash: rgba(179, 35, 29, 0.08);

  --muga: #b58540;
  --muga-lit: #d3ac6a;
  --muga-wash: rgba(181, 133, 64, 0.14);

  --luit: #35576a;

  --ink: #241b13;
  --ink-soft: #5f4e3a;
  --ink-faint: #93816a;

  --as: 'Noto Serif Bengali', 'Cormorant Garamond', Georgia, serif;
  --en: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;

  --gutter: clamp(1.1rem, 4vw, 2.6rem);
  --round: 3px;

  color-scheme: light;
}

/* Evening. The cloth put away, the lamp on, the red still the red. */
@media (prefers-color-scheme: dark) {
  :root {
    --cotton: #171310;
    --cotton-2: #1f1a15;
    --cotton-3: #2a231b;
    --cotton-edge: #3a3025;

    --gamosa: #d9463c;
    --gamosa-deep: #b5322a;
    --gamosa-wash: rgba(217, 70, 60, 0.12);

    --muga: #d3aa60;
    --muga-lit: #e8c98c;
    --muga-wash: rgba(211, 170, 96, 0.16);

    --luit: #7aa5bb;

    --ink: #f2e7d5;
    --ink-soft: #c3b195;
    --ink-faint: #8d7d67;

    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--cotton);
  color: var(--ink);
  font-family: var(--en);
  font-size: clamp(15.5px, 0.5vw + 13.5px, 18px);
  line-height: 1.6;
  overflow-x: hidden;

  /* the slub of handloom cotton */
  background-image:
    repeating-linear-gradient(90deg, transparent 0 3px, rgba(0, 0, 0, 0.012) 3px 4px),
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(0, 0, 0, 0.012) 3px 4px);
}

::selection {
  background: var(--gamosa);
  color: var(--cotton);
}

.looms {
  position: absolute;
  width: 0;
  height: 0;
}

:focus-visible {
  outline: 2px solid var(--gamosa);
  outline-offset: 3px;
}

/* ── the woven bands ─────────────────────────────────────────────────────── */

.band {
  display: block;
  height: 86px;
  overflow: hidden;
  background: var(--cotton-2);
  border-block: 1px solid var(--cotton-edge);
}

.band__weave {
  display: block;
  width: 100%;
  height: 86px;
}

/* the loom does not start and stop at the edge of the screen */
.band--top .band__weave { transform: translateX(-14px); width: calc(100% + 28px); }
.band--bottom .band__weave { transform: translateX(-31px); width: calc(100% + 62px); }

.band--top {
  border-top: 0;
}

.band--bottom {
  border-bottom: 0;
  margin-top: 2.5rem;
}

.rule {
  height: 14px;
  margin: clamp(1.6rem, 4vw, 2.6rem) 0;
  opacity: 0.8;
}

.rule__thread {
  display: block;
  width: 100%;
  height: 14px;
}

/* ── the cloth ───────────────────────────────────────────────────────────── */

.cloth {
  max-width: 1020px;
  margin: 0 auto;
  padding: clamp(1.6rem, 5vw, 3.2rem) var(--gutter) 0;
}

/* ── masthead ────────────────────────────────────────────────────────────── */

.mast {
  text-align: center;
  display: grid;
  gap: 0.35rem;
  justify-items: center;
}

.mast__title {
  margin: 0;
  display: grid;
  gap: 0.1rem;
  line-height: 1.05;
}

.mast__as {
  font-family: var(--as);
  font-weight: 600;
  font-size: clamp(2.4rem, 8vw, 4rem);
  color: var(--gamosa);
  letter-spacing: -0.01em;
}

.mast__en {
  font-family: var(--en);
  font-weight: 500;
  font-size: clamp(0.85rem, 2vw, 1.05rem);
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  text-transform: uppercase;
  color: var(--muga);
}

.mast__sub {
  margin: 0.2rem 0 0;
  font-family: var(--as);
  font-size: 0.92rem;
  font-weight: 400;
  color: var(--ink-soft);
}

.mast__live {
  margin: 0.7rem 0 0;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 0.75rem;
  padding: 0.34rem 1rem;
  border: 1px solid var(--cotton-edge);
  border-radius: 999px;
  background: var(--cotton-2);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.mast__lamp {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--ink-faint);
  flex: none;
  transition: background 0.4s ease, box-shadow 0.4s ease;
}

.mast__lamp[data-state='playing'] {
  background: var(--gamosa);
  box-shadow: 0 0 0 3px var(--gamosa-wash);
  animation: breathe 3.2s ease-in-out infinite;
}

.mast__lamp[data-state='seeking'] {
  background: var(--muga);
}

@keyframes breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.mast__clock {
  color: var(--muga);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.16em;
}

/* ── the stage ───────────────────────────────────────────────────────────── */

.stage {
  margin-top: clamp(1.8rem, 5vw, 3rem);
  display: grid;
  gap: clamp(1.6rem, 4vw, 3rem);
  align-items: center;
  justify-items: center;
}

@media (min-width: 860px) {
  .stage {
    grid-template-columns: minmax(16rem, 22rem) 1fr;
    justify-items: stretch;
    text-align: left;
  }
}

/* the japi */

.japi {
  position: relative;
  margin: 0;
  width: min(74vw, 20rem);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.japi__svg {
  width: 100%;
  height: 100%;
  transform-origin: 50% 50%;
  filter: drop-shadow(0 10px 22px rgba(90, 60, 20, 0.16));
}

body[data-playing='true'] .japi__svg {
  animation: turn 26s linear infinite;
}

@keyframes turn {
  to {
    transform: rotate(360deg);
  }
}

/* the split bamboo, laid as one unbroken spiral */
.japi__cane {
  fill: none;
  stroke: var(--muga);
  stroke-width: 0.62;
  opacity: 0.5;
}

/* the cane rings that bind it down */
.japi__ring {
  fill: none;
  stroke: var(--muga);
  stroke-width: 1.15;
  opacity: 0.72;
}

.japi__rib {
  fill: none;
  stroke: var(--muga);
}

.japi__field {
  fill: var(--cotton-2);
  stroke: var(--cotton-edge);
  stroke-width: 1;
}

/* the brim binding, and the stitches holding it on */
.japi__brim {
  fill: none;
  stroke: var(--gamosa);
  stroke-width: 6;
}

.japi__brim-inner {
  fill: none;
  stroke: var(--gamosa);
  stroke-width: 1.2;
  opacity: 0.6;
}

.japi__stitch {
  stroke: var(--cotton);
  stroke-width: 1.1;
  opacity: 0.55;
}

/* the cloth appliqué that makes it a phulam japi */
.japi__cloth {
  fill: var(--gamosa);
  opacity: 0.16;
}

.japi__cloth--gold {
  fill: var(--muga);
  opacity: 0.2;
}

/* the small mirrors, sewn in rings */
.japi__mirror circle {
  fill: var(--muga-lit);
  stroke: var(--muga);
  stroke-width: 0.6;
  opacity: 0.85;
}

.japi__mirror .japi__mirror-eye {
  fill: var(--cotton);
  stroke: none;
  opacity: 0.9;
}

/* the rosettes */
.japi__petal {
  fill: var(--gamosa);
  opacity: 0.88;
}

.japi__petal--gold {
  fill: var(--muga);
  opacity: 0.92;
}

.japi__seed {
  fill: var(--cotton);
  stroke: var(--gamosa);
  stroke-width: 0.9;
}

.japi__boss {
  fill: var(--gamosa);
  stroke: var(--muga-lit);
  stroke-width: 2;
}

.japi__pin {
  fill: var(--cotton);
}

.japi__shadow {
  position: absolute;
  inset: auto 12% -4% 12%;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(90, 60, 20, 0.2), transparent);
  pointer-events: none;
}

/* the song */

.now {
  display: grid;
  gap: 0.2rem;
  text-align: center;
  width: 100%;
}

@media (min-width: 860px) {
  .now {
    text-align: left;
  }
}

.now__programme {
  margin: 0 0 0.35rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: baseline;
  justify-content: center;
  font-family: var(--as);
  font-size: 0.98rem;
  color: var(--gamosa);
}

@media (min-width: 860px) {
  .now__programme {
    justify-content: flex-start;
  }
}

.now__programme-en {
  font-family: var(--en);
  font-size: 0.74rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muga);
}

.now__native {
  margin: 0;
  font-family: var(--as);
  font-weight: 600;
  font-size: clamp(1.7rem, 5.4vw, 2.9rem);
  line-height: 1.28;
  letter-spacing: -0.005em;
  text-wrap: balance;
}

.now__native:empty {
  display: none;
}

.now__roman {
  margin: 0.15rem 0 0;
  font-family: var(--en);
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  font-style: italic;
  color: var(--ink-soft);
}

.now__artist {
  margin: 0.8rem 0 0;
  font-family: var(--as);
  font-size: 1.08rem;
  font-weight: 500;
  color: var(--luit);
}

.now__meta {
  margin: 0.1rem 0 0;
  font-size: 0.85rem;
  color: var(--ink-faint);
  letter-spacing: 0.03em;
}

.now__meta:empty {
  display: none;
}

/* progress, woven as a thread pulled through the cloth */

.progress {
  margin-top: 1.1rem;
  display: grid;
  gap: 0.35rem;
}

.progress__track {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: var(--cotton-3);
  overflow: hidden;
}

.progress__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--muga), var(--gamosa));
  transition: width 1s linear;
}

.progress__times {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
}

/* controls */

.controls {
  margin-top: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1rem, 4vw, 2.2rem);
}

@media (min-width: 860px) {
  .controls {
    justify-content: flex-start;
  }
}

.ctl {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0.4rem;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--ink-soft);
  font: inherit;
  transition: color 0.25s ease, transform 0.25s ease;
}

.ctl:hover,
.ctl:focus-visible {
  color: var(--gamosa);
}

.ctl:active {
  transform: translateY(1px);
}

.ctl svg {
  width: 1.7rem;
  height: 1.7rem;
  fill: currentColor;
}

.ctl__word {
  font-family: var(--as);
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
}

.ctl--play {
  width: auto;
}

.ctl--play svg {
  width: 2rem;
  height: 2rem;
  fill: var(--cotton);
  position: relative;
  z-index: 1;
  margin: 0.85rem;
}

.ctl--play .ctl__ring {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 3.7rem;
  height: 3.7rem;
  border-radius: 50%;
  background: var(--gamosa);
  box-shadow: 0 6px 18px rgba(179, 35, 29, 0.28), inset 0 0 0 3px var(--muga-lit);
  transition: background 0.3s ease, transform 0.3s ease;
}

.ctl--play:hover .ctl__ring,
.ctl--play:focus-visible .ctl__ring {
  background: var(--gamosa-deep);
  transform: translateX(-50%) scale(1.04);
}

.ctl--play .ctl__word {
  color: var(--gamosa);
}

.offair {
  margin: 0.9rem 0 0;
  font-size: 0.8rem;
  color: var(--ink-faint);
  font-style: italic;
}

.offair button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: var(--gamosa);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── where the sound comes from ──────────────────────────────────────────── */

.source {
  margin-top: clamp(1.8rem, 5vw, 2.8rem);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.9rem;
  align-items: start;
  padding: clamp(0.9rem, 2.5vw, 1.2rem) clamp(1rem, 3vw, 1.5rem);
  border: 1px solid var(--cotton-edge);
  border-left: 3px solid var(--gamosa);
  border-radius: var(--round);
  background: var(--cotton-2);
}

.source__mark {
  width: 2.1rem;
  height: 1.5rem;
  margin-top: 0.2rem;
  flex: none;
}

.source__mark rect {
  fill: var(--gamosa);
}

.source__play {
  fill: var(--cotton-2);
}

.source__body {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.62;
  color: var(--ink-soft);
}

.source__body strong {
  color: var(--ink);
  font-weight: 600;
}

.source__link {
  display: inline-block;
  margin-top: 0.35rem;
  color: var(--gamosa);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid var(--gamosa-wash);
}

.source__link:hover {
  border-bottom-color: var(--gamosa);
}

/* ── panels ──────────────────────────────────────────────────────────────── */

.panels {
  display: grid;
  gap: clamp(1.6rem, 4vw, 2.6rem);
}

@media (min-width: 760px) {
  .panels {
    grid-template-columns: 1fr 1fr;
  }
}

.panel__label {
  margin: 0 0 0.8rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.6rem;
  font-family: var(--as);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
}

.panel__label span {
  font-family: var(--en);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muga);
}

.panel__label--gap {
  margin-top: 1.9rem;
}

/* the day's programmes */

.programmes {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.15rem;
}

.prog {
  display: grid;
  grid-template-columns: 4.4rem 1fr;
  gap: 0.7rem;
  align-items: center;
  width: 100%;
  padding: 0.55rem 0.7rem;
  background: none;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: var(--round);
  cursor: pointer;
  font: inherit;
  text-align: left;
  color: var(--ink-soft);
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.prog:hover {
  background: var(--muga-wash);
  color: var(--ink);
}

.prog[data-on='true'] {
  background: var(--gamosa-wash);
  border-left-color: var(--gamosa);
  color: var(--ink);
}

.prog__hours {
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
}

.prog[data-on='true'] .prog__hours {
  color: var(--gamosa);
}

.prog__name {
  display: grid;
  gap: 0.02rem;
}

.prog__as {
  font-family: var(--as);
  font-size: 1rem;
  line-height: 1.3;
}

.prog__en {
  font-size: 0.76rem;
  font-style: italic;
  color: var(--ink-faint);
}

/* the queue */

.queue {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.1rem;
  counter-reset: q;
}

.queue li {
  display: grid;
  grid-template-columns: 1.4rem 1fr auto;
  gap: 0.7rem;
  align-items: baseline;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--cotton-3);
  font-size: 0.9rem;
}

.queue li::before {
  counter-increment: q;
  content: counter(q);
  font-size: 0.72rem;
  color: var(--muga);
  font-variant-numeric: tabular-nums;
}

.queue__title {
  display: grid;
  gap: 0.05rem;
  min-width: 0;
}

.queue__as {
  font-family: var(--as);
  line-height: 1.35;
}

.queue__who {
  font-size: 0.76rem;
  font-style: italic;
  color: var(--ink-faint);
}

.queue__len {
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-faint);
}

/* the voices */

.voices {
  margin: 0;
  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.24rem 0.62rem;
  border: 1px solid var(--cotton-edge);
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--ink-soft);
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.voices li span {
  font-size: 0.7rem;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.voices li[data-on='true'] {
  background: var(--gamosa);
  border-color: var(--gamosa);
  color: var(--cotton);
}

.voices li[data-on='true'] span {
  color: var(--cotton-3);
}

/* ── colophon ────────────────────────────────────────────────────────────── */

.colophon {
  margin-top: clamp(2rem, 5vw, 3rem);
  padding-top: 1.4rem;
  border-top: 1px solid var(--cotton-3);
  text-align: center;
  font-size: 0.83rem;
  line-height: 1.7;
  color: var(--ink-faint);
}

.colophon p {
  margin: 0 auto;
  max-width: 44rem;
}

.colophon em {
  font-family: var(--as);
  font-style: normal;
  color: var(--ink-soft);
}

.colophon__note {
  margin-top: 0.6rem;
  font-style: italic;
  opacity: 0.85;
}

/* ── the curtain ─────────────────────────────────────────────────────────── */

.curtain {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: var(--gutter);
  background: var(--cotton);
  background-image: radial-gradient(60% 50% at 50% 40%, var(--cotton-2), var(--cotton) 70%);
  transition: opacity 0.8s ease, visibility 0.8s;
}

.curtain[hidden] {
  display: grid;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.curtain__inner {
  display: grid;
  justify-items: center;
  gap: 0.55rem;
  text-align: center;
  max-width: 27rem;
}

.curtain__japi {
  width: clamp(9rem, 34vw, 13rem);
  height: auto;
}

.curtain__cone {
  fill: var(--cotton-2);
  stroke: var(--muga);
  stroke-width: 2;
}

.curtain__weave {
  fill: none;
  stroke: var(--muga);
  stroke-width: 0.6;
  opacity: 0.5;
}

.curtain__brim {
  fill: none;
  stroke: var(--gamosa);
  stroke-width: 2.4;
}

.curtain__flower {
  fill: var(--gamosa);
  opacity: 0.85;
}

.curtain__title {
  margin: 0.6rem 0 0;
  font-family: var(--as);
  font-weight: 600;
  font-size: clamp(2rem, 8vw, 2.8rem);
  color: var(--gamosa);
}

.curtain__body {
  margin: 0;
  font-size: 0.94rem;
  color: var(--ink-soft);
}

.curtain__key {
  margin-top: 1rem;
  padding: 0.72rem 2.6rem;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  background: var(--gamosa);
  color: var(--cotton);
  font-family: var(--as);
  font-size: 1rem;
  letter-spacing: 0.04em;
  box-shadow: 0 8px 20px rgba(179, 35, 29, 0.3), inset 0 0 0 3px var(--muga-lit);
  transition: transform 0.25s ease, background 0.25s ease;
}

.curtain__key:hover,
.curtain__key:focus-visible {
  background: var(--gamosa-deep);
  transform: translateY(-1px);
}

.curtain__fine {
  margin: 0.7rem 0 0;
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* 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(--cotton-edge);
  --vol-fill: var(--gamosa);
  --vol-thumb: var(--gamosa);
  --vol-ink: var(--ink-soft);
}

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

.vol__value {
  font-family: var(--en);
  font-size: 0.74rem;
}
