:root {
  --paper: #121515;
  --paper-2: #1b1f1f;
  --ink: #e6ebe8;
  --ink-soft: #96a19d;
  --rule: #2c3433;
  --accent: #82b5a5;
  /* Tanda genres, in the metals of the palette: verdigris, brass, copper, pewter */
  --genre-tango: #82b5a5;
  --genre-vals: #cdb276;
  --genre-milonga: #d6957c;
  --genre-other: #a7a3cf;
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --measure: 40rem;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

.wrap {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.25rem;
}

a { color: inherit; text-decoration-color: var(--rule); text-underline-offset: 0.2em; }
a:hover { color: var(--accent); text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.005em;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.5rem, 7vw, 3.75rem); font-weight: 400; }
h2 { font-size: clamp(1.5rem, 4vw, 1.875rem); }

p { margin: 0 0 1.1em; }

.eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.lede {
  font-family: var(--serif);
  font-size: clamp(1.3rem, 3.5vw, 1.55rem);
  line-height: 1.45;
  color: var(--ink-soft);
}

/* Header / footer */

/* The nav drops below the wordmark when both don't fit on one line */
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding-top: 1.75rem;
  padding-bottom: 1.75rem;
}

.wordmark {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 500;
  text-decoration: none;
  letter-spacing: 0.01em;
}
.wordmark span { color: var(--accent); }

.site-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
.site-nav a {
  font-size: 0.8125rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-soft);
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }
.site-nav a[aria-current="page"] { border-bottom: 1px solid var(--accent); }

.site-footer {
  margin-top: 5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.8125rem;
  color: var(--ink-soft);
}
.site-footer .wrap { padding-top: 1.5rem; padding-bottom: 2.5rem; }
.site-footer p { margin: 0; }

/* Sections */

.hero { padding: clamp(3rem, 12vw, 7rem) 0 clamp(2rem, 6vw, 3.5rem); }
.page-head { padding: clamp(2rem, 8vw, 4rem) 0 1.5rem; }

.section { padding-top: 2.5rem; }
.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.6rem;
  margin-bottom: 0.5rem;
}
.section-title h2 { margin: 0; }
.section-title a { font-size: 0.875rem; color: var(--ink-soft); }

.ornament {
  border: 0;
  height: 1px;
  background: var(--rule);
  margin: 2.5rem 0;
}

/* "Curated by" line on the home page, with a small round portrait */
.byline {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 2rem 0 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--ink-soft);
}
.byline img {
  flex: none;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--rule), 0 0 0 4px var(--paper), 0 0 0 5px var(--rule);
}
.byline a { color: var(--ink); }

/* A short aside, such as the curation note on resources */
.note {
  border-left: 2px solid var(--accent);
  padding: 0.1rem 0 0.1rem 1rem;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

.about-photo { margin: 0 0 1.75rem; }
.about-photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: 50% 30%;
  border-radius: 6px;
}
@media (min-width: 40rem) {
  .about-photo { float: right; width: 15rem; margin: 0.35rem 0 1.25rem 2rem; }
  .about-photo img { aspect-ratio: 3 / 4; }
}
.clear { clear: both; }

/* Where I've played */

/* Map styles: unused while "showMap" is false in scripts/places.json */
.world-map {
  /* Wider than the text column on large screens */
  width: min(56rem, 100vw - 2.5rem);
  margin: 1.25rem 0 1.5rem 50%;
  transform: translateX(-50%);
}
.world-map svg { display: block; width: 100%; height: auto; }
.world-map .land { fill: var(--paper-2); stroke: var(--rule); stroke-width: 0.6; }
.world-map .city { cursor: default; outline: none; }
.world-map .hit { fill: transparent; }
.world-map .dot { fill: var(--accent); transition: r 0.15s; }
.world-map .halo { fill: none; stroke: var(--accent); stroke-width: 1.5; opacity: 0.6; }
.world-map text {
  font: 500 15px var(--sans);
  fill: var(--ink);
  paint-order: stroke;
  stroke: var(--paper);
  stroke-width: 5px;
  stroke-linejoin: round;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.world-map .city:hover .dot, .world-map .city:focus .dot { fill: var(--ink); r: 5px; }

.city-groups { margin: 1.25rem 0 3rem; }
.city-groups div {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 0.25rem 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--rule);
}
.city-groups dt {
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding-top: 0.3rem;
}
.city-groups dd { margin: 0; }
.city-groups ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.city-groups li { font-family: var(--serif); font-size: 1.25rem; line-height: 1.4; }
.city-groups li:not(:last-child)::after { content: "·"; margin: 0 0.55rem; color: var(--ink-soft); }
@media (max-width: 30rem) {
  .city-groups div { grid-template-columns: 1fr; }
}
.home-tag {
  font-family: var(--sans);
  margin-left: 0.3rem;
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.event-list { list-style: none; margin: 0 0 2.5rem; padding: 0; }
.event-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.1rem 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--rule);
}
.event-name { font-family: var(--serif); font-size: 1.3rem; line-height: 1.25; }
.event-year { color: var(--ink-soft); font-size: 0.875rem; font-variant-numeric: tabular-nums; align-self: center; }
.event-city { grid-column: 1 / -1; color: var(--ink-soft); font-size: 0.875rem; }

.contact-links { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.5rem; }
.contact-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--serif);
  font-size: 1.3rem;
  text-decoration: none;
}
.contact-links a span { border-bottom: 1px solid var(--accent); line-height: 1.2; }
.contact-links .icon {
  width: 1.35rem;
  height: 1.35rem;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.contact-links .icon .fill { fill: var(--accent); }
.contact-links a:hover .icon { stroke: currentColor; }
.contact-links a:hover .icon .fill { fill: currentColor; }

/* Playlist list, and the link list on resources (same rows) */

.playlist-list, .link-list { list-style: none; margin: 0; padding: 0; }
.playlist-list li, .link-list li { border-bottom: 1px solid var(--rule); }
.playlist-list a, .link-list a {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.15rem 1rem;
  padding: 1.15rem 0;
  text-decoration: none;
}
.playlist-list .name, .link-list .name {
  font-family: var(--serif);
  font-size: 1.45rem;
  line-height: 1.2;
}
.playlist-list .when {
  font-size: 0.8125rem;
  color: var(--ink-soft);
  white-space: nowrap;
  align-self: center;
  font-variant-numeric: tabular-nums;
}
.playlist-list .where {
  grid-column: 1 / -1;
  font-size: 0.875rem;
  color: var(--ink-soft);
}
.playlist-list .where em {
  font-style: normal;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.75rem;
}
.playlist-list a:hover .name, .link-list a:hover .name { color: var(--accent); }

.link-list { margin-bottom: 3rem; border-top: 1px solid var(--rule); }
.link-list .host {
  font-size: 0.8125rem;
  color: var(--ink-soft);
  align-self: center;
}
.link-list .host::after { content: " ↗"; color: var(--accent); }
.link-list .desc {
  grid-column: 1 / -1;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

/* Playlist page */

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  margin: 1.5rem 0 0;
  font-size: 0.875rem;
}
.meta div { display: flex; flex-direction: column; }
.meta dt {
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.meta dd { margin: 0; }

/* Genre color, used through var(--g) */
.g-tango { --g: var(--genre-tango); }
.g-vals { --g: var(--genre-vals); }
.g-milonga { --g: var(--genre-milonga); }
.g-other { --g: var(--genre-other); }

/* Set overview: one bar per tanda in its genre color, then a legend */
.set-overview { margin: 0.75rem 0 0.5rem; }
.set-strip { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; }
.set-strip li { flex: 1; }
.set-strip a { display: block; padding: 0.6rem 0; }
.set-strip a::before {
  content: "";
  display: block;
  height: 0.375rem;
  border-radius: 1px;
  background: var(--g);
  opacity: 0.8;
  transition: opacity 0.15s, transform 0.15s;
}
.set-strip a:hover::before, .set-strip a:focus-visible::before { opacity: 1; transform: scaleY(1.7); }
.genre-legend {
  list-style: none;
  margin: 0.15rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.4rem;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}
.genre-legend li::before {
  content: "";
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--g);
  margin-right: 0.45rem;
}
.genre-legend span { color: var(--ink); margin-left: 0.15rem; font-variant-numeric: tabular-nums; }

.tandas { list-style: none; margin: 1.5rem 0 0; padding: 0; counter-reset: tanda; }

.tanda {
  counter-increment: tanda;
  position: relative;
  margin: 0.4rem 0;
  padding: 1.25rem 1.25rem 1rem 3.25rem;
  border-radius: 6px;
  /* A faint panel in the genre color */
  background: color-mix(in srgb, var(--g, var(--accent)) 8%, var(--paper));
  scroll-margin-top: 1rem;
}
/* Tanda number, with a thin line in the genre color below it */
.tanda::before {
  content: counter(tanda, decimal-leading-zero);
  position: absolute;
  left: 1rem;
  top: 1.25rem;
  font-size: 0.75rem;
  line-height: 1.5;
  letter-spacing: 0.08em;
  color: var(--g, var(--accent));
  font-variant-numeric: tabular-nums;
}
.tanda::after {
  content: "";
  position: absolute;
  left: 1.45rem;
  top: 2.85rem;
  bottom: 1.25rem;
  width: 1px;
  background: var(--g, var(--accent));
  opacity: 0.5;
}
.tanda .genre {
  font-size: 0.6875rem;
  line-height: 1.6;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--g, var(--accent));
  margin: 0 0 0.35rem;
}
.tanda h2 { margin-bottom: 0.15rem; }
.tanda-info {
  font-size: 0.875rem;
  color: var(--ink-soft);
  margin-bottom: 0.75rem;
}

/* Track rows: title (and credits when the tanda mixes them), then year and time in fixed columns */
.tracks { margin: 0; padding: 0; list-style: none; }
.tracks li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  column-gap: 1rem;
  align-items: baseline;
  padding: 0.45rem 0;
  line-height: 1.45;
  border-bottom: 1px dotted color-mix(in srgb, var(--g, var(--accent)) 20%, var(--paper));
}
.tracks li:last-child { border-bottom: 0; }
.tracks .year, .tracks .time {
  color: var(--ink-soft);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.tracks .year { min-width: 2.25rem; }
.tracks .time { min-width: 2.5rem; }
.tracks .credit { color: var(--ink-soft); font-size: 0.875rem; }
.tracks .credit::before { content: "— "; }
.genre-tag {
  color: var(--g);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cortina {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  color: var(--ink-soft);
  padding: 0.5rem 0;
}
.cortina::before, .cortina::after {
  content: "";
  flex: 1 0 2rem;
  height: 1px;
  background: var(--rule);
}
.cortina > span { text-wrap: balance; }
.cortina .name, .cortina .by { text-transform: none; letter-spacing: 0; }
.cortina .name { font-style: italic; font-family: var(--serif); font-size: 1rem; margin-left: 0.3rem; }
.cortina .by { font-size: 0.8125rem; }
.cortina .by::before { content: "· "; }

/* A closing La Cumparsita after the last tanda: centered on its own, outside the tanda panels */
.cumparsita { text-align: center; padding: 1.25rem 0 0.75rem; }
.cumparsita::before {
  content: "";
  display: block;
  width: 2.5rem;
  height: 1px;
  margin: 0 auto 1rem;
  background: var(--accent);
}
.cumparsita h2 { font-style: italic; margin-bottom: 0.15rem; }
.cumparsita p { font-size: 0.875rem; color: var(--ink-soft); margin: 0; }

.back { font-size: 0.875rem; color: var(--ink-soft); }

@media (max-width: 30rem) {
  /* Keeps "Resources Playlists About Grigor" on one line on small phones */
  .site-nav { column-gap: 1.1rem; }
  .site-nav a { font-size: 0.75rem; letter-spacing: 0.1em; }
  .meta { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem 1.5rem; }
  /* Panels run almost to the screen edges */
  .tanda { margin-left: -0.75rem; margin-right: -0.75rem; padding: 1.1rem 0.75rem 0.9rem 2.6rem; }
  .tanda::before { left: 0.75rem; }
  .tanda::after { left: 1.2rem; }
  .tracks li { column-gap: 0.75rem; font-size: 1rem; }
  /* Credits and cortina details go on their own lines instead of wrapping mid-phrase */
  .tracks .credit { display: block; line-height: 1.45; }
  .cortina > span { line-height: 1.45; }
  .cortina .name, .cortina .by { display: block; margin: 0.15rem 0 0; }
  .tracks .credit::before, .cortina .by::before { content: none; }
}
