/* ==========================================================
   Solfeggio Hymns · The Listening Room
   ========================================================== */
:root {
  --bg: #07060b;
  --bg-2: #0e0b14;
  --ink: #f4ece0;
  --ink-2: rgba(244, 236, 224, .72);
  --ink-3: rgba(244, 236, 224, .48);
  --line: rgba(244, 236, 224, .12);
  --glass: rgba(18, 14, 24, .62);

  /* album accent colours, swapped by JS */
  --a1: #ff9b54;
  --a2: #e8566c;
  --a3: #8e5bd6;
  --level: 0;          /* live audio level, 0..1 */
  --bass: 0;

  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --fraktur: "UnifrakturMaguntia", "Cormorant Garamond", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  --player-h: 92px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.55;
  overflow-x: hidden;
  padding-bottom: calc(var(--player-h) + env(safe-area-inset-bottom));
}
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--a1); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--a2); color: #fff; }

/* ---------- Nave (fixed atmosphere) ---------- */
.nave { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.nave__glow {
  position: absolute; inset: -20%;
  background:
    radial-gradient(40% 32% at 50% 30%, color-mix(in srgb, var(--a1) 30%, transparent), transparent 70%),
    radial-gradient(50% 40% at 30% 70%, color-mix(in srgb, var(--a3) 16%, transparent), transparent 70%),
    radial-gradient(50% 40% at 75% 75%, color-mix(in srgb, var(--a2) 14%, transparent), transparent 70%),
    radial-gradient(120% 90% at 50% 0%, #120e19 0%, var(--bg) 60%);
  opacity: calc(.7 + var(--level) * .5);
  transition: background 1.6s ease;
}
.nave__rays { position: absolute; left: 50%; top: 4vh; width: 0; height: 0; }
.nave__rays span {
  position: absolute; left: 0; top: 0;
  width: 26vmin; height: 140vh;
  transform-origin: 50% 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--a1) 34%, transparent) 0%, color-mix(in srgb, var(--a2) 10%, transparent) 40%, transparent 85%);
  filter: blur(18px);
  mix-blend-mode: screen;
  opacity: calc(.12 + var(--level) * .45);
  clip-path: polygon(42% 0, 58% 0, 100% 100%, 0 100%);
  margin-left: -13vmin;
  animation: sway 18s ease-in-out infinite alternate;
}
.nave__rays span:nth-child(1) { transform: rotate(-26deg); animation-delay: -3s; }
.nave__rays span:nth-child(2) { transform: rotate(-12deg); width: 18vmin; animation-delay: -7s; }
.nave__rays span:nth-child(3) { transform: rotate(0deg); width: 34vmin; margin-left: -17vmin; }
.nave__rays span:nth-child(4) { transform: rotate(13deg); width: 20vmin; animation-delay: -11s; }
.nave__rays span:nth-child(5) { transform: rotate(27deg); animation-delay: -5s; }
@keyframes sway { to { translate: 2vmin 0; scale: 1.06 1; } }
#motes { position: absolute; inset: 0; width: 100%; height: 100%; }
.nave__grain {
  position: absolute; inset: 0; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Top bar ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--gutter);
  padding-top: max(14px, env(safe-area-inset-top));
  background: linear-gradient(180deg, rgba(7,6,11,.85), rgba(7,6,11,0));
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--sans); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; font-weight: 500; }
.brand img { border-radius: 50%; box-shadow: 0 0 18px color-mix(in srgb, var(--a2) 60%, transparent); }
.topnav { display: flex; align-items: center; gap: clamp(12px, 3vw, 28px); font-family: var(--sans); font-size: 13px; letter-spacing: .04em; }
.topnav a { text-decoration: none; color: var(--ink-2); transition: color .2s; }
.topnav a:hover { color: var(--ink); }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.03); }
.pill svg { width: 15px; height: 15px; color: #1ed760; }
@media (max-width: 540px) { .topnav a:not(.pill) { display: none; } .brand span { display: none; } }

main { position: relative; z-index: 1; }

/* ---------- Sanctuary (hero) ---------- */
.sanctuary {
  min-height: 100svh;
  display: grid; place-items: center; align-content: center;
  gap: clamp(8px, 2vh, 24px);
  padding: 72px var(--gutter) 24px;
  text-align: center;
}
.window-wrap {
  position: relative;
  width: min(80vw, calc(100svh - 360px), 640px);
  min-width: 240px;
  aspect-ratio: 1;
}
#rose { width: 100%; height: 100%; display: block; }
.window-play {
  position: absolute; left: 50%; top: 50%;
  width: 20%; aspect-ratio: 1; translate: -50% -50%;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #fff;
  transition: transform .4s cubic-bezier(.2,.8,.2,1);
}
.window-play:hover { transform: scale(1.05); }
.window-play svg { width: 34%; height: 34%; fill: #fff; filter: drop-shadow(0 2px 10px rgba(0,0,0,.6)); position: relative; z-index: 1; transition: opacity .3s; }
.window-play__ring {
  position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle, rgba(10,8,14,.55) 0%, rgba(10,8,14,.15) 70%, transparent 72%);
  opacity: 1; transition: opacity .6s;
}
.window-play .i-pause { position: absolute; opacity: 0; }
body.is-playing .window-play .i-play { opacity: 0; }
body.is-playing .window-play__ring { opacity: 0; }
body.is-playing .window-play:hover .i-pause { opacity: .9; }
body.is-playing .window-play:hover .window-play__ring { opacity: .7; }

.sanctuary__text { max-width: 760px; }
.eyebrow {
  font-family: var(--sans); font-size: 11.5px; font-weight: 500;
  letter-spacing: .28em; text-transform: uppercase;
  color: color-mix(in srgb, var(--a1) 70%, var(--ink));
  margin: 0 0 10px;
}
.title { margin: 0; font-weight: 400; line-height: 1; }
.title__fraktur {
  font-family: var(--fraktur);
  font-size: clamp(42px, 8vw, 92px);
  background: linear-gradient(180deg, #fff8ec 10%, color-mix(in srgb, var(--a1) 55%, #f4e3c3) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 40px color-mix(in srgb, var(--a1) 25%, transparent);
  letter-spacing: .01em;
}
.now { margin: 14px 0 0; display: grid; gap: 2px; min-height: 3.2em; }
.now__track { font-size: clamp(22px, 3vw, 28px); font-style: italic; }
.now__meta { font-family: var(--sans); font-size: 13px; color: var(--ink-3); letter-spacing: .03em; }

/* ---------- Verse ---------- */
.verse { text-align: center; padding: clamp(60px, 12vh, 140px) var(--gutter); }
.verse__orn { width: 120px; color: var(--a1); opacity: .7; }
.verse blockquote { margin: 18px auto 10px; font-size: clamp(30px, 5vw, 56px); font-style: italic; line-height: 1.15; max-width: 16ch; font-weight: 400; }
.verse cite { font-family: var(--sans); font-style: normal; font-size: 12px; letter-spacing: .24em; text-transform: uppercase; color: var(--ink-3); }

/* ---------- Section heads ---------- */
.section-head { max-width: 720px; margin: 0 auto clamp(28px, 5vh, 52px); text-align: center; padding: 0 var(--gutter); }
.section-head h2 { font-size: clamp(34px, 5vw, 58px); font-weight: 500; line-height: 1.05; margin: 0 0 14px; letter-spacing: -.01em; }
.lede { color: var(--ink-2); margin: 0; font-size: clamp(18px, 1.6vw, 21px); }

/* ---------- Records ---------- */
.records { padding: clamp(40px, 8vh, 100px) 0; }
.shelf {
  display: flex; justify-content: center; gap: clamp(14px, 3vw, 34px);
  padding: 10px var(--gutter) 30px;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
}
.shelf::-webkit-scrollbar { display: none; }
.record {
  flex: 0 0 auto; width: clamp(150px, 22vw, 230px);
  scroll-snap-align: center;
  text-align: left;
  transition: transform .5s cubic-bezier(.2,.8,.2,1), opacity .4s;
  opacity: .55;
}
.record:hover { opacity: .85; transform: translateY(-4px); }
.record[aria-selected="true"] { opacity: 1; transform: translateY(-8px); }
.record__art {
  display: block; aspect-ratio: 1; border-radius: 6px; overflow: hidden; position: relative;
  box-shadow: 0 18px 40px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.06);
}
.record[aria-selected="true"] .record__art { box-shadow: 0 24px 60px rgba(0,0,0,.6), 0 0 50px color-mix(in srgb, var(--glow, #fff) 35%, transparent), 0 0 0 1px rgba(255,255,255,.14); }
.record__art img, .record__art .advent-art { width: 100%; height: 100%; object-fit: cover; }
.record__name { display: block; margin-top: 14px; font-size: 21px; line-height: 1.15; }
.record__meta { display: block; font-family: var(--sans); font-size: 12px; color: var(--ink-3); margin-top: 4px; letter-spacing: .03em; }
.record__eq { position: absolute; right: 10px; bottom: 10px; display: none; gap: 3px; align-items: flex-end; height: 18px; padding: 5px 6px; border-radius: 6px; background: rgba(0,0,0,.55); backdrop-filter: blur(6px); }
.record__eq i { width: 3px; background: #fff; border-radius: 2px; animation: eq 1s ease-in-out infinite alternate; }
.record__eq i:nth-child(2) { animation-delay: -.4s; } .record__eq i:nth-child(3) { animation-delay: -.7s; }
@keyframes eq { from { height: 3px; } to { height: 13px; } }
body.is-playing .record.is-live .record__eq { display: flex; }

/* Advent cover, drawn in CSS (no local artwork) */
.advent-art {
  position: relative; display: grid; place-items: center; text-align: center;
  background:
    radial-gradient(3px 3px at 18% 22%, #ffe9a8, transparent), radial-gradient(5px 5px at 74% 18%, #ffdd7a, transparent),
    radial-gradient(4px 4px at 82% 64%, #fff3c4, transparent), radial-gradient(3px 3px at 30% 78%, #ffd36b, transparent),
    radial-gradient(18px 18px at 25% 35%, rgba(255,205,90,.35), transparent), radial-gradient(28px 28px at 70% 30%, rgba(255,214,120,.28), transparent),
    radial-gradient(24px 24px at 62% 76%, rgba(255,196,80,.3), transparent), radial-gradient(34px 34px at 15% 70%, rgba(255,220,130,.18), transparent),
    radial-gradient(22px 22px at 88% 88%, rgba(255,200,90,.22), transparent), radial-gradient(16px 16px at 45% 12%, rgba(255,230,160,.3), transparent),
    radial-gradient(70% 60% at 50% 45%, #13224f 0%, #0a1030 55%, #05070f 100%);
  color: #f3d77e;
}
.advent-art b { font-family: var(--fraktur); font-weight: 400; font-size: clamp(20px, 3vw, 34px); line-height: 1.05; text-shadow: 0 0 16px rgba(243,215,126,.5); }
.advent-art small { display: block; margin-top: 8px; font-family: var(--sans); font-size: 9px; letter-spacing: .3em; text-transform: uppercase; color: rgba(243,215,126,.7); }

.album {
  max-width: 1080px; margin: 10px auto 0;
  padding: clamp(20px, 3vw, 40px);
  margin-inline: max(var(--gutter), calc((100% - 1080px) / 2));
  display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px);
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.01));
  border: 1px solid var(--line); border-radius: 18px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.album__art { position: relative; align-self: start; position: sticky; top: 90px; }
.album__cover { aspect-ratio: 1; border-radius: 8px; overflow: hidden; position: relative; z-index: 1; box-shadow: 0 30px 70px rgba(0,0,0,.6); }
.album__cover img, .album__cover .advent-art { width: 100%; height: 100%; object-fit: cover; }
.album__cover .advent-art b { font-size: clamp(30px, 4vw, 46px); }
.album__glow { position: absolute; inset: 8%; z-index: 0; border-radius: 50%; filter: blur(50px); background: var(--a1); opacity: calc(.25 + var(--level) * .6); transition: background 1.2s; }
.album__body h3 { font-size: clamp(34px, 4.4vw, 52px); font-weight: 500; line-height: 1; margin: 0 0 12px; }
.album__blurb { color: var(--ink-2); margin: 0 0 22px; max-width: 54ch; }
.album__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 26px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px;
  font-family: var(--sans); font-size: 14px; font-weight: 500; text-decoration: none;
  transition: transform .2s, background .2s, box-shadow .2s;
}
.btn svg { width: 16px; height: 16px; }
.btn--light { background: var(--ink); color: #120e18; box-shadow: 0 0 30px color-mix(in srgb, var(--a1) 30%, transparent); }
.btn--light:hover { transform: translateY(-1px); box-shadow: 0 0 44px color-mix(in srgb, var(--a1) 50%, transparent); }
.btn--ghost { border: 1px solid var(--line); color: var(--ink); }
.btn--ghost:hover { background: rgba(255,255,255,.05); }

.tracks { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); counter-reset: t; }
.track {
  display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 12px;
  padding: 12px 10px; border-bottom: 1px solid var(--line);
  border-radius: 8px; cursor: pointer;
  transition: background .2s;
}
.track:hover { background: rgba(255,255,255,.04); }
.track__n { font-family: var(--sans); font-size: 12px; color: var(--ink-3); text-align: center; position: relative; height: 18px; display: grid; place-items: center; }
.track__n .bars { display: none; gap: 2px; align-items: flex-end; height: 14px; }
.track__n .bars i { width: 3px; background: var(--a1); border-radius: 2px; animation: eq .9s ease-in-out infinite alternate; }
.track__n .bars i:nth-child(2) { animation-delay: -.3s; } .track__n .bars i:nth-child(3) { animation-delay: -.6s; }
.track__t { min-width: 0; }
.track__name { display: block; font-size: 20px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track__hymn { display: block; font-family: var(--sans); font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track__d { font-family: var(--sans); font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.track.is-current .track__name { color: color-mix(in srgb, var(--a1) 75%, #fff); }
body.is-playing .track.is-current .track__n .num { display: none; }
body.is-playing .track.is-current .track__n .bars { display: flex; }

@media (max-width: 820px) {
  .album { grid-template-columns: 1fr; }
  .album__art { position: relative; top: 0; max-width: 320px; width: 100%; margin: 0 auto; }
  .album__body { text-align: center; }
  .album__actions { justify-content: center; }
  .tracks { text-align: left; }
  .shelf { justify-content: flex-start; }
}

/* ---------- Tones ---------- */
.tones { padding: clamp(60px, 12vh, 140px) 0 clamp(40px, 8vh, 100px); }
.tone-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 2vw, 22px); max-width: 1080px; margin: 0 auto; padding: 0 var(--gutter); }
.tone {
  position: relative; overflow: hidden;
  text-align: left; padding: clamp(22px, 3vw, 34px);
  border: 1px solid var(--line); border-radius: 18px;
  background: linear-gradient(160deg, rgba(255,255,255,.05), rgba(255,255,255,.01));
  display: grid; gap: 6px; align-content: start;
  transition: border-color .3s, transform .3s;
}
.tone::before {
  content: ""; position: absolute; inset: -40% -40% auto auto; width: 70%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, var(--tone-c), transparent 65%); opacity: .35; transition: opacity .4s, transform .6s;
}
.tone[data-hz="285"] { --tone-c: #ff9b54; }
.tone[data-hz="396"] { --tone-c: #4f7cff; }
.tone[data-hz="528"] { --tone-c: #f4b33c; }
.tone:hover { border-color: rgba(255,255,255,.24); transform: translateY(-3px); }
.tone:hover::before, .tone.is-sounding::before { opacity: .7; transform: scale(1.2); }
.tone.is-sounding { border-color: var(--tone-c); }
.tone.is-sounding::before { animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.45); opacity: .9; } }
.tone__hz { position: relative; font-size: clamp(54px, 7vw, 84px); line-height: .9; font-weight: 500; letter-spacing: -.02em; }
.tone__hz small { font-family: var(--sans); font-size: 13px; letter-spacing: .14em; margin-left: 6px; color: var(--ink-3); }
.tone__name { position: relative; font-family: var(--sans); font-size: 12px; letter-spacing: .26em; text-transform: uppercase; color: var(--tone-c); margin-top: 8px; }
.tone__note { position: relative; color: var(--ink-2); font-size: 18px; }
.tone__hear { position: relative; margin-top: 10px; font-family: var(--sans); font-size: 12.5px; color: var(--ink-3); }
.tone.is-sounding .tone__hear { color: var(--ink); }
@media (max-width: 760px) { .tone-grid { grid-template-columns: 1fr; } }

/* ---------- Closing ---------- */
.closing { text-align: center; padding: clamp(60px, 12vh, 140px) var(--gutter); display: grid; justify-items: center; gap: 14px; }
.closing img { width: clamp(150px, 22vw, 220px); height: auto; border-radius: 50%; box-shadow: 0 0 80px color-mix(in srgb, #e8566c 45%, transparent); animation: slowspin 120s linear infinite; }
@keyframes slowspin { to { rotate: 360deg; } }
.closing h2 { font-size: clamp(30px, 4.4vw, 50px); font-weight: 500; margin: 14px 0 0; line-height: 1.05; }
.closing p { margin: 0 0 8px; color: var(--ink-2); }

.footer { position: relative; z-index: 1; text-align: center; padding: 30px var(--gutter) 40px; font-family: var(--sans); font-size: 12px; color: var(--ink-3); border-top: 1px solid var(--line); }
.footer p { margin: 4px 0; }
@media (hover: none) { .footer__keys { display: none; } }

/* ---------- Player bar ---------- */
.player {
  position: fixed; z-index: 40; left: 0; right: 0; bottom: 0;
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(1.4); -webkit-backdrop-filter: blur(22px) saturate(1.4);
  border-top: 1px solid var(--line);
}
.player__progress { position: relative; height: 16px; margin-top: -8px; cursor: pointer; touch-action: none; }
.player__progress::before, .player__buffer, .player__fill { position: absolute; left: 0; top: 7px; height: 2px; }
.player__progress::before { content: ""; right: 0; background: rgba(255,255,255,.1); }
.player__buffer { background: rgba(255,255,255,.18); width: 0; }
.player__fill { width: 0; background: linear-gradient(90deg, var(--a3), var(--a2), var(--a1)); box-shadow: 0 0 12px var(--a1); }
.player__knob { position: absolute; right: -6px; top: -5px; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 0 10px var(--a1); transform: scale(0); transition: transform .2s; }
.player__progress:hover .player__knob, .player__progress.is-drag .player__knob { transform: scale(1); }
.player__progress:hover::before, .player__progress:hover .player__buffer, .player__progress:hover .player__fill { height: 4px; top: 6px; }

.player__row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 16px; padding: 6px var(--gutter) 14px; min-height: calc(var(--player-h) - 8px); }
.player__info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.player__thumb { width: 52px; height: 52px; border-radius: 5px; overflow: hidden; flex: none; background: rgba(255,255,255,.06); box-shadow: 0 6px 18px rgba(0,0,0,.4); }
.player__thumb img, .player__thumb .advent-art { width: 100%; height: 100%; object-fit: cover; }
.player__thumb .advent-art b { font-size: 9px; } .player__thumb .advent-art small { display: none; }
.player__text { min-width: 0; display: grid; }
.player__title { font-size: 18px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player__sub { font-family: var(--sans); font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.player__controls { display: flex; align-items: center; gap: 6px; }
.ctl { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); transition: color .2s, background .2s, transform .15s; position: relative; }
.ctl:hover { color: var(--ink); background: rgba(255,255,255,.06); }
.ctl:active { transform: scale(.94); }
.ctl svg { width: 20px; height: 20px; }
.ctl--sm svg { width: 18px; height: 18px; }
.ctl--main { width: 50px; height: 50px; background: var(--ink); color: #120e18; box-shadow: 0 0 calc(18px + var(--level) * 30px) color-mix(in srgb, var(--a1) 55%, transparent); }
.ctl--main:hover { background: #fff; color: #120e18; }
.ctl--main svg { width: 22px; height: 22px; }
.ctl .i-pause, body.is-playing .ctl .i-play { display: none; }
body.is-playing .ctl .i-pause { display: block; }
.ctl[aria-pressed="true"], .ctl[data-mode="one"] { color: var(--a1); }
.ctl[aria-pressed="true"]::after, .ctl[data-mode="one"]::after { content: ""; position: absolute; bottom: 3px; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.ctl__badge { display: none; position: absolute; top: 6px; right: 6px; font-family: var(--sans); font-size: 8px; font-weight: 600; }
.ctl[data-mode="one"] .ctl__badge { display: block; }
.ctl[data-mode="off"] { color: var(--ink-3); }

.player__extra { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.player__time { font-family: var(--sans); font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; margin-right: 6px; white-space: nowrap; }
.vol { display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
.vol svg { width: 18px; height: 18px; }
.vol input { -webkit-appearance: none; appearance: none; width: 96px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--ink-2) var(--v, 85%), rgba(255,255,255,.15) var(--v, 85%)); cursor: pointer; }
.vol input::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: #fff; }
.vol input::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: #fff; }

.sleep { position: relative; }
.sleep__left { position: absolute; top: -6px; right: -10px; font-family: var(--sans); font-size: 9.5px; font-weight: 600; color: var(--a1); white-space: nowrap; }
.sleep__menu {
  position: absolute; bottom: calc(100% + 14px); right: -20px; width: 200px;
  padding: 8px; border-radius: 14px; border: 1px solid var(--line);
  background: rgba(20,16,26,.96); backdrop-filter: blur(20px);
  box-shadow: 0 20px 50px rgba(0,0,0,.5);
  opacity: 0; pointer-events: none; transform: translateY(6px); transition: opacity .2s, transform .2s;
}
.sleep__menu.is-open { opacity: 1; pointer-events: auto; transform: none; }
.sleep__menu p { margin: 4px 10px 6px; font-family: var(--sans); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.sleep__menu button { display: block; width: 100%; text-align: left; padding: 9px 10px; border-radius: 8px; font-family: var(--sans); font-size: 14px; }
.sleep__menu button:hover { background: rgba(255,255,255,.07); }
.sleep__menu button.is-active { color: var(--a1); }
.sleep__off { color: var(--ink-3); }

@media (max-width: 860px) {
  .vol, .player__time { display: none; }
}
@media (max-width: 620px) {
  :root { --player-h: 128px; }
  .player__row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "info extra" "controls controls"; row-gap: 6px; padding-bottom: 10px; }
  .player__info { grid-area: info; }
  .player__extra { grid-area: extra; }
  .player__controls { grid-area: controls; justify-content: center; gap: 14px; }
  .player__thumb { width: 44px; height: 44px; }
  .sleep__menu { right: 0; }
}

/* ---------- Room for the host's "Powered by Netlify" badge ----------
   Netlify's free plan pins a ~190×48px badge to the bottom-right corner.
   When it's present (body.has-host-badge, set in app.js) the player keeps
   that corner clear instead of letting the badge cover the controls. */
@media (min-width: 621px) {
  body.has-host-badge .player__row { padding-right: 212px; }
}
@media (max-width: 620px) {
  body.has-host-badge { --player-h: 140px; }
  body.has-host-badge .player__row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "controls extra" "info info";
    row-gap: 4px; padding-bottom: 0;
  }
  body.has-host-badge .player__controls { justify-content: flex-start; gap: 8px; }
  body.has-host-badge .player__info { min-height: 56px; padding-right: 196px; }
  body.has-host-badge .player__thumb { width: 40px; height: 40px; }
  body.has-host-badge .player__title { font-size: 16px; }
}

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 1.1s ease, transform 1.1s cubic-bezier(.2,.8,.2,1); }
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
