:root {
  --ink: #1f2328;
  --muted: #5c6269;
  --accent: #a31f34;
  --blue: #246b91;
  --blue-deep: #194e6b;
  --blue-soft: #eaf3f7;
  --light: #f5f5f5;
  --lighter: #fafafa;
  --line: #dedede;
  --line-dark: #b8b8b8;
  --green: #17804c;
  --sans: "Noto Sans", "Google Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", Menlo, Consolas, monospace;
  --content: min(1040px, calc(100vw - 40px));
  --narrow: min(940px, calc(100vw - 40px));
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font-family: var(--sans);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

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

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

a:hover,
a:focus-visible {
  text-decoration: underline;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 9px 14px;
  color: #fff;
  background: #111;
  transform: translateY(-140%);
}

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

.publication-header {
  width: var(--content);
  margin: 0 auto;
  padding: 66px 0 36px;
  text-align: center;
}

.venue-lockup {
  display: inline-flex;
  margin-top: 18px;
  align-items: center;
  gap: 12px;
}

.venue-lockup img {
  width: 132px;
  height: auto;
}

.venue-lockup span {
  padding-left: 12px;
  border-left: 1px solid var(--line-dark);
  color: #282828;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

h1,
h2,
h3,
p,
figure {
  margin-top: 0;
}

h1 {
  max-width: 950px;
  margin: 0 auto 22px;
  font-size: clamp(2.4rem, 4.5vw, 3.55rem);
  font-weight: 650;
  line-height: 1.12;
  letter-spacing: -0.038em;
}

h2 {
  margin-bottom: 22px;
  font-size: clamp(1.65rem, 3vw, 2.15rem);
  font-weight: 650;
  line-height: 1.22;
  letter-spacing: -0.02em;
  text-align: center;
}

h3 {
  margin-bottom: 8px;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
}

.publication-authors {
  max-width: 940px;
  margin: 0 auto 10px;
  color: var(--accent);
  font-size: 1.08rem;
  line-height: 1.8;
}

.publication-authors strong {
  font-weight: 650;
}

.publication-authors sup,
.publication-affiliations sup,
.publication-notes sup {
  color: #333;
}

.publication-affiliations {
  display: flex;
  margin-bottom: 3px;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 24px;
  color: #333;
  font-size: 0.92rem;
}

.publication-notes {
  margin-bottom: 0;
  color: #747474;
  font-size: 0.77rem;
}

.resource-links {
  display: flex;
  margin-top: 20px;
  justify-content: center;
  flex-wrap: wrap;
  gap: 9px;
}

.resource-links a {
  display: inline-flex;
  min-height: 41px;
  padding: 8px 16px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #282828;
  border-radius: 999px;
  color: #fff;
  background: #2d2d2d;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 140ms ease, border-color 140ms ease;
}

.resource-links a:hover,
.resource-links a:focus-visible {
  border-color: #000;
  background: #000;
  text-decoration: none;
}

.resource-links a span {
  min-width: 16px;
  color: #fff;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
}

.section-narrow,
.section-inner {
  width: var(--narrow);
  margin: 0 auto;
}

.teaser {
  padding: 24px 0 20px;
}

.lead {
  max-width: 850px;
  margin: 0 auto 32px;
  font-size: clamp(1.08rem, 2.2vw, 1.36rem);
  line-height: 1.58;
  text-align: center;
}

.lead strong {
  color: var(--accent);
}

.teaser-figure,
.result-figure {
  margin-bottom: 0;
  text-align: center;
}

.teaser-figure img {
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
}

figcaption {
  max-width: 840px;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

figcaption strong {
  color: #353535;
}

.paper-section {
  padding-top: 62px;
  padding-bottom: 68px;
}

.paper-section + .paper-section:not(.section-soft),
.paper-section.section-soft + .paper-section {
  border-top: 0;
}

.section-soft {
  width: 100%;
  background: var(--light);
}

.section-intro {
  max-width: 740px;
  margin: -10px auto 34px;
  color: var(--muted);
  text-align: center;
}

.method-flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.method-flow article {
  position: relative;
  min-height: 250px;
  padding: 22px 18px 20px;
  border-radius: 7px;
  background: #fff;
}

.method-flow article:last-child {
  background: var(--blue-soft);
}

.method-flow article:not(:last-child)::after {
  content: "→";
  position: absolute;
  z-index: 2;
  top: 31px;
  right: -16px;
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  border: 1px solid #d7d7d7;
  border-radius: 50%;
  color: var(--blue);
  background: #fff;
  font-size: 0.7rem;
}

.step-number {
  display: grid;
  width: 28px;
  height: 28px;
  margin-bottom: 38px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--blue);
  font-size: 0.73rem;
  font-weight: 700;
}

.method-flow p {
  min-height: 76px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.method-flow code {
  display: block;
  padding-top: 12px;
  border-top: 1px solid #e3e3e3;
  color: #1f4257;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.82rem;
  font-style: italic;
  line-height: 1.45;
}

.method-summary {
  display: grid;
  max-width: 860px;
  margin: 34px auto 0;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  text-align: center;
}

.method-summary div {
  position: relative;
  padding: 0 10px;
}

.method-summary div::after {
  position: absolute;
  top: 2px;
  right: -17px;
  color: var(--accent);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  font-weight: 700;
}

.method-summary div:first-child::after {
  content: "+";
}

.method-summary div:nth-child(2)::after {
  content: "=";
}

.method-summary strong,
.method-summary span {
  display: block;
}

.method-summary strong {
  margin-bottom: 3px;
  color: var(--blue-deep);
  font-size: 0.9rem;
}

.method-summary span {
  color: var(--muted);
  font-size: 0.78rem;
}

.method-details {
  margin-top: 52px;
  border-top: 1px solid #d8d8d8;
}

.method-detail {
  display: grid;
  padding: 36px 0;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  grid-template-rows: auto 1fr;
  gap: 18px 44px;
  border-bottom: 1px solid #d8d8d8;
}

.method-detail-heading {
  display: flex;
  grid-row: 1 / 3;
  gap: 16px;
}

.method-detail-heading > span {
  flex: 0 0 auto;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.8;
}

.method-detail-heading h3 {
  margin-bottom: 9px;
  font-size: 1.08rem;
}

.method-detail-heading p,
.method-explanation {
  margin-bottom: 0;
  color: #565c62;
  font-size: 0.84rem;
  line-height: 1.67;
}

.display-equation {
  display: flex;
  min-height: 76px;
  padding: 16px 18px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  overflow-x: auto;
  border-radius: 6px;
  color: #1d3544;
  background: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  line-height: 1.7;
}

.display-equation > span:last-child,
.display-equation > math:last-child {
  flex: 0 0 auto;
  min-width: max-content;
  white-space: nowrap;
}

.equation-name {
  flex: 0 0 auto;
  color: #6a6f74;
  font-family: var(--sans);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.fraction {
  display: inline-flex;
  margin: 0 0.18em;
  vertical-align: middle;
  flex-direction: column;
  align-items: center;
  font-size: 0.88em;
  line-height: 1.15;
}

.fraction > span:first-child {
  width: 100%;
  padding: 0 0.16em 0.1em;
  border-bottom: 1px solid currentColor;
  text-align: center;
}

.fraction > span:last-child {
  padding: 0.1em 0.16em 0;
}

.formula {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.02em;
}

.method-explanation {
  padding: 0 4px;
}

.headline-results {
  display: grid;
  margin: 42px 0 48px;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid #ddd;
  border-bottom: 1px solid #ddd;
}

.headline-results div {
  padding: 26px 18px;
  border-right: 1px solid var(--line);
  text-align: center;
}

.headline-results div:last-child {
  border-right: 0;
}

.headline-results strong,
.headline-results span {
  display: block;
}

.headline-results strong {
  margin-bottom: 4px;
  color: var(--accent);
  font-size: clamp(2.1rem, 5vw, 3.2rem);
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.04em;
}

.headline-results span {
  color: var(--muted);
  font-size: 0.78rem;
}

.result-figure {
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #fff;
}

.result-figure img {
  width: 100%;
  background: #fff;
  object-fit: contain;
}

.result-figure figcaption {
  margin: 0;
  padding: 13px 4px 8px;
  border-top: 0;
  text-align: center;
}

.result-figure-wide {
  margin: 0 0 28px;
}

.benchmark-layout {
  display: grid;
  margin-bottom: 28px;
  grid-template-columns: 0.88fr 1.12fr;
  gap: 28px;
}

.results-table-wrap {
  padding: 25px 24px 20px;
  border: 0;
  border-radius: 0;
  background: var(--light);
}

.results-table-wrap h3 {
  margin-bottom: 20px;
  text-align: center;
}

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

th,
td {
  padding: 9px 5px;
  border-bottom: 1px solid #ddd;
  text-align: right;
  font-size: 0.76rem;
}

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

th {
  color: #6d7277;
  font-size: 0.67rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ours-row {
  color: var(--accent);
  background: rgba(163, 31, 52, 0.045);
  font-weight: 700;
}

.ours-row td:first-child {
  padding-left: 5px;
}

td small {
  color: var(--green);
  font-size: 0.64rem;
}

.citation-layout {
  display: grid;
  grid-template-columns: 0.65fr 1.35fr;
  gap: 54px;
  align-items: center;
}

.citation-layout h2,
.citation-layout .section-intro {
  text-align: left;
}

.citation-layout .section-intro {
  margin: -10px 0 22px;
}

.citation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.citation-actions a {
  font-size: 0.86rem;
  font-weight: 600;
}

.bibtex-wrap {
  overflow: hidden;
  border: 1px solid #d1d1d1;
  border-radius: 8px;
  background: #fff;
}

.code-head {
  display: flex;
  min-height: 44px;
  padding: 9px 12px 9px 18px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e1e1e1;
  color: #6b6f73;
  font-family: var(--mono);
  font-size: 0.69rem;
}

.copy-button {
  padding: 6px 10px;
  border: 1px solid #c9c9c9;
  border-radius: 5px;
  color: #3c3f42;
  background: #f6f6f6;
  font: inherit;
  cursor: pointer;
}

.copy-button:hover,
.copy-button:focus-visible {
  border-color: #888;
  background: #fff;
}

pre {
  margin: 0;
  padding: 22px 18px 26px;
  overflow-x: auto;
  color: #303438;
  font-family: var(--mono);
  font-size: 0.7rem;
  line-height: 1.65;
}

footer {
  width: var(--narrow);
  margin: 0 auto;
  padding: 28px 0 42px;
  border-top: 1px solid #eee;
  color: #777;
  font-size: 0.72rem;
  text-align: center;
}

footer p {
  margin-bottom: 0;
}

@media (max-width: 900px) {
  .method-flow {
    grid-template-columns: 1fr 1fr;
  }

  .method-flow article {
    min-height: 230px;
  }

  .method-flow article:last-child {
    grid-column: 1 / -1;
    min-height: 190px;
  }

  .method-flow article:not(:last-child)::after {
    display: none;
  }

  .method-flow p {
    min-height: 54px;
  }

  .method-detail {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: 18px;
  }

  .method-detail-heading {
    grid-row: auto;
  }

  .benchmark-layout,
  .citation-layout {
    grid-template-columns: 1fr;
  }

  .citation-layout {
    gap: 30px;
  }

  .citation-layout h2,
  .citation-layout .section-intro {
    text-align: center;
  }

  .citation-layout .section-intro {
    margin-right: auto;
    margin-left: auto;
  }

  .citation-actions {
    justify-content: center;
  }
}

@media (max-width: 640px) {
  :root {
    --content: min(100vw - 28px, 1040px);
    --narrow: min(100vw - 28px, 940px);
  }

  .publication-header {
    padding-top: 34px;
  }

  .venue-lockup {
    margin-bottom: 22px;
  }

  .venue-lockup img {
    width: 135px;
  }

  .venue-lockup span {
    font-size: 0.9rem;
  }

  h1 {
    font-size: clamp(2rem, 10vw, 2.85rem);
  }

  .publication-authors {
    font-size: 0.94rem;
  }

  .publication-affiliations {
    gap: 2px 14px;
    font-size: 0.78rem;
  }

  .resource-links {
    gap: 7px;
  }

  .resource-links a {
    min-height: 39px;
    padding: 7px 13px;
    font-size: 0.78rem;
  }

  .teaser {
    padding-bottom: 18px;
  }

  .paper-section {
    padding-top: 54px;
    padding-bottom: 58px;
  }

  .method-flow {
    grid-template-columns: 1fr;
  }

  .method-flow article,
  .method-flow article:last-child {
    grid-column: auto;
    min-height: 0;
    border-right: 0;
  }

  .method-flow article:last-child {
    border-bottom: 0;
  }

  .step-number {
    margin-bottom: 22px;
  }

  .method-flow p {
    min-height: 0;
  }

  .method-summary,
  .headline-results {
    grid-template-columns: 1fr;
  }

  .method-summary {
    gap: 18px;
  }

  .method-summary div::after {
    display: none;
  }

  .method-details {
    margin-top: 42px;
  }

  .method-detail {
    padding: 30px 0;
  }

  .display-equation {
    padding: 14px 15px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: flex-start;
    gap: 8px;
    font-size: clamp(0.78rem, 3.4vw, 0.92rem);
  }

  .display-equation > span:last-child,
  .display-equation > math:last-child {
    min-width: max-content;
  }

  .headline-results div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .headline-results div:last-child {
    border-bottom: 0;
  }

  .result-figure,
  .results-table-wrap,
  .bibtex-wrap {
    border-radius: 7px;
  }

  .results-table-wrap {
    padding-inline: 14px;
  }

  th,
  td {
    font-size: 0.68rem;
  }

  pre {
    padding: 18px 14px 22px;
    font-size: 0.61rem;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
