@font-face {
  font-family: cmr10;
  src: url("fonts/CMUSerif-Roman.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: cmr10;
  src: url("fonts/CMUSerif-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: cmr10;
  src: url("fonts/CMUSerif-Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --red: #c0392b;
  --green: #2e8b3a;
  --orange: #e67e22;
  --blue: #2471a3;
  --ink: #111;
  --muted: #444;
  --rule: #ccc;
  --dbrrt-bg: #e6e6e6;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font-family: cmr10, "Computer Modern Serif", "CMU Serif", serif;
  font-weight: 400;
  line-height: 1.45;
}

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

a {
  color: inherit;
}

.wrap {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
}

header.hero {
  padding: 2.25rem 0 1.25rem;
  text-align: center;
}

header.hero h1 {
  margin: 0;
  font-size: clamp(2.4rem, 8vw, 4.6rem);
  font-weight: 400;
  line-height: 1.1;
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1.1rem;
  margin-top: 1rem;
  font-size: 1.05rem;
}

nav a {
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

nav a:hover,
nav a:focus {
  border-bottom-color: currentColor;
}

section {
  padding: 1.75rem 0 2.25rem;
  border-top: 1px solid var(--rule);
}

h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.6rem, 4vw, 2.15rem);
  font-weight: 400;
  text-align: center;
}

h3 {
  margin: 1.5rem 0 0.85rem;
  font-size: clamp(1.15rem, 2.6vw, 1.4rem);
  font-weight: 400;
  text-align: center;
}

.note {
  margin: 0 auto 1.1rem;
  max-width: 52em;
  text-align: center;
  color: var(--muted);
  font-size: 0.98rem;
}

.scenarios {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.7rem 0.45rem;
}

.scenarios figure,
.trajectories figure,
.plots figure {
  margin: 0;
}

.scenarios img,
.trajectories img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #fff;
  border: 1px solid #bbb;
}

.caption {
  margin: 0.3rem 0 0;
  font-size: 0.78rem;
  line-height: 1.2;
  text-align: center;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table.bench {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  font-size: 0.82rem;
}

table.bench th,
table.bench td {
  padding: 0.28rem 0.32rem;
  text-align: right;
  white-space: nowrap;
  vertical-align: middle;
}

table.bench thead th {
  font-weight: 400;
  text-align: center;
}

table.bench .name,
table.bench td.name {
  text-align: left;
  white-space: normal;
}

table.bench .dyn {
  text-align: left;
  white-space: nowrap;
}

table.bench .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

table.bench thead tr:first-child th {
  border-bottom: none;
}

table.bench thead tr:last-child th {
  border-bottom: 1px solid #222;
}

table.bench tbody td {
  border-bottom: 1px solid #e6e6e6;
}

table.bench tbody tr:last-child td {
  border-bottom: 1px solid #222;
}

table.bench .group {
  border-left: 1px solid #bbb;
}

.dbrrt {
  background: var(--dbrrt-bg);
}

.best {
  font-weight: 700;
}

.trajectories,
.plots {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.55rem 0.4rem;
}

.plots img {
  width: 100%;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem 1.25rem;
  margin: 0.9rem 0 0;
  font-size: 0.98rem;
}

.swatch {
  display: inline-block;
  width: 1.35em;
  height: 0.28em;
  margin-right: 0.4em;
  vertical-align: middle;
  border-radius: 1px;
}

.swatch.red { background: var(--red); }
.swatch.green { background: var(--green); }
.swatch.orange { background: var(--orange); }
.swatch.blue { background: var(--blue); }

footer {
  padding: 1.25rem 0 2rem;
  border-top: 1px solid var(--rule);
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 980px) {
  .scenarios {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .trajectories,
  .plots {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .wrap {
    width: calc(100% - 1.1rem);
  }

  .scenarios,
  .trajectories,
  .plots {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  table.bench {
    font-size: 0.75rem;
  }
}
