:root {
  --ink: #171717;
  --muted: #66635f;
  --faint: #9a9690;
  --line: #d9d6d0;
  --paper: #fbfaf7;
  --white: #fff;
  --accent: #9d2d20;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-x: clip; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

a { color: inherit; }
button { font: inherit; }

.site-header {
  height: 62px;
  padding: 0 clamp(20px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(251, 250, 247, .94);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -.02em;
}

.wordmark-mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: var(--white);
  background: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
}

.header-meta {
  display: flex;
  gap: 26px;
  font-size: 12px;
  color: var(--muted);
}

.header-meta a { text-underline-offset: 3px; }

.hero {
  padding: clamp(64px, 9vw, 128px) clamp(20px, 4vw, 64px) 56px;
  border-bottom: 1px solid var(--line);
  background: var(--white);
}

.hero-copy {
  width: min(900px, 100%);
  margin: 0 auto 64px;
  text-align: center;
  min-width: 0;
}

.kicker {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }

h1 {
  max-width: 860px;
  margin: 0 auto 22px;
  font: 700 clamp(46px, 7vw, 92px)/.96 var(--serif);
  letter-spacing: -.055em;
}

.dek {
  max-width: 700px;
  margin: 0 auto;
  color: #4d4b47;
  font: 20px/1.55 var(--serif);
}

.chart-shell {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding-top: 30px;
  border-top: 1px solid var(--line);
  min-width: 0;
}

.chart-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.chart-label {
  margin-bottom: 3px;
  font-size: 13px;
  font-weight: 700;
}

.chart-total {
  font-size: 44px;
  line-height: 1;
  letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
}

.chart-total small {
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0;
}

.segmented {
  padding: 3px;
  border-radius: 999px;
  display: inline-flex;
  background: #f0efec;
}

.metric-button {
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  cursor: pointer;
}

.metric-button.is-active {
  color: var(--ink);
  background: var(--white);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .11);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.legend-button {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  background: var(--white);
  font-size: 12px;
  cursor: pointer;
  transition: opacity .15s, border-color .15s;
}

.legend-button::before {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--term-color);
}

.legend-button.is-active {
  border-color: var(--ink);
  color: var(--ink);
}

.legend-button:not(.is-active) { opacity: .43; }
.legend-count { color: var(--faint); font-variant-numeric: tabular-nums; }

.chart-wrap {
  width: 100%;
  min-height: 430px;
  position: relative;
  min-width: 0;
}

#usage-chart {
  width: 100%;
  height: 430px;
  display: block;
  overflow: visible;
}

.grid-line { stroke: #deddd9; stroke-dasharray: 3 5; }
.zero-line { stroke: #aaa7a1; }
.axis-label { fill: #77736e; font: 11px var(--sans); }
.axis-note { fill: #77736e; font: 10px var(--sans); text-transform: uppercase; letter-spacing: .08em; }
.series-line { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.series-area { opacity: .08; }
.hover-rule { stroke: #77736e; stroke-width: 1; stroke-dasharray: 2 3; }
.chart-dot { stroke: var(--white); stroke-width: 2; }
.chart-hit { fill: transparent; cursor: crosshair; }

.chart-tooltip {
  position: absolute;
  z-index: 4;
  min-width: 190px;
  max-width: 260px;
  padding: 12px 14px;
  border: 1px solid #cbc8c2;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .12);
  pointer-events: none;
  font-size: 12px;
}

.tooltip-date { margin-bottom: 5px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.tooltip-title { margin-bottom: 9px; font-family: var(--serif); font-size: 14px; font-weight: 700; line-height: 1.25; }
.tooltip-row { display: flex; justify-content: space-between; gap: 20px; line-height: 1.7; }
.tooltip-row span:first-child::before { content: ''; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; display: inline-block; background: var(--term-color); }

.thumbnail-rail {
  margin: 6px 42px 0 54px;
  display: grid;
  grid-template-columns: repeat(var(--video-count, 10), 1fr);
  gap: 5px;
}

.rail-item {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  opacity: .66;
  transition: opacity .15s, transform .15s;
}

.rail-item:hover, .rail-item.is-active { opacity: 1; transform: translateY(-2px); }
.rail-item img { width: 100%; aspect-ratio: 16/9; display: block; object-fit: cover; filter: grayscale(25%); }
.rail-item.is-active img { outline: 2px solid var(--ink); outline-offset: 2px; filter: none; }

.section-grid {
  width: min(1220px, calc(100% - 40px));
  margin: 0 auto;
  padding: 110px 0;
  display: grid;
  grid-template-columns: minmax(220px, .8fr) minmax(0, 1.35fr);
  gap: clamp(50px, 9vw, 130px);
  border-bottom: 1px solid var(--line);
}

.section-heading h2, .streams h2 {
  margin-bottom: 18px;
  font: 700 clamp(34px, 4.5vw, 58px)/1.02 var(--serif);
  letter-spacing: -.04em;
}

.section-heading > p:last-child {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.lead {
  margin-bottom: 48px;
  font: 27px/1.4 var(--serif);
  letter-spacing: -.015em;
}

.summary-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--ink);
}

.stat { padding: 17px 18px 0 0; }
.stat + .stat { padding-left: 18px; border-left: 1px solid var(--line); }
.stat-value { display: block; margin-bottom: 6px; font-size: clamp(28px, 3vw, 44px); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: 11px; line-height: 1.35; text-transform: uppercase; letter-spacing: .08em; }

.sticky-heading { align-self: start; position: sticky; top: 98px; }

.term-breakdown { border-top: 2px solid var(--ink); }

.term-row {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 74px 1.7fr;
  gap: 24px;
  align-items: center;
}

.term-name { font: 700 20px var(--serif); }
.term-kind { display: block; margin-top: 5px; color: var(--faint); font: 10px var(--sans); text-transform: uppercase; letter-spacing: .1em; }
.term-total { font-size: 30px; font-variant-numeric: tabular-nums; text-align: right; }
.term-bar-track { height: 6px; background: #e5e2dc; }
.term-bar { height: 100%; min-width: 0; background: var(--term-color); }

.streams {
  width: min(1400px, calc(100% - 40px));
  margin: 0 auto;
  padding: 110px 0 120px;
  border-bottom: 1px solid var(--line);
}

.streams-heading {
  margin-bottom: 50px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 32px;
}

.streams-heading h2 { margin-bottom: 0; }
.streams-heading > p { max-width: 360px; margin-bottom: 6px; color: var(--muted); font: 15px/1.5 var(--serif); }

.video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 26px;
  row-gap: 52px;
}

.video-card { min-width: 0; }

.video-thumb-link { display: block; position: relative; overflow: hidden; background: #ddd; }
.video-thumb-link img { width: 100%; aspect-ratio: 16/9; display: block; object-fit: cover; transition: transform .25s; }
.video-thumb-link:hover img { transform: scale(1.018); }
.duration {
  padding: 4px 6px;
  position: absolute;
  right: 8px;
  bottom: 8px;
  color: var(--white);
  background: rgba(0, 0, 0, .78);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.video-meta { margin: 15px 0 7px; display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .07em; }
.video-card h3 { margin: 0 0 18px; min-height: 2.6em; font: 700 20px/1.3 var(--serif); letter-spacing: -.01em; }

.mini-counts { padding: 11px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px 15px; }
.mini-count { color: var(--muted); font-size: 11px; }
.mini-count b { color: var(--ink); font-size: 13px; font-variant-numeric: tabular-nums; }

.methodology { border-bottom: 0; }
.method-copy { max-width: 690px; font: 17px/1.65 var(--serif); }
.method-copy p { margin-bottom: 18px; }
.data-stamp { color: var(--muted); font: 11px var(--sans) !important; text-transform: uppercase; letter-spacing: .07em; }

footer {
  padding: 28px clamp(20px, 4vw, 64px);
  border-top: 1px solid var(--ink);
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  background: var(--white);
  font-size: 11px;
}

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

.error-message { padding: 80px 20px; text-align: center; color: var(--accent); }

@media (max-width: 900px) {
  .hero { padding-inline: 20px; }
  .chart-shell { overflow: visible; }
  .chart-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  #usage-chart { min-width: 780px; }
  .thumbnail-rail {
    min-width: 0;
    margin: 10px 0 0;
    padding-bottom: 8px;
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 72px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
  }
  .section-grid { grid-template-columns: 1fr; gap: 40px; padding: 80px 0; }
  .sticky-heading { position: static; }
  .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .site-header { padding-inline: 16px; }
  .header-meta { display: none; }
  .hero-copy { margin-bottom: 46px; }
  .kicker { font-size: 9px; letter-spacing: .1em; line-height: 1.35; }
  h1 { font-size: 42px; letter-spacing: -.045em; overflow-wrap: anywhere; }
  .dek { font-size: 17px; }
  .chart-topline { align-items: flex-start; flex-wrap: wrap; gap: 12px; }
  .chart-total { font-size: 36px; }
  .segmented { flex-shrink: 0; }
  .metric-button { padding: 7px 10px; font-size: 11px; }
  .legend { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; }
  .legend-button { flex: 0 0 auto; }
  .summary-stats { grid-template-columns: 1fr; }
  .stat { padding: 15px 0; display: flex; justify-content: space-between; align-items: end; border-bottom: 1px solid var(--line); }
  .stat + .stat { padding-left: 0; border-left: 0; }
  .stat-value { margin: 0; }
  .stat-label { max-width: 120px; text-align: right; }
  .term-row { grid-template-columns: 1fr 50px; gap: 10px; }
  .term-bar-track { grid-column: 1 / -1; }
  .streams-heading { align-items: start; flex-direction: column; }
  .video-grid { grid-template-columns: 1fr; }
  .video-card h3 { min-height: auto; }
  footer { gap: 20px; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
