/* Company31 Radio on company31.com/radio/. Sits on top of ../assets/styles.css.
   Always night: the page wears the dark tokens whatever the site theme, so
   the desk scene and the player read as one room. */

body.rd {
  --ground: #0A1633; --text: #E9F0FC;
  --muted: rgba(233, 240, 252, .75); --faint: rgba(233, 240, 252, .66);
  --accent: #3B8AF7; --accent-strong: #3B8AF7; --fill: rgba(59, 138, 247, .09);
  --line: rgba(59, 138, 247, .32); --hairline: rgba(59, 138, 247, .16);
  --card-border: rgba(59, 138, 247, .30); --chip-border: rgba(59, 138, 247, .24);
  --grad-btn-a: #3B8AF7; --grad-btn-b: #A9CCFB; --btn-text: #0A1633;
  --logo-fix: invert(.88) hue-rotate(190deg) saturate(1.35) brightness(1.1);
  --rd-deep: #060d22;
  --rd-gold: #E9B95C;
  --rd-player: 88px;
  color-scheme: dark;
  background: var(--ground);
  color: var(--text);
  padding-bottom: var(--rd-player);
}
body.rd::before { display: none; }

.rd header { padding-block: .9rem; }
.rd-brandtag { font-weight: 600; color: var(--rd-gold); }

.rd-welcome {
  text-align: center;
  font-size: clamp(1rem, 2.1vw, 1.25rem);
  font-weight: 600;
  letter-spacing: -.005em;
  padding: .8rem 1rem;
  margin: 0;
}
.rd-welcome span { color: var(--muted); font-weight: 500; }

/* ---- the desk ----------------------------------------------------------- */

.rd-stage {
  position: relative;
  height: min(56.25vw, calc(100svh - var(--rd-player) - 8.5rem));
  min-height: 300px;
  background: #070b1e;
  overflow: hidden;
  border-block: 1px solid var(--hairline);
}
.rd-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 42% 50%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.rd-tunein {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; gap: .8rem;
  padding: .95rem 1.6rem .95rem 1.2rem;
  border: 1.5px solid rgba(169, 204, 251, .7);
  border-radius: 999px;
  background: rgba(6, 13, 34, .72);
  color: #fff;
  font: 600 1.1rem "Company31 Sans", "Bricolage Grotesque", serif;
  cursor: pointer;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .45), 0 0 0 6px rgba(59, 138, 247, .12);
  backdrop-filter: blur(3px);
  transition: background .2s ease, transform .2s ease;
}
.rd-tunein:hover { background: rgba(28, 79, 216, .85); }
.rd-tunein[hidden] { display: none; }
.rd-tunein-icon {
  width: 34px; height: 34px; border-radius: 50%; background: #3B8AF7; position: relative; flex: none;
}
.rd-tunein-icon::after {
  content: ""; position: absolute; left: 13px; top: 10px;
  border-left: 11px solid #0A1633; border-top: 7px solid transparent; border-bottom: 7px solid transparent;
}

.rd-focusbadge {
  position: absolute; right: 1rem; top: 1rem;
  padding: .35rem .7rem; border-radius: 999px;
  background: rgba(6, 13, 34, .75); color: var(--rd-gold);
  border: 1px solid rgba(233, 185, 92, .45);
}
.rd-focusbadge[hidden] { display: none; }

.rd-keys {
  position: absolute; left: 1rem; bottom: .8rem;
  max-width: calc(100% - 2rem);
  color: rgba(233, 240, 252, .8);
}
.rd-keys summary {
  cursor: pointer; list-style: none; display: inline-flex; align-items: center; min-height: 24px;
  padding: .3rem .6rem; border-radius: 6px; background: rgba(6, 13, 34, .6);
}
.rd-keys summary::-webkit-details-marker { display: none; }
.rd-keys summary::before { content: "\25B8"; margin-right: .45rem; transition: transform .2s ease; }
.rd-keys[open] summary::before { transform: rotate(90deg); }
.rd-keys dl {
  margin: .4rem 0 0; padding: .7rem .9rem; border-radius: 10px;
  background: rgba(6, 13, 34, .88); border: 1px solid var(--hairline);
  display: grid; gap: .25rem; font-size: .88rem;
}
.rd-keys dl div { display: flex; gap: .8rem; }
.rd-keys dt { min-width: 7.5rem; }
.rd-keys dd { margin: 0; color: var(--muted); }
kbd {
  font: 500 .76rem "Company31 Mono", "Spline Sans Mono", monospace;
  padding: .05rem .35rem; border-radius: 4px;
  border: 1px solid rgba(169, 204, 251, .4); background: rgba(59, 138, 247, .12);
}

/* ---- stations ----------------------------------------------------------- */

.rd-stations {
  list-style: none; margin: 1.4rem 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr)); gap: .9rem;
}
.rd-st { display: flex; flex-direction: column; gap: .25rem; }
.rd-stbtn {
  flex: 1;
  display: flex; flex-direction: column; gap: .35rem; text-align: left;
  padding: 1rem 1.05rem 1.05rem; border-radius: 12px;
  border: 1px solid var(--card-border); background: rgba(59, 138, 247, .05);
  color: var(--text); cursor: pointer; font: inherit;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}
.rd-stbtn:hover { border-color: #3B8AF7; background: rgba(59, 138, 247, .1); }
.rd-stbtn.is-on { border-color: var(--rd-gold); background: rgba(233, 185, 92, .08); box-shadow: inset 0 0 0 1px var(--rd-gold); }
.rd-sttop { display: flex; justify-content: space-between; gap: .6rem; }
.rd-stgenre { color: var(--accent); font-size: .66rem; }
.rd-ststate { font-size: .66rem; color: #7ee0a0; white-space: nowrap; }
.rd-ststate::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: .4rem; vertical-align: 1px; }
.rd-ststate.is-bad { color: #FF9AA2; }
.rd-ststate:empty { display: none; }
.rd-stbtn.is-house { background: linear-gradient(135deg, rgba(28, 79, 216, .35), rgba(233, 185, 92, .12)); border-color: rgba(169, 204, 251, .55); }
.rd-stbtn.is-house .rd-ststate { color: var(--rd-gold); }
.rd-stbtn.is-on .rd-ststate { color: var(--rd-gold); }
.rd-stname { font: 600 1.15rem/1.25 "Company31 Sans", "Bricolage Grotesque", serif; }
.rd-sttag { color: var(--muted); font-size: .95rem; line-height: 1.5; }
.rd-stsite { color: var(--faint); text-decoration: none; font-size: .64rem; align-self: flex-start; padding-inline: .2rem; }
.rd-stsite:hover { color: var(--accent); }
.rd-status { margin-top: 1rem; color: var(--rd-gold); min-height: 1.4em; }
.rd-more { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.2rem; margin-top: .4rem; }
.rd-more button { cursor: pointer; font: inherit; }
.rd-more button[hidden] { display: none; }
.rd-morenote { color: var(--faint); font-size: .92rem; max-width: 40rem; }

/* ---- the house station -------------------------------------------------- */

.rd-house {
  display: grid; grid-template-columns: minmax(0, 24rem) minmax(0, 1fr); gap: 2rem; align-items: start;
  padding: 1.5rem 1.7rem; border-radius: 16px;
  border: 1px solid rgba(169, 204, 251, .4);
  background: linear-gradient(135deg, rgba(28, 79, 216, .22), rgba(233, 185, 92, .06));
}
.rd-housenow .mono { color: var(--accent); display: block; }
.rd-housetitle { font: 600 1.35rem/1.25 "Company31 Sans", "Bricolage Grotesque", serif; margin: .25rem 0 .2rem; }
.rd-housemeta { color: var(--muted); font-size: .92rem; margin-bottom: 1rem; }
.rd-housenext { font-size: 1rem; margin-top: .2rem; }
.rd-housenote { color: var(--muted); }
.rd-tracklist { margin-top: 1.2rem; }
.rd-tracklist summary { cursor: pointer; color: var(--accent); display: inline-flex; min-height: 24px; align-items: center; }
.rd-tracklist ol {
  list-style: none; margin: 1rem 0 0; padding: 0;
  columns: 3 16rem; column-gap: 2rem;
}
.rd-tracklist li {
  display: flex; gap: .7rem; align-items: baseline; padding: .28rem .4rem; border-radius: 6px;
  break-inside: avoid; font-size: .95rem;
}
.rd-tracklist li.is-now { background: rgba(233, 185, 92, .14); color: var(--rd-gold); }
.rd-tn { color: var(--faint); font-size: .66rem; }
.rd-tt { flex: 1; }
.rd-td { color: var(--faint); font-size: .66rem; }

/* ---- focus timer -------------------------------------------------------- */

.rd-focus {
  display: grid; grid-template-columns: minmax(0, 22rem) minmax(0, 1fr); gap: 2rem; align-items: center;
  padding: 1.6rem 1.8rem; border-radius: 16px;
  border: 1px solid var(--card-border); background: rgba(59, 138, 247, .05);
}
.rd-fmode { color: var(--accent); }
.rd-focus.is-break .rd-fmode { color: #7ee0a0; }
.rd-ftime {
  font: 600 clamp(3.2rem, 9vw, 4.6rem)/1.05 "Company31 Mono", "Spline Sans Mono", monospace;
  letter-spacing: -.02em; margin: .3rem 0 .7rem; font-variant-numeric: tabular-nums;
}
.rd-fbar { display: block; height: 4px; border-radius: 2px; background: rgba(59, 138, 247, .18); overflow: hidden; }
.rd-fbar i { display: block; height: 100%; background: var(--rd-gold); transform-origin: left; transform: scaleX(0); }
.rd-focus.is-break .rd-fbar i { background: #7ee0a0; }
.rd-fbtns { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.1rem; }
.rd-fbtns button { cursor: pointer; font: inherit; }
.rd-fnote { color: var(--muted); max-width: 32rem; }

/* ---- elsewhere ---------------------------------------------------------- */

.rd-links {
  list-style: none; margin: 1.2rem 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: .7rem;
}
.rd-links a {
  display: flex; flex-direction: column; gap: .2rem; height: 100%;
  padding: .85rem 1rem; border-radius: 10px; text-decoration: none;
  border: 1px solid var(--hairline); color: var(--text);
}
.rd-links a:hover { border-color: var(--accent); }
.rd-links b { font: 600 1rem "Company31 Sans", "Bricolage Grotesque", serif; }
.rd-links b::after { content: " \2197"; color: var(--accent); }
.rd-links span { color: var(--muted); font-size: .92rem; line-height: 1.5; }

.rd-about { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.6rem; }
.rd-about h3 { font-size: 1.1rem; margin-bottom: .5rem; }
.rd-about p { color: var(--muted); font-size: .97rem; }

/* ---- acknowledgement of Country ------------------------------------------- */

.rd-ack .wrap { max-width: 46rem; text-align: center; }
.rd-ack h2 { color: var(--rd-gold); font-size: .72rem; margin-bottom: .8rem; }
.rd-ack p { color: var(--muted); }
.rd-ack .rd-acknote { color: var(--faint); font-size: .92rem; margin-top: .6rem; }

/* ---- the player --------------------------------------------------------- */

.rd-player {
  position: fixed; inset: auto 0 0 0; z-index: 50;
  height: var(--rd-player);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  align-items: center; gap: 1rem;
  padding: 0 1rem 0 .9rem;
  background: rgba(6, 13, 34, .96);
  border-top: 1px solid rgba(59, 138, 247, .3);
  box-shadow: 0 -8px 30px rgba(0, 0, 0, .35);
  backdrop-filter: blur(8px);
}
.rd-cover { width: 64px; height: 64px; border-radius: 6px; overflow: hidden; background: #111a3d; flex: none; }
.rd-cover canvas, .rd-cover img { display: block; width: 64px; height: 64px; object-fit: cover; }
.rd-cover [hidden] { display: none; }
.rd-now { min-width: 0; }
.rd-now p { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-title { font: 600 1.08rem/1.3 "Company31 Sans", "Bricolage Grotesque", serif; }
.rd-artist { font-size: .92rem; line-height: 1.35; color: var(--text); }
.rd-album { font-size: .8rem; line-height: 1.35; color: var(--faint); }
.rd-bar { display: block; height: 3px; margin-top: .35rem; border-radius: 2px; background: rgba(233, 240, 252, .14); overflow: hidden; position: relative; }
.rd-bar i { display: block; height: 100%; background: #E9F0FC; transform-origin: left; transform: scaleX(0); transition: transform 1s linear; }
.rd-bar-live i { display: none; }
.rd-bar-live::after {
  content: ""; position: absolute; inset: 0; width: 30%;
  background: linear-gradient(90deg, transparent, rgba(59, 138, 247, .9), transparent);
  animation: rdlive 3.2s ease-in-out infinite;
}
@keyframes rdlive { from { transform: translateX(-100%); } to { transform: translateX(340%); } }

.rd-side { display: flex; flex-direction: column; align-items: flex-end; gap: .3rem; text-align: right; }
.rd-listeners { font: 600 1.05rem "Company31 Sans", "Bricolage Grotesque", serif; }
.rd-listeners[hidden] { display: none; }
.rd-chip {
  font-size: .62rem; padding: .25rem .55rem; border-radius: 4px; max-width: 13rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: #E9F0FC; color: #0A1633;
}

.rd-controls { display: flex; align-items: center; gap: .4rem; }
.rd-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid transparent;
  background: transparent; color: #E9F0FC; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.05rem;
}
.rd-btn:hover { background: rgba(59, 138, 247, .16); }
.rd-btn[aria-pressed="true"] { color: var(--rd-gold); border-color: rgba(233, 185, 92, .5); }
.rd-play {
  width: 58px; height: 58px; border-radius: 10px; cursor: pointer;
  border: 1.5px solid #E9F0FC; background: #E9F0FC; position: relative;
}
.rd-play span {
  position: absolute; left: 22px; top: 17px;
  border-left: 18px solid #0A1633; border-top: 12px solid transparent; border-bottom: 12px solid transparent;
}
.rd-play.is-playing { background: transparent; }
.rd-play.is-playing span {
  left: 18px; top: 16px; width: 22px; height: 26px; border: 0;
  background: linear-gradient(90deg, #E9F0FC 0 8px, transparent 8px 14px, #E9F0FC 14px 22px);
}
.rd-extra { display: flex; align-items: center; gap: .3rem; }
.rd-wx { position: relative; }
.rd-wxbtn.is-wet { color: #A9CCFB; }
.rd-wxbtn[aria-expanded="true"] { color: var(--rd-gold); border-color: rgba(233, 185, 92, .5); }
.rd-wxpanel {
  position: absolute; right: -4.5rem; bottom: calc(100% + 1.2rem); z-index: 70;
  width: 18.5rem; padding: 1rem 1.1rem 1.1rem; border-radius: 14px;
  max-height: calc(100svh - var(--rd-player) - 2.5rem); overflow-y: auto;
  background: rgba(6, 13, 34, .98); border: 1px solid rgba(59, 138, 247, .4);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .45);
}
.rd-wxpanel[hidden] { display: none; }
.rd-wxpanel fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: .15rem; }
.rd-wxpanel legend { color: var(--accent); margin-bottom: .5rem; padding: 0; }
.rd-wxpanel label { display: flex; align-items: flex-start; gap: .6rem; padding: .3rem .4rem; border-radius: 8px; cursor: pointer; font-size: .95rem; line-height: 1.35; }
.rd-wxpanel label:hover { background: rgba(59, 138, 247, .1); }
.rd-wxpanel input[type=radio] { accent-color: var(--rd-gold); margin-top: .2rem; }
.rd-wxpanel small { display: block; color: var(--faint); font-size: .8rem; }
.rd-wxpanel label > span > small { display: inline; }
.rd-wxlive small { display: block !important; }
.rd-wxvol { flex-direction: column; gap: .3rem !important; margin-top: .6rem; border-top: 1px solid var(--hairline); border-radius: 0 !important; padding-top: .8rem !important; }
.rd-wxvol .mono { color: var(--accent); }
.rd-wxvol input { width: 100%; accent-color: #3B8AF7; }
.rd-top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .3rem 1rem;
  padding: .55rem 1rem;
}
.rd-top .rd-welcome { padding: 0; }
.rd-wxlabel {
  display: inline-flex; align-items: center; gap: .5rem; min-height: 28px; max-width: 100%;
  padding: .3rem .75rem; border-radius: 999px; cursor: pointer;
  background: rgba(59, 138, 247, .1); color: #A9CCFB; font-size: .62rem; letter-spacing: .12em;
  border: 1px solid rgba(169, 204, 251, .3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rd-wxlabel:hover { border-color: #A9CCFB; color: #E9F0FC; }
.rd-wxlabel::after { content: "Change"; color: var(--rd-gold); flex: none; }
.rd-wxlabel:empty { display: none; }

.rd-loc { display: grid; gap: .35rem; padding-bottom: .8rem; margin-bottom: .7rem; border-bottom: 1px solid var(--hairline); }
.rd-loc > .mono { color: var(--accent); }
.rd-locname { font: 600 1.05rem "Company31 Sans", "Bricolage Grotesque", serif; }
.rd-locnote { color: var(--faint); font-size: .82rem; line-height: 1.4; }
.rd-locme {
  justify-self: start; cursor: pointer; font: inherit; font-size: .88rem; color: #E9F0FC;
  padding: .35rem .8rem; border-radius: 999px; border: 1px solid rgba(169, 204, 251, .45); background: transparent;
}
.rd-locme:hover { border-color: #A9CCFB; background: rgba(59, 138, 247, .12); }
.rd-locq {
  width: 100%; font: inherit; font-size: .92rem; color: #E9F0FC; background: rgba(59, 138, 247, .08);
  border: 1px solid rgba(169, 204, 251, .35); border-radius: 8px; padding: .45rem .6rem;
}
.rd-locq::placeholder { color: var(--faint); }
.rd-locresults { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.rd-locresults:empty { display: none; }
.rd-locresults button {
  width: 100%; text-align: left; cursor: pointer; font: inherit; font-size: .92rem; color: #E9F0FC;
  background: transparent; border: 0; border-radius: 6px; padding: .3rem .4rem;
}
.rd-locresults button:hover, .rd-locresults button:focus-visible { background: rgba(59, 138, 247, .14); }
.rd-locresults small { color: var(--faint); margin-left: .4rem; font-size: .78rem; }
.rd-locnone { color: var(--faint); font-size: .85rem; padding: .2rem .4rem; }
.rd-mute .rd-off, .rd-mute.is-muted .rd-on { display: none; }
.rd-mute.is-muted .rd-off { display: block; }
.rd-volume { width: 110px; accent-color: #3B8AF7; cursor: pointer; }

.rd .consent { bottom: var(--rd-player); }

/* ---- smaller screens ---------------------------------------------------- */

@media (max-width: 900px) {
  .rd-focus, .rd-house { grid-template-columns: 1fr; gap: 1rem; }
  .rd-about { grid-template-columns: 1fr; gap: 1.2rem; }
  .rd-side { display: none; }
}
@media (max-width: 640px) {
  body.rd { --rd-player: 76px; }
  .rd .hnav .hlink:not(:last-of-type) { display: none; }
  .rd-stage { height: 62vw; min-height: 240px; }
  .rd-stage canvas { object-position: 38% 50%; }
  .rd-keys { display: none; }
  .rd-player { gap: .6rem; padding: 0 .6rem; grid-template-columns: auto minmax(0, 1fr) auto auto; }
  .rd-cover, .rd-cover canvas, .rd-cover img { width: 48px; height: 48px; }
  .rd-album { display: none; }
  .rd-step, .rd-volume, .rd-mute { display: none; }
  .rd-wxpanel { right: -.2rem; width: min(17.5rem, calc(100vw - 1.2rem)); }
  .rd-wxlabel { font-size: .56rem; }
  .rd-play { width: 48px; height: 48px; }
  .rd-play span { left: 17px; top: 12px; }
  .rd-play.is-playing span { left: 13px; top: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  .rd-bar-live::after { animation: none; transform: none; width: 100%; opacity: .35; }
  .rd-tunein, .rd-stbtn { transition: none; }
}
html.a11y-motion .rd-bar-live::after { animation: none; transform: none; width: 100%; opacity: .35; }
@media (max-width: 640px) {
  .rd-tunein { padding: .6rem 1.1rem .6rem .8rem; font-size: 1rem; }
  .rd-tunein-icon { width: 28px; height: 28px; }
  .rd-tunein-icon::after { left: 11px; top: 8px; border-left-width: 9px; border-top-width: 6px; border-bottom-width: 6px; }
}
