/* djgraph — visual system.
   Ground is petrol-shifted rather than neutral black; the four data hues carry
   genre-family meaning, so colour is information rather than decoration. */

:root {
  --ground:    #0F1417;
  --ground-2:  #131A1E;
  --surface:   #171F24;
  --line:      #25323A;
  --line-soft: #1C262C;
  --ink:       #E9EEF0;
  --ink-2:     #A9BAC2;
  --dim:       #74888F;

  /* Brand and heat colours. Not categorical: the wordmark is an accent and the
     fingerprint ramp is sequential, so neither needs the separation test. */
  --techno:  #FF5A34;
  --house:   #FFC24B;
  --trance:  #4FC6F0;
  --electro: #A98CFF;

  /* Categorical slots, validated against this surface. Same four the map uses,
     so a genre is the same colour wherever it appears. */
  --cat-1: #3987e5;
  --cat-2: #c98500;
  --cat-3: #d55181;
  --cat-4: #008300;

  /* The one accent. Used for what you can act on -- the current page, the
     main button, a row under the pointer -- so it never competes with data. */
  --accent:    #FF6A45;
  --accent-bg: rgba(255, 90, 52, 0.12);

  --measure: 62ch;
  --pad: clamp(1.1rem, 4vw, 3.25rem);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: Archivo, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--trance);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 var(--pad); }

/* ---------- masthead ---------- */
.masthead {
  display: flex; align-items: baseline; gap: 1.5rem; flex-wrap: wrap;
  padding: 1.5rem 0 1.25rem;
  border-bottom: 1px solid var(--line);
}
.wordmark {
  font-size: 1.32rem; font-weight: 800; letter-spacing: -0.035em;
  font-variation-settings: 'wdth' 118;
  text-decoration: none;
}
.wordmark i { font-style: normal; color: var(--techno); }
.masthead p { margin: 0; color: var(--dim); font-size: 0.86rem; }
.masthead nav { margin-left: auto; display: flex; gap: 1.25rem; font-size: 0.88rem; }
.masthead nav a { color: var(--ink-2); text-decoration: none; }
.masthead nav a { padding: 0.2rem 0; border-bottom: 2px solid transparent; }
.masthead nav a:hover { color: var(--ink); }
.masthead nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.home .masthead .find { display: none; }

/* ---------- hero ---------- */
.hero { padding: clamp(2.5rem, 7vw, 4.75rem) 0 2.25rem; }
.hero h1 {
  margin: 0 0 1.1rem;
  font-size: clamp(2.3rem, 6.4vw, 4.3rem);
  line-height: 0.98;
  font-weight: 800;
  letter-spacing: -0.042em;
  font-variation-settings: 'wdth' 112;
  max-width: 18ch;
  text-wrap: balance;
}
.hero .lede { max-width: var(--measure); color: var(--ink-2); font-size: 1.02rem; margin: 0; }

.counts { display: flex; flex-wrap: wrap; gap: 2.5rem; margin-top: 2.5rem; }
.count b {
  display: block; font-size: clamp(1.6rem, 3.4vw, 2.3rem); font-weight: 700;
  letter-spacing: -0.03em; line-height: 1.05;
  font-variation-settings: 'wdth' 108;
}
.count span { color: var(--dim); font-size: 0.82rem; }

/* ---------- sections ---------- */
section { padding: 2.75rem 0; border-top: 1px solid var(--line-soft); }
section > h2, .sechead h2 {
  margin: 0 0 0.35rem; font-size: 1.5rem; font-weight: 700; line-height: 1.15;
  letter-spacing: -0.02em; font-variation-settings: 'wdth' 108;
}
section .note { margin: 0 0 1.1rem; color: var(--dim); font-size: 0.86rem; max-width: var(--measure); }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th {
  text-align: left; font-weight: 600; color: var(--dim); font-size: 0.78rem;
  padding: 0 0.7rem 0.6rem; border-bottom: 1px solid var(--line);
}
th.num, td.num { text-align: right; }
th { white-space: nowrap; }
td { padding: 0.62rem 0.7rem; border-bottom: 1px solid var(--line-soft); vertical-align: baseline; }
tbody tr:hover { background: var(--ground-2); }
td a { text-decoration: none; }
td a:hover { text-decoration: underline; text-underline-offset: 3px; }
td .by { display: block; }
.by { color: var(--dim); }
tr[data-href] { cursor: pointer; }
tr[data-href]:hover td:first-child a, tr[data-href]:hover td:nth-child(2) > a { color: var(--accent); }
td.rank, th.rank { color: var(--dim); width: 2.6rem; padding-right: 0.2rem; }
td.when { color: var(--ink-2); white-space: nowrap; }
.dimmer { color: var(--dim); }
.scroll { overflow-x: auto; }

/* share bar lives inside the cell it describes */
/* A share bar needs a track. Without one a 1.8% fill is two pixels of colour
   floating under a number, which reads as a rendering artefact rather than a
   small value. */
.bar { position: relative; display: block; min-width: 3.2rem; }
.bar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -0.32rem;
  height: 2px; background: var(--line-soft);
}
.bar i {
  position: absolute; right: 0; bottom: -0.32rem; height: 2px; min-width: 2px;
  background: var(--cat-2); z-index: 1;
}
/* numbers are right-aligned, so their bars grow from the right edge too */
.bar::after { left: 0; right: 0; }

/* ---------- the set strip: one segment per track position ---------- */
.strip { display: flex; gap: 1px; height: 22px; align-items: stretch; }
.lane { display: block; }
.strip a, .strip u {
  flex: 1 1 0; min-width: 1px; background: #33444D;
  text-decoration: none; border-radius: 1px;
}
/* A record nobody identified is not a quiet record, it is an absence. Texture
   rather than another shade, so it never reads as a point on the heat ramp. */
.strip u[data-unknown] {
  background: repeating-linear-gradient(45deg,
    var(--line-soft) 0 3px, var(--ground) 3px 6px);
}
.strip a:hover, .strip a:focus-visible { outline: 1px solid var(--ink); outline-offset: 1px; }
.setrow time a { color: inherit; text-decoration: none; }
.setrow time a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* one tag shown, the rest counted: a three-line tag stack made every row a
   different height and the strips stopped lining up */
.setrow .tags { white-space: nowrap; text-overflow: ellipsis; }
.setrow .tags em { font-style: normal; color: var(--ink-2); }
.setrow .meta i {
  display: block; font-style: normal; line-height: 1.35;
}
.setrow .meta { text-align: right; }

/* The strip is what the row is for, so everything beside it is trimmed to what
   its own content needs and the rest goes to 1fr. */
.setrow { display: grid; grid-template-columns: 5.4rem 1fr 2.8rem 7rem 7.5rem;
          gap: 0.7rem; align-items: center; padding: 0.42rem 0;
          border-bottom: 1px solid var(--line-soft); }
.setrow .dur, .setrow .tags { color: var(--dim); font-size: 0.76rem; }
.setrow .tags { overflow: hidden; }
.setrow .dur { text-align: right; }
.flag { color: var(--dim); }
/* in a table cell the partial count belongs under the figure, not beside it */
td .flag { display: block; font-size: 0.78rem; }
.setrow time { color: var(--dim); font-size: 0.8rem; }
.setrow .meta { color: var(--dim); font-size: 0.78rem; text-align: right; }
.setrow:hover { background: var(--ground-2); }

.legend { display: flex; flex-wrap: wrap; gap: 0.5rem 1.15rem; margin: 1.1rem 0 0; padding: 0;
          list-style: none; font-size: 0.82rem; }
.legend li { display: flex; align-items: center; gap: 0.45rem; color: var(--ink-2); }
.legend em { width: 11px; height: 11px; border-radius: 2px; font-style: normal; flex: none; }

/* ---------- genre mix ---------- */
.mix { display: flex; flex-direction: column; gap: 0.3rem; }
.mixrow { display: grid; grid-template-columns: 3rem 1fr; gap: 0.8rem; align-items: center; }
.mixrow span { color: var(--dim); font-size: 0.8rem; }
.mixbar { display: flex; height: 15px; border-radius: 2px; overflow: hidden;
          background: var(--line-soft); gap: 2px; }
.mixbar i { display: block; min-width: 0; }

.mixlegend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; margin: 0 0 0.9rem;
             padding: 0; list-style: none; font-size: 0.8rem; color: var(--ink-2); }
.mixlegend li { display: flex; align-items: center; gap: 0.42rem; }
.mixlegend em { width: 11px; height: 11px; border-radius: 2px; flex: none; }
/* Eight style slots, matching the map: slots 0-3 are the four validated hues,
   4-7 the same hues under a stripe. The stripe is texture rather than colour,
   so it adds categories without spending any of the colour budget, exactly as
   the ring does on the canvas. */
[data-slot="0"] { background: var(--cat-1); }
[data-slot="1"] { background: var(--cat-2); }
[data-slot="2"] { background: var(--cat-3); }
[data-slot="3"] { background: var(--cat-4); }
[data-slot="4"] { background: repeating-linear-gradient(45deg, var(--cat-1) 0 3px, #0d2036 3px 6px); }
[data-slot="5"] { background: repeating-linear-gradient(45deg, var(--cat-2) 0 3px, #3a2700 3px 6px); }
[data-slot="6"] { background: repeating-linear-gradient(45deg, var(--cat-3) 0 3px, #3d1626 3px 6px); }
[data-slot="7"] { background: repeating-linear-gradient(45deg, var(--cat-4) 0 3px, #002600 3px 6px); }
[data-slot="-1"] { background: #5C6B73; }

/* ---------- layout helpers ---------- */
.cols { display: grid; gap: clamp(1.75rem, 4vw, 3.25rem); }
@media (min-width: 900px) { .cols.two { grid-template-columns: 1.55fr 1fr; } }

.peer { display: flex; justify-content: space-between; gap: 1rem; padding: 0.5rem 0;
        border-bottom: 1px solid var(--line-soft); font-size: 0.9rem; }
.peer a { text-decoration: none; }
.peer a:hover { text-decoration: underline; text-underline-offset: 3px; }
.peer b { font-weight: 600; }
.peer .n { color: var(--dim); font-size: 0.8rem; }

/* ---------- profile header ---------- */
.profile { padding: clamp(2rem, 5vw, 3.25rem) 0 1.5rem; }
.profile h1 {
  margin: 0 0 0.5rem; font-size: clamp(2rem, 5vw, 3.35rem); font-weight: 800;
  letter-spacing: -0.04em; font-variation-settings: 'wdth' 112; line-height: 1;
}
.profile .sub { color: var(--ink-2); margin: 0; max-width: var(--measure); }

.tag { display: inline-block; padding: 0.1rem 0.5rem; border: 1px solid var(--line);
       border-radius: 999px; font-size: 0.76rem; color: var(--ink-2); }

.timed { color: var(--trance); }
.untimed { color: var(--dim); }

footer { border-top: 1px solid var(--line); padding: 2rem 0 3.5rem; color: var(--dim);
         font-size: 0.82rem; }
footer a { color: var(--ink-2); }
footer p { max-width: var(--measure); }
/* The licence line is a legal condition, not something anyone reads twice.
   Small and quiet, but kept above the ~11px where muted text stops being
   legible on a phone. */
footer p.licence { font-size: 0.74rem; line-height: 1.45; }

@media (prefers-reduced-motion: no-preference) {
  .strip a, .strip u { transition: opacity 120ms ease; }
}


/* Heat ramp: grey where a record is a one-off, warming as it becomes a weapon. */
.strip a[data-heat="1"] { background: #6E4331; }
.strip a[data-heat="2"] { background: #C2653A; }
.strip a[data-heat="3"] { background: var(--techno); }
.legend em[data-heat-swatch="0"] { background: #33444D; }
.legend em[data-heat-swatch="1"] { background: #6E4331; }
.legend em[data-heat-swatch="2"] { background: #C2653A; }
.legend em[data-heat-swatch="3"] { background: var(--techno); }
.legend em[data-unknown-swatch] {
  background: repeating-linear-gradient(45deg,
    var(--line-soft) 0 3px, var(--ground) 3px 6px);
}
.setrow .meta { font-size: 0.76rem; }

/* ---------- artist graph ---------- */
.graphsec { padding-top: 1rem; }
.graphwrap { position: relative; }
#crate {
  width: 100%; height: auto; display: block;
  background: radial-gradient(120% 90% at 50% 40%, #131C21 0%, var(--ground) 72%);
  border: 1px solid var(--line-soft); border-radius: 4px;
  touch-action: manipulation;
}
#crate .edges line { stroke: #4C6470; }
#crate .node circle { stroke: var(--ground); stroke-width: 1.5; }
#crate .node text {
  fill: var(--ink-2); font-size: 10.5px; text-anchor: middle;
  paint-order: stroke; stroke: var(--ground); stroke-width: 3px;
  pointer-events: none;
}
#crate .node { cursor: pointer; }

#crate.focused .node          { opacity: 0.16; }
#crate.focused .node.is-near  { opacity: 0.9; }
#crate.focused .node.is-focus { opacity: 1; }
#crate.focused .node.is-focus circle { stroke: var(--ink); stroke-width: 2; }
#crate.focused .edges line          { opacity: 0.05 !important; }
#crate.focused .edges line.is-lit   { opacity: 0.85 !important; stroke: var(--ink-2); }
#crate .node.is-focus text, #crate .node.is-near text { fill: var(--ink); }

@media (prefers-reduced-motion: no-preference) {
  #crate .node, #crate .edges line { transition: opacity 140ms ease; }
}

.inspector {
  position: absolute; left: 1rem; bottom: 1rem; max-width: 22rem;
  background: rgba(15, 20, 23, 0.94); border: 1px solid var(--line);
  border-radius: 3px; padding: 0.7rem 0.9rem; pointer-events: none;
}
.inspector b { display: block; font-size: 1.02rem; letter-spacing: -0.015em; }
.inspector p { margin: 0.2rem 0 0; color: var(--ink-2); font-size: 0.82rem; }

.graphlegend { margin-top: 1rem; align-items: center; }
.graphlegend em { border-radius: 50%; width: 10px; height: 10px; }
.panhint { display: none; }

@media (max-width: 760px) {
  /* The map is drawn 1180 units wide. Squeezed into a phone it becomes a smear
     of unlabelled dots, so instead it keeps a legible size and pans sideways --
     a network is worth reading at scale or not showing at all. */
  .graphwrap { overflow-x: auto; -webkit-overflow-scrolling: touch; position: relative; }
  #crate { min-width: 760px; }
  .panhint { display: inline; }
  /* A fade at the right edge is the only cue that there is more map off-screen. */
  .graphsec { position: relative; }
  .graphsec::after {
    content: ""; position: absolute; top: 0; right: 0; width: 34px; height: 100%;
    background: linear-gradient(to right, transparent, var(--ground));
    pointer-events: none;
  }
  .inspector { position: sticky; left: 0; max-width: none; }

  .masthead { gap: 0.15rem 1rem; padding-bottom: 0.9rem; }
  .masthead p { flex-basis: 100%; order: 3; }
  .masthead nav { margin-left: 0; order: 2; gap: 1rem; }

  /* Duration and tags are the first thing to go on a phone: the strip and the
     share are what the row is for. */
  .setrow { grid-template-columns: 4.6rem 1fr 4.6rem; gap: 0.55rem; }
  .setrow .dur, .setrow .tags { display: none; }
  .setrow time { font-size: 0.72rem; }
  .setrow .meta { font-size: 0.68rem; }
  .counts { gap: 1.5rem 2rem; }
  table { font-size: 0.86rem; }
  td, th { padding-left: 0.4rem; padding-right: 0.4rem; }
}

/* ---------- search ---------- */
.find { position: relative; margin-left: auto; }
.find input {
  width: 15rem; max-width: 100%;
  background: var(--ground-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 3px;
  padding: 0.38rem 0.6rem; font: inherit; font-size: 0.86rem;
}
.find input::placeholder { color: var(--dim); }
.find input:focus { outline: none; border-color: var(--trance); background: var(--surface); }
.find input::-webkit-search-cancel-button { filter: invert(0.6); }

.findlist {
  position: absolute; z-index: 20; top: calc(100% + 5px); right: 0;
  width: 23rem; max-width: 84vw; max-height: 22rem; overflow-y: auto;
  margin: 0; padding: 0.25rem; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 4px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
}
.findlist a {
  display: block; padding: 0.4rem 0.55rem; border-radius: 3px; text-decoration: none;
}
.findlist b { display: block; font-weight: 600; font-size: 0.88rem; }
.findlist span { color: var(--dim); font-size: 0.76rem; }
.findlist a:hover, .findlist a.on { background: var(--ground-2); }
.findlist a.on b { color: var(--trance); }

@media (max-width: 760px) {
  .masthead { align-items: center; }
  .find { order: 4; flex-basis: 100%; margin: 0.55rem 0 0; }
  .find input { width: 100%; }
  .findlist { width: 100%; right: auto; left: 0; }
}

/* ---------- crate map (canvas) ---------- */
.mapsec { padding-top: 0.75rem; }
.mapwrap { position: relative; }
#map {
  display: block; width: 100%; height: min(74vh, 760px);
  background: var(--ground);
  border: 1px solid var(--line-soft); border-radius: 4px;
  cursor: grab; touch-action: none;
}
#map:active { cursor: grabbing; }

.mapctl { position: absolute; top: 0.7rem; right: 0.7rem; display: flex; gap: 0.35rem; }
.mapctl button {
  min-width: 2rem; height: 2rem; padding: 0 0.5rem;
  background: rgba(22, 29, 33, 0.92); color: var(--ink);
  border: 1px solid var(--line); border-radius: 3px;
  font: inherit; font-size: 0.86rem; line-height: 1; cursor: pointer;
}
.mapctl button:hover { background: var(--surface); border-color: var(--ink-2); }

.maphint {
  position: absolute; right: 0.9rem; bottom: 0.8rem; margin: 0; max-width: 20rem;
  text-align: right;
  color: var(--dim); font-size: 0.78rem; pointer-events: none;
}
.mapsec .inspector { left: 0.9rem; bottom: 0.9rem; }

@media (max-width: 760px) {
  #map { height: 66vh; }
  .maphint { font-size: 0.72rem; max-width: 12rem; }
  .mapsec .inspector { position: absolute; left: 0.6rem; right: 0.6rem; bottom: 0.6rem; }
}

/* colour-mode switch */
.modectl {
  position: absolute; top: 0.7rem; left: 0.9rem; display: flex;
  border: 1px solid var(--line); border-radius: 3px; overflow: hidden;
  background: rgba(22, 29, 33, 0.92);
}
.modectl button {
  padding: 0.3rem 0.7rem; background: none; color: var(--ink-2);
  border: 0; border-right: 1px solid var(--line-soft);
  font: inherit; font-size: 0.8rem; cursor: pointer;
}
.modectl button:last-child { border-right: 0; }
.modectl button:hover { color: var(--ink); }
.modectl button[aria-pressed="true"] { background: var(--surface); color: var(--ink); }
.graphlegend .legnote { margin-left: auto; color: var(--dim); }
@media (max-width: 760px) {
  /* pinned to the bottom of the canvas, which is 66vh tall here, not of the
     wrapper: the key bar below would otherwise sit underneath it */
  .modectl { top: calc(66vh - 2.6rem); left: 0.6rem; }
  .maphint { display: none; }
}

/* a set whose tracklist nobody finished */
.strip.partial a, .strip.partial u { opacity: 0.45; }
.setrow:hover .strip.partial a, .setrow:hover .strip.partial u { opacity: 0.7; }

.pager { display: flex; align-items: center; gap: 1.1rem; margin-top: 1.1rem;
         font-size: 0.86rem; }
.pager a { color: var(--ink-2); }
.pager span { color: var(--dim); }
.pager .pos { margin-left: auto; }

/* breakdown of the folded "other" band, on hover or keyboard focus */
.mixrow { position: relative; }
.mixbar i[data-other] { cursor: help; }
.otherpop {
  display: none; position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  min-width: 14rem; padding: 0.6rem 0.7rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 4px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}
.mixrow:has(i[data-other]:hover) .otherpop,
.mixrow:has(i[data-other]:focus) .otherpop { display: block; }
.otherpop b { display: block; font-size: 0.78rem; color: var(--dim);
              font-weight: 500; margin-bottom: 0.4rem; }
.opr { display: grid; grid-template-columns: 8.5rem 1fr 2.6rem;
       align-items: center; gap: 0.5rem; font-size: 0.8rem; padding: 0.1rem 0; }
.opr > span { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis;
              white-space: nowrap; }
.opr i { display: block; height: 6px; border-radius: 1px; background: #5C6B73; min-width: 2px; }
.opr em { font-style: normal; color: var(--dim); text-align: right; }


/* styled tooltip for the fingerprint segments; progressive enhancement over the
   native title, which stays as the no-JavaScript fallback */
#segtip {
  position: fixed; z-index: 60; pointer-events: none; max-width: 22rem;
  padding: 0.32rem 0.55rem; border-radius: 3px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--ink); font-size: 0.78rem; line-height: 1.3;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
}

/* full screen: the canvas takes the whole viewport, controls stay on top */
.mapwrap:fullscreen { background: var(--ground); }
.mapwrap:fullscreen #map {
  height: 100vh; border: 0; border-radius: 0;
}



/* ---------- design refresh: shared pieces ---------- */

.kicker {
  margin: 0 0 0.3rem; color: var(--accent); font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.sechead { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 1.25rem; }
.sechead .kicker { flex-basis: 100%; }
.sechead h2 { margin-bottom: 0.3rem; }
.sechead .more {
  margin-left: auto; color: var(--ink-2); font-size: 0.86rem; text-decoration: none;
  white-space: nowrap;
}
.sechead .more:hover { color: var(--accent); }

/* Method notes: accurate, and wanted by few. One line of plain language stays
   on the page; the working is a click away rather than in the way. */
.how { margin: -0.5rem 0 1.2rem; font-size: 0.82rem; color: var(--dim); max-width: var(--measure); }
.how summary {
  cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 0.35rem;
  color: var(--dim); user-select: none;
}
.how summary::-webkit-details-marker { display: none; }
.how summary::before {
  content: "i"; display: inline-grid; place-items: center; width: 1.05rem; height: 1.05rem;
  border: 1px solid var(--line); border-radius: 50%; font-size: 0.66rem; font-weight: 700;
  font-style: italic;
}
.how summary:hover { color: var(--ink-2); }
.how[open] summary { color: var(--ink-2); }
.how p { margin: 0.5rem 0 0; padding: 0.7rem 0.9rem; background: var(--ground-2);
         border-left: 2px solid var(--line); border-radius: 0 3px 3px 0; line-height: 1.5; }
.profile .how { margin-top: 0.9rem; }

.clock::before {
  content: ""; display: inline-block; width: 0.8em; height: 0.8em; margin-right: 0.3em;
  vertical-align: -0.05em; background: currentColor; opacity: 0.7;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='black' stroke-width='1.8' d='M8 1.5a6.5 6.5 0 1 0 0 13a6.5 6.5 0 0 0 0-13zM8 4.5V8l2.4 1.6'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='black' stroke-width='1.8' d='M8 1.5a6.5 6.5 0 1 0 0 13a6.5 6.5 0 0 0 0-13zM8 4.5V8l2.4 1.6'/%3E%3C/svg%3E") center / contain no-repeat;
}
th .clock::before { margin-right: 0.35em; }
th .clock { display: inline; }

.btn {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.55rem 1rem; border-radius: 4px; border: 0;
  background: var(--accent); color: #1A0C07; font: inherit; font-weight: 650; font-size: 0.9rem;
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: #FF8566; }
section > .btn { margin-top: 1.4rem; }
.btn-quiet {
  margin-top: 0.8rem; padding: 0.4rem 0.8rem; border-radius: 4px;
  background: none; border: 1px solid var(--line); color: var(--ink-2);
  font: inherit; font-size: 0.84rem; cursor: pointer;
}
.btn-quiet:hover { border-color: var(--ink-2); color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 1rem; }

/* ---------- front page ---------- */
.hero .lede { font-size: 1.1rem; }
.find-hero { margin: 1.8rem 0 0; max-width: 40rem; display: flex; gap: 0.5rem; }
.find-hero input {
  flex: 1; width: auto; padding: 0.85rem 1rem; font-size: 1.02rem; border-radius: 5px;
  background: var(--surface); border-color: #33444D;
}
.find-hero input:focus { border-color: var(--accent); }
.find-hero button { padding: 0 1.3rem; border-radius: 5px; font-size: 0.98rem; }
.find-hero button { border: 0; background: var(--accent); color: #1A0C07; font: inherit; font-weight: 650; cursor: pointer; }
.find-hero button:hover { background: #FF8566; }
.find-hero .findlist { left: 0; right: auto; width: 100%; max-width: 40rem; top: calc(100% + 6px); }

.feature .legend { margin: 0 0 1rem; }

.preview { position: relative; display: block; border: 1px solid var(--line-soft); border-radius: 6px;
           background: radial-gradient(120% 90% at 50% 40%, #131C21 0%, var(--ground) 72%);
           overflow: hidden; text-decoration: none; }
.preview svg { display: block; width: 100%; height: auto; aspect-ratio: 1 / 0.92; }
.preview circle { fill-opacity: 0.2; stroke-width: 0.35%; stroke-opacity: 0.8; }
.preview circle[data-slot="0"] { fill: var(--cat-1); stroke: var(--cat-1); background: none; }
.preview circle[data-slot="1"] { fill: var(--cat-2); stroke: var(--cat-2); background: none; }
.preview circle[data-slot="2"] { fill: var(--cat-3); stroke: var(--cat-3); background: none; }
.preview circle[data-slot="3"] { fill: var(--cat-4); stroke: var(--cat-4); background: none; }
.preview circle[data-slot="-1"] { fill: #5C6B73; stroke: #5C6B73; background: none; }
.preview circle.ring { fill-opacity: 0; stroke-width: 0.6%; }
.preview text { fill: var(--ink); text-anchor: middle; dominant-baseline: middle; font-weight: 600; }
.preview-cta {
  position: absolute; right: 0.8rem; bottom: 0.8rem; padding: 0.4rem 0.75rem;
  background: rgba(15, 20, 23, 0.9); border: 1px solid var(--line); border-radius: 4px;
  font-size: 0.82rem; color: var(--ink);
}
.preview:hover { border-color: var(--line); }
.preview:hover .preview-cta { border-color: var(--accent); color: var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  .preview svg { transition: transform 400ms ease; }
  .preview:hover svg { transform: scale(1.03); }
}

.pairs { display: grid; column-gap: 3rem; }
@media (min-width: 900px) { .pairs { grid-template-columns: 1fr 1fr; } }

/* ---------- DJ page ---------- */
.peers { margin-top: 2.5rem; }
.peer .n { margin-right: 0.5rem; }

/* ---------- track page ---------- */
.landing { padding-bottom: 1.5rem; }
.dist {
  position: relative; display: flex; align-items: flex-end; gap: 4px;
  height: 84px; max-width: 46rem; padding-bottom: 1px; border-bottom: 1px solid var(--line);
}
.dist span {
  flex: 1; height: var(--h); background: var(--accent); opacity: 0.55;
  border-radius: 2px 2px 0 0;
}
.dist span:hover { opacity: 1; }
.dist .median {
  position: absolute; top: -6px; bottom: -6px; width: 2px; margin-left: -1px;
  background: var(--ink); border-radius: 1px;
}
.distaxis { display: flex; justify-content: space-between; max-width: 46rem;
            margin-top: 0.45rem; color: var(--dim); font-size: 0.76rem; }

td.pos { white-space: nowrap; width: 9.5rem; }
.posbar { position: relative; display: inline-block; width: 5.5rem; height: 2px;
          background: var(--line); vertical-align: middle; border-radius: 1px; }
.posbar i { position: absolute; top: -3.5px; width: 9px; height: 9px; margin-left: -4.5px;
            border-radius: 50%; background: var(--accent); }
.posn { display: inline-block; margin-left: 0.6rem; color: var(--dim); font-size: 0.78rem; min-width: 2.6rem; }
a.timed { text-decoration: none; white-space: nowrap; }
a.timed:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- set page ---------- */
.tracklist td.label { color: var(--dim); font-size: 0.82rem; }

/* ---------- crate graph ---------- */
/* The key sits in a bar joined to the bottom of the canvas: close enough to
   read against the picture, without covering any of it. */
.mapsec #map { border-radius: 4px 4px 0 0; }
.mapkey {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1.5rem;
  padding: 0.65rem 0.9rem; background: var(--ground-2);
  border: 1px solid var(--line-soft); border-top: 0; border-radius: 0 0 4px 4px;
}
.mapwrap:fullscreen .mapkey {
  position: absolute; right: 1rem; bottom: 1rem; max-width: 26rem;
  border: 1px solid var(--line); border-radius: 4px; background: rgba(15, 20, 23, 0.92);
}
.mapkey .graphlegend { margin: 0; gap: 0.3rem 0.9rem; font-size: 0.78rem; }
.mapkey .legnote { color: var(--dim); }
.mapkey .maphint { position: static; margin: 0 0 0 auto; text-align: right; max-width: none; }
.mapwrap:fullscreen .mapkey .maphint { margin: 0; text-align: left; }
.insp-cta { color: var(--accent) !important; font-size: 0.76rem !important; margin-top: 0.4rem !important; }
.modectl button[aria-pressed="true"] { box-shadow: inset 0 -2px 0 var(--accent); }

@media (max-width: 760px) {
  .hide-sm { display: none; }
  .sechead .more { margin-left: 0; flex-basis: 100%; margin-bottom: 0.3rem; }
  .find-hero input { font-size: 16px; }         /* below 16px iOS zooms the page */
  .find-hero button { display: none; }
  td.pos { width: auto; }
  .posbar { width: 3.2rem; }
  .posn { margin-left: 0.35rem; min-width: 0; }
  .mapsec .inspector { top: 3.4rem; bottom: auto; }
  /* Full screen the canvas is the whole viewport, so the 66vh anchor above
     would leave the switch floating mid-map. Tuck it under the zoom buttons,
     and drop the inspector below it. */
  .mapwrap:fullscreen .modectl { top: 3.4rem; left: 0.6rem; }
  .mapwrap:fullscreen .inspector { top: 6.1rem; }
  .mapwrap:fullscreen .mapkey { left: 0.6rem; right: 0.6rem; bottom: 0.6rem; max-width: none; }
  .counts { gap: 1.1rem 1.8rem; }
  .count b { font-size: 1.55rem; }
  .preview svg { aspect-ratio: 1 / 1; }
}

.clusterlist { margin: 1rem 0 0; padding: 0; list-style: none; }
.clusterlist li { display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0;
                  border-bottom: 1px solid var(--line-soft); font-size: 0.88rem; }
.clusterlist em { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.clusterlist em.ring { background: transparent !important; }
.clusterlist em.ring[data-slot="0"] { box-shadow: inset 0 0 0 2.5px var(--cat-1); }
.clusterlist em.ring[data-slot="1"] { box-shadow: inset 0 0 0 2.5px var(--cat-2); }
.clusterlist em.ring[data-slot="2"] { box-shadow: inset 0 0 0 2.5px var(--cat-3); }
.clusterlist em.ring[data-slot="3"] { box-shadow: inset 0 0 0 2.5px var(--cat-4); }
.clusterlist span { margin-left: auto; color: var(--dim); font-size: 0.8rem; }
.on-touch { display: none; }
@media (hover: none) { .on-touch { display: inline; } .on-mouse { display: none; } }

/* A partial tracklist, said plainly on the set's own page. Amber rather than
   the accent: it is a caveat about the data, not something to click. */
.tag-warn { border-color: #6B5320; color: var(--house); background: rgba(255, 194, 75, 0.08);
            text-decoration: none; }
a.tag-warn:hover { border-color: var(--house); }
.callout {
  max-width: var(--measure); margin: 0 0 1.2rem; padding: 0.7rem 0.9rem;
  border-left: 2px solid var(--house); border-radius: 0 3px 3px 0;
  background: rgba(255, 194, 75, 0.06); color: var(--ink-2); font-size: 0.88rem;
}
.callout b { color: var(--ink); font-weight: 600; }

.setrow .tags[title], .setrow .tags[data-tip] { cursor: default; }
.setrow .tags[title]:hover em, .setrow .tags[data-tip]:hover em { color: var(--ink); }

/* Column labels over a peer list, with the affinity explanation behind a "?" */
.peerhead {
  position: relative; display: flex; justify-content: space-between; gap: 1rem;
  padding: 0 0 0.45rem; border-bottom: 1px solid var(--line);
  color: var(--dim); font-size: 0.76rem; font-weight: 600;
}
.qhelp { display: inline-block; }
.qhelp summary {
  list-style: none; cursor: pointer; display: inline-grid; place-items: center;
  width: 1.1rem; height: 1.1rem; margin-left: 0.2rem; vertical-align: -0.2rem;
  border: 1px solid var(--line); border-radius: 50%;
  color: var(--ink-2); font-size: 0.68rem; font-weight: 700;
}
.qhelp summary::-webkit-details-marker { display: none; }
.qhelp summary:hover, .qhelp[open] summary { border-color: var(--accent); color: var(--accent); }
.qhelp p {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  width: min(22rem, 86vw); margin: 0; padding: 0.7rem 0.85rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 4px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  color: var(--ink-2); font-size: 0.82rem; font-weight: 400; line-height: 1.5;
}
.qhelp p b { color: var(--ink); font-weight: 600; }
.has-qhelp { position: relative; }
