:root {
  --page-bg: #f6f7f5;
  --surface: #ffffff;
  --surface-muted: #eef4f1;
  --text: #202422;
  --muted: #66706b;
  --border: #d8dfda;
  --accent: #156c5b;
  --accent-strong: #0d493e;
  --accent-warm: #9f5d2e;
  --shadow: 0 1px 6px rgba(28, 42, 36, 0.06);
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--page-bg);
  font-family: "Noto Sans", Arial, sans-serif;
}

body.modal-open {
  overflow: hidden;
}

a {
  color: var(--accent);
}

a:hover {
  color: var(--accent-strong);
}

.section {
  background: var(--surface);
  padding: 4.5rem 1.5rem;
}

.section:nth-of-type(even) {
  background: var(--page-bg);
}

.publication-hero {
  background: linear-gradient(180deg, #ffffff 0%, #f6f7f5 100%);
  border-bottom: 1px solid var(--border);
}

.hero-body {
  padding: 4rem 1.5rem 3rem;
}

.publication-kicker {
  color: var(--accent-warm);
  font-family: "Google Sans", "Noto Sans", Arial, sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 0.8rem;
  text-transform: uppercase;
}

.publication-title {
  color: var(--text);
  font-family: "Google Sans", "Noto Sans", Arial, sans-serif;
  font-size: clamp(2.1rem, 5vw, 4.2rem);
  letter-spacing: 0;
  line-height: 1.05;
  margin: 0 auto 1.5rem;
  max-width: 1050px;
}

.publication-authors {
  color: var(--muted);
  font-family: "Google Sans", "Noto Sans", Arial, sans-serif;
  line-height: 1.7;
}

.publication-authors a {
  color: var(--accent) !important;
}

.publication-authors a:hover {
  text-decoration: underline;
}

.publication-affiliation {
  margin-top: 0.4rem;
}

.author-block {
  display: inline-block;
}

.publication-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.8rem;
}

.publication-links .button {
  min-width: 110px;
}

.button.is-dark {
  background: var(--accent-strong);
}

.button.is-dark:hover {
  background: var(--accent);
}

.button.is-light {
  border: 1px solid var(--border);
}

.video-card video {
  display: block;
  height: 100%;
  object-fit: contain;
  width: 100%;
  background: transparent;
  border: 0;
  outline: 0;
}

.caption {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 1rem auto 0;
  max-width: 820px;
  text-align: center;
}

.abstract-section .content,
.method-section .content,
.result-note {
  font-size: 1.03rem;
  line-height: 1.78;
}

.contribution-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 2rem;
}

.contribution-item,
.metric-box,
.video-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.contribution-item:hover,
.metric-box:hover,
.video-card:hover {
  border-color: rgba(21, 108, 91, 0.42);
  box-shadow: 0 10px 22px rgba(28, 42, 36, 0.12);
  transform: translateY(-4px);
}

.contribution-item {
  padding: 1.25rem;
}

.contribution-item h3,
.video-card h3,
.metric-box h3 {
  color: var(--text);
  font-family: "Google Sans", "Noto Sans", Arial, sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 0.55rem;
}

.contribution-item p,
.video-card p,
.metric-box p {
  color: var(--muted);
  margin: 0;
}

.pipeline-frame {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-top: 2rem;
  overflow: hidden;
}

.method-image {
  display: block;
  width: 100%;
}

.references-section .subtitle {
  color: var(--muted);
  margin-left: auto;
  margin-right: auto;
  max-width: 760px;
}

.reference-grid {
  display: grid;
  gap: 1.4rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 2rem;
  margin-left: auto;
  margin-right: auto;
  max-width: 760px;
}

.reference-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.reference-card:hover {
  border-color: rgba(21, 108, 91, 0.42);
  box-shadow: 0 10px 22px rgba(28, 42, 36, 0.12);
  transform: translateY(-4px);
}

.reference-card img {
  aspect-ratio: 4 / 3;
  background: #f2f6f3;
  display: block;
  object-fit: contain;
  width: 100%;
}

.reference-card a {
  cursor: zoom-in;
  display: block;
}

.reference-card h3 {
  font-family: "Google Sans", "Noto Sans", Arial, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  padding: 1rem;
}

.comparison-section .subtitle,
.results-section .subtitle {
  color: var(--muted);
  margin-left: auto;
  margin-right: auto;
  max-width: 820px;
}

.comparison-section .container {
  overflow: visible;
}

.comparison-set-title {
  font-family: "Google Sans", "Noto Sans", Arial, sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  margin: 2.25rem 0 0;
  text-align: center;
}

.video-comparison-grid {
  display: grid;
  gap: 1.4rem;
  grid-auto-columns: minmax(420px, 460px);
  grid-auto-flow: column;
  justify-content: center;
  margin-left: calc(50% - 50vw + 1.5rem);
  margin-right: calc(50% - 50vw + 1.5rem);
  margin-top: 1rem;
  overflow-x: auto;
  overflow-y: visible;
  padding: 0.25rem 0.25rem 1rem;
  scroll-snap-type: x mandatory;
  scrollbar-color: rgba(21, 108, 91, 0.36) transparent;
  scrollbar-width: thin;
}

.video-comparison-grid::-webkit-scrollbar {
  height: 8px;
}

.video-comparison-grid::-webkit-scrollbar-track {
  background: transparent;
}

.video-comparison-grid::-webkit-scrollbar-thumb {
  background: rgba(21, 108, 91, 0.28);
  border-radius: 999px;
}

.video-card {
  overflow: hidden;
  padding: 1rem;
  scroll-snap-align: start;
}

.video-frame {
  aspect-ratio: 1 / 1;
  background: #f2f6f3;
  border-radius: 6px;
  line-height: 0;
  overflow: hidden;
}

.video-card-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  min-height: 1.65rem;
  padding: 0 0 0.75rem;
}

.video-card-header h3 {
  margin: 0;
}

.video-card-header span {
  background: var(--surface-muted);
  border-radius: 999px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.45rem 0.65rem;
  white-space: nowrap;
}

.metrics-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 2rem;
}

.metric-box {
  padding: 1.15rem;
}

.metric-box .value {
  color: var(--accent-strong);
  font-family: "Google Sans", "Noto Sans", Arial, sans-serif;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  margin: 0.25rem 0 0.65rem;
}

.table-container {
  margin-top: 2rem;
  overflow-x: auto;
}

.comparison-table {
  border: 1px solid var(--border);
  min-width: 1060px;
}

.comparison-table thead th {
  background: var(--surface-muted);
  border-color: var(--border);
  color: var(--text);
  font-size: 0.86rem;
  text-align: center;
  white-space: nowrap;
}

.comparison-table tbody td {
  border-color: var(--border);
  font-size: 0.9rem;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.comparison-table tbody td:first-child,
.comparison-table thead th:first-child {
  text-align: left;
}

.comparison-table .ours-row {
  background: #f4faf7;
}

.comparison-table .is-best {
  color: var(--accent-strong);
  font-weight: 700;
}

.result-figure {
  margin-top: 2rem;
}

.result-figure img {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: block;
  margin: 0 auto;
  max-width: 820px;
  width: 100%;
}

.result-note {
  margin-top: 1.5rem;
}

.citation-section pre {
  background: #1f2421;
  border-radius: 8px;
  color: #f4f7f5;
  overflow-x: auto;
  padding: 1.25rem;
  white-space: pre;
}

.citation-meta {
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.image-modal {
  align-items: center;
  background: rgba(20, 24, 22, 0.78);
  display: none;
  inset: 0;
  justify-content: center;
  padding: 2rem;
  position: fixed;
  z-index: 1000;
}

.image-modal.is-open {
  display: flex;
}

.image-modal img {
  background: var(--surface);
  border-radius: 8px;
  max-height: 88vh;
  max-width: 92vw;
  object-fit: contain;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

.image-modal-close {
  align-items: center;
  background: var(--surface);
  border: 0;
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  font-size: 1.7rem;
  height: 42px;
  justify-content: center;
  line-height: 1;
  position: fixed;
  right: 1.5rem;
  top: 1.5rem;
  width: 42px;
}

.footer {
  background: #202422;
  color: #dfe7e2;
  padding: 2.5rem 1.5rem;
}

.footer a {
  color: #ffffff;
  text-decoration: underline;
}

#btt-button {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  bottom: 24px;
  box-shadow: var(--shadow);
  display: flex;
  height: 48px;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  right: 24px;
  transition: opacity 0.2s ease, transform 0.2s ease;
  width: 48px;
  z-index: 100;
}

#btt-button svg {
  fill: var(--accent-strong);
}

#btt-button.show {
  opacity: 1;
  pointer-events: auto;
}

#btt-button:hover {
  transform: translateY(-2px);
}

@media screen and (max-width: 900px) {
  .contribution-grid,
  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media screen and (max-width: 640px) {
  .section {
    padding: 3.25rem 1rem;
  }

  .hero-body {
    padding: 3rem 1rem 2rem;
  }

  .publication-title {
    font-size: 2.2rem;
  }

  .publication-links .button {
    flex: 1 1 140px;
  }

  .contribution-grid,
  .reference-grid,
  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .video-comparison-grid {
    grid-auto-columns: calc(100vw - 3rem);
    justify-content: start;
    margin-left: 0;
    margin-right: 0;
  }

  #btt-button {
    display: none;
  }
}
