/* EnviroBench site styles.

   EnviroBench is a sibling of Statvis, not a copy. Its own field is a
   midnight teal (#102c31) with a deep teal (#0a6f7c) for links and actions;
   the one accent it shares with Statvis is aqua (#00cacb). In figures,
   blue (#0095ed) is the answer key and orange (#e8622c) is system output.
   Schibsted Grotesk for headlines (Statvis does not use it), Inter for text
   and UI as a neutral shared thread, JetBrains Mono for code only. The
   methodology page keeps a serif document body. Topographic textures are
   EnviroBench's own render of real terrain (site/brand/build_topo.py).
   No colour washes, glows or blurred glass in CSS. */

:root {
  --bg: #ffffff;
  --paper: #f3f6f5;
  --surface: #ffffff;
  --text: #13201f;
  --muted: #55636a;
  --rule: #dde4e3;
  --rule-strong: #13201f;
  --link: #0a6f7c;
  --link-hover: #075560;
  --focus: #0a6f7c;
  --code-bg: #f1f4f4;
  --lane: #f5f8f8;
  --lane-adapter: #fbf6f1;
  --notice-bg: #f3f6f5;
  --bad: #b54713;
  --bad-fill: #e8622c;

  --brand: #102c31;
  --brand-deep: #0a1f23;
  --brand-line: #24464c;
  --on-brand: #e8f1f1;
  --on-brand-muted: #a9c3c6;
  --punch: #00cacb;
  --punch-hover: #4ee0e0;
  --answer: #0095ed;
  --system: #e8622c;

  --shadow-sm: 0 1px 2px rgba(16, 44, 49, 0.06), 0 1px 1px rgba(16, 44, 49, 0.04);
  --shadow-md: 0 1px 2px rgba(16, 44, 49, 0.06), 0 14px 32px -18px rgba(16, 44, 49, 0.35);
  --shadow-lg: 0 2px 6px rgba(10, 31, 35, 0.12), 0 40px 80px -36px rgba(10, 31, 35, 0.55);
  --radius: 14px;

  --display: "Schibsted Grotesk", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --measure: 46rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1719;
    --paper: #121d20;
    --surface: #152225;
    --text: #e6eceb;
    --muted: #9fb0b3;
    --rule: #263538;
    --rule-strong: #c9d3d3;
    --link: #3fd6d6;
    --link-hover: #8be9e9;
    --focus: #3fd6d6;
    --code-bg: #18262a;
    --lane: #142023;
    --lane-adapter: #1d1f1c;
    --notice-bg: #152225;
    --bad: #f2925e;
    --bad-fill: #e8622c;
    --brand: #0c2226;
    --brand-deep: #08181b;
    --brand-line: #1f3d42;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.4), 0 14px 32px -18px rgba(0, 0, 0, 0.8);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.4), 0 40px 80px -36px rgba(0, 0, 0, 0.9);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0f1719;
  --paper: #121d20;
  --surface: #152225;
  --text: #e6eceb;
  --muted: #9fb0b3;
  --rule: #263538;
  --rule-strong: #c9d3d3;
  --link: #3fd6d6;
  --link-hover: #8be9e9;
  --focus: #3fd6d6;
  --code-bg: #18262a;
  --lane: #142023;
  --lane-adapter: #1d1f1c;
  --notice-bg: #152225;
  --bad: #f2925e;
  --bad-fill: #e8622c;
  --brand: #0c2226;
  --brand-deep: #08181b;
  --brand-line: #1f3d42;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.4), 0 14px 32px -18px rgba(0, 0, 0, 0.8);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.4), 0 40px 80px -36px rgba(0, 0, 0, 0.9);
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.doc {
  font-family: var(--serif);
  font-optical-sizing: auto;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 0.15s ease;
}

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

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

code,
pre {
  font-family: var(--mono);
}

code {
  font-size: 0.84em;
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-optical-sizing: auto;
  letter-spacing: -0.02em;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--rule-strong);
  font-family: var(--sans);
  font-size: 0.875rem;
  z-index: 20;
}

.skip-link:focus {
  top: 1rem;
}

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

/* Brand: mark and wordmark */

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

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

.mark {
  width: 1.75rem;
  height: 1.75rem;
  flex: none;
}

.mark-tile {
  fill: var(--brand);
}

.mark-ink {
  fill: var(--punch);
  stroke: var(--punch);
}

.mark-ink path:not([fill]) {
  stroke: none;
}

.wordmark {
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Header */

.site-header {
  font-family: var(--sans);
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}

.site-header-dark {
  background: var(--brand);
  border-bottom-color: var(--brand-line);
}

.site-header-dark .brand,
.site-header-dark .brand:hover {
  color: var(--on-brand);
}

.site-header-dark .mark-tile {
  fill: var(--brand-deep);
  stroke: var(--brand-line);
}

.header-row {
  max-width: 76rem;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem 2rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.4rem;
  margin-left: auto;
  font-size: 0.9rem;
  font-weight: 500;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
}

.site-header-dark .site-nav a {
  color: var(--on-brand-muted);
}

.site-header-dark .site-nav a:hover {
  color: var(--on-brand);
}

@media (max-width: 52rem) {
  .header-row {
    flex-wrap: wrap;
  }

  .site-nav {
    order: 3;
    width: 100%;
    margin-left: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.15rem;
    gap: 1.1rem;
  }

  .site-header .button-small {
    margin-left: auto;
  }
}

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  padding: 0.6rem 1.15rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: var(--punch);
  color: var(--brand-deep);
}

.button-primary:hover {
  background: var(--punch-hover);
  color: var(--brand-deep);
}

.button-ghost {
  border-color: rgba(232, 241, 241, 0.35);
  color: var(--on-brand);
}

.button-ghost:hover {
  border-color: var(--on-brand);
  color: var(--on-brand);
}

.button-small {
  min-height: 2.25rem;
  padding: 0.4rem 0.95rem;
  background: var(--link);
  color: #ffffff;
  font-size: 0.85rem;
}

.button-small:hover {
  background: var(--link-hover);
  color: #ffffff;
}

.site-header-dark .button-small {
  background: transparent;
  border-color: rgba(232, 241, 241, 0.35);
  color: var(--on-brand);
}

.site-header-dark .button-small:hover {
  border-color: var(--punch);
  color: var(--punch);
}

:root[data-theme="dark"] .button-small {
  color: var(--brand-deep);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .button-small {
    color: var(--brand-deep);
  }
}

.text-link {
  font-weight: 600;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

/* Layout */

.layout {
  max-width: 66rem;
  margin: 0 auto;
  padding: 0 1rem;
}

main {
  max-width: var(--measure);
  min-width: 0;
}

.toc {
  display: none;
}

@media (min-width: 70rem) {
  .layout {
    display: grid;
    grid-template-columns: 12rem minmax(0, var(--measure));
    gap: 4rem;
    justify-content: center;
  }

  .toc {
    display: block;
    position: sticky;
    top: 2rem;
    align-self: start;
    padding-top: 3.25rem;
    font-family: var(--sans);
    font-size: 0.8125rem;
    line-height: 1.5;
  }

  .toc-title {
    margin: 0 0 0.5rem;
    color: var(--muted);
    font-weight: 600;
  }

  .toc ol {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--muted);
  }

  .toc li {
    margin: 0.3rem 0;
  }

  .toc a {
    color: var(--text);
    text-decoration: none;
  }

  .toc a:hover {
    text-decoration: underline;
  }
}

/* Title block */

.title-block {
  padding: 3rem 0 1.5rem;
}

h1 {
  margin: 0;
  font-size: 2.5rem;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.subtitle {
  margin: 0.35rem 0 0;
  font-size: 1.3125rem;
  line-height: 1.4;
  color: var(--text);
}

.byline {
  margin: 0.75rem 0 0;
  color: var(--muted);
}

.facts {
  margin: 1.5rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.875rem;
}

.facts div {
  padding: 0.65rem 1rem 0.65rem 0;
}

.facts dt {
  color: var(--muted);
}

.facts dd {
  margin: 0.1rem 0 0;
}

.notice {
  margin: 1.25rem 0 0;
  padding: 0.75rem 1rem;
  background: var(--notice-bg);
  border-left: 3px solid var(--rule-strong);
  font-family: var(--sans);
  font-size: 0.9rem;
  line-height: 1.55;
}

/* Sections */

section {
  padding: 1.25rem 0 0.75rem;
}

.abstract {
  padding-top: 0.75rem;
}

.abstract h2 {
  font-size: 1rem;
  font-family: var(--sans);
  font-weight: 600;
  margin: 0 0 0.35rem;
}

.abstract p {
  margin: 0;
}

h2 {
  margin: 1.5rem 0 0.75rem;
  font-size: 1.5rem;
  line-height: 1.3;
  font-weight: 600;
}

h3 {
  margin: 1.75rem 0 0.5rem;
  font-size: 1.125rem;
  line-height: 1.35;
  font-weight: 600;
}

.secnum {
  display: inline-block;
  min-width: 1.6em;
  margin-right: 0.35em;
  color: var(--muted);
  font-weight: 400;
}

h3 .secnum {
  min-width: 2.2em;
}

p,
ul,
ol {
  margin: 0 0 1rem;
}

ul {
  padding-left: 1.25rem;
}

li {
  margin: 0.35rem 0;
}

.note {
  font-size: 0.9375rem;
  color: var(--muted);
}

/* Tables: booktabs rules, sans text, tabular figures */

.table-wrap {
  margin: 1.25rem 0 1.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 0.84375rem;
  line-height: 1.45;
  border-top: 1.5px solid var(--rule-strong);
  border-bottom: 1.5px solid var(--rule-strong);
}

caption {
  caption-side: top;
  text-align: left;
  padding: 0 0 0.5rem;
  font-family: var(--serif);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.label {
  font-weight: 600;
}

th,
td {
  padding: 0.5rem 0.75rem 0.5rem 0;
  text-align: left;
  vertical-align: top;
}

th:last-child,
td:last-child {
  padding-right: 0;
}

thead th {
  font-weight: 600;
  border-bottom: 1px solid var(--rule-strong);
  white-space: nowrap;
}

tbody th {
  font-weight: 600;
}

tbody tr + tr > * {
  border-top: 1px solid var(--rule);
}

tbody tr:not(.group-start) > td {
  border-top-color: var(--rule);
}

table.metrics tbody tr + tr:not(.group-start) > td {
  border-top-style: dotted;
}

table.metrics tbody tr.group-start > * {
  border-top-style: solid;
}

table th code,
table td code {
  font-size: 0.92em;
}

/* Tabular figures only where numbers line up in a column; IDs, dates and
   labels keep the proportional text face. Monospace is for code only. */
.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

table.compact {
  width: auto;
  min-width: 60%;
}

table.changelog td:first-child {
  white-space: nowrap;
  padding-right: 1.5rem;
}

/* Code */

pre {
  margin: 0.75rem 0 1.25rem;
  padding: 0.875rem 1rem;
  background: var(--code-bg);
  border: 1px solid var(--rule);
  overflow-x: auto;
  font-size: 0.8125rem;
  line-height: 1.55;
  tab-size: 2;
}

pre code {
  font-size: inherit;
  overflow-wrap: normal;
}

/* Figure 1 */

figure {
  margin: 1.5rem 0;
}

figcaption {
  margin-top: 0.6rem;
  font-size: 0.9375rem;
  line-height: 1.45;
}

.diagram-wide {
  display: block;
  width: 100%;
  height: auto;
}

.diagram-narrow {
  display: none;
}

.d-lane {
  fill: var(--lane);
  stroke: var(--rule);
}

.d-lane-adapter {
  fill: var(--lane-adapter);
}

.d-lane-label {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  fill: var(--muted);
}

.d-boundary {
  stroke: var(--muted);
  stroke-width: 1;
  stroke-dasharray: 5 4;
}

.d-step rect {
  fill: var(--bg);
  stroke: var(--rule-strong);
  stroke-width: 1.25;
}

.d-output rect {
  stroke-dasharray: 4 3;
}

.d-title {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  fill: var(--text);
}

.d-num {
  fill: var(--muted);
}

.d-body {
  font-family: var(--sans);
  font-size: 13px;
  fill: var(--muted);
}

.d-output .d-body {
  font-family: var(--mono);
  font-size: 12.5px;
  fill: var(--text);
}

.d-small {
  font-family: var(--sans);
  font-size: 11.5px;
  fill: var(--muted);
}

.d-flow {
  fill: none;
  stroke: var(--rule-strong);
  stroke-width: 1.25;
}

.d-arrowhead {
  fill: var(--rule-strong);
}

@media (max-width: 40rem) {
  .diagram-wide {
    display: none;
  }

  .diagram-narrow {
    display: block;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: step;
    font-family: var(--sans);
    font-size: 0.875rem;
    line-height: 1.45;
  }

  .diagram-narrow li {
    counter-increment: step;
    position: relative;
    margin: 0;
    padding: 0.6rem 0.75rem 0.6rem 2.25rem;
    border: 1px solid var(--rule-strong);
    background: var(--bg);
  }

  .diagram-narrow li + li {
    margin-top: 1.1rem;
  }

  .diagram-narrow li + li::before {
    content: "";
    position: absolute;
    left: 50%;
    top: -1.1rem;
    height: 1.1rem;
    border-left: 1.25px solid var(--rule-strong);
  }

  .diagram-narrow li::after {
    content: counter(step);
    position: absolute;
    left: 0.75rem;
    top: 0.6rem;
    color: var(--muted);
    font-weight: 600;
  }

  .diagram-narrow li.adapter {
    background: var(--lane-adapter);
    border-style: dashed;
  }

  .diagram-narrow .lane {
    display: block;
    color: var(--muted);
    font-size: 0.8125rem;
  }

  .diagram-narrow b {
    font-weight: 600;
  }
}

/* Home page */

.shell {
  max-width: 76rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.site-header.site-header-dark .button-small,
.site-header.site-header-dark .button-small:hover {
  background: transparent;
}

.site-header.site-header-dark .button-small {
  color: var(--on-brand);
}

.site-header.site-header-dark .button-small:hover {
  color: var(--punch);
}

.eyebrow {
  margin: 0 0 0.75rem;
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--link);
}

/* Hero: a midnight band with faint contours, closing on the showpiece card. */

.hero {
  position: relative;
  overflow: hidden;
  background: var(--brand) url("assets/topo/topo-dark.svg") center / cover no-repeat;
  color: var(--on-brand);
  padding: 5.5rem 0 0;
}

.hero-inner {
  position: relative;
}

.hero .eyebrow {
  color: var(--punch);
}

.hero h1 {
  max-width: 16ch;
  margin: 0;
  font-size: clamp(2.6rem, 6vw, 4.75rem);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #ffffff;
}

.hero-sub {
  max-width: 40rem;
  margin: 1.4rem 0 0;
  font-size: 1.2rem;
  line-height: 1.55;
  color: var(--on-brand-muted);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 2rem;
}

.hero .text-link,
.cta-band .text-link {
  color: var(--on-brand);
}

.hero-meta {
  margin: 1.4rem 0 0;
  font-size: 0.875rem;
  color: var(--on-brand-muted);
}

.hero-meta a {
  color: var(--on-brand);
}

.hero-shot {
  position: relative;
  margin-top: 3.5rem;
  padding-bottom: 4rem;
}

.product-shot {
  padding: 1.5rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--rule);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow-lg);
}

.product-shot figcaption {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Bands */

.band {
  position: relative;
  padding: 6rem 0;
  background: var(--bg);
}

.band-paper {
  background-color: var(--paper);
}

/* White sections: faint contours fading in from the top-right corner. */
.band-corner {
  background-image: url("assets/topo/topo-corner.svg");
  background-repeat: no-repeat;
  background-position: right top;
  background-size: min(1500px, 160%) auto;
}

:root[data-theme="dark"] .band-corner {
  background-image: url("assets/topo/topo-corner-dark.svg");
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .band-corner {
    background-image: url("assets/topo/topo-corner-dark.svg");
  }
}

.band-dark {
  overflow: hidden;
  background: var(--brand);
  color: var(--on-brand);
}

/* Text-heavy dark bands carry the same terrain, quieter. */
.band-dark::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("assets/topo/topo-dark.svg") right top / max(1600px, 100%) auto no-repeat;
  opacity: 0.55;
  pointer-events: none;
}

.band-dark .eyebrow {
  color: var(--punch);
}

.band-dark .shell {
  position: relative;
}

.band-dark a {
  color: var(--punch);
}

.section-head {
  max-width: 48rem;
  margin-bottom: 2.5rem;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.band-dark .section-head h2 {
  color: #ffffff;
}

.section-intro {
  margin: 1rem 0 0;
  font-size: 1.125rem;
  color: var(--muted);
}

/* Fact strip */

.fact-band {
  padding: 3.5rem 0;
  background-color: var(--bg);
  border-bottom: 1px solid var(--rule);
}

.fact-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1.5rem 2.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.fact-strip li {
  padding-top: 1rem;
  border-top: 2px solid var(--link);
}

.fact-strip strong {
  display: block;
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.fact-strip span {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.95rem;
  color: var(--muted);
}

/* Cards */

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card-kicker {
  margin: 0 0 0.4rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--link);
}

.card h3 {
  margin: 0 0 0.6rem;
  font-size: 1.6rem;
  line-height: 1.15;
  font-weight: 700;
}

.checks {
  font-size: 0.95rem;
  color: var(--muted);
}

.checks-label {
  font-weight: 600;
  color: var(--text);
}

.mini-grid {
  display: grid;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.mini-card {
  padding: 1.75rem;
}

.mini-card p:last-child {
  margin-bottom: 0;
}

.feature-card {
  display: grid;
  gap: 1.75rem;
  padding: 1.75rem;
  margin-top: 1.25rem;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.feature-card:hover,
.mini-card:hover {
  border-color: #c4d0cf;
  box-shadow: var(--shadow-md);
}

.feature-text {
  max-width: 44rem;
}

.feature-text p:last-child {
  margin-bottom: 0;
}

.feature-card .figure {
  margin: 0;
}

.feature-card figcaption {
  font-size: 0.9rem;
  color: var(--muted);
}

/* Leaderboard card */

.board-card {
  padding: 1.5rem;
}

/* How scoring works */

.flow-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.75rem;
  margin: 0 0 2.5rem;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.flow-steps li {
  position: relative;
  margin: 0;
  padding: 1.1rem 1.1rem 1.2rem;
  border: 1px solid var(--brand-line);
  border-radius: 12px;
  background: var(--brand-deep);
}

.flow-steps li:nth-child(2) {
  border-color: rgba(232, 98, 44, 0.55);
}

.flow-steps strong {
  display: block;
  margin-top: 0.5rem;
  font-family: var(--display);
  font-size: 1.05rem;
  color: #ffffff;
}

.flow-steps span:last-child {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.9rem;
  color: var(--on-brand-muted);
}

.flow-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--punch);
  color: var(--brand-deep);
  font-size: 0.8rem;
  font-weight: 700;
}

.band-dark .principles li {
  border-top-color: var(--brand-line);
}

.band-dark .principles li::before {
  color: var(--punch);
}

.band-dark .principles h3 {
  color: #ffffff;
}

.band-dark .principles p {
  color: var(--on-brand-muted);
}

.figure-card {
  margin-top: 2.5rem;
  padding: 1.5rem;
  color: var(--text);
}

.figure-card a {
  color: var(--link);
}

.figure-card .figure-wide {
  margin: 0;
}

.figure-card figcaption {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Test sets */

.set-grid {
  display: grid;
  gap: 1.25rem;
}

.set-card {
  padding: 1.75rem;
  border-top: 4px solid var(--link);
}

.set-card-private {
  border-top-color: var(--brand);
}

.set-note {
  margin-top: 1.5rem;
  color: var(--muted);
}

/* Closing call to action */

.cta-band {
  padding: 5.5rem 0;
}

.cta-inner {
  max-width: 48rem;
}

.cta-inner h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: #ffffff;
}

.cta-inner p {
  margin: 1rem 0 0;
  font-size: 1.125rem;
  color: var(--on-brand-muted);
}

.cta-band .button-primary {
  color: var(--brand-deep);
}

.cta-band .button-ghost {
  color: var(--on-brand);
}

/* Footer (shared) */

.site-footer {
  padding: 3.5rem 1.25rem 2rem;
  background: var(--brand-deep);
  color: var(--on-brand-muted);
  font-family: var(--sans);
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  gap: 2rem;
  max-width: 76rem;
  margin: 0 auto;
}

.site-footer .brand,
.site-footer .brand:hover {
  color: var(--on-brand);
}

.site-footer .mark-tile {
  fill: var(--brand);
}

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

.footer-meta a {
  color: var(--on-brand);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.footer-title {
  margin: 0 0 0.25rem;
  font-weight: 600;
  color: var(--on-brand);
}

.footer-links a {
  color: var(--on-brand-muted);
  text-decoration: none;
}

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

.footer-legal {
  max-width: 76rem;
  margin: 2.5rem auto 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--brand-line);
  font-size: 0.8125rem;
}

/* One subtle reveal for figure cards; nothing moves without JavaScript or
   when the reader prefers reduced motion. */

.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .button,
  .button:hover,
  .feature-card,
  a {
    transition: none;
    transform: none;
  }
}

@media (min-width: 48rem) {
  .mini-grid,
  .set-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }
}

@media (min-width: 60rem) {
  .feature-split {
    grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
    gap: 2.5rem;
    align-items: start;
    padding: 2.25rem;
  }

  .feature-flip {
    grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  }

  .feature-flip .feature-text {
    order: 2;
  }

  .feature-card:not(.feature-split) {
    padding: 2.25rem;
  }
}

@media (max-width: 40rem) {
  .hero {
    padding-top: 3.5rem;
  }

  .hero-shot {
    margin-top: 2.5rem;
    padding-bottom: 2.5rem;
  }

  .product-shot {
    padding: 0.9rem;
  }

  .fact-band {
    padding-top: 3rem;
  }

  .band {
    padding: 4rem 0;
  }

  .feature-card,
  .mini-card,
  .board-card,
  .figure-card,
  .set-card {
    padding: 1.1rem;
  }

  .card h3 {
    font-size: 1.35rem;
  }
}

/* Figures */

/* Hero: the report page and the records it defines. */

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.records-panel .table-wrap {
  margin: 0;
}

table.records {
  font-size: 0.8125rem;
}

table.records td,
table.records th {
  padding: 0.4rem 0.6rem 0.4rem 0;
  white-space: nowrap;
}

table.records tr.keyed td {
  font-weight: 600;
}

.records-more {
  margin: 0.5rem 0 0;
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--muted);
}

.callout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.3rem;
  height: 1.3rem;
  flex: none;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

.callout-key {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--sans);
  font-size: 0.875rem;
  line-height: 1.45;
}

.callout-key li {
  display: flex;
  gap: 0.6rem;
  margin: 0.5rem 0;
}

.co circle {
  fill: #1b1d20;
  stroke: #ffffff;
  stroke-width: 2;
}

.co text {
  fill: #ffffff;
  font-family: var(--sans);
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: central;
}

.ro {
  stroke-width: 3;
  fill-opacity: 0.13;
}

.ro-sample { fill: #3a47a9; stroke: #3a47a9; }
.ro-parameter { fill: #1baf7a; stroke: #1baf7a; }
.ro-unit { fill: #e3a008; stroke: #e3a008; }
.ro-result { fill: #0095ed; stroke: #0095ed; }

/* Overlays on document images. */

.ov-ref-box {
  fill: none;
  stroke: #0095ed;
  stroke-width: 5;
  stroke-dasharray: 16 9;
}

.ov-sys-box {
  fill: none;
  stroke: #e8622c;
  stroke-width: 5;
}

.ov-ref-line {
  stroke: #0095ed;
  stroke-width: 3;
}

.ov-sys-line {
  stroke: #e8622c;
  stroke-width: 3;
  stroke-dasharray: 9 7;
}

.ov-ref {
  fill: none;
  stroke: #0095ed;
  stroke-width: 4.5;
}

.ov-sys {
  fill: none;
  stroke: #e8622c;
  stroke-width: 5;
  stroke-linecap: round;
}

.ov-link {
  stroke: #e8622c;
  stroke-width: 2.5;
  stroke-dasharray: 6 5;
}

.ov-missed {
  fill: none;
  stroke: #e8622c;
  stroke-width: 4;
  stroke-dasharray: 9 6;
}

.ov-cell {
  fill: #0095ed;
  fill-opacity: 0.08;
  stroke: #0095ed;
  stroke-width: 1.6;
}

/* Legends: swatches and marks sit on the page background. */

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--muted);
}

.legend-stacked {
  flex-direction: column;
  margin: 0 0 1rem;
}

.legend li {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.swatch {
  display: inline-block;
  width: 0.95rem;
  height: 0.95rem;
  flex: none;
  border: 2px solid var(--rule-strong);
}

.sw-sample { border-color: #3a47a9; background: #e0e2f1; }
.sw-parameter { border-color: #1baf7a; background: #dbf2ea; }
.sw-unit { border-color: #e3a008; background: #fbf0d8; }
.sw-result { border-color: #0095ed; background: #d6eefc; }
.sw-none { border-color: var(--rule); }

.sw-ref-line,
.sw-sys-line {
  height: 0;
  width: 1.4rem;
  border: 0;
  border-top: 3px solid #0095ed;
}

.sw-sys-line {
  border-top: 3px dashed #e8622c;
}

.swatch-mark {
  width: 1rem;
  height: 1rem;
  flex: none;
}

.swatch-mark circle {
  fill: none;
  stroke: #0095ed;
  stroke-width: 2.2;
}

.swatch-mark path {
  fill: none;
  stroke: #e8622c;
  stroke-width: 2.4;
  stroke-linecap: round;
}

.swatch-mark.miss circle {
  stroke: #e8622c;
  stroke-dasharray: 3 2;
}

.swatch-new {
  background: var(--bad-fill);
  border-color: var(--bad-fill);
}

.swatch-none {
  border-color: var(--rule-strong);
}

/* Tasks: text, then a large figure; wide screens alternate the side. */

.scan-grid,
.plan-grid,
.scan-side {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.scan-side {
  gap: 0.75rem;
}

.scan-side .legend {
  margin: 0;
}

.scan-side .callout-key {
  margin: 0;
}

.ocr-pages {
  display: grid;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

table.plan-results {
  width: 100%;
  font-size: 0.8125rem;
}

.score-far,
.score-missed {
  color: var(--bad);
  font-weight: 600;
}

.bad {
  color: var(--bad);
  font-weight: 600;
}

table.decisions {
  margin: 0;
}

.ranking {
  margin: 0;
  padding-left: 1.5rem;
  font-family: var(--sans);
  font-size: 0.875rem;
  line-height: 1.45;
}

.ranking li {
  margin: 0.55rem 0;
  padding-left: 0.25rem;
}

.grade {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
}

.grade-2 { color: var(--link); }
.grade-1 { color: var(--text); }
.grade-0 { color: var(--bad); }

/* Leaderboard */

.boards {
  margin-top: 1.25rem;
}

/* Pre-release: systems under evaluation and the categories, no scores */

.prerelease-board {
  display: grid;
  gap: 1.5rem 3rem;
}

.prerelease-board h3 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}

.prerelease-group {
  margin: 1rem 0 0.35rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.prerelease-group:first-of-type {
  margin-top: 0;
}

.prerelease-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--rule);
}

.prerelease-list li {
  display: grid;
  gap: 0.1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--rule);
}

.prerelease-list span {
  color: var(--muted);
  font-size: 0.875rem;
}

@media (min-width: 40rem) {
  .prerelease-systems li {
    grid-template-columns: minmax(0, 1fr) minmax(0, auto);
    align-items: baseline;
    gap: 0.25rem 1rem;
  }

  .prerelease-systems span {
    text-align: right;
  }
}

.prerelease-more {
  margin: 0.9rem 0 0;
  font-size: 0.9rem;
}

@media (min-width: 60rem) {
  .prerelease-board {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.board-tabs {
  display: flex;
  gap: 0.15rem;
  margin: 0 0 1.25rem;
  padding: 0.3rem;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper);
  font-family: var(--sans);
  font-size: 0.8125rem;
}


.board-tabs button {
  flex: none;
  padding: 0.45rem 0.75rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.board-tabs button:hover {
  color: var(--text);
}

.board-tabs button[aria-selected="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--rule);
}

.board + .board {
  margin-top: 1.5rem;
}

.js-boards .board + .board {
  margin-top: 0;
}

.board-title {
  margin: 0 0 0.25rem;
  font-size: 1.125rem;
}

.board-meta {
  margin: 0 0 0.25rem;
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--muted);
}

.board-set {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-right: 0.35rem;
  color: var(--text);
  font-weight: 600;
}

.board-set::before {
  content: "";
  width: 0.6rem;
  height: 0.6rem;
  border: 1.5px solid currentColor;
}

.board-set-private::before {
  background: currentColor;
}

table.leaderboard td {
  color: var(--muted);
}

table.leaderboard th[scope="row"] {
  white-space: nowrap;
}

.board-kind,
.board-measure {
  display: block;
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--muted);
}

.board-task {
  display: block;
}

.board-dir {
  font-weight: 400;
  color: var(--muted);
}

table.leaderboard.overview thead th {
  white-space: normal;
  min-width: 5.75rem;
}

/* Six categories and a cost column must fit the card at desktop widths; the
   wrapper still scrolls on narrower screens. */
table.leaderboard.overview th[scope="row"] {
  max-width: 14rem;
}

.principles {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: principle;
}

.principles li {
  counter-increment: principle;
  position: relative;
  margin: 0;
  padding: 1rem 0 0.25rem 3rem;
  border-top: 1px solid var(--rule);
}

.principles li::before {
  content: counter(principle);
  position: absolute;
  left: 0;
  top: 0.8rem;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--muted);
}

.principles h3 {
  margin: 0 0 0.35rem;
  font-size: 1.125rem;
}

.principles p {
  max-width: 44rem;
}

.case-grid {
  margin: 0;
}

.case-grid td,
.case-grid th {
  vertical-align: middle;
}

.cells {
  display: inline-flex;
  gap: 3px;
}

.cells i {
  display: inline-block;
  width: 0.85rem;
  height: 0.85rem;
  border: 1px solid var(--rule-strong);
}

.cells i.new {
  background: var(--bad-fill);
  border-color: var(--bad-fill);
}

.figure-wide {
  margin: 2.25rem 0 0;
}

.two-col {
  display: grid;
  gap: 0 2.5rem;
}

.two-col h3 {
  margin-top: 0.5rem;
}

@media (min-width: 56rem) {
  .hero-grid {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 2rem;
  }

  .task-with-figure {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
    gap: 2.75rem;
    align-items: start;
  }

  .task-flip .task-text {
    order: 2;
  }

  .task-flip {
    grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  }

  .scan-grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 1.75rem;
  }

  .plan-grid {
    grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
    gap: 1.5rem;
  }

  .two-col {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 40rem) {
  .home h1 {
    font-size: 2.5rem;
  }

  .lead {
    font-size: 1.175rem;
  }

  .home h2 {
    font-size: 1.6rem;
  }

  table.stack thead {
    display: none;
  }

  table.stack,
  table.stack tbody,
  table.stack tr,
  table.stack td,
  table.stack th {
    display: block;
    width: 100%;
  }

  table.stack {
    border-bottom: 0;
  }

  table.stack tbody tr {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--rule-strong);
  }

  table.stack tbody tr + tr > * {
    border-top: 0;
  }

  table.stack td,
  table.stack th {
    display: grid;
    grid-template-columns: 7.5rem minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0.2rem 0;
    text-align: left;
  }

  table.stack td::before,
  table.stack th::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 400;
  }
}


.home main {
  max-width: none;
}

.home .figure figcaption {
  max-width: 52rem;
}

@media print {
  .site-header,
  .toc,
  .skip-link {
    display: none;
  }

  .layout {
    display: block;
  }
}

/* 404 */

.error-page main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 5rem 1.25rem;
}

.error-page h1 {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

/* Updates form (disabled until the endpoint is live) */

.updates-form {
  display: grid;
  gap: 0.5rem;
  max-width: 24rem;
  margin-top: 1.5rem;
  font-size: 0.9rem;
}

.updates-form input {
  font: inherit;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

.updates-form button {
  justify-self: start;
}

.honeypot {
  position: absolute;
  left: -10000px;
}

.form-message {
  display: none;
}

.form-message.visible {
  display: block;
}

/* Leaderboard drill-down */

.board-range {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted);
}

.board-incomplete {
  font-size: 0.8125rem;
  color: var(--muted);
}

table.leaderboard td strong {
  color: var(--text);
}

.task-board {
  margin-top: 1rem;
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 0.25rem 1rem;
  background: var(--surface);
}

.task-board summary {
  cursor: pointer;
  padding: 0.65rem 0;
  font-weight: 600;
  font-size: 0.9rem;
}

.task-board[open] summary {
  border-bottom: 1px solid var(--rule);
  margin-bottom: 0.75rem;
}

table.categories .board-measure {
  max-width: 16rem;
}

/* Leaderboard as the hero's showpiece */

.board-card-hero {
  padding: 1.75rem;
  color: var(--text);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow-lg);
}

.board-head {
  display: grid;
  gap: 0.5rem 2.5rem;
  margin-bottom: 1.25rem;
}

.board-head h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.board-head .eyebrow {
  margin-bottom: 0.4rem;
}

.board-head p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.mini-grid-single {
  grid-template-columns: minmax(0, 1fr);
  margin-top: 1.25rem;
}

@media (min-width: 60rem) {
  .board-head {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
    align-items: end;
  }

  .mini-grid.mini-grid-single {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 40rem) {
  .board-card-hero {
    padding: 1.1rem;
  }
}

.board-secondary {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted);
}

.board-provenance strong {
  color: var(--text);
}

table.leaderboard .board-kind {
  max-width: 17rem;
  white-space: normal;
}

table.leaderboard .board-entry-note {
  margin-top: 0.25rem;
  font-style: italic;
}

td.nowrap {
  white-space: nowrap;
}

/* Sortable overview headers */

table.leaderboard button.sort {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-align: inherit;
  cursor: pointer;
}

table.leaderboard button.sort:hover .board-task,
table.leaderboard button.sort:hover {
  color: var(--link);
}

table.leaderboard th[aria-sort="descending"] .board-task::after,
table.leaderboard th[aria-sort="descending"] button.sort:not(:has(.board-task))::after {
  content: " ↓";
  color: var(--link);
}

table.leaderboard th[aria-sort="ascending"] .board-task::after,
table.leaderboard th[aria-sort="ascending"] button.sort:not(:has(.board-task))::after {
  content: " ↑";
  color: var(--link);
}

table.leaderboard.overview .board-rank,
table.leaderboard.overview thead th.board-rank-head {
  width: 1%;
  min-width: 0;
  padding-right: 0.5rem;
  color: var(--muted);
  font-size: 0.75rem;
}

/* Category boards list up to seven component tasks: let their headings wrap
   so the table fits the card at desktop widths (it still scrolls below). */
.board > .table-wrap > table.leaderboard:not(.overview) thead th {
  white-space: normal;
  min-width: 5.5rem;
}
