/* The whole site's stylesheet: the dashboard and the /music pages it links
   to are one design, so they share one file and one set of tokens. */
:root {
  color-scheme: dark;
  --bg: #0d0e11; --panel: #121417; --ink: #edeef0; --secondary: #a2a6ad;
  --muted: #7d818a; --faint: #6d717a;
  --line: rgba(255, 255, 255, .08); --hair: rgba(255, 255, 255, .07);
  --edge: rgba(255, 255, 255, .14);
  --accent: #e8b95c; --cool: #5ec2d6;
  --warm-wash: rgba(232, 185, 92, .08); --cool-wash: rgba(94, 194, 214, .09);
  --sans: "Schibsted Grotesk", Helvetica, -apple-system, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  /* Single-hue sequential ramp, faint→full: one hue, rising opacity, so the
     only thing a cell's colour encodes is how much was played that day. */
  --empty: rgba(255, 255, 255, .055);
  --seq-1: rgba(94, 194, 214, .2); --seq-2: rgba(94, 194, 214, .36);
  --seq-3: rgba(94, 194, 214, .53); --seq-4: rgba(94, 194, 214, .74);
  --seq-5: rgba(94, 194, 214, .95);
}
* { box-sizing: border-box; }
body {
  margin: 0; padding: 28px 28px 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 var(--sans);
}
main { max-width: 1420px; margin: 0 auto; display: flex; flex-direction: column;
       gap: 16px; padding-bottom: 56px; }
a { color: inherit; text-decoration: none; }
a:hover, a:focus-visible { color: var(--accent); }
h1 { font-size: 19px; font-weight: 600; letter-spacing: -.03em; margin: 0; }
h2 { font-size: 17px; font-weight: 600; letter-spacing: -.02em; margin: 0; }
h3 { font-size: 17px; font-weight: 600; letter-spacing: -.02em; margin: 0; }
p { margin: 0; }
ol, ul { list-style: none; margin: 0; padding: 0; }

/* The mono voice: every label, count and timestamp on the site, so figures
   line up in a column and never get mistaken for prose. */
.mono, .caption, .eyebrow, .count, .rank, .note, .scale, .hours, .months,
.span, .crumbs, code, th, td.n, time { font-family: var(--mono); }
.eyebrow { font-size: 11px; letter-spacing: .13em; text-transform: uppercase;
           color: var(--muted); }
.caption, .note, .mono { font-size: 11.5px; color: var(--faint); }
code { font-size: 12px; color: var(--accent); background: var(--warm-wash);
       border: 1px solid rgba(232, 185, 92, .18); border-radius: 8px; padding: 6px 10px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
        padding: 20px 22px; }
/* Every card's top line: what it is on the left, what qualifies it on the right. */
.cardtop { display: flex; align-items: baseline; justify-content: space-between;
           gap: 20px; flex-wrap: wrap; }

/* The masthead names the site, the listener, and what the site is. */
.masthead { display: flex; align-items: center; justify-content: space-between;
            gap: 24px; flex-wrap: wrap; padding-bottom: 16px;
            border-bottom: 1px solid rgba(255, 255, 255, .09); }
.brand { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mark { width: 28px; height: 28px; border-radius: 9px; background: var(--accent);
        color: var(--bg); display: flex; align-items: center; justify-content: center;
        font-size: 12px; font-weight: 700; letter-spacing: -.02em; flex: none; }
.pill { font-family: var(--mono); font-size: 11px; color: var(--muted);
        border: 1px solid rgba(255, 255, 255, .12); border-radius: 999px; padding: 3px 9px; }
.note { margin-left: 6px; }

/* Pills, not tabs: the period is a filter on the charts, not a change of page. */
.tabs { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.tabs h2 { font-family: var(--mono); font-size: 11px; letter-spacing: .13em;
           text-transform: uppercase; color: var(--muted); font-weight: 400;
           margin-right: 4px; }
.tabs a { font-size: 12.5px; font-weight: 500; border-radius: 999px; padding: 7px 13px;
          color: var(--secondary); border: 1px solid var(--edge); }
.tabs a:hover { color: var(--ink); border-color: var(--secondary); }
.tabs a[aria-current="page"] { background: var(--accent); border-color: var(--accent);
                               color: var(--bg); }

/* Two panels that share a row, the left one leading. They fall to one column
   before either gets too narrow to read. */
.split { display: flex; gap: 16px; align-items: stretch; flex-wrap: wrap; }
.split > .lead { flex: 1.35 1 30rem; min-width: 0; }
.split > .aside { flex: 1 1 20rem; min-width: 0; display: flex; flex-direction: column;
                  gap: 16px; }
/* A panel that sits beside the lead without competing with it for width. */
.split > .flank { flex: 0 1 260px; min-width: 0; }
.split.top { align-items: stretch; }
.split.top > * { display: flex; flex-direction: column; }

/* The week: one big number, seven bars, three things worth naming. */
.week { gap: 20px; }
.weekline { display: flex; align-items: flex-end; gap: 26px; flex-wrap: wrap; }
.bignum { display: flex; align-items: baseline; gap: 10px; }
.bignum b { font-size: 64px; font-weight: 600; letter-spacing: -.045em; line-height: .9; }
.bignum span { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.days { display: flex; align-items: flex-end; gap: 7px; height: 74px; }
.days div { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 32px; }
.days em { display: block; width: 100%; background: rgba(232, 185, 92, .4); border-radius: 3px; }
.days .n, .days .d { font-family: var(--mono); font-size: 10px; color: var(--faint); }
.days .quiet em { background: rgba(255, 255, 255, .07); }
.days .peak em { background: var(--accent); }
.days .peak .n, .days .peak .d { color: var(--accent); }
.highlights { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px;
              border-top: 1px solid var(--hair); padding-top: 16px; }
.highlights div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.highlights b { font-size: 15px; font-weight: 500; letter-spacing: -.015em;
                overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.highlights span:last-child { font-family: var(--mono); font-size: 11px; color: var(--muted); }

/* Now playing. It is the only card the page keeps re-fetching, so it is also
   the only one that disappears when there is nothing to say. */
#now-playing:empty { display: none; }
.now { flex: 1; display: flex; flex-direction: column; justify-content: space-between; gap: 18px; }
.now .eyebrow { color: var(--accent); display: flex; align-items: center; gap: 10px; }
.eq { display: flex; align-items: flex-end; gap: 3px; height: 14px; }
.eq i { display: block; width: 3px; height: 14px; border-radius: 2px; background: var(--accent);
        transform-origin: bottom; animation: eq .8s ease-in-out infinite; }
.eq i:nth-child(2) { animation-duration: .96s; animation-delay: .11s; }
.eq i:nth-child(3) { animation-duration: 1.13s; animation-delay: .22s; }
.eq i:nth-child(4) { animation-duration: 1.3s; animation-delay: .33s; }
@keyframes eq { 0%, 100% { transform: scaleY(.2); } 50% { transform: scaleY(1); } }
.np { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.np .track-name { font-size: 36px; line-height: 1.02; font-weight: 600; letter-spacing: -.035em;
                  text-wrap: pretty; }
.np .by { font-size: 16px; color: var(--secondary); }
.npfoot { display: flex; align-items: center; gap: 9px; font-family: var(--mono);
          font-size: 11.5px; color: var(--faint); border-top: 1px solid var(--hair);
          padding-top: 14px; }
.pulse { width: 6px; height: 6px; border-radius: 999px; background: var(--accent); flex: none;
         animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.loved { color: var(--accent); margin-left: auto; }

/* Figures share one hairline grid, so the row reads as one instrument rather
   than as six cards that happen to be adjacent. */
.figures { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line);
           border-radius: 14px; overflow: hidden; }
.figures.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.figures.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.figures.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.figures.auto { grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); }
.fig { background: var(--panel); padding: 16px 18px; display: flex; flex-direction: column;
       gap: 3px; justify-content: center; min-width: 0; }
.fig b { font-size: 26px; font-weight: 600; letter-spacing: -.035em; }
.fig span { font-family: var(--mono); font-size: 10px; letter-spacing: .11em;
            text-transform: uppercase; color: var(--muted); }
.figures.four .fig b { font-size: 23px; }

/* Chart rows. The bar is the row's own background, so the count is read off
   the number and the shape is read off the fill -- one value, two encodings. */
.chart { display: flex; flex-direction: column; gap: 12px; }
.chart li.row { position: relative; display: grid; align-items: center; gap: 12px;
                grid-template-columns: 24px minmax(0, 1fr) auto;
                padding: 8px 10px 8px 0; border-top: 1px solid var(--hair); overflow: hidden; }
.chart.wide li.row { grid-template-columns: 24px minmax(0, 1fr) 130px auto; gap: 14px;
                     padding: 9px 10px 9px 0; }
/* Rows with no rank number drop the rank column instead of squeezing the title. */
.chart .unranked li.row { grid-template-columns: minmax(0, 1fr) auto; }
.bar { position: absolute; left: 0; top: 0; bottom: 0; background: var(--warm-wash); }
.cool .bar { background: var(--cool-wash); }
.rank { position: relative; font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.body { position: relative; display: flex; flex-direction: column; min-width: 0; }
.chart.wide .body { display: contents; }
.title { display: block; font-size: 13.5px; font-weight: 500; overflow: hidden;
         text-overflow: ellipsis; white-space: nowrap; }
.chart.wide .title { position: relative; font-size: 14px; letter-spacing: -.01em; }
.by { display: block; font-size: 11.5px; color: var(--muted); overflow: hidden;
      text-overflow: ellipsis; white-space: nowrap; }
.chart.wide .by { position: relative; font-size: 12.5px; }
.count { position: relative; font-size: 12px; color: var(--secondary); white-space: nowrap;
         font-variant-numeric: tabular-nums; }

/* The recent list is a reading column, not a chart: three of them, filled
   across, so a screen's worth of history is one glance. */
.history { display: flex; flex-direction: column; gap: 12px; }
.cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 32px; }
.cols li.row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center;
               gap: 12px; padding: 8px 0; border-top: 1px solid var(--hair); }
.cols .body { min-width: 0; }
.cols time { font-size: 11px; color: var(--faint); white-space: nowrap; }

/* Columns grow from one baseline, with the peak picked out; the labels below
   repeat the same colour so the peak is named as well as shaded. */
.clock { display: flex; align-items: flex-end; gap: 5px; height: 186px; }
.clock > div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end;
               gap: 7px; height: 100%; min-width: 0; }
.clock .n { font-family: var(--mono); font-size: 10px; color: var(--faint); text-align: center; }
.clock em { display: block; background: rgba(94, 194, 214, .42); border-radius: 4px 4px 2px 2px; }
.clock .peak em { background: var(--accent); }
.clock .peak .n { color: var(--accent); }
.hours { display: flex; gap: 5px; border-top: 1px solid var(--hair); padding-top: 7px; }
.hours span { flex: 1; font-size: 10px; color: var(--faint); text-align: center; min-width: 0; }
.hours .peak { color: var(--accent); }

/* A year of days. Columns are weeks, so the cells size themselves to the card
   rather than the card scrolling to fit a fixed grid. */
.calendar { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, auto);
            grid-auto-columns: minmax(0, 1fr); gap: 3px; }
.calendar i { display: block; width: 100%; aspect-ratio: 1 / 1; border-radius: 3px;
              background: var(--empty); }
.calendar i[data-level="1"] { background: var(--seq-1); }
.calendar i[data-level="2"] { background: var(--seq-2); }
.calendar i[data-level="3"] { background: var(--seq-3); }
.calendar i[data-level="4"] { background: var(--seq-4); }
.calendar i[data-level="5"] { background: var(--seq-5); }
.calendar i.blank { background: none; }
.months { display: grid; grid-auto-flow: column; grid-template-columns: repeat(52, minmax(0, 1fr));
          gap: 3px; font-size: 10px; color: var(--faint); margin-bottom: 7px; overflow: hidden; }
.months span { white-space: nowrap; }
.scale { display: flex; align-items: center; gap: 8px; font-size: 10.5px; color: var(--faint); }
.scale .ramp { display: flex; gap: 3px; }
.scale i { display: block; width: 10px; height: 10px; border-radius: 3px; }
.year { display: flex; flex-direction: column; gap: 14px; }

/* Plays by year: few enough bars to label every one of them. */
.years { display: flex; align-items: flex-end; gap: 12px; height: 132px; }
.years > div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end;
               gap: 6px; height: 100%; }
.years .n { font-family: var(--mono); font-size: 10.5px; color: var(--secondary); text-align: center; }
.years em { display: block; background: rgba(232, 185, 92, .32); border-radius: 4px 4px 2px 2px; }
.years .peak em { background: var(--accent); }
.ylabels { display: flex; gap: 12px; border-top: 1px solid var(--hair); padding-top: 7px; }
.ylabels span { flex: 1; font-family: var(--mono); font-size: 10px; color: var(--faint);
                text-align: center; }

/* The artist page's own header: a name at display size, and the one figure
   that puts it in proportion to everything else the listener plays. */
.hero { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; padding: 6px 0 4px; }
.hero .name { flex: 1 1 24rem; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.hero h1 { font-size: 76px; line-height: .94; font-weight: 600; letter-spacing: -.045em;
           text-wrap: pretty; }
.share { flex: 0 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.share .cardtop { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.share .cardtop b { color: var(--accent); font-weight: 400; }
.meter { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.share p { font-family: var(--mono); font-size: 11px; color: var(--faint); line-height: 1.6; }

/* The Apple Music player, when the record turns out to be streamable. The
   section arrives hidden and is unhidden by the script, so a record Apple does
   not have leaves no empty card behind. */
.player .frame { margin-top: 14px; }
.player iframe { display: block; width: 100%; max-width: 660px; border: 0;
                 border-radius: 12px; overflow: hidden; background: transparent;
                 color-scheme: normal; }

.crumbs { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-size: 11.5px;
          color: var(--faint); }
.crumbs a { color: var(--secondary); display: flex; align-items: center; gap: 9px; }
.crumbs .here { color: var(--ink); }
.crumbs .mark { width: 24px; height: 24px; border-radius: 8px; font-family: var(--sans);
                font-size: 11px; }
.back { font-family: var(--mono); font-size: 11.5px; color: var(--muted);
        border: 1px solid var(--edge); border-radius: 999px; padding: 6px 12px; }

/* Colour alone never carries a value: every shaded chart keeps its numbers. */
details { font-size: 12.5px; }
summary { font-family: var(--mono); font-size: 11px; color: var(--muted); cursor: pointer; }
table { border-collapse: collapse; width: 100%; margin-top: 10px; }
th, td { text-align: left; padding: 4px 8px 4px 0; border-bottom: 1px solid var(--hair);
         font-weight: 400; }
th { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
td.n { text-align: right; font-variant-numeric: tabular-nums; }

.lede { color: var(--secondary); font-size: 13.5px; }
.empty { color: var(--muted); font-size: 13px; padding: 8px 0; }
.span { display: flex; justify-content: space-between; font-size: 10px; color: var(--faint); }
footer { display: flex; align-items: center; justify-content: space-between; gap: 20px;
         flex-wrap: wrap; padding: 16px 22px; border: 1px solid rgba(255, 255, 255, .09);
         border-radius: 14px; background: var(--panel); }
footer p { font-size: 13.5px; color: var(--secondary); }

@media (max-width: 900px) {
  body { padding: 20px 16px 0; }
  .figures.six, .figures.five { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols { grid-template-columns: minmax(0, 1fr); }
  .highlights { grid-template-columns: minmax(0, 1fr); }
  .chart.wide li.row { grid-template-columns: 24px minmax(0, 1fr) auto; }
  .chart.wide .by { display: none; }
  .hero h1 { font-size: 46px; }
  .np .track-name { font-size: 28px; }
  .bignum b { font-size: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  .eq i, .pulse { animation: none; }
}
