:root {
  --pad-m: 16px;
  --bg: #0d0c0b;
  --bg-2: #151311;
  --bg-3: #1d1a17;
  --line: rgba(236, 228, 214, 0.09);
  --text: #ece4d6;
  --muted: #9b9184;
  --faint: #6a6259;
  --amber: #c9a063;
  --amber-soft: rgba(201, 160, 99, 0.16);
  --serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --pad: 16px;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { overflow-x: clip; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 15px; line-height: 1.5; font-weight: 400;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.page { max-width: 760px; margin: 0 auto; padding: 0 var(--pad) 48px; }

/* ---------- skeletons ---------- */
.skel { background: linear-gradient(100deg, var(--bg-3) 30%, #26221e 50%, var(--bg-3) 70%); background-size: 300% 100%; animation: shimmer 1.6s ease-in-out infinite; border-radius: 8px; }
.skel-text { display: inline-block; height: .9em; vertical-align: middle; border-radius: 4px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* ---------- header ---------- */
.profile { position: sticky; top: 0; z-index: 10; display: grid; grid-template-columns: auto 1fr auto; gap: 0 12px; align-items: center;
  margin: 0 calc(var(--pad) * -1); padding: calc(env(safe-area-inset-top) + 10px) var(--pad) 9px;
  background: rgba(13,12,11,.78); backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid var(--line); transition: padding .25s ease; }
.profile .avatar, .profile .username, .profile .since { transition: all .25s ease; }
.profile .since { max-height: 18px; overflow: hidden; }
.profile.shrunk { padding-top: calc(env(safe-area-inset-top) + 6px); padding-bottom: 6px; }
.profile.shrunk .avatar { width: 32px; height: 32px; }
.profile.shrunk .username { font-size: 18px; }
.profile.shrunk .since { max-height: 0; opacity: 0; }
.profile.shrunk .stats { margin-top: 5px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: var(--bg-3); box-shadow: 0 0 0 1px var(--line); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.username { font-family: var(--serif); font-weight: 400; font-size: 21px; line-height: 1.1; margin: 0; letter-spacing: -0.01em; font-variation-settings: 'opsz' 72; }
.since { color: var(--muted); font-size: 11.5px; line-height: 1.3; }
.lang { align-self: start; display: flex; gap: 2px; }
.lang button { appearance: none; background: none; border: 0; padding: 4px 5px; font: 500 10px var(--sans); letter-spacing: .12em; color: var(--faint); cursor: pointer; border-radius: 4px; }
.lang button[aria-pressed="true"] { color: var(--amber); }
.lang button:hover { color: var(--text); }
.stats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, auto); justify-content: start; margin: 8px 0 0; }
.stats > div { padding: 0 10px; border-left: 1px solid var(--line); display: flex; align-items: baseline; gap: 5px; white-space: nowrap; }
.stats > div:first-child { padding-left: 0; border-left: 0; }
.stats dt { font-size: 8.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); order: 2; }
.stats dd { margin: 0; font-family: var(--serif); font-size: 14px; font-weight: 400; font-variant-numeric: tabular-nums lining-nums; }


.name-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.follow { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px 0 6px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font: 500 13px/1 var(--sans); transition: color .2s, border-color .2s, background .2s; flex: none; }
.follow svg { width: 13.5px; height: 13.5px; color: #1db954; opacity: .85; }
.follow:hover { color: var(--text); border-color: rgba(29,185,84,.5); background: rgba(29,185,84,.08); }
button.play.hdr { width: 22px; height: 22px; flex: none; border-color: var(--line); color: var(--amber); }
button.play.hdr svg { width: 50%; height: 50%; }
button.play.hdr[hidden] { display: none; }
button.play.hdr:hover, button.play.hdr[data-state="playing"] { background: var(--amber-soft); border-color: var(--amber-soft); }
@media (min-width: 720px) { .follow { height: 26px; font-size: 14px; padding: 0 10px 0 8px; } .follow svg { width: 15.5px; height: 15.5px; } button.play.hdr { width: 26px; height: 26px; } }

/* ---------- hero ---------- */
.hero { position: relative; margin: 12px 0 4px; border-radius: 18px; overflow: hidden; background: var(--bg-2); border: 1px solid var(--line); isolation: isolate; }
.hero-glow { position: absolute; inset: -30%; background-size: cover; background-position: center; filter: blur(56px) saturate(1.5); opacity: .7; z-index: -1; transform: translateZ(0); transition: opacity .8s ease; }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(13,12,11,.15), rgba(13,12,11,.75)); z-index: -1; }
.hero-inner { padding: 12px 14px 14px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.hero-label { display: flex; align-items: center; gap: 10px; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--amber); margin-bottom: 10px; min-height: 16px; align-self: stretch; justify-content: center; }
.hero-label .ago { color: var(--muted); letter-spacing: .06em; text-transform: none; font-size: 12px; }
.hero-cover { position: relative; width: min(86%, calc(100svh - 318px)); min-width: 170px; aspect-ratio: 1; border-radius: 12px; overflow: hidden; box-shadow: 0 30px 60px -20px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.04); background: var(--bg-3); }
.hero-cover img, .hero-cover .fallback { width: 100%; height: 100%; object-fit: cover; }
.hero-text { margin-top: 12px; width: 100%; }
.hero-track { font-family: var(--serif); font-weight: 400; font-size: 23px; line-height: 1.12; margin: 0 0 3px; letter-spacing: -0.01em; font-variation-settings: 'opsz' 72; }
.hero-artist { font-size: 15px; color: var(--text); }
.hero-album { font-size: 13px; color: var(--muted); font-style: italic; font-family: var(--serif); margin-top: 2px; }
.hero.idle .hero-glow { opacity: .5; }

.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; }
.eq i { width: 2.5px; background: var(--amber); border-radius: 1px; animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.4s; } .eq i:nth-child(3) { animation-delay: -.7s; } .eq i:nth-child(4) { animation-delay: -.2s; }
@keyframes eq { 0%,100% { height: 3px; } 50% { height: 12px; } }
@media (prefers-reduced-motion: reduce) { .eq i, .skel { animation: none; } .eq i { height: 8px; } }

/* ---------- controls ---------- */
.controls { position: sticky; top: calc(var(--hdr-h, 0px) - 1px); z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 20px calc(var(--pad) * -1) 0; padding: 12px var(--pad); background: rgba(13,12,11,.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 4px; background: var(--bg-2); padding: 4px; border-radius: 999px; border: 1px solid var(--line); }
.tabs button { appearance: none; border: 0; background: transparent; color: var(--muted); font: 500 13px var(--sans); padding: 8px 15px; border-radius: 999px; cursor: pointer; transition: color .2s, background .2s; }
.tabs button[aria-selected="true"] { background: var(--text); color: var(--bg); }
.year-select select { appearance: none; -webkit-appearance: none; background: var(--bg-2) url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M1 1l4 4 4-4' stroke='%23c9a063' fill='none' stroke-width='1.4'/></svg>") no-repeat right 12px center; color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 8px 30px 8px 14px; font: 500 13px var(--sans); font-variant-numeric: tabular-nums; cursor: pointer; }
.period-caption { color: var(--faint); font-size: 12px; margin: 12px 0 0; letter-spacing: .02em; min-height: 18px; }

/* ---------- blocks ---------- */
.block { padding: 30px 0 4px; border-top: 1px solid var(--line); margin-top: 26px; }
.period-caption + .block { border-top: 0; margin-top: 4px; padding-top: 14px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; }
.block-head h3 { font-family: var(--serif); font-weight: 400; font-size: 22px; margin: 0; letter-spacing: -0.005em; font-variation-settings: 'opsz' 48; }
.block-note { color: var(--faint); font-size: 12px; }
.empty { color: var(--muted); font-size: 14px; font-style: italic; font-family: var(--serif); padding: 8px 0; }

/* artists carousel */
.carousel { display: grid; grid-auto-flow: column; grid-auto-columns: 62%; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 var(--pad); margin: 0 calc(var(--pad) * -1); padding: 0 var(--pad) 8px; scrollbar-width: none; }
.carousel { -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
.carousel::-webkit-scrollbar { display: none; }
.artist { scroll-snap-align: start; position: relative; }
.artist .img { aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--bg-3); position: relative; }
.artist .img img, .artist .img .fallback { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.artist:hover .img img { transform: scale(1.03); }
.artist .img::after { content: ''; position: absolute; inset: 0; background: radial-gradient(120% 90% at 0% 0%, rgba(13,12,11,.78) 0%, rgba(13,12,11,0) 45%); pointer-events: none; }
.artist .rank { z-index: 1; position: absolute; top: 10px; left: 12px; font-family: var(--serif); font-size: 34px; line-height: 1; color: var(--text); text-shadow: 0 2px 16px rgba(0,0,0,.6); font-variation-settings: 'opsz' 144; font-weight: 300; }
.artist .name { margin-top: 12px; font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.artist .plays { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.artist.skel-card .img { background: none; }

.fallback { display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 46px; font-weight: 300; color: rgba(236,228,214,.85); }

/* albums */
.albums { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px 14px; }
.album .img { aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--bg-3); }
.album .img img, .album .img .fallback { width: 100%; height: 100%; object-fit: cover; }
.album .fallback { font-size: 34px; }
.album .t { margin-top: 10px; font-size: 14px; font-weight: 500; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.album .a { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.album .p { font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; margin-top: 2px; }

/* tracks */
.tracks { list-style: none; margin: 0; padding: 0; }
.tracks li { display: grid; grid-template-columns: 28px minmax(0,1fr) auto; gap: 4px 12px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line); }
.tracks li:last-child { border-bottom: 0; }
.tracks .n { font-family: var(--serif); color: var(--faint); font-size: 16px; font-variant-numeric: tabular-nums lining-nums; }
.tracks .t { font-size: 14.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tracks .a { display: block; font-size: 12.5px; color: var(--muted); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tracks .c { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tracks .bar { grid-column: 2 / -1; height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; margin-top: 6px; }
.tracks .bar span { display: block; height: 100%; background: var(--amber); opacity: .85; border-radius: 2px; transform-origin: left; animation: grow .9s cubic-bezier(.2,.7,.2,1) both; }
@keyframes grow { from { transform: scaleX(0); } }

/* recent */
.recent { list-style: none; margin: 0; padding: 0; }
.recent li { display: grid; grid-template-columns: 44px minmax(0,1fr) auto; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.recent li:last-child { border-bottom: 0; }
.recent .img { width: 44px; height: 44px; border-radius: 6px; overflow: hidden; background: var(--bg-3); }
.recent .img img, .recent .img .fallback { width: 100%; height: 100%; object-fit: cover; }
.recent .fallback { font-size: 18px; }
.recent .meta { min-width: 0; }
.recent .t { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent .a { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent .when { font-size: 12px; color: var(--faint); white-space: nowrap; }
.recent .when.live { color: var(--amber); display: inline-flex; gap: 6px; align-items: center; }

/* monthly chart */
.chart { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; align-items: end; height: 190px; padding-top: 22px; }
.chart .col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 8px; }
.chart .v { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; min-height: 12px; }
.chart .b { width: 100%; max-width: 30px; background: linear-gradient(180deg, var(--amber), rgba(201,160,99,.35)); border-radius: 3px 3px 1px 1px; min-height: 2px; transform-origin: bottom; animation: rise .9s cubic-bezier(.2,.7,.2,1) both; }
.chart .b.zero { background: var(--line); }
.chart .b.future { background: transparent; border: 1px dashed var(--line); min-height: 6px; animation: none; }
.chart .m { font-size: 10.5px; color: var(--faint); text-transform: lowercase; letter-spacing: .04em; }
@keyframes rise { from { transform: scaleY(0); } }

/* error */
.error-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; color: var(--muted); font-size: 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.error-box button { background: transparent; color: var(--amber); border: 1px solid var(--amber-soft); padding: 7px 14px; border-radius: 999px; font: 500 12.5px var(--sans); cursor: pointer; }

.foot { margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--faint); font-size: 12px; text-align: center; }
.foot a { color: var(--muted); border-bottom: 1px solid var(--line); }

/* ---------- desktop ---------- */
@media (min-width: 720px) {
  :root { --pad: 36px; }
  .page { padding-top: 0; }
  .profile { padding-top: 24px; padding-bottom: 16px; }
  .profile.shrunk .avatar { width: 44px; height: 44px; }
  .profile.shrunk .username { font-size: 26px; }
  .profile { grid-template-columns: auto 1fr auto auto; gap: 0 18px; }
  .avatar { width: 64px; height: 64px; }
  .username { font-size: 34px; }
  .since { font-size: 13px; }
  .stats { grid-column: auto; margin: 0; grid-row: 1; grid-column: 3; }
  .stats > div { flex-direction: column; gap: 2px; padding: 0 20px; }
  .stats dt { order: 0; }
  .stats dd { font-size: 21px; }
  .lang { grid-column: 4; }
  .hero { margin-top: 24px; }
  .hero-inner { flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 0 32px; padding: 26px 30px 30px; text-align: left; }
  .hero-label { width: 100%; justify-content: flex-start; margin-bottom: 18px; }
  .hero-cover { width: 260px; min-width: 0; flex: none; }
  .hero-text { flex: 1; margin: 0 0 8px; min-width: 0; }
  .hero-text .links { justify-content: flex-start; }
  .hero-track { font-size: 38px; }
  .carousel { grid-auto-columns: 23%; }
  .albums { grid-template-columns: repeat(4, 1fr); }
  .chart { height: 220px; gap: 10px; }
}

/* ---------- preview player + links ---------- */
.cover-play { position: absolute; right: 10px; bottom: 10px; width: 56px; height: 56px; display: grid; place-items: center; }
.cover-play[hidden] { display: none; }
.cover-play .ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); pointer-events: none; }
.cover-play .ring circle { fill: none; stroke-width: 2; }
.cover-play .ring .bg { stroke: rgba(236,228,214,.18); }
.cover-play .ring .fg { stroke: var(--amber); stroke-linecap: round; transition: stroke-dashoffset .25s linear; }
button.play { appearance: none; border: 1px solid var(--amber-soft); background: transparent; color: var(--amber); border-radius: 50%; display: inline-grid; place-items: center; cursor: pointer; padding: 0; transition: background .2s, color .2s, border-color .2s, transform .2s; }
button.play svg { width: 55%; height: 55%; }
button.play.glass { width: 46px; height: 46px; color: var(--text); background: rgba(13,12,11,.38); border: 1px solid rgba(236,228,214,.22); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); box-shadow: 0 6px 20px rgba(0,0,0,.35); }
button.play.glass svg { width: 42%; height: 42%; }
button.play.glass:hover { background: rgba(13,12,11,.55); transform: scale(1.04); }
button.play.glass[data-state="playing"] { color: var(--amber); }
button.play.small { width: 26px; height: 26px; margin-left: 10px; vertical-align: middle; opacity: .75; }
button.play.small:hover, button.play.small[data-state="playing"] { opacity: 1; background: var(--amber-soft); }
button.play.none { opacity: .25; cursor: default; }
button.play .spin { animation: spin 0.9s linear infinite; transform-origin: center; }
@keyframes spin { to { transform: rotate(360deg); } }
.links { display: flex; justify-content: center; gap: 16px; font-size: 12px; letter-spacing: .04em; margin-top: 9px; }
.links a { color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 1px; transition: color .2s, border-color .2s; }
.links a:hover { color: var(--text); border-color: var(--amber); }
.recent .right { display: flex; align-items: center; }
.tracks .c { display: inline-flex; align-items: center; }
@media (max-width: 374px) { .stats > div { padding: 0 7px; gap: 4px; } .stats dt { letter-spacing: .05em; } .stats dd { font-size: 13.5px; } }
