/* ---------- tokens ---------- */
:root {
  --bg:        #0b0c10;
  --bg-raised: #14161d;
  --line:      #262a34;
  --ink:       #eef0f5;
  --ink-dim:   #8b91a3;
  --accent:    #ff2f80;
  --accent-2:  #d9ff4b;
  --radius:    14px;
  --card-h:    248px;          /* every frame is this tall; width follows the poster */
  --ease:      cubic-bezier(.2,.7,.3,1);
}

* { box-sizing: border-box; }

/* `hidden` must beat the display rules below it */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 500px at 50% -10%, #1c1030 0%, transparent 70%),
    var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; }

/* ---------- masthead ---------- */
.masthead {
  text-align: center;
  padding: 52px 20px 8px;
}

.wordmark {
  margin: 0;
  font-size: clamp(34px, 7vw, 58px);
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1;
}
/* The two halves of the name are the festival switches. They have to look like
   one continuous wordmark, so the buttons are stripped right back. */
.fest-toggle {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  letter-spacing: inherit;
  color: var(--ink);
  cursor: pointer;
  transition: opacity .2s var(--ease), color .2s var(--ease);
}
.fest-toggle.alt { color: var(--accent); }
.fest-toggle:hover { opacity: .78; }
.fest-toggle:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 4px; border-radius: 6px; }
.fest-toggle.off {
  color: #454b5e;
  text-decoration: line-through;
  text-decoration-thickness: .06em;
}

.tagline .hint { display: block; margin-top: 5px; font-size: 13px; color: #5d6375; }

/* ---------- one block per festival ---------- */
.fest { margin-top: 30px; }
.fest[hidden] { display: none; }

.fest-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 0;
  padding: 0 40px;
  font-size: 15px;
  font-weight: 600;
}
.fest-name { font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.fest[data-fest="osheaga"] .fest-name { color: var(--ink); }
.fest[data-fest="lollapalooza"] .fest-name { color: var(--accent); }
.fest-where { color: var(--ink-dim); font-weight: 500; }
.fest-blurb { color: #5d6375; font-weight: 400; font-size: 13px; margin-left: auto; }

.fest .timeline { margin-top: 6px; }

/* a band on screen: the verdict names the festivals, so the headings step aside */
body.band-on .fest-head { display: none; }

/* "only their years": every other card leaves the row, and a festival they never
   played leaves the page */
body.hits-only .card:not(.hit) { display: none; }
body.hits-only .fest.no-hits { display: none; }
body.hits-only .card.edge-l .node::before { left: 50%; }
body.hits-only .card.edge-r .node::before { right: 50%; }
/* centre what's left; auto margins (not justify-content) so a row that still
   overflows keeps its start reachable instead of clipping off the left */
body.hits-only .card.edge-l { margin-left: auto; }
body.hits-only .card.edge-r { margin-right: auto; }

body.nothing-shown .verdict::after {
  content: "Both timelines are hidden — tap the name above to bring one back.";
  color: var(--ink-dim);
  font-size: 15px;
  font-weight: 500;
}

.tagline {
  margin: 12px 0 0;
  color: var(--ink-dim);
  font-size: 15px;
}

/* ---------- search ---------- */
.search {
  position: relative;
  max-width: 560px;
  margin: 28px auto 0;
  padding: 0 20px;
}

.field {
  position: relative;
  display: flex;
  align-items: center;
}

.glass {
  position: absolute;
  left: 18px;
  width: 19px; height: 19px;
  fill: none;
  stroke: var(--ink-dim);
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}

#q {
  width: 100%;
  padding: 16px 46px 16px 48px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 17px;
  outline: none;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
#q::placeholder { color: #5d6375; }
#q:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgb(255 47 128 / .14);
}
#q::-webkit-search-cancel-button { display: none; }

.clear {
  position: absolute;
  right: 12px;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  background: none;
  border: 0;
  border-radius: 50%;
  color: var(--ink-dim);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.clear:hover { background: #22252e; color: var(--ink); }

/* ---------- suggestions ---------- */
.suggestions {
  position: absolute;
  z-index: 20;
  left: 20px; right: 20px;
  margin: 6px 0 0;
  padding: 6px;
  list-style: none;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 20px 44px rgb(0 0 0 / .55);
  max-height: 330px;
  overflow-y: auto;
}

.suggestions li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  cursor: pointer;
}
.suggestions li[aria-selected="true"] { background: #23262f; }
.suggestions .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggestions .yrs { display: flex; gap: 5px; flex: none; }
.suggestions .chip {
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
.suggestions .chip.osheaga { background: rgb(255 47 128 / .16); color: #ff9ec4; }
.suggestions .chip.lollapalooza { background: rgb(217 255 75 / .14); color: #d9ff4b; }

/* ---------- examples ---------- */
.examples {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}
.examples button {
  padding: 6px 13px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-dim);
  font-size: 13.5px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.examples button:hover { color: var(--ink); border-color: #454b5c; }
.examples .lucky { color: var(--accent-2); border-color: #3d4726; }
.examples .lucky:hover { border-color: var(--accent-2); }

/* ---------- verdict ---------- */
.verdict {
  min-height: 30px;
  margin: 34px 20px 0;
  text-align: center;
  font-size: clamp(17px, 2.6vw, 22px);
  font-weight: 600;
  letter-spacing: -.01em;
}
.verdict .who { color: var(--accent); display: block; }
/* The name is a Spotify link: a dotted underline and a play glyph give it away
   without turning the headline into a blue hyperlink. */
.verdict .who a {
  color: inherit;
  text-decoration: underline dotted rgb(255 47 128 / .5);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
  transition: text-decoration-color .2s var(--ease);
}
.verdict .who a:hover,
.verdict .who a:focus-visible { text-decoration-color: var(--accent); }
.verdict .who .listen {
  width: .8em; height: .8em;
  margin-left: .3em;
  vertical-align: -.06em;
  color: #1ed760;   /* Spotify green */
}
.verdict .who .listen circle { fill: none; stroke: currentColor; stroke-width: 2; }
.verdict .who .listen path   { fill: currentColor; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.verdict .tallies {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 26px;
  margin-top: 10px;
}
.verdict .tally {
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
}
.verdict .tally b { font-weight: 700; }
.verdict .tally.none { color: #5d6375; font-weight: 500; }
.verdict .tally .count { margin-left: 4px; }
.verdict .count { color: var(--accent-2); }
.verdict .miss { color: var(--ink-dim); font-weight: 500; }

.verdict .years {
  display: block;
  margin-top: 8px;
  color: var(--ink-dim);
  font-size: 15px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* ---------- timeline ---------- */
.timeline {
  position: relative;
  margin-top: 26px;
  padding-bottom: 8px;
}
/* edge fades */
.timeline::before,
.timeline::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 56px;
  pointer-events: none;
  z-index: 3;
}
.timeline::before { left: 0;  background: linear-gradient(90deg, var(--bg), transparent); }
.timeline::after  { right: 0; background: linear-gradient(270deg, var(--bg), transparent); }

.track {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 18px 40px 30px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: #333846 transparent;
}
.track::-webkit-scrollbar { height: 9px; }
.track::-webkit-scrollbar-thumb { background: #333846; border-radius: 9px; }

/* ---------- poster card ---------- */
.card {
  position: relative;
  flex: 0 0 auto;
  /* Posters run from 2:3 (2006) to square (2022 on), so a shared frame ratio had to
     crop one era or the other. Instead each card is as wide as its own poster is,
     at the one shared height — nothing is cut, and the spine below stays level. */
  width: calc(var(--card-h) * var(--ratio, .75));
  scroll-snap-align: center;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: center;
  transition: transform .3s var(--ease), opacity .3s var(--ease), filter .3s var(--ease);
}

.frame {
  position: relative;
  height: var(--card-h);
  border-radius: 11px;
  overflow: hidden;
  background: #1a1d25;
  box-shadow: 0 8px 22px rgb(0 0 0 / .45);
  transition: box-shadow .3s var(--ease);
}
.frame img {
  width: 100%; height: 100%;
  display: block;
  object-fit: cover;
  object-position: 50% 0;
}
.frame::after {                 /* highlight ring, faded unless hit */
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 2px transparent;
  transition: box-shadow .3s var(--ease);
}

/* the timeline spine */
.node {
  position: relative;
  height: 22px;
}
.node::before {                 /* the connecting rail, drawn per-card so it spans the row */
  content: "";
  position: absolute;
  top: 10px;
  left: calc(-9px - 1px);       /* half the gap, plus a hair to close seams */
  right: calc(-9px - 1px);
  height: 2px;
  background: var(--line);
}
.card:first-child .node::before { left: 50%; }
.card:last-child  .node::before { right: 50%; }

.dot {
  position: absolute;
  top: 6px; left: 50%;
  width: 10px; height: 10px;
  margin-left: -5px;
  border-radius: 50%;
  background: #2f3441;
  box-shadow: 0 0 0 4px var(--bg);
  transition: background .3s var(--ease), transform .3s var(--ease), box-shadow .3s var(--ease);
}

.year {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink-dim);
  transition: color .3s var(--ease);
}

/* hover */
.card:hover .frame { box-shadow: 0 14px 30px rgb(0 0 0 / .6); }
.card:hover .year  { color: var(--ink); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: 12px; }

/* --- states --- */
.searching .card { filter: grayscale(1) brightness(.5); opacity: .4; transform: scale(.94); }
.searching .card .year { color: #565c6d; }

.searching .card.hit {
  filter: none;
  opacity: 1;
  transform: translateY(-10px) scale(1.03);
}
.searching .card.hit .frame {
  box-shadow: 0 16px 38px rgb(0 0 0 / .6), 0 0 34px rgb(255 47 128 / .32);
}
.searching .card.hit .frame::after { box-shadow: inset 0 0 0 2px var(--accent); }
.searching .card.hit .dot { background: var(--accent); transform: scale(1.25); }
.searching .card.hit .year { color: var(--accent); }

.card.open .frame::after { box-shadow: inset 0 0 0 2px var(--accent-2); }

/* The lost years — 2020 cancelled, 2021 shrunk to the Get Together. They keep a
   poster and still open (poster only, no lineup), but sit permanently faded: no
   hover lift, no highlight, greyed whatever the rest of the timeline is doing. */
.card.void .frame { filter: grayscale(.85) brightness(.62); }
.card.void .year  { color: #565c6d; }
.card.void:hover .frame { box-shadow: 0 8px 22px rgb(0 0 0 / .45); }
.card.void:hover .year  { color: #565c6d; }

/* a cancelled year with no poster at all falls back to the striped placeholder */
.card.blank { width: 118px; }
.card.blank .frame {
  background:
    repeating-linear-gradient(45deg, #14161d 0 8px, #111319 8px 16px);
  border: 1px dashed #2c3140;
  box-shadow: none;
  display: grid;
  place-items: center;
}
.card.blank .frame span {
  padding: 0 10px;
  color: #565c6d;
  font-size: 12px;
  line-height: 1.35;
  text-transform: uppercase;
  letter-spacing: .07em;
}
.searching .card.void { filter: none; opacity: .28; transform: none; }

/* ---------- detail ---------- */
.detail {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: 28px;
  max-width: 900px;
  margin: 8px auto 0;
  padding: 26px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.detail-close {
  position: absolute;
  top: 12px; right: 14px;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: none; border: 0;
  border-radius: 50%;
  color: var(--ink-dim);
  font-size: 24px; line-height: 1;
  cursor: pointer;
}
.detail-close:hover { background: #23262f; color: var(--ink); }

.detail-poster img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
}
.detail-poster img[hidden] { display: none; }
.detail-img-link { display: block; }
.detail-img-link[href] { cursor: zoom-in; }

/* site map, under the poster — only rendered for years we have one for */
.detail-map { margin: 14px 0 0; }
.detail-map img { background: #fff; }
.detail-map figcaption {
  margin-top: 7px;
  color: var(--ink-dim);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.detail-body h2 {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -.02em;
}
.detail-dates {
  margin: 4px 0 0;
  color: var(--ink-dim);
  font-size: 14px;
}

/* Optional trivia under the dates. Spacing lives on the lineup below so the gap
   is the same whether or not a year has a note. */
.detail-notes {
  margin: 7px 0 0;
  max-width: 62ch;
  color: #5d6375;
  font-size: 12.5px;
  line-height: 1.5;
}
.detail-notes[hidden] { display: none; }

.detail-body .detail-lineup { margin-top: 18px; }

.detail-lineup {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.detail-lineup li {
  padding: 4px 10px;
  background: #1c1f28;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 13.5px;
  color: #b9bfd0;
  cursor: pointer;
  transition: filter .15s var(--ease);
}
/* Lift on hover with a filter rather than a colour, so the one rule reads the same
   on a plain pill, a silver or gold one, and the pink search hit. */
.detail-lineup li:hover { filter: brightness(1.35); }
.detail-lineup li:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* Returning acts: silver on the second Osheaga, gold on the third and beyond. */
.detail-lineup li.repeat {
  background: linear-gradient(180deg, rgb(214 222 235 / .18), rgb(214 222 235 / .09));
  border-color: rgb(214 222 235 / .38);
  color: #dde3ee;
}
.detail-lineup li.regular {
  background: linear-gradient(180deg, rgb(255 199 89 / .22), rgb(255 199 89 / .10));
  border-color: rgb(255 199 89 / .45);
  color: #ffdfa3;
}

/* Played the other festival too — a quiet dotted underline, so it stacks with
   the silver/gold return tints instead of fighting them for the background. */
.detail-lineup li.crossover {
  text-decoration: underline dotted var(--accent-2);
  text-underline-offset: 3px;
}

.detail-lineup li.hit {
  background: rgb(255 47 128 / .16);
  border-color: var(--accent);
  color: #ffd6e6;
  font-weight: 600;
}

/* ---------- the numbers ---------- */
/* A handful of headline counts is a KPI row, not a chart: the number is the
   mark. Identity is carried by the label text, so no colour coding is needed. */
.numbers {
  max-width: 940px;
  margin: 54px auto 0;
  padding: 0 20px;
}
.numbers[hidden] { display: none; }

.numbers-head {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.02em;
}
.numbers-hint {
  margin: 0;
  color: var(--ink-dim);
  font-size: 13px;
}
.numbers-sub {
  margin: 26px 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-dim);
}

.kpi {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 16px 18px 17px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.tile .label {
  color: var(--ink-dim);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .01em;
}
.tile .value {
  margin-top: 3px;
  font-size: 36px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.02em;
  /* proportional figures on purpose: tabular-nums makes a big number look loose */
  font-variant-numeric: proportional-nums;
}
.tile .note {
  margin-top: 7px;
  color: #5d6375;
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.45;
}

/* a tile that can open its list */
.tile[role="button"] { cursor: pointer; transition: border-color .15s var(--ease), background .15s var(--ease); }
.tile[role="button"]:hover { border-color: #3a4051; }
.tile[role="button"]:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; }
.tile.open { border-color: var(--accent); background: #191b24; }
/* A chevron in the corner marks each tile as something that opens — on touch
   screens there's no hover state to hint at it. It turns down while open. */
.tile[role="button"]::after {
  content: "";
  position: absolute;
  top: 19px; right: 18px;
  width: 7px; height: 7px;
  border-right: 2px solid var(--ink-dim);
  border-bottom: 2px solid var(--ink-dim);
  transform: rotate(-45deg);
  transition: transform .2s var(--ease), border-color .2s var(--ease);
}
.tile[role="button"]:hover::after { border-color: var(--ink); }
.tile.open::after { transform: rotate(45deg); border-color: var(--accent); }
/* no hover on touch, so start the tiles a notch brighter */
@media (hover: none) {
  .tile[role="button"] { border-color: #333846; }
  .tile[role="button"]:active { background: #191b24; }
}

/* ---------- the acts behind a number ---------- */
.bucket {
  position: relative;
  max-width: 940px;
  margin: 16px auto 0;
  padding: 20px 22px 22px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.bucket[hidden] { display: none; }
.bucket-head {
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 700;
  padding-right: 40px;
}
.bucket-count { color: var(--ink-dim); font-weight: 500; font-size: 14px; }

/* Long lists scroll instead of pushing the page out; 1,600-odd acts is a lot. */
.bucket-list {
  max-height: 340px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #333846 transparent;
  padding-right: 4px;
}
/* No crossover underline in here: this panel is already sorted by cross-festival
   status, so the marker would only repeat what the heading says. */
.bucket-list li.crossover { text-decoration: none; }

/* ---------- colophon ---------- */
.colophon {
  margin: 46px 0 40px;
  text-align: center;
  color: #5d6375;
  font-size: 13px;
}
.colophon p { margin: 0; }

/* ---------- responsive ---------- */
@media (max-width: 700px) {
  :root { --card-h: 190px; }
  .masthead { padding-top: 34px; }
  .track { padding-left: 24px; padding-right: 24px; gap: 14px; }
  .node::before { left: -8px; right: -8px; }
  .detail { grid-template-columns: 1fr; margin: 8px 16px 0; padding: 20px; }
  .detail-poster { max-width: 260px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
