:root {
  --text: #1f2937;
  --muted: #5f6b7a;
  --line: #e5e7eb;
  --blue: #2563eb;
  --light: #f7f9fc;
  --card: #ffffff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: white;
  line-height: 1.65;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container { width: min(100% - 32px, 980px); margin: 0 auto; }
.is-max-desktop { max-width: 980px; }

.hero {
  padding: 72px 0 28px;
  text-align: center;
  background: linear-gradient(180deg, #f9fbff 0%, #ffffff 80%);
}
.publication-header { max-width: 900px; margin: 0 auto; }
.tagline {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 18px;
}
.title {
  margin: 0 auto 18px;
  max-width: 920px;
  font-size: clamp(38px, 5.6vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.055em;
  font-weight: 850;
}
.authors { margin: 0; font-size: 21px; color: var(--blue); font-weight: 600; }
.venue { margin: 6px 0 22px; color: var(--muted); font-size: 17px; }
.button-row { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: white;
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 8px 24px rgba(31,41,55,.08);
}
.button.primary { color: white; background: var(--blue); border-color: var(--blue); }
.button.disabled { color: #8a94a3; background: #f1f5f9; box-shadow: none; cursor: default; }

.section { padding: 54px 0; }
.section.light { background: var(--light); border-top: 1px solid #edf1f7; border-bottom: 1px solid #edf1f7; }
.teaser-section { padding-top: 20px; }
.teaser-card, .wide-figure {
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(31,41,55,.10);
}
.teaser-card img { width: 100%; }
figcaption { padding: 12px 16px; color: var(--muted); font-size: 15px; text-align: center; }

.section-title {
  margin: 0 0 18px;
  text-align: center;
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: -0.035em;
}
.section-lead {
  max-width: 780px;
  margin: -4px auto 28px;
  text-align: center;
  color: var(--muted);
  font-size: 18px;
}
.abstract-text {
  max-width: 900px;
  margin: 0 auto;
  text-align: justify;
  font-size: 18px;
}
.method-grid, .result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 26px 0 28px;
}
.method-card, .result-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 10px 26px rgba(31,41,55,.05);
}
.method-card h3 { margin: 10px 0 8px; font-size: 19px; line-height: 1.2; }
.method-card p, .result-card span { margin: 0; color: var(--muted); font-size: 15px; }
.num {
  width: 34px; height: 34px; border-radius: 50%;
  background: #e8f0ff; color: var(--blue); font-weight: 800;
  display: grid; place-items: center;
}
.demo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  align-items: stretch;
}
.demo-card {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: white;
  box-shadow: 0 10px 26px rgba(31,41,55,.06);
}
.demo-card:first-child { grid-column: 1 / -1; }
/* Same media box for every demo so cards align; GIFs may differ in native aspect ratio. */
.demo-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: center;
  flex-shrink: 0;
  background: #eceef2;
}
.demo-card figcaption {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: calc(12px + 12px + 2 * 1.65em);
}

.table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--line); background: white; }
table { border-collapse: collapse; width: 100%; min-width: 680px; }
th, td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--line); }
th { background: #eef4ff; font-size: 14px; }
tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 700; color: var(--blue); }
.result-card { display: flex; flex-direction: column; gap: 8px; }
.result-card strong { font-size: 20px; }
.note { text-align: center; color: var(--muted); }
.bibtex {
  margin: 0;
  padding: 20px;
  overflow-x: auto;
  background: #0f172a;
  color: #e5e7eb;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
}
.footer { padding: 30px 0 50px; color: var(--muted); text-align: center; font-size: 14px; }

@media (max-width: 800px) {
  .hero { padding-top: 50px; }
  .method-grid, .result-grid, .demo-grid { grid-template-columns: 1fr; }
  .demo-card:first-child { grid-column: auto; }
  .abstract-text { text-align: left; font-size: 16px; }
}
