:root {
  --blue: #2563b4;
  --blue-dark: #194d95;
  --text: #242424;
  --muted: #666;
  --line: #dedede;
  --soft: #f5f7fa;
  --pi: #cbd5e1;
  --motus: #94a3b8;
  --fast: #5f6f82;
  --ours: #2e6fbb;
  --max-width: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--text);
  background: #fff;
  font-family: "Noto Sans", "Segoe UI", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

.site-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.site-nav-inner {
  width: min(calc(100% - 40px), var(--max-width));
  min-height: 62px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.site-brand {
  flex: 0 0 auto;
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.site-brand::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 9px;
  border-radius: 50%;
  background: var(--blue);
}

.site-nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 25px;
}

.site-nav-links a {
  padding: 19px 0 17px;
  border-bottom: 2px solid transparent;
  color: #526077;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav-links a:hover,
.site-nav-links a:focus-visible {
  border-bottom-color: var(--blue);
  color: var(--blue-dark);
}

.container {
  width: min(calc(100% - 40px), var(--max-width));
  margin: 0 auto;
}

#top,
.project-section { scroll-margin-top: 82px; }

.hero {
  padding-top: 68px;
  text-align: center;
}

h1 {
  max-width: 1080px;
  margin: 0 auto;
  font-size: clamp(2.2rem, 4.4vw, 3.6rem);
  line-height: 1.12;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

h1 span { color: var(--blue); }

.authors {
  max-width: 980px;
  margin: 26px 0 0;
  margin-inline: auto;
  color: var(--blue);
  font-size: 1.15rem;
}

.authors span { white-space: nowrap; }

.authors sup,
.affiliation sup,
.author-notes sup {
  font-size: 0.68em;
  line-height: 0;
  vertical-align: super;
}

.affiliation {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2px 18px;
  margin: 7px auto 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.affiliation span { white-space: nowrap; }

.author-notes {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

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

.links a {
  min-width: 104px;
  padding: 8px 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: white;
  background: #343434;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}

.links a:hover,
.links a:focus-visible { background: var(--blue); }

.links a[data-placeholder] { cursor: default; }

.link-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.paper-icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.github-icon { fill: currentColor; }

.lead-teaser { padding-top: 42px; }

.realworld-video {
  width: 100%;
  max-height: 78vh;
  background: #111;
}

.video-figure {
  margin: 30px 0 42px;
}

h2 {
  margin: 0 0 25px;
  text-align: center;
  font-size: clamp(1.9rem, 4vw, 2.65rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.project-summary {
  max-width: 1040px;
  padding-top: 36px;
  text-align: left;
}

.contribution-list {
  margin: 0;
  padding-left: 28px;
  color: #444;
}

.contribution-list li {
  margin: 10px 0;
  padding-left: 4px;
  line-height: 1.55;
}

.contribution-list strong { color: #303030; }

.project-section { padding-top: 72px; }

.teaser,
.figure-frame,
.chart-card,
.latency-card { margin: 0; }

.figure-frame img { width: 100%; }

.method-teaser-crop {
  width: 100%;
  aspect-ratio: 2134 / 900;
  overflow: hidden;
}

.method-teaser-crop img {
  width: 100%;
  max-width: none;
  transform: translateY(-5.83%);
}

figcaption {
  max-width: 940px;
  margin: 12px auto 0;
  color: var(--muted);
  text-align: center;
  font-size: 0.88rem;
  line-height: 1.5;
}

.method-description {
  max-width: 940px;
  margin: 16px auto 0;
  color: var(--text);
  text-align: center;
}

.result-subheading {
  margin: 64px 0 12px;
  text-align: center;
  font-size: 1.45rem;
  line-height: 1.3;
}

.supplement-figure {
  margin-top: 26px;
}

.abstract,
.section-intro {
  max-width: 940px;
  margin: 0 auto;
}

.abstract { text-align: justify; }
.section-intro { text-align: center; }

.legend {
  margin: 26px 0 18px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  color: #555;
  font-size: 0.82rem;
}

.legend > span { display: flex; align-items: center; gap: 7px; }
.legend i { width: 12px; height: 12px; }
.legend .math-label { display: inline-block; white-space: nowrap; }
.legend .math-label sub {
  font-size: 0.72em;
  line-height: 0;
  vertical-align: -0.25em;
}
.color-pi { background: var(--pi); }
.color-motus { background: var(--motus); }
.color-fast { background: var(--fast); }
.color-ours { background: var(--ours); }

.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.chart-card,
.latency-card {
  padding: 26px 26px 20px;
  border: 1px solid var(--line);
  background: #fff;
}

.chart-heading {
  text-align: center;
}

.chart-heading h3 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.3;
}

.chart-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.79rem;
}

.chart {
  position: relative;
  height: 300px;
  margin-top: 24px;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  gap: 20px;
  border-bottom: 1px solid #aaa;
}

.grid-lines {
  position: absolute;
  inset: 0 0 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}

.grid-lines i {
  display: block;
  width: 100%;
  height: 1px;
  background: #ececec;
}

.bar-group {
  z-index: 1;
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
}

.bars {
  width: 100%;
  height: 258px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
}

.bar {
  position: relative;
  width: min(28px, 19%);
  height: var(--value);
  min-height: 2px;
  background: #999;
}

.bar span {
  position: absolute;
  left: 50%;
  top: -22px;
  transform: translateX(-50%);
  color: #454545;
  font-size: 0.65rem;
  font-weight: 600;
}

.bar.pi { background: var(--pi); }
.bar.motus { background: var(--motus); }
.bar.fast { background: var(--fast); }
.bar.ours { background: var(--ours); }

.bar.ours span {
  color: var(--blue-dark);
  font-weight: 800;
}

.bar-group > strong {
  width: 100%;
  min-height: 42px;
  padding-top: 8px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  text-align: center;
  font-size: 0.75rem;
  line-height: 1.25;
}

.real-chart .bars { gap: 3px; }
.real-chart .bar { width: min(23px, 20%); }

.chart-card figcaption { min-height: 42px; margin-top: 14px; }

.latency-card { margin-top: 22px; }

.latency-chart {
  margin-top: 25px;
  padding: 7px 0;
}

.latency-row {
  display: grid;
  grid-template-columns: 112px 1fr 86px;
  gap: 12px;
  align-items: center;
  min-height: 38px;
}

.latency-row strong,
.latency-row span { font-size: 0.76rem; }
.latency-row span { color: var(--muted); text-align: right; }

.latency-row i {
  display: block;
  width: max(4px, var(--width));
  height: 17px;
  background: #999;
}

.latency-row i.pi { background: var(--pi); }
.latency-row i.fast { background: var(--fast); }
.latency-row i.ours { background: var(--ours); }
.latency-row i.motus { background: var(--motus); }
.latency-row i.teacher { background: #3d4651; }

.citation-intro {
  max-width: 940px;
  margin: 0 auto 14px;
}

.citation-block {
  max-width: 940px;
  margin: 0 auto;
  padding: 22px 24px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #303846;
  background: var(--soft);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  text-align: left;
  white-space: pre;
}

.citation-block code { font: inherit; }

footer {
  margin-top: 80px !important;
  padding: 28px 0 42px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
  font-size: 0.82rem;
}

footer p { margin: 2px 0; }

@media (max-width: 760px) {
  body { font-size: 16px; }
  .site-nav-inner {
    width: 100%;
    min-height: 54px;
    padding-left: 16px;
    gap: 18px;
  }
  .site-nav-links {
    min-width: 0;
    flex: 1 1 auto;
    justify-content: flex-start;
    gap: 20px;
    padding-right: 16px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .site-nav-links::-webkit-scrollbar { display: none; }
  .site-nav-links a { padding: 15px 0 13px; font-size: 0.82rem; }
  #top,
  .project-section { scroll-margin-top: 70px; }
  .hero { padding-top: 44px; }
  .lead-video { padding-top: 42px; }
  .project-summary { padding-top: 24px; text-align: left; }
  .project-section { padding-top: 58px; }
  .abstract,
  .section-intro { text-align: left; }
  .chart-grid { grid-template-columns: 1fr; }
  .chart-card { padding-left: 16px; padding-right: 16px; }
  .chart { height: 280px; }
  .bars { height: 238px; }
  .latency-row { grid-template-columns: 88px 1fr 74px; gap: 8px; }
  .citation-block { padding: 18px; font-size: 0.76rem; }
}
