/* Spindle brand tokens (brand sheet v1.1). Ink on paper; signal orange marks the one highlighted thing. */
:root {
  --paper: #f6f7f9; --card: #ffffff; --ink: #141821; --muted: #626a7b; --rule: #dde1e8; --groove: #e8ebf0;
  --signal: #ff5a1f; --on-signal: #ffffff;
  --slate-0: #26324d; --slate-1: #3d4c6e; --slate-2: #566890; --slate-3: #7383a6;
  --slate-4: #93a0bd; --slate-5: #2f3d5c; --slate-6: #6a7a9e; --slate-7: #a7b2c9;
  --disc-ink: #ffffff;
  --display: "Unbounded", "Arial Black", sans-serif;
  --body: "Onest", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --bar-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f1218; --card: #171b23; --ink: #eef0f4; --muted: #9aa2b3; --rule: #2a303c; --groove: #20252f;
    --signal: #ff6a33;
    --slate-0: #a9b6d3; --slate-1: #8796ba; --slate-2: #6f7fa5; --slate-3: #5b6a8f;
    --slate-4: #4a587a; --slate-5: #97a6c6; --slate-6: #7c8bb0; --slate-7: #3f4b69;
    --disc-ink: #0f1218;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0f1218; --card: #171b23; --ink: #eef0f4; --muted: #9aa2b3; --rule: #2a303c; --groove: #20252f;
  --signal: #ff6a33;
  --slate-0: #a9b6d3; --slate-1: #8796ba; --slate-2: #6f7fa5; --slate-3: #5b6a8f;
  --slate-4: #4a587a; --slate-5: #97a6c6; --slate-6: #7c8bb0; --slate-7: #3f4b69;
  --disc-ink: #0f1218;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font-family: var(--body); font-size: 15px; line-height: 1.5; min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
.eyebrow { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.eyebrow.signal { color: var(--signal); font-weight: 600; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }

/* ---------- top bar ---------- */
.bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px 28px; min-height: var(--bar-h); padding: 10px max(20px, env(safe-area-inset-right)) 10px max(20px, env(safe-area-inset-left)); background: var(--paper); border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand svg { width: 30px; height: 30px; }
.brand span { font-family: var(--display); font-weight: 900; font-size: 19px; letter-spacing: .06em; }
nav { display: flex; gap: 22px; }
nav a { text-decoration: none; color: var(--muted); font-weight: 500; padding: 6px 0; border-bottom: 3px solid transparent; }
nav a:hover { color: var(--ink); }
nav a[aria-current="page"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--signal); }
.search { position: relative; margin-left: auto; }
.search input { width: 300px; max-width: 100%; height: 38px; padding: 0 52px 0 18px; border-radius: 19px; border: 1px solid var(--rule); background: var(--card); font-size: 15px; }
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: var(--signal); }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-family: var(--mono); font-size: 12px; color: var(--muted); pointer-events: none; }
#results { position: absolute; top: calc(100% + 6px); right: 0; width: min(420px, 92vw); margin: 0; padding: 6px; list-style: none; background: var(--card); border: 1px solid var(--rule); border-radius: 14px; box-shadow: 0 12px 32px rgb(0 0 0 / .14); z-index: 30; }
#results li button { all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 12px; border-radius: 9px; cursor: pointer; }
#results li button:hover, #results li button[aria-selected="true"] { background: var(--paper); }
#results li small { font-family: var(--mono); font-size: 11px; color: var(--muted); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
#results .empty { padding: 10px 12px; color: var(--muted); font-size: 14px; }
.time { display: flex; align-items: center; gap: 14px; }
.time .track { position: relative; width: 170px; height: 20px; }
.time .track::before { content: ""; position: absolute; left: 0; right: 0; top: 9px; height: 3px; background: var(--rule); border-radius: 2px; }
.time .tick { position: absolute; top: 4px; width: 1px; height: 13px; background: var(--muted); border: 0; padding: 0; }
.time .knob { all: unset; position: absolute; top: 3px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--card); border: 2px solid var(--muted); cursor: pointer; box-sizing: border-box; }
.time .knob[aria-pressed="true"] { background: var(--signal); border-color: var(--signal); }
.time .date { font-family: var(--mono); font-size: 13px; }

/* ---------- records ---------- */
.view { flex: 1; }
.records { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; padding: 16px max(20px, env(safe-area-inset-right)) 16px max(20px, env(safe-area-inset-left)); align-items: start; }
.stage { position: relative; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; min-height: 24px; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.crumbs button { all: unset; cursor: pointer; color: var(--muted); }
.crumbs button:hover { color: var(--ink); text-decoration: underline; }
.crumbs b { color: var(--ink); font-weight: 500; }
canvas#cv { display: block; width: 100%; touch-action: none; cursor: grab; border-radius: 14px; }
canvas#cv:active { cursor: grabbing; }
.loading { position: absolute; inset: 34px 0 60px; display: grid; place-items: center; color: var(--muted); font-family: var(--mono); font-size: 13px; }
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: 13px; }
.group { display: flex; align-items: center; gap: 8px; }
.group > span { color: var(--muted); font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 999px; overflow: hidden; background: var(--card); }
.seg button { border: 0; background: none; padding: 5px 12px; cursor: pointer; font-size: 13px; }
.seg button + button { border-left: 1px solid var(--rule); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.toggle { border: 1px solid var(--rule); background: var(--card); padding: 5px 12px; border-radius: 999px; cursor: pointer; font-size: 13px; }
.toggle[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.hint { color: var(--muted); font-size: 12px; margin-left: auto; }

/* ---------- trail panel ---------- */
.trail { position: sticky; top: calc(var(--bar-h) + 16px); background: var(--card); border: 1px solid var(--rule); border-radius: 14px; padding: 24px 26px; display: flex; flex-direction: column; gap: 18px; min-width: 0; max-height: calc(100vh - var(--bar-h) - 32px); overflow: auto; }
.trail h2 { font-family: var(--display); font-weight: 800; font-size: 26px; line-height: 1.12; letter-spacing: -.01em; overflow-wrap: anywhere; }
.trail .stat { font-family: var(--mono); font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.trail p { margin: 0; color: var(--muted); font-size: 14px; }
.chain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.chain li { position: relative; padding: 0 0 18px 26px; }
.chain li::before { content: ""; position: absolute; left: 4px; top: 22px; bottom: 2px; width: 2px; background: var(--rule); }
.chain li:last-child::before { display: none; }
.chain li i { position: absolute; left: 0; top: 17px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--ink); background: var(--card); }
.chain li:last-child i { background: var(--ink); width: 12px; height: 12px; left: -1px; }
.chain li.ended i { border-style: dashed; border-color: var(--muted); }
.chain .eyebrow { font-size: 10.5px; }
.chain button, .chain span.name { all: unset; display: block; font-weight: 600; font-size: 17px; cursor: pointer; overflow-wrap: anywhere; }
.chain button:hover { text-decoration: underline; }
.chain small { display: block; font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.bars li { display: grid; grid-template-columns: minmax(0, 1fr) 90px 52px; align-items: center; gap: 10px; }
.bars button { all: unset; cursor: pointer; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bars button:hover { text-decoration: underline; }
.bars .b { height: 7px; border-radius: 4px; background: var(--slate-1); min-width: 2px; }
.bars .v { font-family: var(--mono); font-size: 11.5px; color: var(--muted); text-align: right; }
.trail .actions { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13.5px; }
.trail .actions a { color: var(--ink); text-underline-offset: 3px; }
.trail .actions a.primary { color: var(--signal); font-weight: 600; }
.note { font-size: 13px; color: var(--muted); background: var(--paper); border-radius: 10px; padding: 10px 12px; }

/* ---------- artist page ---------- */
.artist-page, .list-page, .about-page { width: 100%; max-width: 1200px; margin: 0 auto; padding: 36px max(20px, env(safe-area-inset-right)) 56px max(20px, env(safe-area-inset-left)); }
.artist-page .url { font-family: var(--mono); font-size: 14px; color: var(--muted); }
.artist-page .who { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 40px; align-items: center; margin-top: 18px; }
.artist-page h1 { font-family: var(--display); line-height: 1.05; letter-spacing: -.02em; }
.artist-page h1 .q { display: block; font-weight: 400; font-size: clamp(1.4rem, 3vw, 2rem); color: var(--muted); }
.artist-page h1 .n { display: block; font-weight: 800; font-size: clamp(2.2rem, 5.5vw, 3.6rem); overflow-wrap: anywhere; }
.facts { margin: 28px 0 0; display: flex; flex-direction: column; }
.facts div { border-bottom: 1px solid var(--rule); padding: 10px 0; }
.facts dt { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 600; font-size: 19px; }
.facts dd small { font-weight: 400; font-size: 13px; color: var(--muted); font-family: var(--mono); }
.rings svg { width: 100%; height: auto; display: block; }
.artist-page .more { margin-top: 36px; display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.artist-page .more h3 { font-size: 15px; margin-bottom: 10px; }
.artist-page .actions { margin-top: 24px; display: flex; gap: 12px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 999px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); text-decoration: none; font-weight: 600; font-size: 14px; cursor: pointer; }
.btn.ghost { background: none; color: var(--ink); border-color: var(--rule); }
.footnote { margin-top: 28px; font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* ---------- artists list ---------- */
.list-page h1, .about-page h1 { font-family: var(--display); font-weight: 800; font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -.02em; }
.list-page .lede, .about-page .lede { color: var(--muted); max-width: 66ch; margin: 10px 0 22px; font-size: 16px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
table.ranked { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.ranked th { text-align: left; font-family: var(--mono); font-weight: 500; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--rule); }
table.ranked td { padding: 9px 10px; border-bottom: 1px solid var(--rule); vertical-align: baseline; }
table.ranked td.n, table.ranked th.n { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
table.ranked td.rank { font-family: var(--mono); color: var(--muted); width: 3em; }
table.ranked td a { text-decoration: none; font-weight: 600; }
table.ranked td a:hover { text-decoration: underline; }
table.ranked tr:hover td { background: var(--card); }
.major-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }

/* ---------- about ---------- */
.about-page section { margin-top: 34px; }
.about-page h2 { font-family: var(--display); font-weight: 600; font-size: 1.25rem; margin-bottom: 10px; }
.about-page p, .about-page li { max-width: 70ch; }
.about-page ul { padding-left: 20px; }
.rules { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.rules > div { display: flex; flex-direction: column; gap: 8px; }
.rules svg { width: 100%; height: auto; background: var(--card); border: 1px solid var(--rule); border-radius: 12px; }
.rules h3 { font-size: 15px; }
.rules p { margin: 0; color: var(--muted); font-size: 14px; }

.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px max(20px, env(safe-area-inset-right)) 18px max(20px, env(safe-area-inset-left)); font-family: var(--mono); font-size: 12px; color: var(--muted); border-top: 1px solid var(--rule); }

@media (max-width: 1100px) {
  .time { display: none; }
}
@media (max-width: 920px) {
  .records { grid-template-columns: minmax(0, 1fr); }
  .trail { position: static; max-height: none; }
  .artist-page .who, .artist-page .more { grid-template-columns: minmax(0, 1fr); }
  .rules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hint { margin-left: 0; }
}
@media (max-width: 640px) {
  .bar { gap: 10px 18px; padding-left: 16px; padding-right: 16px; }
  .search { margin-left: 0; width: 100%; order: 3; }
  .search input { width: 100%; }
  .records, .artist-page, .list-page, .about-page { padding-left: 16px; padding-right: 16px; }
  .trail { padding: 18px; }
  table.ranked .hide-sm { display: none; }
}
