:root {
  --accent: #138d75;
  --accent-dark: #0e6b59;
  --accent-soft: #e8f6f2;
  --ink: #363636;
  --muted: #5f6368;
  --rule: #e3e6e8;
  --panel: #f7f9fa;
  --bad: #c0392b;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  color: var(--ink);
  background: #ffffff;
}

.publication-title,
.publication-authors,
.section .title,
.tabs,
.stat .value {
  font-family: 'Google Sans', 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ---------------------------------------------------------------- hero */
.hero.is-header .hero-body { padding-top: 2.75rem; padding-bottom: 1.25rem; }

.publication-title { line-height: 1.25 !important; text-wrap: balance; max-width: 900px; margin-left: auto; margin-right: auto; }
.publication-title .method { color: var(--accent); }
.publication-subtitle {
  font-family: 'Google Sans', 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 1.5rem;
  color: var(--accent-dark);
  margin-top: 0.6rem;
}

.publication-authors { font-size: 1.15rem; margin-top: 0.6rem; }
.publication-authors a { color: var(--accent) !important; }
.publication-authors a:hover { text-decoration: underline; }
.author-block { display: inline-block; margin: 0 0.35rem; }
.affiliations { font-size: 1rem; color: var(--muted); margin-top: 0.25rem; }

.publication-venue {
  display: inline-block;
  margin-top: 0.9rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: #555;
  letter-spacing: 0.01em;
}

.publication-links { margin-top: 1.1rem; }
.link-block { display: inline-block; margin: 0.25rem 0.2rem; }
.external-link.button { font-family: 'Google Sans', 'Noto Sans', sans-serif; }
.external-link.button.is-dark { background-color: #363636; }
.external-link.button.is-dark:hover { background-color: #1f1f1f; }
.external-link.button[disabled] { opacity: 0.55; cursor: not-allowed; }
.button .soon { font-size: 0.72em; margin-left: 0.4em; opacity: 0.85; }

/* ---------------------------------------------------------------- opening demo */
.demo .hero-body { padding-top: 0.5rem; padding-bottom: 1.5rem; }
.demo-lead { max-width: 760px; margin: 0 auto 1rem; text-align: center; font-size: 1.08rem; line-height: 1.6; text-wrap: balance; }
.demo-card {
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: #fff;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.demo-grid { display: grid; grid-template-columns: 1.05fr 1fr 0.95fr; gap: 1rem; align-items: center; }
.demo-photos { display: grid; grid-template-rows: 1fr 1fr; gap: 0.6rem; }
.demo-photo { position: relative; margin: 0; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 8px; background: #eef0f2; }
.demo-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.demo-badge {
  position: absolute; top: 0.45rem; left: 0.45rem;
  background: rgba(60, 64, 67, 0.88); color: #fff;
  font-family: 'Google Sans', 'Noto Sans', sans-serif; font-size: 0.8rem;
  padding: 0.1rem 0.55rem; border-radius: 999px;
}
.demo-map img { width: 100%; height: auto; display: block; }
.demo-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.3rem 0.9rem; margin-top: 0.4rem; font-size: 0.82rem; color: var(--muted); }
.demo-legend li { display: flex; align-items: center; gap: 0.35rem; }
.swatch { width: 1.35rem; height: 1rem; flex: 0 0 auto; }
.demo-map-note { text-align: center; font-size: 0.78rem; color: #8a9095; margin-top: 0.15rem; }
.demo-verdict { display: flex; flex-direction: column; gap: 0.75rem; }
.demo-key { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.demo-verdict .demo-key + .meter { margin-top: -0.35rem; }
.demo-error-value { font-family: 'Google Sans', 'Noto Sans', sans-serif; font-size: 2.6rem; font-weight: 700; line-height: 1.1; color: var(--bad); }
.meter-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; font-size: 0.92rem; }
.meter-value { font-weight: 700; color: #6b7177; white-space: nowrap; }
.meter-value.is-geocond { color: var(--accent-dark); }
.meter-track { height: 0.75rem; border-radius: 999px; background: #eceff1; overflow: hidden; margin-top: 0.3rem; }
.meter-fill { height: 100%; border-radius: 999px; transition: width 0.45s ease; }
.meter-fill.is-native { background: #aab2bd; }
.meter-fill.is-geocond { background: var(--accent); }
.demo-scale { font-size: 0.8rem; color: var(--muted); line-height: 1.45; }
.demo-footer { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 0.9rem; border-top: 1px solid var(--rule); padding-top: 0.8rem; }
.demo-caption { font-size: 0.9rem; line-height: 1.55; color: var(--ink); flex: 1 1 auto; }
.demo-switch { flex: 0 0 auto; margin-bottom: 0 !important; }
.demo-switch .button { margin-bottom: 0 !important; }
.demo-switch .button.is-selected { background-color: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------------------------------------------------------------- teaser */
.teaser .hero-body { padding-top: 1.5rem; padding-bottom: 2rem; }
.teaser img { width: 100%; border-radius: 10px; }
.tldr {
  margin: 1.2rem auto 0;
  max-width: 820px;
  font-size: 1.12rem;
  line-height: 1.6;
  text-align: center;
}
.tldr strong { color: var(--accent-dark); }

/* ---------------------------------------------------------------- sections */
.section { padding: 2.5rem 1.5rem; }
.section.is-shaded { background: var(--panel); }
.section .title.is-3 { margin-bottom: 1.25rem; }
.section .title.is-4 { margin-top: 2rem; margin-bottom: 0.9rem; }
.content.has-text-justified p { line-height: 1.7; }
.lead { font-size: 1.05rem; line-height: 1.7; }

figure.figure { margin: 1.25rem 0 0; }
figure.figure img { width: 100%; display: block; border-radius: 6px; }
figure.figure.is-framed img { border: 1px solid var(--rule); background: #fff; }
figure.figure a { display: block; }
figcaption {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.55;
  margin-top: 0.6rem;
  text-align: left;
}
figcaption b { color: var(--ink); }

/* ---------------------------------------------------------------- stats */
.stats { margin-top: 0.5rem; }
.stat {
  height: 100%;
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  background: #fff;
}
.stat .value { font-size: 1.65rem; font-weight: 700; color: var(--accent-dark); line-height: 1.15; }
.stat .value .vs { font-size: 0.6em; font-weight: 400; color: var(--muted); margin: 0 0.25em; }
.stat .value .base { color: #8a9095; }
.stat .stat-label { font-size: 0.9rem; color: var(--muted); margin-top: 0.35rem; line-height: 1.45; }

/* ---------------------------------------------------------------- method cards */
.card-panel {
  height: 100%;
  border: 1px solid var(--rule);
  border-top: 3px solid var(--accent);
  border-radius: 8px;
  padding: 1rem 1.15rem;
  background: #fff;
}
.card-panel h4 { font-family: 'Google Sans', 'Noto Sans', sans-serif; font-size: 1.1rem; font-weight: 600; margin-bottom: 0.5rem; }
.card-panel ul { margin: 0.25rem 0 0 1.1rem; list-style: disc; }
.card-panel li { margin: 0.2rem 0; font-size: 0.95rem; line-height: 1.5; }
.card-panel p { font-size: 0.95rem; line-height: 1.55; }
.tag.variant { font-family: 'Google Sans', 'Noto Sans', sans-serif; font-weight: 600; background: var(--accent-soft); color: var(--accent-dark); }

/* ---------------------------------------------------------------- gallery */
.gallery-controls { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.75rem; }
.gallery-controls .tabs { margin-bottom: 0; flex: 1 1 auto; }
.tabs.is-toggle li.is-active a { background-color: var(--accent); border-color: var(--accent); }
.tabs a { font-size: 0.95rem; }
.dataset-switch .button.is-selected { background-color: var(--accent); border-color: var(--accent); color: #fff; }

.gallery-stage {
  position: relative;
  margin-top: 1rem;
  border: 1px solid #bbb;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.gallery-stage a, .gallery-stage img { display: block; width: 100%; height: auto; }
.gallery-pager { display: flex; align-items: center; gap: 0.5rem; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; }
.gallery-nav {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  border: none;
  background: #4a4a4a;
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.gallery-nav:hover, .gallery-nav:focus-visible { background: var(--accent-dark); outline: none; }
.gallery-counter { font-size: 0.8rem; color: var(--muted); min-width: 2.6rem; text-align: right; }
.gallery-footer { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-top: 0.7rem; }
.gallery-caption { font-size: 0.95rem; line-height: 1.55; color: var(--ink); flex: 1 1 auto; }
.gallery-dots { display: flex; gap: 0.4rem; }
.gallery-dots button {
  width: 0.7rem; height: 0.7rem; border-radius: 50%;
  border: 1px solid #9aa0a6; background: #fff; padding: 0; cursor: pointer;
}
.gallery-dots button.is-active { background: var(--accent); border-color: var(--accent); }
.gallery-note { font-size: 0.85rem; color: var(--muted); margin-top: 0.9rem; }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; margin-top: 0.75rem; }
table.results { width: 100%; font-size: 0.95rem; border-collapse: collapse; }
table.results th, table.results td { padding: 0.45rem 0.7rem; border-bottom: 1px solid var(--rule); text-align: center; white-space: nowrap; }
table.results th:first-child, table.results td:first-child { text-align: left; }
table.results thead th { font-weight: 600; border-bottom: 2px solid #4a4a4a; vertical-align: bottom; }
table.results thead tr.group th { border-bottom: 1px solid #9aa0a6; }
table.results tbody tr.ours td { background: var(--accent-soft); }
table.results tbody tr.ours td:first-child { font-weight: 600; color: var(--accent-dark); }
table.results tbody tr.reference td { color: var(--muted); font-style: italic; }
table.results tbody tr.sep td { border-top: 2px solid #9aa0a6; }
table.results td.best { font-weight: 700; }
.table-caption { font-size: 0.9rem; color: var(--muted); line-height: 1.55; margin-top: 0.6rem; }

/* ---------------------------------------------------------------- closing statement */
.takeaway-line {
  margin-top: 1.4rem;
  padding-left: 1rem;
  border-left: 4px solid var(--accent);
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-size: 1.2rem;
  line-height: 1.55;
  color: var(--accent-dark);
  text-align: left;
}

/* ---------------------------------------------------------------- bibtex */
.bibtex-box { position: relative; }
.bibtex-box pre {
  background: #f5f5f5;
  border-radius: 8px;
  padding: 1.1rem 1.25rem;
  font-size: 0.85rem;
  line-height: 1.5;
  white-space: pre;
  overflow-x: auto;
}
.copy-button {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
}
.copy-button.is-copied { background-color: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------------------------------------------------------------- footer */
.footer { padding: 2rem 1.5rem 3rem; background: #fafafa; }
.footer .content { font-size: 0.85rem; color: var(--muted); }
.footer a { color: var(--accent-dark); }
.credits { font-size: 0.8rem; color: var(--muted); margin-top: 0.5rem; }
.credits summary { cursor: pointer; text-align: center; font-size: 0.85rem; color: var(--accent-dark); }
.credits p { margin: 0.8rem 0 0.5rem; }
.credits ul { margin: 0; padding-left: 1.1rem; list-style: disc; overflow-wrap: anywhere; }
.credits li { margin: 0.15rem 0; }

@media screen and (min-width: 769px) and (max-width: 1023px) {
  .demo-grid { grid-template-columns: 1fr 1fr; }
  .demo-verdict { grid-column: 1 / -1; }
}

@media screen and (max-width: 768px) {
  .content.has-text-justified, .content.has-text-justified p { text-align: left !important; }
  .hero.is-header .hero-body { padding-top: 2rem; }
  .publication-title { font-size: 1.85rem !important; }
  .publication-authors { font-size: 1rem; }
  .gallery-footer { flex-direction: column-reverse; align-items: stretch; }
  .gallery-pager { justify-content: center; }
  .stat .value { font-size: 1.4rem; }
  .publication-subtitle { font-size: 1.2rem; }
  .demo-grid { grid-template-columns: 1fr; }
  .demo-photos { grid-template-rows: none; grid-template-columns: 1fr 1fr; }
  .demo-map { max-width: 360px; margin: 0 auto; width: 100%; }
  .demo-footer { flex-direction: column-reverse; align-items: stretch; }
  .demo-switch { justify-content: center; }
}
