:root {
  --benchmark-orange: #f06a24;
  --benchmark-orange-soft: #ffb27d;
  --benchmark-cream: #f4eadc;
  --benchmark-grid: color-mix(in srgb, var(--text) 9%, transparent);
}

.benchmark-body {
  background:
    linear-gradient(var(--benchmark-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--benchmark-grid) 1px, transparent 1px),
    var(--bg);
  background-size: 48px 48px;
}

.benchmark-main {
  width: min(1120px, 100%);
  margin-inline: auto;
  padding: 28px 20px 96px;
}

.benchmark-hero {
  position: relative;
  isolation: isolate;
  min-height: 560px;
  margin-top: 26px;
  padding: clamp(30px, 7vw, 76px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  border: 1px solid #363b38;
  border-radius: 10px;
  color: var(--benchmark-cream);
  background:
    radial-gradient(circle at 83% 26%, rgb(240 106 36 / 42%), transparent 20%),
    radial-gradient(circle at 75% 32%, rgb(240 106 36 / 14%), transparent 37%),
    linear-gradient(138deg, #0d100f 0 58%, #171b19 100%);
  box-shadow: 0 28px 80px rgb(0 0 0 / 24%);
}

.benchmark-hero::before {
  content: "13 / 3";
  position: absolute;
  z-index: -1;
  top: 5%;
  right: 4%;
  color: rgb(255 255 255 / 4%);
  font-size: clamp(8rem, 26vw, 18rem);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -0.09em;
}

.benchmark-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: 50px;
  right: -110px;
  width: 430px;
  height: 2px;
  background: var(--benchmark-orange);
  box-shadow: 0 24px var(--benchmark-orange), 0 48px var(--benchmark-orange), 0 72px var(--benchmark-orange);
  opacity: 0.5;
  transform: rotate(-22deg);
}

.benchmark-kicker {
  position: absolute;
  top: clamp(26px, 5vw, 52px);
  left: clamp(30px, 7vw, 76px);
  right: clamp(30px, 7vw, 76px);
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: var(--benchmark-orange-soft);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.benchmark-hero h1 {
  max-width: 12ch;
  margin: 0;
  font-size: clamp(3rem, 8vw, 7.2rem);
  font-weight: 900;
  line-height: 0.84;
  letter-spacing: -0.07em;
}

.benchmark-hero h1 span { display: block; }
.benchmark-hero h1 span:nth-child(2) { color: var(--benchmark-orange); }

.benchmark-hero > p {
  max-width: 68ch;
  margin: 28px 0 0;
  color: #c8c9c4;
  font-size: clamp(1rem, 2vw, 1.16rem);
  line-height: 1.65;
}

.benchmark-actions {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.benchmark-actions a {
  min-height: 44px;
  padding: 0 17px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #525854;
  border-radius: 4px;
  color: var(--benchmark-cream);
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
}

.benchmark-actions .benchmark-primary {
  border-color: var(--benchmark-orange);
  color: #190b04;
  background: var(--benchmark-orange);
}

.benchmark-actions a:hover,
.benchmark-actions a:focus-visible { transform: translateY(-1px); }

.benchmark-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border);
  border-top: 0;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.benchmark-metrics article {
  min-width: 0;
  padding: 24px;
  border-right: 1px solid var(--border);
}

.benchmark-metrics article:last-child { border-right: 0; }
.benchmark-metrics span,
.method-card-grid > article > span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.benchmark-metrics strong {
  margin-top: 9px;
  display: block;
  color: var(--text);
  font-size: clamp(1.65rem, 4vw, 2.7rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.benchmark-metrics small {
  margin-top: 8px;
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.benchmark-section {
  margin-top: 92px;
  scroll-margin-top: 24px;
}

.benchmark-section-heading > p {
  margin: 0 0 8px;
  color: var(--benchmark-orange);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.benchmark-section-heading h2 {
  max-width: 18ch;
  margin: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 0.96;
  letter-spacing: -0.055em;
}

.benchmark-heading-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
}

.benchmark-intro {
  max-width: 72ch;
  margin: 18px 0 24px;
  color: var(--muted);
  line-height: 1.7;
}

.finding-grid {
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  border: 1px solid var(--border);
  background: var(--border);
}

.finding-grid article { padding: 30px; background: var(--surface); }
.finding-grid article > span { color: var(--benchmark-orange); font-size: 12px; font-weight: 900; }

.finding-grid h3 {
  margin: 48px 0 12px;
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.finding-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.benchmark-filters { display: flex; flex-wrap: wrap; gap: 10px; }

.benchmark-filters label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.benchmark-filters select {
  min-width: 142px;
  min-height: 40px;
  padding: 0 34px 0 11px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  background: var(--surface);
}

.benchmark-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

.benchmark-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.benchmark-table th,
.benchmark-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
  vertical-align: middle;
}

.benchmark-table thead th {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: color-mix(in srgb, var(--surface) 83%, var(--bg));
}

.benchmark-table tbody tr:last-child > * { border-bottom: 0; }
.benchmark-table tbody th strong { display: block; font-size: 13px; }
.benchmark-table tbody th span,
.compatibility-table td small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.benchmark-table td { color: var(--text); font-size: 12px; }

.size-meter {
  width: 100px;
  height: 4px;
  margin-bottom: 7px;
  overflow: hidden;
  background: color-mix(in srgb, var(--muted) 18%, transparent);
}

.size-meter span {
  width: clamp(3px, var(--meter), 100%);
  height: 100%;
  display: block;
  background: var(--benchmark-orange);
}

.support-pill {
  width: fit-content;
  padding: 5px 7px;
  display: block;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 850;
}

.support-pill.is-pass { color: #0b493c; background: #a8ead6; }
.support-pill.is-fail { color: #6f210d; background: #ffc1a7; }
.support-pill.is-unknown { color: var(--muted); background: var(--border-soft); }

.browser-version-grid {
  margin: 24px 0 12px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.browser-version-grid div {
  padding: 14px 16px;
  border-left: 3px solid var(--benchmark-orange);
  background: var(--surface);
}

.browser-version-grid span,
.browser-version-grid strong { display: block; }
.browser-version-grid span { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.browser-version-grid strong { margin-top: 5px; font-size: 14px; }

.methodology-section ol {
  max-width: 780px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: method;
}

.methodology-section li {
  position: relative;
  padding: 16px 12px 16px 54px;
  counter-increment: method;
  border-bottom: 1px solid var(--border);
  line-height: 1.65;
}

.methodology-section li::before {
  content: counter(method, decimal-leading-zero);
  position: absolute;
  left: 8px;
  color: var(--benchmark-orange);
  font-size: 11px;
  font-weight: 900;
}

.method-card-grid {
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.method-card-grid article { padding: 26px; border: 1px solid var(--border); background: var(--surface); }
.method-card-grid p { color: var(--muted); line-height: 1.6; }
.method-card-grid dl { margin: 22px 0 0; }
.method-card-grid dl > div { padding: 10px 0; display: grid; grid-template-columns: 90px 1fr; gap: 12px; border-top: 1px solid var(--border-soft); }
.method-card-grid dt { color: var(--muted); font-size: 11px; }
.method-card-grid dd { margin: 0; font-size: 12px; overflow-wrap: anywhere; }
.benchmark-license { color: var(--muted); font-size: 12px; }
.benchmark-license a { color: var(--text); }

.benchmark-tool-links {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.benchmark-tool-links a {
  min-height: 130px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--surface);
  text-decoration: none;
}

.benchmark-tool-links a:hover,
.benchmark-tool-links a:focus-visible { border-color: var(--benchmark-orange); }
.benchmark-tool-links strong { font-size: 18px; }
.benchmark-tool-links span { margin-top: 7px; color: var(--muted); font-size: 12px; line-height: 1.5; }

.benchmark-faq details { max-width: 820px; border-bottom: 1px solid var(--border); }
.benchmark-faq summary { padding: 19px 0; font-weight: 800; cursor: pointer; }
.benchmark-faq details p { margin: 0 0 20px; color: var(--muted); line-height: 1.65; }
.benchmark-empty { color: var(--muted); }

@media (max-width: 800px) {
  .benchmark-hero { min-height: 510px; }
  .benchmark-metrics { grid-template-columns: repeat(2, 1fr); }
  .benchmark-metrics article:nth-child(2) { border-right: 0; }
  .benchmark-metrics article:nth-child(-n + 2) { border-bottom: 1px solid var(--border); }
  .finding-grid { grid-template-columns: 1fr; }
  .finding-grid h3 { margin-top: 22px; }
  .benchmark-heading-row { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 620px) {
  .benchmark-main { padding-inline: 14px; }
  .benchmark-hero { min-height: 530px; padding: 28px; }
  .benchmark-kicker { top: 25px; left: 28px; right: 28px; }
  .benchmark-kicker span:last-child { display: none; }
  .benchmark-hero h1 { font-size: clamp(2.75rem, 15vw, 4.5rem); }
  .benchmark-actions a { flex: 1 1 calc(50% - 10px); justify-content: center; }
  .benchmark-actions .benchmark-primary { flex-basis: 100%; }
  .benchmark-metrics article { padding: 18px; }
  .benchmark-section { margin-top: 68px; }
  .benchmark-section-heading h2 { font-size: 2.25rem; }
  .benchmark-filters { width: 100%; }
  .benchmark-filters label { flex: 1; }
  .benchmark-filters select { width: 100%; min-width: 0; }
  .benchmark-table-wrap { overflow: visible; }
  .benchmark-table { min-width: 0; }
  .benchmark-table:not(.compatibility-table),
  .benchmark-table:not(.compatibility-table) tbody { display: block; }
  .benchmark-table:not(.compatibility-table) thead { display: none; }
  .benchmark-table:not(.compatibility-table) tr {
    padding: 13px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    border-bottom: 1px solid var(--border);
  }
  .benchmark-table:not(.compatibility-table) th,
  .benchmark-table:not(.compatibility-table) td { padding: 0; border: 0; }
  .benchmark-table:not(.compatibility-table) th { grid-column: 1 / -1; }
  .benchmark-table:not(.compatibility-table) td::before {
    display: block;
    color: var(--muted);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
  .benchmark-table:not(.compatibility-table) td:nth-child(2)::before { content: "Actual file"; }
  .benchmark-table:not(.compatibility-table) td:nth-child(3)::before { content: "Effective bitrate"; }
  .benchmark-table:not(.compatibility-table) td:nth-child(4)::before { content: "Share of WAV"; }
  .benchmark-table:not(.compatibility-table) td:nth-child(5)::before { content: "Median encode"; }
  .compatibility-table,
  .compatibility-table tbody { display: block; }
  .compatibility-table thead { display: none; }
  .compatibility-table tr {
    padding: 13px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    border-bottom: 1px solid var(--border);
  }
  .compatibility-table th,
  .compatibility-table td { padding: 0; border: 0; min-width: 0; }
  .compatibility-table th { grid-column: 1 / -1; }
  .compatibility-table td::before {
    margin-bottom: 5px;
    display: block;
    color: var(--muted);
    font-size: 8px;
    font-weight: 850;
    text-transform: uppercase;
  }
  .compatibility-table td:nth-child(2)::before { content: "Chromium"; }
  .compatibility-table td:nth-child(3)::before { content: "Firefox"; }
  .compatibility-table td:nth-child(4)::before { content: "WebKit"; }
  .compatibility-table td small { overflow-wrap: anywhere; }
  .browser-version-grid { grid-template-columns: 1fr; }
  .method-card-grid,
  .benchmark-tool-links { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .benchmark-actions a { transition: none; }
}
