:root {
  --text: #1f2328;
  --muted: #59636e;
  --faint: #8c959f;
  --rule: #d1d9e0;
  --link: #1f5fbf;
  --surface: #f6f8fa;
  --dark: #24292f;
  --column: 840px; /* text, figures, tables and captions all share this width */
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

main,
footer {
  max-width: calc(var(--column) + 48px);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */

header {
  padding: 72px 0 40px;
  text-align: center;
}

h1 {
  margin: 0 0 24px;
  font-size: clamp(1.65rem, 1.15rem + 2vw, 2.15rem);
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.nowrap {
  white-space: nowrap;
}

.authors {
  margin: 0 0 6px;
  font-size: 1.15rem;
}

.authors span {
  display: inline-block;
  margin: 0 0.2em;
}

.affiliation,
.venue {
  margin: 0;
  color: var(--muted);
}

.venue {
  margin-top: 4px;
  font-style: italic;
}

.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  border-radius: 999px;
  background: var(--dark);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.2;
}

.button:hover {
  background: #000;
  text-decoration: none;
}

.button svg {
  flex: none;
  width: 17px;
  height: 17px;
}

/* Sections */

section {
  padding-top: 48px;
}

h2 {
  margin: 0 0 16px;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-align: center;
}

p {
  margin: 0 0 1em;
}

/* Justified body text and captions: both edges line up with figures and tables */
section p,
figcaption {
  text-align: justify;
  -webkit-hyphens: auto;
  hyphens: auto;
  text-wrap: pretty;
}

.equation {
  margin: 20px 0 24px;
}

.equation img {
  width: auto;
  max-width: 100%;
  margin: 0 auto;
}

sup {
  position: relative;
  top: -0.45em;
  font-size: 0.75em;
  line-height: 0;
  vertical-align: baseline;
}

/* Figures and tables: full column width, numbered captions */

figure {
  margin: 32px 0;
}

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

figcaption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

figcaption b {
  color: var(--text);
  font-weight: 600;
}

.table-figure figcaption {
  margin: 0 0 12px;
}

.screenshot img {
  border-radius: 6px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}

th:first-child,
td:first-child {
  padding-left: 0;
}

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

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

tbody tr:last-child td {
  border-bottom: 1.5px solid var(--text);
}

.num {
  text-align: right;
  white-space: nowrap;
}

tr.total td {
  border-top: 1px solid var(--text);
  font-weight: 600;
}

/* Citation */

.bibtex {
  position: relative;
}

pre {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  border-radius: 6px;
  background: var(--surface);
  font-size: 0.85rem;
  line-height: 1.55;
}

pre,
code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

.copy {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.copy:hover {
  border-color: var(--faint);
  color: var(--text);
}

/* Footer */

footer {
  margin-top: 56px;
  padding-bottom: 56px;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

footer p {
  margin: 0;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}

@media (max-width: 600px) {
  body {
    font-size: 16px;
  }

  header {
    padding-top: 44px;
  }

  section p,
  figcaption {
    text-align: left;
    -webkit-hyphens: manual;
    hyphens: manual;
  }

  table {
    font-size: 0.85rem;
  }

  th,
  td {
    padding-left: 5px;
    padding-right: 5px;
  }

  thead th,
  thead th.num {
    white-space: normal;
  }
}
