/* bls.studio listener app — black + chrome, each track tints the glow with its own hue (--h). */

:root {
  --h: 250;
  --bg: #050505;
  --panel: #0c0c0c;
  --fg: #f2f2f2;
  --fg-hi: #f4f4f4;
  --text-2: #c8c8c8;
  --muted: #a8a8a8;
  --dim: #7a7a7a;
  --line: #2e2e2e;
  --line-2: #3a3a3a;
  --chrome: linear-gradient(180deg, #f2f2f2, #cfcfcf);
  --glow: oklch(0.26 0.03 var(--h));
  --glow-shadow: oklch(0.45 0.06 var(--h) / 0.5);
  --sans: 'Cairo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; min-height: 100dvh; }
h1, h2, p { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
a { color: #d8d8d8; text-decoration: none; }
a:hover { color: #fff; }
:focus-visible { outline: 2px solid #f2f2f2; outline-offset: 2px; border-radius: 3px; }
img { display: block; }
[hidden] { display: none !important; }

/* ---------- shared pieces ---------- */

.ph { background: repeating-linear-gradient(135deg, #1a1a1a 0 10px, #262626 10px 20px); border: 1px solid var(--line-2); }
.cover { display: block; position: relative; overflow: hidden; border-radius: 3px; flex: none; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.thumb { width: 46px; height: 46px; }

.link { font-size: 13px; color: #d8d8d8; white-space: nowrap; }
.link:hover { color: #fff; }

.play-btn {
  flex: none; width: 42px; height: 42px; border-radius: 50%; padding: 0; overflow: hidden;
  background: #e8e8e8; color: #1f1f1f;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .12s ease;
}
.play-btn:active { transform: scale(.94); }
.play-btn svg { width: 100%; height: 100%; display: block; fill: currentColor; }
.play-btn.xl { width: 76px; height: 76px; }
.icon-btn { color: var(--fg); display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; }
.icon-btn:hover { background: rgba(255, 255, 255, .06); }
.icon-btn svg { width: 22px; height: 22px; }

.wave { display: flex; align-items: center; gap: 2px; height: 70px; cursor: pointer; touch-action: none; }
.wave .b { flex: 1; min-width: 1px; border-radius: 1px; background: var(--line); height: 20%; transition: background .15s; }
.wave .b.on { background: linear-gradient(180deg, #fff, #9a9a9a); }

.kicker { font-size: 11px; letter-spacing: .3em; color: var(--muted); text-transform: uppercase; }

.piano { display: inline-block; width: 17px; height: 17px; margin-left: 8px; vertical-align: -3px; filter: invert(1); opacity: .9; }
.np-title .piano { width: 16px; height: 16px; }
.sh-title .piano { width: 24px; height: 24px; vertical-align: -4px; }

/* site fades in on load and after the Enter gate (design: siteIn 1.4s) */
@keyframes siteIn { from { opacity: 0; } to { opacity: 1; } }
.app { animation: siteIn 1.4s ease both; }
html.gated .app, html.gated .sheet { visibility: hidden; animation: none; }

/* ---------- mobile-first layout ---------- */

.app { padding-bottom: calc(96px + var(--safe-b)); }
.side, .feature, .about { display: none; }
.main { max-width: 680px; margin: 0 auto; }

.artist {
  position: relative; height: 280px; padding: 22px; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 2px;
}
.artist-portrait { position: absolute; inset: 0; border: 0; }
.artist-portrait.ph { background: repeating-linear-gradient(135deg, #161616 0 12px, #1f1f1f 12px 24px); }
.artist-portrait img { width: 100%; height: 100%; object-fit: cover; }
.artist-fade { position: absolute; left: 0; right: 0; bottom: 0; height: 160px; background: linear-gradient(180deg, transparent, var(--bg)); }
.artist-tag { position: relative; font-size: 11px; letter-spacing: .32em; color: #b8b8b8; text-transform: uppercase; }
.artist-name { position: relative; font-size: 46px; font-weight: 700; line-height: 1.05; color: var(--fg-hi); }

.bio { padding: 16px 22px 0; font-size: 15px; line-height: 1.55; color: var(--muted); }

.chips { display: flex; gap: 8px; padding: 16px 22px 4px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  --gh: 0;
  flex: none; white-space: nowrap; padding: 7px 15px; border-radius: 3px;
  font: 600 13px var(--sans);
  border: 1px solid oklch(0.5 0.09 var(--gh)); background: #0e0e0e; color: oklch(0.78 0.12 var(--gh));
}
.chip[aria-pressed="true"] { background: oklch(0.78 0.12 var(--gh)); border-color: oklch(0.78 0.12 var(--gh)); color: #000; }
.chip.all { border-color: var(--line-2); color: #d8d8d8; }
.chip.all[aria-pressed="true"] { background: var(--chrome); border-color: #fff; color: #000; }

.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 18px 22px 10px; }
.sec-head h2 { font-size: 18px; font-weight: 600; white-space: nowrap; }
.count { font-size: 12px; color: var(--dim); font-weight: 400; }
#tracks .sec-head { padding-bottom: 6px; }

.albums { display: flex; gap: 14px; overflow-x: auto; padding: 0 22px 8px; scrollbar-width: none; }
.albums::-webkit-scrollbar { display: none; }
.album { flex: none; width: 130px; transition: opacity .2s; }
.album.dim { opacity: .35; }
.album .cover { width: 100%; aspect-ratio: 1; }
.album-name { font-size: 16px; font-weight: 700; margin-top: 8px; line-height: 1.1; }
.album-meta { font-size: 14px; color: #d3d3d3; font-weight: 600; line-height: 1.1; margin-top: 2px; }

.tracks { list-style: none; margin: 0; padding: 0; }
.row {
  width: 100%; display: flex; align-items: center; gap: 14px; padding: 10px 22px;
  border-left: 2px solid transparent;
}
.row:hover { background: rgba(255, 255, 255, .04); }
.row.on { background: linear-gradient(90deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .02)); border-left-color: #e8e8e8; }
.row .n, .row .c-style, .row .c-album { display: none; }
.row .meta { flex: 1; min-width: 0; }
.row .title { display: block; font-size: 16px; font-weight: 700; line-height: 1.1; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.on .title { color: #fff; }
.row .sub { display: block; font-size: 12px; color: var(--dim); margin-top: 2px; }
.row .time { font-size: 14px; color: #c6c6c6; font-weight: 600; font-variant-numeric: tabular-nums; }
.row .eq { display: none; }
.row.on.playing .eq { display: inline-flex; }

.eq { gap: 2px; align-items: flex-end; height: 12px; margin-right: 6px; vertical-align: middle; }
.eq i { width: 2px; background: #fff; animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.4s; }
.eq i:nth-child(3) { animation-delay: -.7s; }
@keyframes eq { 0%, 100% { height: 3px; } 50% { height: 12px; } }

.empty { padding: 8px 22px 24px; color: var(--muted); font-size: 15px; }
.foot { padding: 28px 22px 12px; font-size: 12px; color: #5a5a5a; }

/* mini player (mobile) */
.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  height: calc(84px + var(--safe-b)); padding: 0 16px var(--safe-b);
  display: flex; align-items: center; gap: 12px;
  background: var(--panel); border-top: 1px solid var(--line);
}
.bar-prog { position: absolute; left: 0; right: 0; top: -1px; height: 2px; background: rgba(255, 255, 255, .1); }
.bar-prog i { display: block; height: 2px; width: 0; background: var(--chrome); }
.np { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; }
.np-text { min-width: 0; display: flex; flex-direction: column; }
.np-title { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-sub { font-size: 12px; color: var(--muted); }
.ctrls { display: flex; align-items: center; gap: 16px; }
.ctrls .skip, .ctrls .t, .ctrls .wave, .vol { display: none; }

/* full player sheet (mobile) */
.sheet {
  position: fixed; inset: 0; z-index: 40; overflow-y: auto;
  background: radial-gradient(ellipse at 50% 20%, var(--glow), var(--bg) 65%);
  transform: translateY(100%); transition: transform .35s ease, background .6s ease;
}
.sheet.open { transform: none; }
.sheet-inner {
  min-height: 100%; max-width: 480px; margin: 0 auto;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 26px calc(30px + var(--safe-b));
  display: flex; flex-direction: column; gap: 20px;
}
.sheet-top { display: flex; justify-content: space-between; align-items: center; }
.sheet-top .link { font-size: 15px; color: var(--fg); padding: 6px 0; }
.sheet-top .spacer { width: 50px; }
.cover.big {
  width: min(76%, 34vh); aspect-ratio: 1; align-self: center; border-radius: 4px;
  box-shadow: 0 20px 60px var(--glow-shadow), 0 0 0 1px #6a6a6a; border: 0;
}
.sh-title { font-size: 30px; font-weight: 700; line-height: 1.1; color: var(--fg-hi); }
.sh-sub { font-size: 14px; color: var(--muted); margin-top: 5px; }
.sh-sub .mono { font: 11px var(--mono); color: var(--dim); }
.viz { flex: none; width: 100%; height: 110px; cursor: pointer; }
.wave.tall { height: 36px; flex: none; }
.sh-notes { font-size: 14px; line-height: 1.55; color: var(--muted); white-space: pre-line; }
.times { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: -12px; font-variant-numeric: tabular-nums; }
.sheet-ctrls { display: flex; align-items: center; justify-content: center; gap: 34px; margin-top: auto; }

.toast {
  position: fixed; left: 50%; bottom: calc(100px + var(--safe-b)); transform: translateX(-50%); z-index: 50;
  padding: 10px 16px; border-radius: 6px; background: #1a1a1a; border: 1px solid var(--line-2); font-size: 14px;
}

@media (prefers-reduced-motion: reduce) {
  .sheet { transition: none; }
  .eq i { animation: none; height: 8px; }
}

/* ---------- Enter gate ---------- */
/* One large icon in the middle: the play disc morphs into a playable piano icon
   (light tile, dark frame, 3 white + 2 black keys — the Material "piano" glyph at icon scale). */

.gate {
  position: fixed; inset: 0; z-index: 100; overflow-y: auto;
  background: radial-gradient(ellipse at 50% 38%, #1b1b1b, #000 64%);
  color: var(--fg); font-family: var(--sans); line-height: 1.3;
  transition: opacity 1s ease;
}
.gate.fading { opacity: 0; pointer-events: none; }
.gate-inner {
  min-height: 100%; max-width: 600px; margin: 0 auto; position: relative;
  display: flex; flex-direction: column; align-items: center;
  padding: calc(clamp(18px, 7vh, 72px) + env(safe-area-inset-top, 0px)) 16px calc(clamp(16px, 4vh, 36px) + var(--safe-b));
}
.gate-title { flex: none; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.gate-kicker { font-size: 11px; letter-spacing: .3em; padding-left: .3em; color: #8a8a8a; text-transform: uppercase; white-space: nowrap; }
.gate-name { font-size: clamp(26px, 4.6vh, 34px); font-weight: 700; line-height: 1.1; color: var(--fg-hi); }

.gate-stage { flex: 1; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(18px, 3.5vh, 30px); padding: 24px 0 8px; }

/* the icon slot: both states share it */
.gate-icon { --pz: clamp(200px, min(66vw, 40vh), 300px); position: relative; width: var(--pz); height: var(--pz); flex: none; }
.gate-icon.shake { animation: gateShake .4s; }
@keyframes gateShake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-10px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }

.gate-play {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%;
  width: 46%; height: 46%; border-radius: 50%; padding: 0; overflow: hidden;
  background: #e8e8e8; color: #1f1f1f;
  box-shadow: 0 0 0 1px #8a8a8a, 0 0 50px rgba(255, 255, 255, .14);
  transition: opacity .45s ease, scale .45s ease, box-shadow .2s;
}
.gate-play svg { width: 100%; height: 100%; display: block; fill: currentColor; }
.gate-play:hover { box-shadow: 0 0 0 1px #bdbdbd, 0 0 60px rgba(255, 255, 255, .22); }
.gate-play:active { scale: .96; }

.gate-piano {
  position: absolute; inset: 0; padding: 7%;
  background: #e8e8e8; border-radius: 22%;
  box-shadow: 0 0 0 1px #8a8a8a, 0 0 60px rgba(255, 255, 255, .12);
  opacity: 0; scale: .55; pointer-events: none;
  transition: opacity .5s ease, scale .55s cubic-bezier(.2, .9, .25, 1.05), box-shadow .25s ease;
}
.gate-frame { width: 100%; height: 100%; padding: 8%; background: #1f1f1f; border-radius: 17%; }
.gate-keys { position: relative; width: 100%; height: 100%; display: flex; gap: 4%; border-radius: 6% 6% 9% 9%; overflow: hidden; }

/* morph: closed shows the play disc; any later phase shows the piano icon */
.gate:not([data-phase="closed"]) .gate-play { opacity: 0; scale: .7; pointer-events: none; }
.gate:not([data-phase="closed"]) .gate-piano { opacity: 1; scale: 1; pointer-events: auto; }
.gate-piano.glow { box-shadow: 0 0 0 1px #9fd0f5, 0 0 70px rgba(150, 205, 255, .42); }

.gate-key {
  display: flex; align-items: flex-end; justify-content: center; padding: 0; cursor: pointer;
  transition: background .1s, transform .08s; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.gate-key.white { flex: 1; padding-bottom: 12%; background: #e8e8e8; }
.gate-key.black {
  position: absolute; top: 0; width: 18%; height: 58%; z-index: 2; padding-bottom: 9%;
  background: #1f1f1f; border-radius: 0 0 14% 14% / 0 0 8% 8%;
  box-shadow: 0 0 0 3px #1f1f1f;   /* keeps a clean gap to the white keys, like the icon */
}
.gate-piano[data-input] .gate-key.white:hover { background: #f6f6f6; }
.gate-piano[data-input] .gate-key.black:hover { background: #2c2c2c; }
.gate-key.white.lit { background: linear-gradient(180deg, #e6f3ff, #a9cbe8); }
.gate-key.black.lit { background: linear-gradient(180deg, #7ab4e4, #2f6290); }
.gate-key:active { transform: translateY(1px); }
.gate-key:focus-visible { outline: 3px solid #4f8fc4; outline-offset: -6px; }
.gate-dot {
  flex: none; width: 22%; aspect-ratio: 1; border-radius: 50%; border: 2px solid transparent;
  opacity: 0; transform: scale(.4); transition: opacity .3s ease, transform .3s ease;
}
.gate-key.black .gate-dot { width: 40%; }
.gate-key.lit .gate-dot { opacity: 1; transform: scale(1); background: #fff; border-color: #1f1f1f; }
.gate-key.black.lit .gate-dot { border-color: #fff; background: #bfe0ff; }

.gate-msg { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; min-height: 86px; }
.gate[data-phase="closed"] .gate-head, .gate[data-phase="closed"] .gate-dots { display: none; }
.gate-head { font-size: 22px; font-weight: 600; min-height: 1.3em; }
.gate-sub { font-size: 14px; color: #8a8a8a; max-width: 420px; padding: 0 12px; }
.gate-dots { display: flex; gap: 10px; height: 10px; }
.gate-dots span { width: 10px; height: 10px; border-radius: 50%; background: #2e2e2e; transition: background .15s; }
.gate-dots span.on { background: #f2f2f2; }

.gate-actions { flex: none; min-height: 44px; display: flex; justify-content: center; align-items: center; }
.gate-ghost { padding: 10px 26px; border-radius: 3px; border: 1px solid #3a3a3a; color: #d8d8d8; font: 700 14px var(--sans); }
.gate-ghost:hover { border-color: #6a6a6a; color: #fff; }
.gate-skip { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); right: 14px; font-size: 12px; color: #6a6a6a; padding: 6px 8px; }
.gate-skip:hover { color: #d8d8d8; }

@media (min-width: 900px) {
  .gate-inner { justify-content: center; padding-top: 56px; padding-bottom: 40px; }
  .gate-stage { flex: none; padding-top: 40px; }
  .gate-icon { --pz: clamp(240px, 36vh, 320px); }
  .gate-kicker { font-size: 12px; letter-spacing: .42em; padding-left: .42em; }
  .gate-name { font-size: 44px; letter-spacing: .02em; }
}
@media (prefers-reduced-motion: reduce) {
  .gate-piano, .gate-play { transition-duration: .2s; }
  .gate-icon.shake { animation: none; }
  .app { animation-duration: .3s; }
}

/* ---------- desktop ---------- */

@media (min-width: 900px) {
  .app {
    display: grid; grid-template-columns: 228px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto;
    height: 100vh; height: 100dvh; padding: 0;
  }
  .side {
    grid-row: 1; display: flex; flex-direction: column; gap: 22px; padding: 26px 18px; overflow-y: auto;
    background: #080808; border-right: 1px solid #161616;
  }
  .brand { display: flex; align-items: center; gap: 10px; color: var(--fg); }
  .brand-logo { width: 34px; height: 34px; border-radius: 3px; overflow: hidden; flex: none; }
  .brand-logo img { width: 100%; height: 100%; object-fit: cover; }
  .brand-name { font-size: 12px; letter-spacing: .22em; font-weight: 600; line-height: 1.3; text-transform: uppercase; }
  .side-nav { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
  .side-nav a { padding: 8px 12px; border-radius: 3px; color: #9a9a9a; }
  .side-nav a.on, .side-nav a:hover { color: var(--fg); background: rgba(255, 255, 255, .07); }
  .side-label { font-size: 11px; letter-spacing: .2em; color: var(--dim); text-transform: uppercase; margin-bottom: -12px; }
  .side-styles { display: flex; flex-direction: column; gap: 2px; }
  .side-style { --gh: 0; display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: 3px; font-size: 14px; color: #9a9a9a; }
  .side-style::before { content: ''; width: 7px; height: 7px; border-radius: 2px; background: oklch(0.7 0.12 var(--gh)); }
  .side-style.all::before { background: var(--chrome); }
  .side-style:hover { color: var(--fg); }
  .side-style[aria-pressed="true"] { color: oklch(0.82 0.11 var(--gh)); background: rgba(255, 255, 255, .07); }
  .side-style.all[aria-pressed="true"] { color: var(--fg); }

  .main { grid-row: 1; max-width: none; margin: 0; overflow-y: auto; scroll-behavior: smooth; }
  .artist, .bio, .chips { display: none; }

  .feature {
    display: flex; gap: 32px; align-items: flex-end; padding: 44px 40px 36px;
    background: radial-gradient(ellipse at 12% 0%, var(--glow), var(--bg) 72%);
    transition: background .6s ease;
  }
  .feature .cover { width: 208px; height: 208px; border-radius: 4px; box-shadow: 0 20px 50px var(--glow-shadow), 0 0 0 1px #4a4a4a; border: 0; }
  .feature-info { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
  .feature-style { font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: oklch(0.8 0.1 var(--h)); }
  .feature-title { font-size: clamp(36px, 4vw, 52px); font-weight: 700; line-height: 1.02; color: var(--fg-hi); }
  .feature-meta { font-size: 14px; color: #c3c3c3; }
  .feature .pill {
    align-self: flex-start; margin-top: 8px; padding: 10px 30px; border-radius: 999px;
    background: var(--chrome); color: #000; font-weight: 700; font-size: 15px;
  }

  .sec-head { padding: 26px 40px 12px; }
  .albums { gap: 18px; padding: 0 40px 10px; scrollbar-width: thin; }
  .album { width: 150px; cursor: pointer; }

  .tracks { padding: 0 28px 24px; }
  .row { gap: 16px; padding: 8px 12px; border-radius: 3px; border-left: 0; }
  .row.on { background: rgba(255, 255, 255, .07); }
  .row .n { display: block; width: 24px; text-align: right; font-size: 13px; color: var(--dim); font-variant-numeric: tabular-nums; }
  .row.on.playing .n { display: none; }
  .row.on.playing .eq { width: 24px; justify-content: flex-end; margin: 0; }
  .row .thumb { width: 40px; height: 40px; }
  .row .title { font-size: 15px; font-weight: 600; }
  .row .sub { display: none; }
  .row .c-style { display: block; width: 130px; font-size: 13px; color: #9a9a9a; }
  .row .c-album { display: block; width: 170px; font-size: 13px; color: #9a9a9a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .row .time { width: 48px; font-size: 13px; color: #9a9a9a; font-weight: 500; text-align: right; }

  .about { display: block; }
  .about p { padding: 0 40px; max-width: 720px; font-size: 16px; line-height: 1.65; color: var(--muted); white-space: pre-line; }
  .empty { padding: 8px 40px 24px; }
  .foot { padding: 36px 40px 24px; }

  .bar {
    position: static; grid-column: 1 / 3; grid-row: 2; height: 88px; padding: 0 24px;
    display: grid; grid-template-columns: minmax(200px, 280px) minmax(0, 1fr) minmax(140px, 200px); gap: 28px;
    background: #090909; border-top: 1px solid #1c1c1c;
  }
  .bar-prog { display: none; }
  .np { cursor: default; }
  .ctrls .skip, .ctrls .t, .vol { display: flex; }
  .ctrls .wave { display: flex; flex: 1; height: 44px; }
  .ctrls .t { font-size: 12px; color: var(--muted); width: 36px; justify-content: center; font-variant-numeric: tabular-nums; }
  .ctrls .play-btn { width: 44px; height: 44px; }
  .ctrls .skip svg { width: 18px; height: 18px; }
  .vol { align-items: center; gap: 10px; justify-self: end; width: 100%; color: var(--muted); }
  .vol-icon svg { width: 18px; height: 18px; display: block; }
  .vol input { flex: 1; accent-color: #d8d8d8; }

  .sheet { display: none; }
  .toast { bottom: 108px; }
}
