/* MapGR project page. Self-contained: system fonts, inline SVG icons, no external CSS/JS. */

:root {
  --text: #1f2328;
  --muted: #57606a;
  --faint: #8c959f;
  --rule: #d0d7de;
  --rule-light: #eaeef2;
  --surface: #f6f8fa;
  --accent: #0b5cad;
  --ours: #f1f6fd;
  --gain: #1a7f37;
  --text-w: 840px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, "Noto Sans", sans-serif,
          "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji";
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

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

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

body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

sup { font-size: 0.68em; line-height: 0; }

.wrap {
  max-width: 1008px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */

.hero {
  padding: 72px 0 8px;
  text-align: center;
}

.paper-title {
  max-width: 900px;
  margin: 0 auto 28px;
  font-size: clamp(28px, 4.2vw, 42px);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.015em;
}

.method-name { color: var(--accent); }

.authors,
.affiliations {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: 0 auto;
}

.authors {
  gap: 4px 22px;
  font-size: 18px;
}

.affiliations {
  gap: 2px 20px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 15.5px;
}

.author-notes {
  margin: 8px 0 0;
  color: var(--faint);
  font-size: 14px;
}

.author-notes .sep { margin: 0 8px; }

.venue {
  margin: 18px 0 0;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px 9px 16px;
  border: 1px solid #24292f;
  border-radius: 999px;
  background: #24292f;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  background: #000;
  border-color: #000;
  text-decoration: none;
}

.btn-light {
  background: #fff;
  border-color: var(--rule);
  color: var(--text);
}

.btn-light:hover {
  background: var(--surface);
  border-color: var(--faint);
}

.btn svg { width: 17px; height: 17px; flex: none; }
.icon-stroke { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-fill { fill: currentColor; }
.emoji { font-size: 16px; line-height: 1; }

/* Sections */

main { padding-bottom: 16px; }

.section { padding-top: 64px; }

h2 {
  margin: 0 0 22px;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  letter-spacing: -0.01em;
}

h3 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 650;
  line-height: 1.4;
}

p { margin: 0 0 14px; }

.prose {
  max-width: var(--text-w);
  margin: 0 auto;
  font-size: 17px;
  line-height: 1.7;
}

.prose-wide {
  max-width: var(--text-w);
  margin: 0 auto;
  font-size: 16.5px;
  line-height: 1.7;
}

.justify { text-align: justify; }

.note { color: var(--muted); font-size: 15.5px; text-align: center; }

.cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  max-width: var(--text-w);
  margin: 8px auto 18px;
}

/* Figures */

figure { margin: 28px 0 36px; }

figure img {
  width: 100%;
  border: 1px solid var(--rule-light);
  border-radius: 8px;
}

figcaption {
  max-width: 860px;
  margin: 12px auto 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  text-align: center;
}

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

.teaser { padding-top: 40px; }
.teaser figure { margin-top: 0; }

/* Tables */

.table-scroll {
  max-width: var(--text-w);
  margin: 28px auto 18px;
  overflow-x: auto;
}

table.booktabs {
  width: 100%;
  border-collapse: collapse;
  border-top: 2px solid var(--text);
  border-bottom: 2px solid var(--text);
  font-size: 15.5px;
  font-variant-numeric: tabular-nums;
}

.booktabs caption {
  caption-side: bottom;
  padding-top: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.booktabs th,
.booktabs td {
  padding: 8px 14px;
  text-align: left;
  white-space: nowrap;
}

.booktabs thead th {
  border-bottom: 1px solid var(--text);
  font-weight: 650;
}

.booktabs .num { text-align: right; }

.booktabs tr.group-start td { border-top: 1px solid var(--rule); }
.booktabs tbody tr.group-start:first-child td { border-top: 0; }

.booktabs td.dataset { font-weight: 600; vertical-align: middle; }

.booktabs strong { font-weight: 650; }

.booktabs tr.ours td { background: var(--ours); font-weight: 600; }

.results { min-width: 600px; }

.gain {
  display: inline-block;
  min-width: 2.7em;
  margin-left: 4px;
  color: var(--gain);
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
}

.efficiency {
  align-items: center;
  margin-top: 48px;
}

.efficiency .table-scroll { margin: 0; }
.efficiency p { color: var(--text); font-size: 16.5px; line-height: 1.7; }

/* Analysis */

.analysis {
  max-width: none;
  grid-template-columns: 1.55fr 1fr;
  align-items: start;
}

.analysis figure { margin: 0; }

.bars {
  padding: 10px 4px 4px;
  font-size: 15px;
}

.bar-row {
  display: grid;
  grid-template-columns: 88px 1fr 40px;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
}

.bar-row b { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

.track {
  height: 10px;
  border-radius: 999px;
  background: var(--rule-light);
  overflow: hidden;
}

.track span {
  display: block;
  width: var(--v);
  height: 100%;
  border-radius: 999px;
  background: var(--faint);
}

.bar-row.ours span:first-child,
.bar-row.ours b { color: var(--accent); font-weight: 650; }
.bar-row.ours .track span { background: var(--accent); }

.bar-axis {
  display: flex;
  justify-content: space-between;
  margin: 4px 52px 0 100px;
  color: var(--faint);
  font-size: 12.5px;
}

/* BibTeX */

.bibtex { position: relative; }

.bibtex pre {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  border: 1px solid var(--rule-light);
  border-radius: 8px;
  background: var(--surface);
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.65;
}

.copy {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 10px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font: 500 13px/1.5 var(--sans);
  cursor: pointer;
}

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

/* Footer */

.footer {
  margin-top: 64px;
  padding: 28px 0 40px;
  border-top: 1px solid var(--rule-light);
  color: var(--faint);
  font-size: 13.5px;
  text-align: center;
}

.footer p { margin: 0; }

/* Small screens */

@media (max-width: 760px) {
  .hero { padding-top: 48px; }
  .authors { gap: 2px 16px; font-size: 17px; }
  .affiliations { font-size: 14.5px; }
  .section { padding-top: 48px; }
  h2 { font-size: 24px; }
  .prose { font-size: 16.5px; }
  .justify { text-align: left; }
  .cols,
  .analysis { grid-template-columns: 1fr; gap: 20px; }
  .analysis figure + figure { margin-top: 24px; }
  .btn { padding: 8px 15px 8px 13px; font-size: 14.5px; }
}

.zoom { display: block; cursor: zoom-in; }
.zoom:hover img { border-color: var(--rule); }
