/* Net Butter Sync benchmark page. Inherits the palette and body styling
   from /styles.css; everything here is page-specific. */

:root {
  --surface: #101010;
  --rule: #24282c;
  --before: #5c646b;
  --after: #b02828;
  --good: #8fd48f;
  --mono: ui-monospace, "Cascadia Mono", "JetBrains Mono", Consolas, monospace;
}

.page {
  display: flex;
  flex-direction: column;
  gap: 2.75rem;
  margin: 0 auto;
  max-width: 900px;
  padding: 1.5rem 1.5rem 5rem;
}

/* The title block sits tighter above and below than the figure sections do;
   the page gap on its own leaves it floating under the nav. */
.page > header {
  margin-bottom: -0.9rem;
}

.eyebrow {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  margin: 0;
  text-transform: uppercase;
}

h1 {
  color: var(--text);
  font-family: Cinzel, Georgia, serif;
  font-size: clamp(2rem, 5vw, 2.9rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.15;
  margin: 0.6rem 0 0;
  text-wrap: balance;
}

.standfirst {
  color: var(--muted);
  font-size: 1.075rem;
  margin: 1rem 0 0;
  max-width: 62ch;
}

h2 {
  color: var(--text);
  font-family: Cinzel, Georgia, serif;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  margin: 0;
  text-transform: uppercase;
}

p { margin: 0; }

/* ---- headline stat row ---- */
.stats {
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 4px;
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  margin: 0;
  overflow: hidden;
}

.stat {
  background: var(--surface);
  padding: 1.25rem 1.15rem;
}

.stat dt {
  color: var(--muted);
  font-family: Cinzel, Georgia, serif;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  margin: 0 0 0.65rem;
  text-transform: uppercase;
}

.stat dd {
  color: var(--good);
  font-family: var(--mono);
  font-size: 1.75rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

.stat .from {
  color: var(--muted);
  display: block;
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0;
  margin-top: 0.4rem;
}

/* ---- figures ---- */
figure {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin: 0;
  padding: 1.5rem 1.5rem 1.25rem;
}

.fig-head {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

figcaption {
  color: var(--muted);
  font-size: 0.925rem;
  max-width: 66ch;
}

.chart-scroll { overflow-x: auto; }

svg {
  display: block;
  height: auto;
  min-width: 520px;
  width: 100%;
}

.legend {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.825rem;
  gap: 1.25rem;
}

.legend span {
  align-items: center;
  display: inline-flex;
  gap: 0.45rem;
}

.swatch {
  border-radius: 2px;
  flex: none;
  height: 11px;
  width: 11px;
}

.bar-label {
  fill: var(--muted);
  font-family: Inter, system-ui, sans-serif;
  font-size: 13px;
}

.bar-value {
  fill: var(--text);
  font-family: var(--mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.axis-line { stroke: var(--border); stroke-width: 1; }
.grid-line { stroke: var(--rule); stroke-width: 1; }

.tick-text {
  fill: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
}

.bar { transition: opacity 0.12s ease; }
.bar:hover { opacity: 0.82; }

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

/* ---- table view ---- */

/* Scoped to .measures: bare details/summary rules here would also hit the
   Products menu in the site nav, which is a <details> too. */
.measures {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.measures > summary {
  color: var(--muted);
  cursor: pointer;
  font-family: Cinzel, Georgia, serif;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  padding: 0.9rem 1.15rem;
  text-transform: uppercase;
}

.measures > summary:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: -2px;
}

.table-scroll {
  overflow-x: auto;
  padding: 0 1.15rem 1.15rem;
}

table {
  border-collapse: collapse;
  font-size: 0.9rem;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--rule);
  padding: 0.6rem 0.9rem 0.6rem 0;
  text-align: left;
}

th {
  color: var(--muted);
  font-family: Cinzel, Georgia, serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

td.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.conditions {
  border-top: 1px solid var(--border);
  color: var(--muted);
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
  gap: 0.6rem;
  padding-top: 1.5rem;
}

.conditions strong {
  color: var(--text);
  font-family: Cinzel, Georgia, serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

code {
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.875em;
}

.back {
  color: var(--red);
  font-family: Cinzel, Georgia, serif;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-decoration: none;
  text-transform: uppercase;
}

.back:hover,
.back:focus-visible {
  color: #c44;
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

#tip {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  opacity: 0;
  padding: 0.35rem 0.55rem;
  pointer-events: none;
  position: fixed;
  transform: translate(-50%, -130%);
  white-space: nowrap;
  z-index: 10;
}

@media (max-width: 480px) {
  .page { gap: 2rem; padding: 2rem 1.15rem 3.5rem; }
  figure { padding: 1.15rem 1rem 1rem; }
}
