/* Black Octave Radio stage. Motion tokens are the whole vocabulary
   (MASTERPIECE 3.1): standard cubic-bezier(0.2,0,0,1); enter
   cubic-bezier(0.05,0.7,0.1,1); exit cubic-bezier(0.3,0,0.8,0.15);
   feedback 100-150ms; morph 250ms; surface 380ms in / 240ms out;
   artwork change 600ms; ceremony 900ms, opening only. */
@font-face { font-family: Michroma; src: url('fonts/michroma.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: Rajdhani; src: url('fonts/rajdhani-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: Rajdhani; src: url('fonts/rajdhani-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('fonts/plexmono.woff2') format('woff2'); font-display: swap; }

:root {
  --accent: #a855f7;
  --accent-text: #a78bfa;   /* AA-safe on black */
  --ink: #e9d5ff;
  --paper: #f4f1fa;
  --muted: #b9a8d9;
  --curve-standard: cubic-bezier(0.2, 0, 0, 1);
  --curve-enter: cubic-bezier(0.05, 0.7, 0.1, 1);
  --curve-exit: cubic-bezier(0.3, 0, 0.8, 0.15);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { overflow: hidden; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

#art { position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  animation: bloom 900ms var(--curve-enter) both; }
body.returning #art { animation-duration: 400ms; }
@keyframes bloom { from { opacity: 0; transform: scale(1.04); } to { opacity: 1; transform: scale(1); } }

#mixcloud-mount { position: absolute; left: 0; right: 0; bottom: 0; height: 0; overflow: hidden; opacity: 0; pointer-events: none; }
#mixcloud-mount iframe { width: 100%; }

#brand { position: absolute; top: max(14px, env(safe-area-inset-top)); left: 18px;
  display: flex; align-items: center; gap: 10px; z-index: 5;
  animation: settle 300ms var(--curve-standard) both; }
#brand .mark { width: 34px; height: 34px; }
#brand .wordmark { font-family: Michroma, sans-serif; font-size: 13px; letter-spacing: 0.14em; color: #fff; white-space: nowrap; }
@keyframes settle { from { opacity: 0; } to { opacity: 1; } }

#stations { position: absolute; top: max(14px, env(safe-area-inset-top)); right: 18px; z-index: 5;
  min-height: 44px; padding: 0 18px; border-radius: 999px;
  background: rgba(20, 8, 38, 0.72); color: var(--ink);
  border: 1px solid var(--accent); font: 600 15px Rajdhani, sans-serif; cursor: pointer; }
#stations:active { transform: scale(0.97); transition: transform 120ms var(--curve-standard); }

#identity { position: absolute; left: 18px; right: 18px; bottom: 106px; z-index: 4; pointer-events: none; }
#identity > * { animation: rise 250ms var(--curve-standard) both; }
#identity > *:nth-child(2) { animation-delay: 60ms; }
#identity > *:nth-child(3) { animation-delay: 120ms; }
body.returning #identity > * { animation: none; }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
#station-name { font-family: Michroma, sans-serif; font-size: clamp(20px, 5.8vw, 38px);
  line-height: 1.16; margin: 0 0 6px; color: #fff;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  text-wrap: balance; text-shadow: 0 2px 18px rgba(0,0,0,0.9); }
#station-desc { margin: 0 0 8px; font-size: 17px; font-weight: 500; color: var(--paper);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  text-shadow: 0 1px 10px rgba(0,0,0,0.9); }
.badge { font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; color: var(--accent-text); margin: 0; letter-spacing: 0.06em; }
/* AD-03: the next thing in the line, named on the stage at all times. */
.upnext { font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; color: var(--muted);
  margin: 6px 0 0; letter-spacing: 0.04em; text-shadow: 0 1px 8px rgba(0,0,0,0.9); }
.upnext:empty { display: none; }
#identity > *:nth-child(4) { animation-delay: 180ms; }

#controls { position: absolute; left: 18px; bottom: 38px; z-index: 5; display: flex; align-items: center; gap: 14px; }
#play { width: 64px; height: 64px; min-width: 64px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--accent); color: #fff; display: grid; place-items: center; position: relative;
  transition: transform 120ms var(--curve-standard); }
#play:active { transform: scale(0.95); }
#play svg { width: 28px; height: 28px; }
#play .glyph-pause { display: none; }
#play.playing .glyph-pause { display: block; }
#play.playing .glyph-play { display: none; }
#play .ring { position: absolute; inset: -5px; border-radius: 50%; border: 2px solid transparent;
  border-top-color: var(--ink); opacity: 0; pointer-events: none; }
#play.connecting .ring { opacity: 1; animation: spin 900ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#fav, #sleep { min-height: 44px; min-width: 44px; border-radius: 999px; cursor: pointer;
  background: rgba(20, 8, 38, 0.72); color: var(--ink); border: 1px solid rgba(168, 85, 247, 0.55);
  font: 600 15px Rajdhani, sans-serif; padding: 0 12px; }
#fav.on, #sleep.on { color: #fff; border-color: var(--accent); background: rgba(88, 28, 135, 0.75); }
#vol-wrap { display: flex; align-items: center; }
#vol { accent-color: var(--accent); width: 92px; }

/* Notices own a reserved slot: top centre, under the brand row, where no
   stage content ever sits (defect D5). */
#notice { position: absolute; left: 50%; transform: translateX(-50%);
  top: calc(max(14px, env(safe-area-inset-top)) + 56px); z-index: 6; margin: 0;
  max-width: min(88vw, 540px); text-align: center;
  font-size: 15.5px; font-weight: 600; color: #fff; background: rgba(20, 8, 38, 0.92);
  border: 1px solid rgba(168,85,247,0.5);
  padding: 8px 16px; border-radius: 999px; opacity: 0; pointer-events: none;
  transition: opacity 250ms var(--curve-standard); }
#notice.show { opacity: 1; }

#scrim { position: fixed; inset: 0; background: rgba(0,0,0,0.72); opacity: 0; pointer-events: none;
  transition: opacity 240ms var(--curve-exit); z-index: 8; }
#scrim.show { opacity: 1; pointer-events: auto; }
#drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 9;
  width: min(430px, 92vw); background: linear-gradient(180deg, #0a0514, #07030d);
  border-left: 1px solid rgba(168,85,247,0.4);
  transform: translateX(102%); transition: transform 380ms var(--curve-enter);
  overflow-y: auto; overscroll-behavior: contain; padding: 18px 16px 28px; }
#drawer.open { transform: none; transition: transform 380ms var(--curve-enter); }
#drawer:not(.open) { transition: transform 240ms var(--curve-exit); }
#drawer-head { display: flex; justify-content: space-between; align-items: center; }
#drawer-head h2 { font-family: Michroma, sans-serif; font-size: 16px; color: #fff; margin: 0; }
#drawer-close { min-height: 44px; background: none; border: 1px solid rgba(168,85,247,0.55);
  color: var(--ink); border-radius: 999px; padding: 0 14px; font: 600 14px Rajdhani, sans-serif; cursor: pointer; }
#search { width: 100%; margin: 14px 0 6px; min-height: 44px; border-radius: 12px;
  border: 1px solid rgba(168,85,247,0.5); background: #0d0618; color: var(--paper);
  padding: 0 12px; font: 500 16px Rajdhani, sans-serif; }
.shelf { margin-top: 20px; }
.shelf h3 { font: 600 13px 'IBM Plex Mono', monospace; letter-spacing: 0.12em; color: var(--accent-text);
  text-transform: uppercase; margin: 0 0 8px; }
.shelf h4 { font: 600 14.5px Rajdhani, sans-serif; color: var(--muted); margin: 14px 0 4px; }
.shelf-note { color: var(--muted); font-size: 15px; line-height: 1.45; }
.row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: none; border: none; border-bottom: 1px solid rgba(168,85,247,0.16);
  padding: 10px 4px; min-height: 44px; cursor: pointer; color: var(--paper);
  font: 500 16px Rajdhani, sans-serif; text-decoration: none; }
.row:active { background: rgba(88,28,135,0.3); transition: background 120ms var(--curve-standard); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-title { font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row-sub { color: var(--muted); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row-badge { flex: 0 0 92px; text-align: right; align-self: flex-start; padding-top: 3px;
  font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--accent-text);
  white-space: nowrap; overflow: hidden; }
.row-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.row-tags:empty { display: none; }
.row-tag { font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: 0.04em;
  color: var(--ink); border: 1px solid rgba(168,85,247,0.45); border-radius: 999px; padding: 1px 7px; }
.row-note { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.row-note:empty { display: none; }
.row.blocked .row-title { color: var(--muted); }
.discovery-child .row-main { padding-left: 16px; }

/* AdShield settings panel (rendered by the module, styled in drawer voice). */
.adshield-settings { display: flex; flex-direction: column; gap: 4px; }
.adshield-row { display: flex; justify-content: space-between; align-items: center;
  min-height: 44px; color: var(--paper); font-size: 15px; cursor: pointer; }
.adshield-row select { background: #0d0618; color: var(--paper);
  border: 1px solid rgba(168,85,247,0.5); border-radius: 8px; min-height: 36px;
  padding: 0 8px; font: 500 14px Rajdhani, sans-serif; }
.adshield-row input[type="checkbox"] { accent-color: var(--accent); width: 20px; height: 20px; }
.adshield-note { color: var(--muted); font-size: 13px; line-height: 1.45; margin: 0; }
/* Bank Lite (rendered by modules/banker into the drawer, same voice). */
.bank-summary { margin-bottom: 6px; }
.bank-bar { height: 6px; border-radius: 3px; background: rgba(168,85,247,0.22); overflow: hidden; margin: 6px 0 10px; }
.bank-bar-fill { height: 100%; background: var(--accent); border-radius: 3px; }
.bank-item { display: flex; align-items: flex-start; gap: 10px; width: 100%;
  padding: 10px 2px; border-bottom: 1px solid rgba(168,85,247,0.14); }
.bank-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bank-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.bank-item .bank-acts { margin-top: 0; flex: 0 0 auto; flex-direction: column; align-items: stretch; }
.bank-act { background: none; border: 1px solid rgba(168,85,247,0.55); color: var(--paper);
  border-radius: 8px; min-height: 36px; padding: 4px 10px; font: 500 13.5px Rajdhani, sans-serif; cursor: pointer; }
.bank-act:active { background: rgba(88,28,135,0.3); }
.bank-show { font: 600 14.5px Rajdhani, sans-serif; color: var(--ink); margin: 12px 0 2px; }
.bank-log { color: var(--muted); font-size: 12.5px; line-height: 1.45; margin: 2px 0; }
.bank-podhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.row-fav { color: var(--accent); width: 14px; }
.attribution { margin-top: 12px; padding: 10px; border: 1px solid rgba(168,85,247,0.3); border-radius: 12px; }
.attribution p { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0 0 6px; }
.attribution a, #drawer-foot a { color: var(--accent-text); }
#drawer-foot { margin-top: 26px; border-top: 1px solid rgba(168,85,247,0.25); padding-top: 12px; }
#drawer-foot p { color: var(--muted); font-size: 13.5px; line-height: 1.5; }
#drawer-foot .credit { color: var(--ink); }

:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  #art, #identity > *, #brand { animation: none; }
  #drawer, #scrim, #notice { transition-duration: 120ms; }
}

/* Small phones: the brand row must never collide with the Stations pill. */
@media (max-width: 430px) {
  #brand .wordmark { font-size: 10.5px; letter-spacing: 0.1em; }
  #brand .mark { width: 28px; height: 28px; }
  #stations { padding: 0 13px; font-size: 14px; }
}
