/* ExplainSong — directory pages (/songs.html and /artists.html).
   Shared so the two indexes cannot drift apart; both are generated, and both
   link this file rather than inlining a copy.

   Colour note: --red (#ec3013) is the accent and is GRAPHIC ONLY — white on it
   is 4.2:1, so it can never carry small text. --red-ui (#c0240c) is the same
   hue darkened to clear 4.5:1 on every surface used here. */

:root{
  --canvas:#e6e4e4; --panel:#f3f2f2; --band:#eae9e9;
  --ink:#201e1d; --body:#444141; --muted:#605d5d; --faint:#9b9797;
  --rule:#d7d3d3; --tint:#fff2ef;
  /* --red is the comp's accent and is graphic only (rules, borders, the large
     brand mark): white on it is 4.2:1, so it cannot carry small text.
     --red-ui is the same hue darkened to clear 4.5:1 on every surface here
     (4.95 on the band, 6.0 for white on the fill). */
  --red:#ec3013; --red-ui:#c0240c; --red-deep:#ae1800;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  margin:0; background:var(--canvas); color:var(--ink);
  font-family:Archivo,system-ui,-apple-system,"Segoe UI",sans-serif;
  font-size:16px; line-height:1.5;
}
a{color:var(--red-deep); text-decoration:none}
a:hover{color:var(--red-ui); text-decoration:underline; text-underline-offset:3px}
::selection{background:rgba(236,48,19,.28)}
:focus-visible{outline:3px solid var(--red); outline-offset:2px}

.sheet{
  max-width:1280px; margin:0 auto; background:var(--panel);
  border-left:2px solid var(--ink); border-right:2px solid var(--ink);
}
@media (max-width:1320px){ .sheet{border-left:0;border-right:0} }

/* ── header ─────────────────────────────────────────────── */
.masthead{
  display:flex; align-items:center; justify-content:space-between;
  gap:16px; min-height:68px; padding:12px 40px;
  border-bottom:2px solid var(--ink); flex-wrap:wrap;
}
.brand{display:flex; align-items:baseline; gap:10px; color:var(--ink)}
.brand:hover{text-decoration:none}
.brand-mark{font-weight:800; font-size:20px; color:var(--red)}
.brand-name{font-weight:800; font-size:19px; letter-spacing:-.01em}
.brand-tag{font-size:12px; color:var(--muted)}
.nav{display:flex; gap:24px; align-items:center; flex-wrap:wrap}
.nav a{font-weight:600; font-size:14px; color:var(--muted)}
.nav a[aria-current="page"]{
  font-weight:800; color:var(--ink);
  border-bottom:2px solid var(--red); padding-bottom:3px;
}

/* ── hero ───────────────────────────────────────────────── */
.hero{
  display:grid; grid-template-columns:1fr 340px;
  border-bottom:2px solid var(--ink);
}
.hero-main{padding:44px 40px 40px; border-right:2px solid var(--ink)}
.kicker{
  font-weight:800; font-size:12px; letter-spacing:.16em;
  text-transform:uppercase; color:var(--red-ui); margin-bottom:16px;
}
h1{
  margin:0 0 14px; font-weight:800; font-size:clamp(38px,6vw,62px);
  line-height:1.02; letter-spacing:-.03em; max-width:15ch;
}
.hero-main p{margin:0; font-size:17px; line-height:1.5; color:var(--body); max-width:52ch}
.stats{display:flex; flex-direction:column}
.stat{padding:20px 28px; border-bottom:1px solid var(--rule)}
.stat:last-child{border-bottom:0}
.stat-n{font-weight:800; font-size:30px; line-height:1; font-variant-numeric:tabular-nums}
.stat-l{
  font-size:12px; letter-spacing:.1em; text-transform:uppercase;
  color:var(--muted); margin-top:4px;
}

/* ── search + filters ───────────────────────────────────── */
.controls{padding:28px 40px 22px; background:var(--band); border-bottom:2px solid var(--ink)}
.searchbar{display:flex; align-items:stretch}
.searchbar input{
  flex:1; min-width:0; font-family:inherit; font-weight:600;
  font-size:clamp(17px,2.2vw,22px); color:var(--ink); background:var(--panel);
  border:2px solid var(--ink); border-right:0; padding:16px 20px; outline:none;
}
.searchbar input::placeholder{color:var(--muted); font-weight:400}
.btn-clear{
  font-family:inherit; font-weight:800; font-size:14px; letter-spacing:.04em;
  text-transform:uppercase; color:#fff; background:var(--red-ui);
  border:2px solid var(--ink); padding:0 clamp(16px,3vw,30px); cursor:pointer;
}
.btn-clear:hover{background:#a81a04}
.btn-clear:active{background:#8f1400}

.filter-row{display:flex; align-items:center; gap:8px; margin-top:22px; flex-wrap:wrap}
.filter-label{
  font-size:12px; letter-spacing:.1em; text-transform:uppercase;
  color:var(--muted); margin-right:8px;
}
.chip{
  font-family:inherit; font-weight:800; font-size:13px; padding:8px 14px;
  border:2px solid var(--ink); background:transparent; color:var(--ink); cursor:pointer;
}
.chip:hover{background:var(--tint)}
.chip.is-on{background:var(--ink); color:var(--panel)}
.jump-row{display:flex; align-items:center; gap:0; margin-top:18px; flex-wrap:wrap}
.jump{
  font-family:inherit; font-weight:800; font-size:13px; min-width:28px; height:28px;
  border:0; border-bottom:2px solid transparent; background:transparent;
  color:var(--muted); cursor:pointer; padding:0 4px;
}
.jump:hover{color:var(--red-ui)}
.jump.is-on{color:var(--red-ui); border-bottom-color:var(--red)}

/* ── result bar + rows ──────────────────────────────────── */
.resultbar{
  display:flex; align-items:baseline; justify-content:space-between;
  gap:16px; padding:20px 40px 14px; flex-wrap:wrap;
}
.count{font-weight:800; font-size:15px}
.sorted{font-size:13px; color:var(--muted)}

.list{border-top:2px solid var(--ink)}
.row{
  display:grid; grid-template-columns:230px 1fr 64px; gap:24px;
  align-items:baseline; padding:16px 40px; border-bottom:1px solid var(--rule);
  color:var(--ink);
}
.row:hover{background:var(--tint); text-decoration:none}
.row-artist{font-weight:600; font-size:14px; color:var(--muted)}
.row-title{
  display:block; font-weight:800; font-size:20px;
  letter-spacing:-.015em; line-height:1.15;
}
.row-teaser{
  display:block; margin-top:3px; font-size:14px; line-height:1.45;
  color:var(--body); max-width:78ch;
}
.row-year{
  font-size:13px; color:var(--muted); text-align:right;
  font-variant-numeric:tabular-nums;
}
.row[hidden]{display:none}

.empty{padding:56px 40px; border-bottom:1px solid var(--rule)}
.empty-h{font-weight:800; font-size:22px; margin-bottom:6px}
.empty-p{font-size:14px; color:var(--muted)}

.more{display:flex; padding:24px 40px 36px}
.btn-more{
  font-family:inherit; font-weight:800; font-size:14px; letter-spacing:.04em;
  text-transform:uppercase; color:var(--ink); background:transparent;
  border:2px solid var(--ink); padding:14px 26px; cursor:pointer;
}
.btn-more:hover{background:var(--ink); color:var(--panel)}

/* ── picks ──────────────────────────────────────────────── */
.picks-sec{border-top:2px solid var(--ink); padding:36px 40px 40px}
.picks-head{
  display:flex; align-items:baseline; justify-content:space-between;
  gap:16px; margin-bottom:22px; flex-wrap:wrap;
}
.picks-head h2{margin:0; font-weight:800; font-size:26px; letter-spacing:-.02em}
.picks-head span{
  font-size:12px; letter-spacing:.1em; text-transform:uppercase; color:var(--muted);
}
.picks{
  display:grid; grid-template-columns:repeat(4,1fr); gap:2px; background:var(--ink);
}
.pick{display:block; background:var(--panel); padding:0 0 20px; color:var(--ink)}
.pick:hover{background:var(--tint); text-decoration:none}
.pick-tile{
  display:flex; align-items:center; justify-content:center; aspect-ratio:4/3;
  background:repeating-linear-gradient(135deg,var(--rule) 0 7px,var(--band) 7px 14px);
}
.pick-tile span{
  font-weight:800; font-size:56px; line-height:1; color:var(--panel);
  background:var(--ink); width:88px; height:88px;
  display:flex; align-items:center; justify-content:center;
}
.pick-body{display:block; padding:16px 18px 0}
.pick-kicker{
  display:block; font-weight:800; font-size:11px; letter-spacing:.12em;
  text-transform:uppercase; color:var(--red-ui); margin-bottom:8px;
}
.pick-title{
  display:block; font-weight:800; font-size:19px; line-height:1.15;
  letter-spacing:-.015em; margin-bottom:6px;
}
.pick-meta{display:block; font-size:13px; color:var(--muted)}

/* ── about / projects / footer ──────────────────────────── */
.about{
  border-top:2px solid var(--ink); padding:36px 40px;
  display:grid; grid-template-columns:220px 1fr 1fr; gap:32px;
}
.about h2{
  margin:0; font-weight:800; font-size:12px; letter-spacing:.12em;
  text-transform:uppercase; color:var(--muted);
}
.about p{margin:0; font-size:13px; line-height:1.6; color:var(--body)}

.projects{
  border-top:2px solid var(--ink); padding:28px 40px; background:var(--band);
  display:flex; align-items:center; justify-content:space-between; gap:24px; flex-wrap:wrap;
}
.projects-label{
  font-weight:800; font-size:12px; letter-spacing:.12em;
  text-transform:uppercase; color:var(--muted);
}
.projects-links{display:flex; gap:28px; flex-wrap:wrap}
.projects-links a{font-weight:600; font-size:14px}

.foot{
  border-top:2px solid var(--ink); padding:32px 40px;
  display:flex; align-items:flex-end; justify-content:space-between; gap:24px; flex-wrap:wrap;
}
.foot-brand{font-weight:800; font-size:17px; margin-bottom:6px}
.foot-brand span{color:var(--red-ui)}
.foot-tag{font-size:13px; color:var(--muted)}
.foot-links{display:flex; gap:26px; flex-wrap:wrap; align-items:baseline}
.foot-links a{font-size:13px; color:var(--muted)}
.foot-copy{font-size:13px; color:var(--muted)}

/* Progressive disclosure is JS-only: with no JS every row stays visible. */
.js .row.is-clipped,
.js .artist.is-clipped{display:none}

@media (max-width:1000px){
  .hero{grid-template-columns:1fr}
  .hero-main{border-right:0; border-bottom:2px solid var(--ink)}
  .stats{flex-direction:row}
  .stat{flex:1; border-bottom:0; border-right:1px solid var(--rule)}
  .stat:last-child{border-right:0}
  .picks{grid-template-columns:repeat(2,1fr)}
  .about{grid-template-columns:1fr; gap:18px}
}
@media (max-width:720px){
  .masthead,.hero-main,.controls,.resultbar,.row,.empty,.more,
  .picks-sec,.about,.projects,.foot{padding-left:20px; padding-right:20px}
  .brand-tag{display:none}
  .row{grid-template-columns:1fr; gap:2px}
  .row-year{text-align:left}
  .picks{grid-template-columns:1fr}
  /* Keep the stats one compact row: stacking them pushes the search box —
     the whole point of the page — most of a screen further down. */
  .stats{flex-direction:row}
  .stat{padding:14px 12px}
  .stat-n{font-size:22px}
  .stat-l{font-size:10px; letter-spacing:.06em}
  h1{font-size:clamp(34px,10vw,44px)}
  .hero-main{padding-top:32px; padding-bottom:28px}
}
@media (prefers-reduced-motion:reduce){
  *{animation:none !important; transition:none !important}
}

/* ── artists index ────────────────────────────────────────
   One row per artist: the name, how many analyses exist, and every one of
   those songs as its own link. Keeping the song links on the page is the
   point of the index — it is what makes /artists.html worth crawling. */
.artist{
  display:grid; grid-template-columns:280px 1fr; gap:24px;
  padding:18px 40px; border-bottom:1px solid var(--rule);
}
.artist:hover{background:var(--tint)}
.artist[hidden]{display:none}
.artist-name{
  font-weight:800; font-size:20px; line-height:1.15;
  letter-spacing:-.015em; color:var(--ink);
}
.artist-count{
  display:block; margin-top:4px; font-size:12px; letter-spacing:.08em;
  text-transform:uppercase; color:var(--muted); font-variant-numeric:tabular-nums;
}
.artist-songs{
  display:flex; flex-wrap:wrap; gap:6px 0; align-items:baseline;
  margin:0; padding:0; list-style:none;
}
/* The separator belongs to the item BEFORE it, not the one after: as a
   ::before on the following item it became the first thing on a wrapped
   line. */
.artist-songs li:not(:last-child)::after{
  content:"·"; color:var(--faint); margin:0 10px;
}
.artist-songs a{font-size:15px; line-height:1.45; color:var(--body)}
.artist-songs a:hover{color:var(--red-ui)}

@media (max-width:1000px){
  .artist{grid-template-columns:1fr; gap:8px}
}
@media (max-width:720px){
  .artist{padding-left:20px; padding-right:20px}
}

/* ── Collection and artist pages (generate-song-collections.js,
      generate-artist-pages.js) and the directory intro ─────────── */
.crumbs{padding:12px 40px; font-size:13px; color:var(--muted); border-bottom:1px solid var(--rule)}
.crumbs a{color:var(--muted)}
.crumbs span{margin:0 8px; color:var(--muted)}
.intro{padding:26px 40px 8px; max-width:78ch}
.intro p{margin:0 0 12px; font-size:15px; line-height:1.6; color:var(--body)}
.intro a{font-weight:600}
a.chip{text-decoration:none; color:inherit}
a.chip.is-on{color:var(--panel)}
.section-link{display:inline-block; margin-top:6px; font-weight:800; font-size:14px}
a.artist-name{font-weight:inherit; color:inherit; text-decoration:underline; text-underline-offset:3px; text-decoration-color:var(--rule)}
a.artist-name:hover{text-decoration-color:currentColor}
@media (max-width:640px){
  .crumbs{padding:10px 16px}
  .intro{padding:20px 16px 4px}
}
