:root {
  --paper: #f5f2ea;
  --card: #fffdf8;
  --ink: #111111;
  --muted: #5f5b54;
  --rule: #d9d3c5;
  --red: #e1261c;
  --blue: #1f4fd1;
  --green: #11884b;
  --yellow: #ffd400;
  --highlight: #fff4b8;
  --wrap: 72rem;
  --gutter: clamp(1rem, 3vw, 2rem);
  --display: "Archivo Black", "Arial Black", Impact, sans-serif;
  --text: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1rem;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--red);
}

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

img {
  max-width: 100%;
  display: block;
}

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

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

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.nowrap {
  white-space: nowrap;
}

/* ---------------------------------------------------------------- chrome */

.topbar {
  background: var(--ink);
  color: #fff;
  font-size: 0.75rem;
}

.topbar-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
}

.topbar-inner span:last-child {
  font-weight: 700;
}

.masthead {
  border-bottom: 3px solid var(--ink);
}

.masthead > .wrap {
  padding-top: 1.25rem;
  padding-bottom: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--ink);
}

.brand:hover {
  color: var(--ink);
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  background: var(--red);
  color: #fff;
  font-family: var(--display);
  font-size: 1.25rem;
  letter-spacing: -0.03em;
}

.brand-name {
  font-family: var(--display);
  font-size: clamp(1.5rem, 5vw, 2.75rem);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}

.nav {
  border-top: 1px solid var(--ink);
}

.nav-inner {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav a {
  flex: none;
  padding: 0.65rem 0.9rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
}

.nav a[aria-current="page"] {
  background: var(--ink);
  color: #fff;
}

.footer {
  margin-top: 4rem;
  background: var(--ink);
  color: #d8d4cb;
  font-size: 0.875rem;
}

.footer-inner {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 2fr 1fr;
  padding-top: 2rem;
  padding-bottom: 2.5rem;
}

.footer .brand,
.footer .brand:hover {
  color: #fff;
}

.brand-small .brand-mark {
  width: 2rem;
  height: 2rem;
  font-size: 0.9rem;
}

.brand-small .brand-name {
  font-size: 1.25rem;
}

.footer p {
  margin: 0.75rem 0 0;
  max-width: 34rem;
}

.footer-meta p {
  margin: 0 0 0.35rem;
}

.footer a:hover {
  color: var(--yellow);
}

/* ---------------------------------------------------------------- page furniture */

.page {
  padding-top: 1.75rem;
}

.page-header {
  margin-bottom: 1.75rem;
}

.page-header h1 {
  margin: 0.25rem 0 0.75rem;
  font-family: var(--display);
  font-size: clamp(2.25rem, 7vw, 4rem);
  line-height: 1;
  letter-spacing: -0.03em;
  font-weight: 400;
}

.video-header h1 {
  font-size: clamp(1.75rem, 5vw, 3rem);
}

.kicker {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lede {
  max-width: 44rem;
  margin: 0;
  font-size: 1.125rem;
  color: #2c2a26;
}

.byline {
  margin: 0;
  font-weight: 600;
}

.crumbs {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.section {
  margin-top: 2.75rem;
}

.section-title {
  margin: 0 0 1rem;
  padding-top: 0.5rem;
  border-top: 3px solid var(--ink);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-intro,
.note {
  margin: -0.25rem 0 1rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.note {
  margin: 0.75rem 0 0;
}

.more-link {
  margin: 1rem 0 0;
  font-weight: 700;
  font-size: 0.875rem;
}

/* ---------------------------------------------------------------- tier colours */

.t-1 { --tier: var(--red); --tier-fg: #fff; }
.t-2 { --tier: var(--blue); --tier-fg: #fff; }
.t-3 { --tier: var(--green); --tier-fg: #fff; }
.t-4 { --tier: var(--yellow); --tier-fg: var(--ink); }
.t-5 { --tier: var(--ink); --tier-fg: #fff; }
.t-sub { --tier: #e6e0d2; --tier-fg: var(--ink); }

.badge {
  display: inline-block;
  min-width: 2.5rem;
  padding: 0.2rem 0.4rem;
  background: var(--tier, var(--ink));
  color: var(--tier-fg, #fff);
  font-family: var(--display);
  font-size: 0.75rem;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

a.badge:hover {
  color: var(--tier-fg, #fff);
  outline: 2px solid var(--ink);
}

/* ---------------------------------------------------------------- home */

.hero {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1rem;
}

.hero-main {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 20rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  background: var(--red);
  color: #fff;
  text-decoration: none;
}

.hero-main:hover {
  color: #fff;
}

.hero-number {
  font-family: var(--display);
  font-size: clamp(5rem, 16vw, 10rem);
  line-height: 0.85;
  letter-spacing: -0.04em;
}

.hero-text {
  margin-top: 0.75rem;
  max-width: 26rem;
  font-family: var(--display);
  font-size: clamp(1.4rem, 3.5vw, 2.1rem);
  line-height: 1.1;
}

.hero-more {
  margin-top: 1.25rem;
  font-weight: 700;
  font-size: 0.875rem;
}

.hero-main:hover .hero-more {
  text-decoration: underline;
}

.hero-side {
  display: grid;
  gap: 1rem;
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1.1rem 1.25rem;
  text-decoration: none;
}

.stat-yellow {
  background: var(--card);
  border: 4px solid var(--yellow);
  border-left-width: 12px;
}

.stat-ink {
  background: var(--ink);
  color: #fff;
}

.stat-red {
  background: var(--red);
  color: #fff;
}

.stat-ink:hover {
  color: var(--yellow);
}

.stat-big {
  font-family: var(--display);
  font-size: clamp(2.5rem, 7vw, 3.5rem);
  line-height: 1;
  letter-spacing: -0.03em;
}

.stat-label {
  font-weight: 700;
  line-height: 1.3;
}

.stat-sub {
  font-size: 0.8rem;
  opacity: 0.85;
}

.stat-red .badge {
  outline: 1px solid #fff;
}

.stages {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stage {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0.75rem;
  background: var(--tier);
  color: var(--tier-fg);
  text-decoration: none;
}

.stage:hover {
  color: var(--tier-fg);
  outline: 3px solid var(--ink);
}

.stage-count {
  font-family: var(--display);
  font-size: clamp(1.1rem, 2.4vw, 1.6rem);
  line-height: 1.1;
}

.stage-label {
  margin-top: auto;
  padding-top: 0.25rem;
  font-size: 0.75rem;
  font-weight: 800;
}

.columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 2.5rem;
}

.ranked {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ranked li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--rule);
}

.ranked-rank {
  flex: none;
  width: 1.75rem;
  color: var(--red);
  font-family: var(--display);
  font-size: 1.25rem;
  text-align: right;
}

.ranked-thumb {
  flex: none;
}

.ranked-thumb img {
  width: 4.5rem;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--rule);
}

.ranked-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.3;
}

.ranked-body > a {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-decoration: none;
}

.ranked-body > a:hover {
  text-decoration: underline;
}

.ranked-meta {
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
}

.ranked-value {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
  font-family: var(--display);
  font-size: 1rem;
}

.ranked-value strong {
  font-weight: 400;
}

.to-go {
  font-family: var(--text);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}

.bar {
  display: block;
  height: 0.4rem;
  margin-top: 0.4rem;
  background: var(--rule);
}

.bar > span {
  display: block;
  height: 100%;
  background: var(--tier, var(--red));
}

.bar > .t-sub {
  background: var(--muted);
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  aspect-ratio: 1;
  padding: 0.9rem;
  background: var(--tier);
  color: var(--tier-fg);
  text-decoration: none;
}

.tile:hover {
  color: var(--tier-fg);
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.tile-label {
  font-family: var(--display);
  font-size: 2.5rem;
  line-height: 1;
}

.tile-count {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---------------------------------------------------------------- tables */

.table-scroll {
  overflow-x: auto;
  border-top: 3px solid var(--ink);
  background: var(--card);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th {
  position: sticky;
  top: 0;
  padding: 0.6rem 0.6rem;
  background: var(--card);
  border-bottom: 1px solid var(--ink);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.data-table td {
  padding: 0.6rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

.data-table tbody tr:hover {
  background: #faf6ea;
}

.data-table .num {
  text-align: right;
}

.data-table .rank {
  color: var(--muted);
  font-weight: 700;
}

.data-table .song {
  min-width: 14rem;
  font-weight: 700;
}

.data-table .song a {
  text-decoration: none;
}

.data-table .song a:hover {
  text-decoration: underline;
}

.data-table .channel {
  min-width: 9rem;
  color: var(--muted);
}

.views strong {
  display: block;
  font-family: var(--display);
  font-weight: 400;
  font-size: 1rem;
}

.views span {
  font-size: 0.7rem;
  color: var(--muted);
}

.tier-table .bar-col {
  width: 50%;
  min-width: 8rem;
}

.tier-table .bar {
  height: 0.9rem;
  margin: 0.15rem 0 0;
}

.milestone-table .is-next {
  background: var(--highlight);
}

.milestone-table .is-next:hover {
  background: var(--highlight);
}

/* ---------------------------------------------------------------- filters */

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1.25rem;
}

.filters label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.filters input,
.filters select {
  min-height: 2.5rem;
  padding: 0.4rem 0.6rem;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--card);
  color: var(--ink);
  font: 500 0.95rem var(--text);
}

.filters input {
  width: min(20rem, 80vw);
}

.filter-count {
  margin: 0 0 0 auto;
  font-size: 0.8rem;
  font-weight: 700;
}

/* ---------------------------------------------------------------- video page */

.video-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 1.25rem;
  align-items: start;
}

.player {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--ink);
}

.player-poster,
.player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.player-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4.5rem;
  height: 3.2rem;
  transform: translate(-50%, -50%);
  background: var(--red);
  border-radius: 0.8rem;
}

.play-button::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 54%;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 0.7rem 0 0.7rem 1.15rem;
  border-color: transparent transparent transparent #fff;
}

.player-poster:hover .play-button {
  background: var(--ink);
}

.video-stats {
  display: grid;
  gap: 1rem;
}

.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0;
  border-top: 3px solid var(--ink);
}

.facts div {
  padding: 0.6rem 0.25rem;
  border-bottom: 1px solid var(--rule);
}

.facts dt {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.facts dd {
  margin: 0.1rem 0 0;
  font-family: var(--display);
  font-size: 1.15rem;
}

.facts small {
  font-family: var(--text);
  font-size: 0.75rem;
  font-weight: 600;
}

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2.5rem;
}

.pager a {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem;
  border: 2px solid var(--ink);
  background: var(--card);
  font-weight: 700;
  text-decoration: none;
}

.pager a:hover {
  background: var(--ink);
  color: #fff;
}

.pager span {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pager-next {
  text-align: right;
}

/* ---------------------------------------------------------------- artists */

.artist-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 3px solid var(--ink);
}

.artist {
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: 1rem;
}

.artist:target {
  background: var(--highlight);
}

.artist-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
}

.artist-rank {
  width: 2.25rem;
  color: var(--red);
  font-family: var(--display);
  font-size: 1.25rem;
  text-align: right;
}

.artist-name {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.35rem;
  line-height: 1.2;
}

.artist-stats {
  margin-left: auto;
  font-size: 0.85rem;
}

.artist-videos {
  margin: 0.5rem 0 0 3rem;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
}

.artist-videos li {
  padding: 0.2rem 0;
}

.artist-videos .badge {
  margin-right: 0.35rem;
  font-size: 0.65rem;
  min-width: 2.2rem;
}

.artist-videos a {
  font-weight: 600;
}

/* ---------------------------------------------------------------- prose */

.prose {
  max-width: 46rem;
}

.prose h2 {
  margin: 2.25rem 0 0.5rem;
  padding-top: 0.5rem;
  border-top: 3px solid var(--ink);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.prose p,
.prose li {
  font-size: 1.05rem;
}

.prose li + li {
  margin-top: 0.4rem;
}

.prose code {
  font-size: 0.9em;
  background: #ece6d8;
  padding: 0.05em 0.3em;
}

/* ---------------------------------------------------------------- responsive */

@media (max-width: 60rem) {
  .stages {
    grid-template-columns: repeat(4, 1fr);
  }

  .columns,
  .video-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 40rem) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-main {
    min-height: 0;
  }

  .footer-inner,
  .pager {
    grid-template-columns: 1fr;
  }

  .filter-count {
    margin-left: 0;
    width: 100%;
  }

  .artist-videos {
    margin-left: 0;
  }

  .artist-stats {
    margin-left: 3rem;
    width: 100%;
  }

  .pager-next {
    text-align: left;
  }
}

/* ---------------------------------------------------------------- quick answers */

.video-summary {
  margin-top: 0.75rem;
}

.faq {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem 2.5rem;
}

.faq-item h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.3;
}

.faq-item p {
  margin: 0;
  color: #2c2a26;
}

@media (max-width: 60rem) {
  .faq {
    grid-template-columns: 1fr;
  }
}
