/* ===== Ambirex Player — theme + layout ===== */
:root {
  --bg: #0b0b10; --panel: #15151f; --raised: #1e1e2c;
  --accent: #c9a24a; --accent2: #6c5ce7; --glow: #ffd86b;
  --text: #efeef5; --muted: #9a9ab0; --line: #2a2a3a;
  --font: "Spectral", Georgia, serif;
  --ui: "Inter", system-ui, sans-serif;
  --bar-h: 92px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--ui);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background .8s ease, color .8s ease;
}
#scene { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; }
#vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(120% 90% at 50% -10%, transparent 40%, rgba(0,0,0,.55) 100%);
}
#app { position: relative; z-index: 2; min-height: 100%; padding-bottom: calc(var(--bar-h) + 28px); }
.loading { padding: 30vh 0; text-align: center; color: var(--muted); font-family: var(--font); font-style: italic; }

a { color: inherit; }
button { font-family: var(--ui); cursor: pointer; }

/* ===== Shelf (Brenty's Music home) ===== */
body[data-scene="home"] {
  background:
    radial-gradient(80% 60% at 18% 8%, rgba(224,145,60,.16), transparent 60%),
    radial-gradient(80% 60% at 84% 22%, rgba(108,92,231,.18), transparent 60%),
    #07070d;
}
.shelf { max-width: 1140px; margin: 0 auto; padding: clamp(40px, 9vh, 110px) 24px 60px; }
.shelf-hero { text-align: center; margin: 0 auto clamp(36px, 7vh, 70px); max-width: 760px; }
.mark { color: var(--glow, #ffd86b); opacity: .9; margin-bottom: 14px; animation: spin 14s linear infinite; display: inline-block; filter: drop-shadow(0 0 16px rgba(255,216,107,.25)); }
@keyframes spin { to { transform: rotate(360deg); } }
.brand {
  font-family: var(--font); font-weight: 800; letter-spacing: -.01em; line-height: .98;
  font-size: clamp(46px, 11vw, 104px); margin: 0;
  background: linear-gradient(92deg, #f0b24a 0%, #ffe9b0 38%, #c9b6ff 72%, #8a7bff 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 8px 40px rgba(0,0,0,.4);
}
.tagline { color: var(--muted); margin: 18px auto 0; font-size: clamp(15px, 2.5vw, 20px);
  font-family: var(--font); font-style: italic; line-height: 1.5; }

.collection { max-width: 980px; margin: 0 auto; }
.collection-head { display: flex; align-items: baseline; justify-content: space-between;
  padding: 0 4px 14px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.ch-label { font-family: var(--font); font-weight: 700; font-size: 15px; letter-spacing: .16em; text-transform: uppercase; color: var(--text); opacity: .9; }
.ch-count { color: var(--muted); font-size: 13px; letter-spacing: .08em; }

.grid { display: grid; gap: clamp(20px, 3vw, 34px); grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.card {
  position: relative; border: 1px solid var(--line); border-radius: 20px; overflow: hidden;
  background: linear-gradient(180deg, color-mix(in srgb, var(--card-accent) 8%, #14141d), #101019);
  text-align: left; padding: 14px; color: inherit; isolation: isolate;
  transition: transform .3s cubic-bezier(.2,.7,.2,1), box-shadow .3s ease, border-color .3s ease;
}
.card::after { content: ""; position: absolute; inset: 0; border-radius: 20px; pointer-events: none;
  box-shadow: inset 0 0 0 1px transparent; transition: box-shadow .3s ease; }
.card:hover { transform: translateY(-7px); box-shadow: 0 30px 70px rgba(0,0,0,.6), 0 0 0 1px var(--card-accent); border-color: transparent; }
.card:hover::after { box-shadow: inset 0 0 50px color-mix(in srgb, var(--card-accent) 22%, transparent); }
.card-artwrap { position: relative; aspect-ratio: 1/1; border-radius: 13px; overflow: hidden; background: #000; box-shadow: 0 12px 30px rgba(0,0,0,.45); }
.card-art { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.card-art.fallback { display: grid; place-items: center; font-family: var(--font); font-size: 22px; color: var(--card-accent); }
.card:hover .card-art { transform: scale(1.05); }
.card-sheen { position: absolute; inset: 0; background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.14) 50%, transparent 60%);
  transform: translateX(-120%); transition: transform .7s ease; }
.card:hover .card-sheen { transform: translateX(120%); }
.card-play { position: absolute; right: 14px; bottom: 14px; width: 48px; height: 48px; border-radius: 999px;
  display: grid; place-items: center; background: var(--card-accent); color: #14100a; font-size: 18px;
  box-shadow: 0 10px 26px rgba(0,0,0,.5); transform: translateY(14px) scale(.85); opacity: 0; transition: all .3s cubic-bezier(.2,.7,.2,1); }
.card:hover .card-play { transform: translateY(0) scale(1); opacity: 1; }
.card-body { padding: 16px 8px 8px; display: flex; flex-direction: column; gap: 7px; }
.card-title { font-family: var(--font); font-weight: 800; font-size: clamp(21px, 3vw, 26px); line-height: 1.05; }
.card-sub { color: var(--muted); font-size: 14px; line-height: 1.45; }
.card-meta { display: flex; align-items: center; gap: 9px; margin-top: 4px; font-size: 12px;
  color: var(--card-accent); letter-spacing: .1em; text-transform: uppercase; }
.card-meta .dotsep { opacity: .5; }
.card-meta .enter { margin-left: auto; opacity: .85; }

.shelf-foot { text-align: center; color: var(--muted); opacity: .6; font-size: 12px; margin-top: clamp(40px, 7vh, 80px); letter-spacing: .04em; }

/* ===== Album view ===== */
.album { max-width: 1080px; margin: 0 auto; padding: 22px 22px 0; }
.crumb { display: inline-flex; gap: 8px; align-items: center; background: rgba(0,0,0,.25);
  border: 1px solid var(--line); color: var(--muted); padding: 7px 13px; border-radius: 999px;
  font-size: 13px; margin: 6px 0 26px; }
.crumb:hover { color: var(--text); border-color: var(--accent); }
.hero { display: grid; grid-template-columns: minmax(220px, 320px) 1fr; gap: clamp(20px, 4vw, 44px); align-items: end; }
.hero-art {
  position: relative; aspect-ratio: 1/1; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--line); box-shadow: 0 26px 60px rgba(0,0,0,.55);
  background: var(--raised);
}
.hero-art img, .hero-art object, .hero-art svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-info { padding-bottom: 6px; }
.eyebrow { color: var(--accent); letter-spacing: .18em; text-transform: uppercase; font-size: 12px; font-weight: 700; }
.album-title { font-family: var(--font); font-weight: 800; font-size: clamp(34px, 7vw, 68px); line-height: .98; margin: 10px 0 6px; }
.album-sub { color: var(--text); font-size: clamp(15px, 2.4vw, 19px); font-family: var(--font); font-style: italic; opacity: .92; }
.album-blurb { color: var(--muted); margin: 16px 0 0; max-width: 60ch; line-height: 1.6; font-size: 14.5px; }
.hero-actions { margin-top: 20px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.play-all {
  background: var(--accent); color: #16100a; border: none; font-weight: 700;
  padding: 12px 22px; border-radius: 999px; font-size: 15px; display: inline-flex; gap: 9px; align-items: center;
  transition: transform .15s ease, filter .15s ease;
}
.play-all:hover { transform: scale(1.04); filter: brightness(1.08); }
.runtime { color: var(--muted); font-size: 13px; }

/* track list */
.sides { margin: 40px 0 30px; }
.side { margin-bottom: 26px; }
.side-head { display: flex; align-items: baseline; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 6px; }
.side-id { font-family: var(--font); font-weight: 800; color: var(--accent); font-size: 18px; }
.side-name { color: var(--muted); font-size: 13.5px; font-style: italic; font-family: var(--font); }
.row {
  display: grid; grid-template-columns: 34px 1fr auto; gap: 14px; align-items: center;
  padding: 11px 12px; border-radius: 12px; cursor: pointer; transition: background .15s ease;
}
.row:hover { background: var(--raised); }
.row.active { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.row.active .row-title { color: var(--accent); }
.row-n { color: var(--muted); font-variant-numeric: tabular-nums; text-align: center; font-size: 14px; position: relative; }
.row.active .row-n .num { display: none; }
.row-n .bars { display: none; }
.row.active.playing .row-n .bars { display: inline-flex; }
.row.active.playing .row-n .num { display: none; }
.bars { gap: 2px; height: 13px; align-items: flex-end; justify-content: center; }
.bars i { width: 3px; background: var(--accent); animation: eq .9s ease-in-out infinite; }
.bars i:nth-child(2){ animation-delay:.2s } .bars i:nth-child(3){ animation-delay:.4s }
@keyframes eq { 0%,100%{height:4px} 50%{height:13px} }
.row-title { font-weight: 600; font-size: 15px; }
.row-lead { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.row-dur { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13.5px; }
.row.disabled { opacity: .4; cursor: default; }
.row.disabled:hover { background: transparent; }

.footer-note { color: var(--muted); font-size: 12px; opacity: .7; padding: 10px 2px 0; }

/* ===== Transport bar ===== */
.bar {
  position: fixed; z-index: 5; left: 0; right: 0; bottom: 0; height: var(--bar-h);
  display: grid; grid-template-columns: minmax(180px, 1fr) 2fr minmax(150px, 1fr); align-items: center; gap: 16px;
  padding: 0 18px; background: color-mix(in srgb, var(--panel) 88%, black);
  backdrop-filter: blur(14px); border-top: 1px solid var(--line);
}
.bar[hidden] { display: none; }
.bar:not([hidden]) { animation: barUp .38s cubic-bezier(.2,.7,.2,1); }
@keyframes barUp { from { transform: translateY(105%); } to { transform: translateY(0); } }
.dismiss { font-size: 13px; opacity: .55; }
.dismiss:hover { opacity: 1; color: var(--accent); }
/* when the player is dismissed, drop the page's reserved bottom space */
body.no-bar #app { padding-bottom: 40px; }
.bar-track { display: flex; align-items: center; gap: 13px; min-width: 0; }
#bar-art { width: 56px; height: 56px; border-radius: 9px; object-fit: cover; background: #000; border: 1px solid var(--line); }
.bar-meta { min-width: 0; }
.bar-title { font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-sub { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-controls { display: flex; flex-direction: column; gap: 6px; }
.buttons { display: flex; gap: 10px; justify-content: center; align-items: center; }
.icon { background: transparent; border: none; color: var(--text); font-size: 17px; opacity: .85; padding: 4px; line-height: 1; }
.icon:hover { opacity: 1; }
.icon.play {
  background: var(--accent); color: #14100a; width: 40px; height: 40px; border-radius: 999px; font-size: 16px;
  display: grid; place-items: center;
}
.seek { display: flex; align-items: center; gap: 10px; }
.t { color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; min-width: 36px; text-align: center; }
input[type=range].scrub, input[type=range].vol {
  -webkit-appearance: none; appearance: none; height: 5px; border-radius: 999px; background: var(--line); outline: none;
}
input[type=range].scrub { flex: 1; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; background: var(--accent); border: none; box-shadow: 0 0 8px var(--glow); }
input[type=range]::-moz-range-thumb { width: 13px; height: 13px; border-radius: 50%; background: var(--accent); border: none; }
.bar-extra { display: flex; align-items: center; gap: 14px; justify-content: flex-end; }
.chip { background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 7px 12px; font-size: 12.5px; }
.chip:hover { color: var(--text); border-color: var(--accent); }
.vol-wrap { display: flex; align-items: center; gap: 7px; }
.vol { width: 84px; }

@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; }
  .hero-art { max-width: 240px; }
  .bar { grid-template-columns: 1fr auto; grid-template-areas: "track extra" "controls controls"; height: auto; padding: 10px 14px 14px; gap: 10px; }
  .bar-track { grid-area: track; } .bar-extra { grid-area: extra; } .bar-controls { grid-area: controls; }
  :root { --bar-h: 128px; }
}
