/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  color-scheme: light dark;
  --bg:       #fbfbfa;
  --surface:  #ffffff;
  --bg2:      #f3f3f1;
  --border:   #e4e4e0;
  --text:     #1f2328;
  --heading:  #0f1215;
  --muted:    #626a75;
  --accent:   #2a5bb8;
  --nav-bg:   rgba(251,251,250,.85);
  --font:     'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono:     'JetBrains Mono', ui-monospace, monospace;
  --max:      760px;
  --nav-h:    60px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:      #121417;
    --surface: #1a1d21;
    --bg2:     #1a1d21;
    --border:  #2a2e34;
    --text:    #d9dde3;
    --heading: #f4f5f7;
    --muted:   #9199a4;
    --accent:  #84a9f0;
    --nav-bg:  rgba(18,20,23,.85);
  }
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: var(--bg); }

a { color: var(--accent); text-decoration: none; transition: color .15s, opacity .15s; }
a:hover { opacity: .8; }

/* ── Nav ── */
nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.25rem, 5vw, 3rem);
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-family: var(--mono);
  font-size: .95rem;
  font-weight: 700;
  color: var(--heading);
  letter-spacing: .02em;
}
.nav-logo span { color: var(--accent); }

.back-link {
  color: var(--muted);
  font-size: .9rem;
  font-weight: 500;
}
.back-link:hover { color: var(--heading); opacity: 1; }

/* ── Main layout ── */
main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 5vw, 3rem);
}

section {
  padding: 3.5rem 0;
  border-bottom: 1px solid var(--border);
}
section:last-child { border-bottom: none; }

#hero { padding-top: 4.5rem; }

#hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.25rem);
  font-weight: 700;
  color: var(--heading);
  letter-spacing: -.03em;
  line-height: 1.1;
  margin-bottom: .6rem;
}

.tagline {
  font-size: 1rem;
  color: var(--muted);
}

h2 {
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .12em;
  margin-bottom: 1.75rem;
}

.muted { color: var(--muted); }

/* ── Overview stat grid ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: .9rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1rem;
  text-align: center;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--heading);
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}

/* Dates are wider than counts; keep them inside the card at any grid width */
.stat-value--date {
  font-size: 1.15rem;
  line-height: 2.2rem;
}

.stat-label {
  margin-top: .3rem;
  font-size: .75rem;
  font-weight: 500;
  color: var(--muted);
}

/* ── Shows per year chart ── */
.year-chart {
  display: flex;
  align-items: flex-end;
  gap: .6rem;
  height: 170px;
  overflow-x: auto;
  padding-bottom: .25rem;
}

.year-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-width: 36px;
  height: 100%;
}

.year-bar {
  width: 100%;
  min-height: 2px;
  background: var(--accent);
  border-radius: 4px 4px 0 0;
}

.year-count {
  font-size: .8rem;
  font-weight: 600;
  color: var(--heading);
  margin-top: .35rem;
}

.year-label {
  font-size: .75rem;
  color: var(--muted);
}

/* ── States list ── */
.states-list {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  list-style: none;
}

.states-list li {
  padding: .2rem .7rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: .8rem;
  color: var(--text);
}

/* ── Song list ── */
.song-list {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.song-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(80px, 3fr) 2.5ch;
  align-items: center;
  gap: .75rem;
  font-size: .9rem;
}

.song-name {
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-bar-track {
  background: var(--bg2);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.song-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
}

.song-count {
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.section-note {
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

/* ── Jam charts ── */
.jam-row {
  padding: .9rem 0;
  border-top: 1px solid var(--border);
}
.jam-row:first-of-type { border-top: none; padding-top: 0; }

.jam-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: .75rem;
}

.jam-song {
  font-weight: 600;
  color: var(--heading);
}

.jam-meta {
  font-size: .8rem;
  color: var(--muted);
}

.jam-desc {
  margin-top: .3rem;
  font-size: .85rem;
  color: var(--text);
}

/* ── Bustouts ── */
.bustout-list {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.bustout-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr) auto;
  align-items: baseline;
  gap: .75rem;
  font-size: .9rem;
}

.bustout-song {
  color: var(--text);
  font-weight: 500;
}

.bustout-meta {
  font-size: .8rem;
  color: var(--muted);
}

.bustout-gap {
  color: var(--muted);
  font-size: .8rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.bustout-gap strong { color: var(--heading); font-size: .95rem; }

/* ── Openers / closers / encores ── */
.rotation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: .9rem;
}

.rotation-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.1rem 1rem;
}

.rotation-card h3 {
  font-size: .75rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: .6rem;
}

.rotation-card ol { list-style: none; }

.rotation-card li {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  font-size: .85rem;
  padding: .15rem 0;
}

/* ── Setlists ── */
.show {
  border-top: 1px solid var(--border);
}
.show:last-child { border-bottom: 1px solid var(--border); }

.show summary {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr) auto;
  gap: .75rem;
  align-items: baseline;
  padding: .75rem 0;
  cursor: pointer;
  list-style: none;
  font-size: .9rem;
}
.show summary::-webkit-details-marker { display: none; }
.show summary:hover .show-venue { color: var(--accent); }

.show-date {
  color: var(--heading);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.show-venue {
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color .15s;
}

.show-place {
  color: var(--muted);
  font-size: .8rem;
}

.setlist {
  padding: 0 0 1rem;
  font-size: .875rem;
}
.setlist p { margin-bottom: .5rem; }

.set-label {
  display: inline-block;
  min-width: 4.75rem;
  margin-right: .35rem;
  font-size: .75rem;
  font-weight: 600;
  color: var(--muted);
}

.segue { color: var(--muted); }

.is-jamchart {
  color: var(--accent);
  font-weight: 600;
}

.setlist-notes {
  font-size: .8rem;
  color: var(--muted);
}

.setlist-link { font-size: .8rem; }

/* ── Footer ── */
footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem clamp(1.25rem, 5vw, 3rem) 3rem;
  font-size: .8rem;
  color: var(--muted);
}

@media (max-width: 600px) {
  .song-row { grid-template-columns: minmax(0, 1fr) minmax(60px, 2fr) 2.5ch; }
  .bustout-row { grid-template-columns: minmax(0, 1fr) auto; }
  .bustout-meta { grid-row: 2; grid-column: 1 / -1; margin-top: -.5rem; }
  .show summary { grid-template-columns: 5.75rem minmax(0, 1fr); }
  .show-place { display: none; }
}
