/* ==========================================================================
   Beattier v4 components (website)
   Live HTML rebuilds of the app's UI pieces. Colours from tokens.css only.
   Sizes scale with --u (one app point), so any element can be oversized by
   setting --u on it or an ancestor.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  overflow-x: clip;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
:root { --u: 1px; }

/* ---- type ---------------------------------------------------------------- */
.display {
  font-family: var(--font-display);
  font-stretch: var(--display-stretch);
  font-style: italic;
  font-weight: 900;
  letter-spacing: var(--display-tracking);
  line-height: var(--display-leading);
  margin: 0;
  text-wrap: balance;
}
.display em { font-style: italic; color: var(--accent-text); }
.eyebrow {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text);
}
.lede { color: var(--text-2); font-size: clamp(17px, 1.4vw, 20px); line-height: 1.5; max-width: 34ch; margin: 0; }
.wordmark {
  font-family: var(--font-display);
  font-stretch: var(--display-stretch);
  font-style: italic;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--wordmark);
  font-size: 26px;
  line-height: 1;
}

/* ---- nav ----------------------------------------------------------------- */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--page-width); margin: 0 auto;
  height: var(--nav-h); padding: 0 var(--gutter);
  position: sticky; top: 0; z-index: 40;
}
.nav__links { display: flex; gap: 28px; font-weight: 500; font-size: 15px; color: var(--text-2); }
@media (max-width: 760px) { .nav__links { display: none; } }

/* ---- buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 52px; padding: 0 24px; border-radius: var(--radius-pill);
  font-weight: 600; font-size: 16px; white-space: nowrap;
}
.btn--sm { height: 40px; padding: 0 18px; font-size: 14px; }
.btn--accent { background: var(--accent); color: var(--on-accent); }
.btn--ink { background: var(--text); color: var(--bg); }
.btn--ghost { background: var(--card); color: var(--text); }
.btn svg { width: 18px; height: 18px; fill: currentColor; }

/* ---- score: tinted pill badge ------------------------------------------- */
[data-band="1"] { --band: var(--band-1); }
[data-band="2"] { --band: var(--band-2); }
[data-band="3"] { --band: var(--band-3); }
[data-band="4"] { --band: var(--band-4); }
[data-band="5"] { --band: var(--band-5); }
[data-band="6"] { --band: var(--band-6); }

.score {
  display: inline-grid; place-items: center;
  min-width: calc(52 * var(--u)); height: calc(32 * var(--u));
  padding: 0 calc(11 * var(--u));
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--band) var(--band-tint), transparent);
  color: var(--band);
  font-family: var(--font-display); font-stretch: var(--display-stretch);
  font-style: italic; font-weight: 900;
  font-size: calc(17 * var(--u)); letter-spacing: -0.02em; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.score--lg { --u: 1.6px; }
.score--xl { --u: 2.6px; }
/* solid disc: friend feed, overlapping the cover */
.score-dot {
  display: grid; place-items: center;
  width: calc(40 * var(--u)); height: calc(40 * var(--u));
  border-radius: 50%;
  background: var(--band); color: var(--on-band);
  font-family: var(--font-display); font-stretch: var(--display-stretch);
  font-style: italic; font-weight: 900; font-size: calc(14 * var(--u));
  letter-spacing: -0.02em;
  box-shadow: 0 0 0 calc(3 * var(--u)) var(--card-raised, var(--bg));
}

/* ---- cover --------------------------------------------------------------- */
.cover {
  aspect-ratio: 1; width: 100%; object-fit: cover;
  border-radius: calc(12 * var(--u));
  background: var(--card);
}

/* ---- album card ---------------------------------------------------------- */
.album-card {
  width: calc(240 * var(--u));
  background: var(--card-raised);
  border-radius: calc(26 * var(--u));
  padding: calc(12 * var(--u));
  box-shadow: var(--shadow-float);
  color: var(--text);
}
.album-card .cover { border-radius: calc(16 * var(--u)); }
.album-card__meta {
  display: flex; align-items: center; gap: calc(10 * var(--u));
  padding: calc(14 * var(--u)) calc(6 * var(--u)) calc(6 * var(--u));
}
.album-card__text { flex: 1; min-width: 0; }
.album-card__title {
  font-weight: 700; font-size: calc(17 * var(--u)); line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  letter-spacing: -0.01em;
}
.album-card__artist {
  color: var(--text-2); font-size: calc(14 * var(--u)); line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---- card shell ---------------------------------------------------------- */
.v4-card {
  background: var(--card);
  border-radius: calc(28 * var(--u));
  padding: calc(22 * var(--u));
  color: var(--text);
}
.v4-card--raised { background: var(--card-raised); box-shadow: var(--shadow-float); }
.v4-card__label {
  font-size: calc(13 * var(--u)); font-weight: 600; color: var(--text-2);
  letter-spacing: 0.02em; margin-bottom: calc(12 * var(--u));
}

/* ---- track rows ---------------------------------------------------------- */
.tracks { display: grid; gap: calc(2 * var(--u)); }
.track {
  display: grid; grid-template-columns: calc(24 * var(--u)) 1fr auto;
  align-items: center; gap: calc(12 * var(--u));
  padding: calc(10 * var(--u)) calc(4 * var(--u));
  border-bottom: 1px solid var(--hairline);
}
.track:last-child { border-bottom: 0; }
.track__no { color: var(--text-3); font-size: calc(14 * var(--u)); font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }
.track__name { font-weight: 600; font-size: calc(16 * var(--u)); line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track__dur { color: var(--text-3); font-size: calc(13 * var(--u)); font-weight: 400; }
.track .score { --u: inherit; }

/* ---- streak -------------------------------------------------------------- */
.streak__head { display: flex; align-items: baseline; gap: calc(8 * var(--u)); margin-bottom: calc(16 * var(--u)); }
.streak__num {
  font-family: var(--font-display); font-stretch: var(--display-stretch);
  font-style: italic; font-weight: 900; font-size: calc(44 * var(--u));
  line-height: 0.9; color: var(--accent-text); letter-spacing: -0.03em;
}
.streak__txt { font-weight: 600; font-size: calc(16 * var(--u)); }
.streak__days { display: grid; grid-template-columns: repeat(7, 1fr); gap: calc(6 * var(--u)); text-align: center; }
.streak__day { display: grid; gap: calc(6 * var(--u)); justify-items: center; font-size: calc(12 * var(--u)); font-weight: 600; color: var(--text-3); }
.streak__dot {
  width: calc(30 * var(--u)); height: calc(30 * var(--u)); border-radius: 50%;
  background: color-mix(in srgb, var(--text) 8%, transparent);
}
.streak__day.is-on .streak__dot { background: var(--accent); }
.streak__day.is-today .streak__dot { background: transparent; box-shadow: inset 0 0 0 calc(2.5 * var(--u)) var(--accent); }
.streak__day.is-on, .streak__day.is-today { color: var(--text); }

/* ---- distribution bar ---------------------------------------------------- */
.dist__bar { display: flex; gap: calc(3 * var(--u)); height: calc(14 * var(--u)); }
.dist__bar span { border-radius: var(--radius-pill); background: var(--band); }
.dist__legend { display: flex; justify-content: space-between; margin-top: calc(10 * var(--u)); font-size: calc(12 * var(--u)); font-weight: 600; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* ---- stats row ----------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: calc(10 * var(--u)); }
.stat { background: var(--card); border-radius: calc(20 * var(--u)); padding: calc(16 * var(--u)) calc(16 * var(--u)) calc(14 * var(--u)); }
.stat__num {
  font-family: var(--font-display); font-stretch: var(--display-stretch);
  font-style: italic; font-weight: 900; font-size: calc(30 * var(--u));
  line-height: 1; letter-spacing: -0.03em;
}
.stat__num[data-band] { color: var(--band); }
.stat__lbl { color: var(--text-2); font-size: calc(13 * var(--u)); font-weight: 500; margin-top: calc(6 * var(--u)); }

/* ---- monthly review (always violet) -------------------------------------- */
.monthly {
  background: var(--violet-500); color: var(--white);
  border-radius: calc(30 * var(--u)); padding: calc(22 * var(--u));
  position: relative; overflow: hidden;
  --text-2: rgba(255, 255, 255, 0.75);
}
.monthly__kicker { font-size: calc(13 * var(--u)); font-weight: 600; opacity: 0.8; letter-spacing: 0.04em; text-transform: uppercase; }
.monthly__title {
  font-family: var(--font-display); font-stretch: var(--display-stretch);
  font-style: italic; font-weight: 900; font-size: calc(34 * var(--u));
  line-height: 0.92; letter-spacing: -0.035em; margin: calc(6 * var(--u)) 0 calc(18 * var(--u));
}
.monthly__top { display: flex; align-items: center; gap: calc(12 * var(--u)); background: rgba(255, 255, 255, 0.14); border-radius: calc(18 * var(--u)); padding: calc(10 * var(--u)); }
.monthly__top img { width: calc(56 * var(--u)); height: calc(56 * var(--u)); border-radius: calc(10 * var(--u)); object-fit: cover; }
.monthly__top b { display: block; font-size: calc(15 * var(--u)); line-height: 1.2; }
.monthly__top small { font-size: calc(13 * var(--u)); color: var(--text-2); }
.monthly__nums { display: flex; gap: calc(20 * var(--u)); margin-top: calc(16 * var(--u)); }
.monthly__nums div { font-size: calc(12 * var(--u)); color: var(--text-2); font-weight: 500; }
.monthly__nums b { display: block; font-family: var(--font-display); font-stretch: var(--display-stretch); font-style: italic; font-weight: 900; font-size: calc(24 * var(--u)); color: var(--white); letter-spacing: -0.03em; line-height: 1.05; }
/* score pill sitting on violet: white chip so the band colour stays legible */
.monthly .score { background: var(--white); }

/* ---- feed card ----------------------------------------------------------- */
.feed {
  display: grid; grid-template-columns: calc(64 * var(--u)) minmax(0, 1fr); gap: calc(14 * var(--u));
  align-items: center;
  background: var(--card-raised); border-radius: calc(24 * var(--u));
  padding: calc(12 * var(--u)) calc(16 * var(--u)) calc(12 * var(--u)) calc(12 * var(--u));
  box-shadow: var(--shadow-soft);
  color: var(--text);
}
.feed__art { position: relative; }
.feed__art .cover { border-radius: calc(12 * var(--u)); }
.feed__art .score-dot { --u: inherit; position: absolute; right: calc(-10 * var(--u)); bottom: calc(-8 * var(--u)); width: calc(34 * var(--u)); height: calc(34 * var(--u)); font-size: calc(12.5 * var(--u)); }
.feed__who { font-size: calc(14 * var(--u)); color: var(--text-2); line-height: 1.35; }
.feed__who b { color: var(--text); font-weight: 600; }
.feed__album { font-weight: 700; font-size: calc(16 * var(--u)); line-height: 1.25; margin-top: calc(2 * var(--u)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed__change { display: flex; align-items: center; gap: calc(8 * var(--u)); margin-top: calc(8 * var(--u)); font-size: calc(13 * var(--u)); color: var(--text-3); font-weight: 500; }
.feed__change s { text-decoration-thickness: 1.5px; }
.feed__time { color: var(--text-3); font-size: calc(12 * var(--u)); }

/* ---- utilities ----------------------------------------------------------- */
.wrap { max-width: var(--page-width); margin: 0 auto; padding: 0 var(--gutter); }
.tilt-l { transform: rotate(-6deg); }
.tilt-r { transform: rotate(5deg); }
.app-badge svg { width: 20px; height: 20px; }

/* ---- per-track score spark (bar per track, band coloured) --------------- */
.spark { display: flex; align-items: flex-end; gap: calc(6 * var(--u)); height: calc(150 * var(--u)); }
.spark span { flex: 1; border-radius: calc(6 * var(--u)); background: var(--band); min-width: 0; }
