:root {
  --bg: #f7f7f5;
  --paper: #fdfdfb;
  --ink: #0a0a0a;
  --ink-soft: #1a1a1a;
  --muted: #525252;
  --soft: #8c8c89;
  --rule: #d8d8d3;
  --rule-soft: #e8e8e3;
  --accent: #8c1c1c;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

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

html {
  scroll-behavior: smooth;
  hanging-punctuation: first last;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  color: var(--ink-soft);
  background: var(--bg);
  font-family: var(--sans);
  font-size: 15px;
  font-feature-settings: "kern", "liga", "ss01";
  font-optical-sizing: auto;
  line-height: 1.62;
}

main {
  max-width: 880px;
  margin: 0 auto;
  padding: 56px 32px 96px;
}

a {
  color: inherit;
}

button {
  font: inherit;
}

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 7px 10px;
  color: var(--bg);
  background: var(--ink);
  font-size: 12px;
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.venue {
  display: inline-block;
  margin-bottom: 20px;
  padding: 6px 10px 5px;
  color: #fff;
  background: var(--accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1.title {
  margin: 0 0 18px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 500;
  font-variation-settings: "SOFT" 100, "opsz" 38;
  letter-spacing: -0.018em;
  line-height: 1.15;
}

.authors {
  margin: 0 0 4px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 400;
  font-variation-settings: "SOFT" 100, "opsz" 17;
  line-height: 1.5;
}

.authors .sep {
  margin: 0 0.55em;
  color: var(--soft);
  user-select: none;
}

.authors sup,
.affiliations sup {
  font-size: 0.65em;
}

.affiliations {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.2em;
  margin: 0 0 28px;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 14px;
  font-style: italic;
  font-variation-settings: "SOFT" 100, "opsz" 14;
  line-height: 1.55;
}

nav.links {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 104px;
}

nav.links::after {
  position: absolute;
  bottom: -32px;
  left: 0;
  width: 56px;
  height: 3px;
  background: var(--accent);
  content: "";
}

nav.links a {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 6px 13px 5px 12px;
  border: 1.25px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  background: transparent;
  box-shadow: 0 1px 2px rgba(10, 10, 10, 0.04), 0 2px 6px rgba(10, 10, 10, 0.05);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: background 0.18s, color 0.18s, transform 0.18s, box-shadow 0.18s,
    border-color 0.18s;
}

nav.links a:hover {
  border-color: var(--accent);
  color: var(--bg);
  background: var(--accent);
  box-shadow: 0 2px 4px rgba(140, 28, 28, 0.18), 0 6px 14px rgba(140, 28, 28, 0.22);
  transform: translateY(-1px);
}

nav.links a svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

section {
  margin-bottom: 64px;
  scroll-margin-top: 32px;
}

h2 {
  position: relative;
  margin: 0 0 24px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
  font-variation-settings: "SOFT" 100, "opsz" 19;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

p.abstract,
.section-intro {
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.72;
  text-align: justify;
  text-justify: inter-word;
  text-wrap: pretty;
}

p.abstract {
  margin: 0;
  hyphens: auto;
}

p.abstract::first-letter {
  float: left;
  margin: 6px 10px 0 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 3.6em;
  font-weight: 500;
  font-variation-settings: "SOFT" 100, "opsz" 144;
  line-height: 0.88;
}

p.abstract .lede {
  color: var(--ink);
  font-feature-settings: "smcp", "c2sc";
  font-variant-caps: all-small-caps;
  letter-spacing: 0.04em;
}

.section-intro {
  margin: 0 0 20px;
}

.paper-figure {
  margin: 0;
}

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

.paper-figure figcaption {
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  text-align: justify;
  text-justify: inter-word;
  text-wrap: pretty;
}

.paper-figure figcaption b,
table.results caption b {
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 400;
  font-variation-settings: "SOFT" 100, "opsz" 14;
}

.method-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: method;
}

.method-list li {
  display: flex;
  gap: 20px;
  padding: 12px 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.6;
  counter-increment: method;
}

.method-list li::before {
  flex-shrink: 0;
  width: 30px;
  padding-top: 3px;
  color: var(--soft);
  content: counter(method, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
}

.method-list li > div {
  flex: 1;
  text-align: justify;
  text-justify: inter-word;
  text-wrap: pretty;
}

.method-list strong {
  color: var(--ink);
  font-weight: 500;
}

.table-wrap {
  margin: 0 0 40px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.table-wrap:last-child {
  margin-bottom: 0;
}

table.results {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

table.results caption {
  padding: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  text-align: left;
  caption-side: top;
}

table.results th,
table.results td {
  padding: 6px 10px;
  line-height: 1.35;
  text-align: center;
  white-space: nowrap;
}

table.results th:first-child,
table.results td:first-child {
  text-align: left;
}

table.results thead th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  vertical-align: middle;
  white-space: normal;
}

table.results thead tr:first-child th {
  padding-top: 8px;
  border-top: 2px solid var(--ink);
}

table.results thead tr:first-child th[colspan] {
  border-bottom: 1px solid var(--rule);
}

table.results thead tr:last-child th,
table.results thead th[rowspan] {
  padding-bottom: 7px;
  border-bottom: 1.5px solid var(--ink);
}

table.results tbody tr:last-child td {
  border-bottom: 2px solid var(--ink);
}

table.results tbody tr:not(:last-child) td {
  border-bottom: 1px solid var(--rule-soft);
}

table.results tr.ours td {
  color: var(--ink);
  font-weight: 600;
}

.bibtex-wrap {
  position: relative;
}

pre.bibtex {
  margin: 0;
  overflow-x: auto;
  padding: 22px 24px;
  border: 1px solid var(--rule);
  border-radius: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
  overscroll-behavior-x: contain;
  white-space: pre;
}

button.copy {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border: 1px solid var(--rule);
  border-radius: 0;
  color: var(--muted);
  background: var(--bg);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

button.copy svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

button.copy .check-icon {
  display: none;
}

button.copy.copied .copy-icon {
  display: none;
}

button.copy.copied .check-icon {
  display: inline-block;
}

button.copy:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--paper);
}

button.copy.copied,
button.copy.copied:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg);
}

footer {
  margin-top: 96px;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

footer a {
  border-bottom: 1px solid var(--rule-soft);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s;
}

footer a:hover {
  border-bottom-color: var(--ink);
}

::selection {
  color: var(--bg);
  background: var(--accent);
}

#progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  width: 0;
  height: 2px;
  background: var(--accent);
  pointer-events: none;
  transition: width 0.06s linear;
}

.toc {
  position: fixed;
  top: 50%;
  left: 32px;
  z-index: 50;
  display: none;
  transform: translateY(-50%);
}

.toc ol {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc a {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--soft);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.2s;
}

.toc a::before {
  width: 14px;
  height: 1px;
  background: currentColor;
  content: "";
  transition: width 0.25s ease, background 0.25s ease;
}

.toc a:hover,
.toc a.active {
  color: var(--ink);
}

.toc a.active::before {
  width: 28px;
  background: var(--accent);
}

h2 .anchor {
  position: absolute;
  top: 0;
  left: -0.85em;
  color: var(--accent);
  font-family: var(--serif);
  font-style: normal;
  font-weight: 400;
  line-height: inherit;
  text-decoration: none;
  opacity: 0.55;
  transition: opacity 0.18s;
}

h2:hover .anchor,
h2 .anchor:focus {
  opacity: 1;
}

main > section {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

main > section.in-view {
  opacity: 1;
  transform: translateY(0);
}

.copy-status {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 100;
  color: var(--bg);
  background: var(--ink);
  font-size: 12px;
}

.copy-status:not(:empty) {
  padding: 8px 10px;
}

@media (min-width: 1200px) {
  .toc {
    display: block;
  }
}

@media (max-width: 1080px) {
  h2 .anchor {
    display: none;
  }
}

@media (max-width: 600px) {
  main {
    padding: 56px 22px 80px;
  }

  h1.title {
    margin-bottom: 40px;
    font-size: 28px;
  }

  .authors {
    font-size: 16px;
  }

  nav.links {
    gap: 10px;
    margin-bottom: 64px;
  }

  .method-list li {
    gap: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  main > section {
    opacity: 1;
    transform: none;
    transition: none;
  }

  #progress {
    display: none;
  }
}
