:root {
  --ink: #17181c;
  --muted: #5f6470;
  --line: #e7e3df;
  --paper: #fff;
  --warm: #fff8f1;
  --state: #f47a3d;
  --state-soft: #fff0e4;
  --visual: #2079bf;
  --visual-soft: #eaf5ff;
  --success: #16865c;
  --danger: #c44e5d;
  --shadow: 0 16px 44px rgba(35, 31, 27, 0.09);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem;
}

body {
  color: var(--ink);
  font-family: "Noto Sans", sans-serif;
  background:
    radial-gradient(circle at 8% 20%, rgba(244, 122, 61, 0.1), transparent 25rem),
    radial-gradient(circle at 92% 25%, rgba(32, 121, 191, 0.1), transparent 25rem),
    linear-gradient(180deg, #fff 0%, #fffdfb 100%);
  background-attachment: fixed;
  text-rendering: optimizeLegibility;
}

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

.project-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: 3.75rem;
  border-bottom: 1px solid rgba(231, 227, 223, 0.88);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
}

.project-nav .navbar-item {
  font-family: "Google Sans", sans-serif;
  font-weight: 500;
}

.project-nav .navbar-end .navbar-item {
  color: #4a4d55;
  padding-left: 1rem;
  padding-right: 1rem;
}

.project-nav .navbar-end .navbar-item:hover {
  color: var(--ink);
  background: transparent;
}

.project-mark {
  display: inline-flex;
  align-items: center;
  font-size: 1.25rem;
  font-weight: 700 !important;
  letter-spacing: -0.03em;
}

.brand-icon {
  width: 1.75rem;
  height: 1.8rem;
  margin-right: 0.42rem;
  object-fit: contain;
}

.mark-state,
.title-state {
  color: var(--state);
}

.mark-play,
.title-play {
  color: var(--visual);
}

.publication-header {
  position: relative;
  overflow: hidden;
  background: transparent;
}

.publication-header::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(980px, 90%);
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}

.publication-header .hero-body {
  padding: 5rem 1.5rem 3rem;
}

.publication-title {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(0.5rem, 1.2vw, 0.85rem);
  margin: 0 auto 1.45rem !important;
  max-width: none;
  font-family: "Google Sans", sans-serif;
  font-size: clamp(0.76rem, 4.1vw, 2.55rem) !important;
  font-weight: 700 !important;
  letter-spacing: -0.045em;
  line-height: 1.12 !important;
}

.title-icon {
  flex: 0 0 auto;
  width: 1.08em;
  height: 1.12em;
  object-fit: contain;
}

.title-copy {
  min-width: 0;
}

.title-line {
  display: block;
  white-space: nowrap;
}

.publication-authors {
  font-family: "Google Sans", sans-serif;
  line-height: 1.75;
}

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

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

.author-block {
  display: inline-block;
  margin: 0 0.15rem;
}

.affiliation-line {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 1rem !important;
}

.publication-links {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(0.3rem, 1.2vw, 0.55rem);
  width: min(100%, 48rem);
  margin-inline: auto;
  margin-top: 1.25rem;
}

.publication-links .button {
  justify-content: center;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 2.35rem;
  min-height: 2.35rem;
  padding-inline: clamp(0.28rem, 1.5vw, 0.75rem);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-sizing: border-box;
  overflow: hidden;
  font-family: "Google Sans", sans-serif;
  font-size: clamp(0.74rem, 2.8vw, 0.92rem);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.publication-links .button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(20, 22, 26, 0.18);
}

.publication-links .resource-icon {
  display: block;
  width: 15px !important;
  min-width: 15px;
  max-width: 15px;
  height: 15px !important;
  min-height: 15px;
  max-height: 15px;
  object-fit: contain;
  margin-right: clamp(0.25rem, 1vw, 0.45rem);
  flex: 0 0 auto;
}

.resource-label {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
  min-width: 0;
  white-space: nowrap;
}

.resource-label small {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.72em;
  font-weight: 500;
}

.is-placeholder {
  opacity: 0.94;
}

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

.teaser .container {
  width: 100%;
  max-width: 1060px !important;
}

.paper-figure {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  box-shadow: var(--shadow);
}

.paper-figure a,
.paper-figure img {
  display: block;
  width: 100%;
}

.teaser-figure {
  padding: 0.35rem;
}

.teaser-figure img,
.method-figure img {
  border-radius: 11px;
}

.teaser-caption {
  max-width: 850px;
  margin: 1.55rem auto 0 !important;
  font-family: "Google Sans", sans-serif;
  line-height: 1.45 !important;
}

.green-text {
  color: #16865c;
  font-weight: 700;
}

.section {
  padding: 5rem 1.5rem;
}

.section-rule {
  border-top: 1px solid var(--line);
}

.section-heading {
  max-width: 800px;
  margin: 0 auto 2.6rem;
}

.section-heading .title,
#abstract .title,
.citation-heading .title {
  margin-top: 0;
  margin-bottom: 0.8rem;
  font-family: "Google Sans", sans-serif;
  letter-spacing: -0.025em;
}

.section-lead {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.abstract-copy {
  color: #343740;
  font-size: 1.02rem;
  line-height: 1.82;
}

.abstract-copy p:not(:last-child) {
  margin-bottom: 1.05rem;
}

.method-section {
  background: transparent;
}

.method-figure {
  max-width: 1100px;
  margin: 0 auto 2.25rem;
  padding: 0.35rem;
}

.takeaway-list {
  margin: 1.35rem auto 0;
  padding-left: 1.55rem;
  color: #383b43;
  font-size: 1.04rem;
  line-height: 1.68;
}

.takeaway-list li {
  position: relative;
  padding-left: 1.35rem;
  list-style: none;
}

.takeaway-list li + li {
  margin-top: 0.72rem;
}

.takeaway-list li::before {
  content: "";
  position: absolute;
  top: 0.84em;
  left: 0;
  width: 0.46rem;
  height: 0.46rem;
  border-radius: 50%;
  background: #17191e;
  transform: translateY(-50%);
}

.takeaway-list strong {
  color: #17191e;
  font-family: "Google Sans", sans-serif;
  font-weight: 700;
}

.method-takeaways {
  max-width: 920px;
}

.result-takeaways {
  margin-top: 0;
  padding: 1.05rem 1.8rem 1.2rem 2.75rem;
  border-top: 1px solid var(--line);
  background: #fcfcfc;
}

.experiment-section {
  background: transparent;
}

.result-block {
  margin-top: 2.25rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  box-shadow: 0 9px 30px rgba(35, 31, 27, 0.05);
}

.result-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.35rem 1.5rem 1.1rem;
  border-bottom: 1px solid var(--line);
}

.result-heading .title {
  margin: 0.22rem 0 0;
  font-family: "Google Sans", sans-serif;
}

.result-heading > p {
  max-width: 430px;
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
  text-align: right;
}

.table-shell {
  overflow-x: auto;
  scrollbar-color: #beb8b1 transparent;
}

.result-table {
  min-width: 940px;
  margin: 0 !important;
  font-size: 0.84rem;
}


.result-table th,
.result-table td {
  padding: 0.75rem 0.7rem !important;
  vertical-align: middle !important;
  text-align: center !important;
  white-space: nowrap;
}

.result-table th:first-child,
.result-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 180px;
  background: white;
  text-align: left !important;
}

.result-table thead th {
  color: #343740;
  background: #f7f5f3;
  font-size: 0.76rem;
}

.result-table thead th:first-child {
  z-index: 4;
  background: #f7f5f3;
}

.result-table thead tr:nth-child(2) > th:first-child {
  position: static;
  min-width: 0;
  text-align: center !important;
}

.metric-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px dotted #7f8790;
  cursor: help;
  outline: none;
}

.metric-tip:focus-visible {
  border-radius: 4px;
  box-shadow: 0 0 0 3px rgba(32, 121, 191, 0.2);
}

.metric-tooltip {
  position: absolute;
  top: calc(100% + 0.65rem);
  left: 50%;
  z-index: 30;
  width: 250px;
  padding: 0.72rem 0.82rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  color: #fff;
  background: rgba(24, 27, 32, 0.97);
  box-shadow: 0 10px 26px rgba(18, 20, 24, 0.24);
  font-size: 0.74rem;
  font-weight: 400;
  line-height: 1.48;
  text-align: left;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, -4px);
  transition: opacity 150ms ease, transform 150ms ease, visibility 150ms ease;
}

.metric-tooltip::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 100%;
  border: 6px solid transparent;
  border-bottom-color: rgba(24, 27, 32, 0.97);
  transform: translateX(-50%);
}

.metric-tip.tip-right .metric-tooltip {
  right: 0;
  left: auto;
  transform: translateY(-4px);
}

.metric-tip.tip-right .metric-tooltip::before {
  right: 1rem;
  left: auto;
  transform: none;
}

.metric-tip:hover .metric-tooltip,
.metric-tip:focus .metric-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.metric-tip.tip-right:hover .metric-tooltip,
.metric-tip.tip-right:focus .metric-tooltip {
  transform: translateY(0);
}

.result-table .group-row th {
  position: static;
  color: #6c6259;
  background: #fbf8f5;
  font-family: "Google Sans", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-align: center !important;
  text-transform: uppercase;
}

.result-table .ours-row td {
  background: #d9f7fa;
}

.result-table .ours-row td:first-child {
  background: #d9f7fa;
}

.ablation-table-shell {
  overflow-x: auto;
}

.ablation-table {
  width: 100%;
  min-width: 1040px;
  table-layout: fixed;
  font-size: 0.8rem;
}

.ablation-table col.compact-col { width: 6.5%; }
.ablation-table col.score-col { width: 7.5%; }
.ablation-table col.state-col { width: 14%; }
.ablation-table col.mechanics-col { width: 15%; }

.ablation-table thead th {
  font-size: 0.78rem;
}

.ablation-table th,
.ablation-table td {
  padding: 0.62rem 0.28rem !important;
  white-space: normal;
}

.ablation-table th:first-child,
.ablation-table td:first-child {
  position: static;
  min-width: 0;
  text-align: center !important;
}

.visualization-section {
  padding-left: 1.2rem;
  padding-right: 1.2rem;
}

.category-tabs {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin: -0.4rem auto 2rem;
}

.category-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.72rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #575b65;
  background: white;
  font-family: "Google Sans", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease, transform 150ms ease;
}

.category-tab:hover {
  transform: translateY(-1px);
  border-color: #bdb6ae;
}

.category-tab.is-active {
  border-color: #1e2026;
  color: white;
  background: #1e2026;
}

.tab-dot {
  width: 0.52rem;
  height: 0.52rem;
  border-radius: 50%;
  background: var(--state);
}

.win-dot {
  background: var(--success);
}

.lose-dot {
  background: var(--danger);
}

.tab-count {
  opacity: 0.55;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.mechanics-note {
  max-width: 920px;
  margin: 0 auto 1.4rem;
  padding: 0.85rem 1rem;
  border-left: 4px solid var(--state);
  border-radius: 4px 10px 10px 4px;
  color: #604b3d;
  background: var(--state-soft);
  font-size: 1.04rem;
  line-height: 1.62;
  text-align: center;
}

.win-note {
  max-width: 1100px;
  white-space: nowrap;
  border-color: var(--success);
  color: #275b48;
  background: #edf9f4;
}

.lose-note {
  max-width: 1100px;
  white-space: nowrap;
  border-color: var(--danger);
  color: #70424a;
  background: #fff1f3;
}

.comparison-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.4rem;
}

.comparison-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 32px rgba(35, 31, 27, 0.07);
}

.comparison-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem 1.05rem 0.9rem;
}

.pair-control {
  flex: 0 0 auto;
  padding: 0.48rem 0.72rem;
  border: 1px solid #dad6d1;
  border-radius: 999px;
  color: #4f535c;
  background: white;
  font-family: "Google Sans", sans-serif;
  font-size: 0.73rem;
  font-weight: 600;
  cursor: pointer;
}

.pair-control:hover {
  border-color: #9f9992;
  color: var(--ink);
}

.speed-control {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.35rem;
  color: #666a73;
  font-family: "Google Sans", sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
}

.speed-control select {
  padding: 0.43rem 1.7rem 0.43rem 0.55rem;
  border: 1px solid #dad6d1;
  border-radius: 999px;
  color: #383b43;
  background-color: white;
  font-family: inherit;
  font-size: 0.73rem;
  font-weight: 600;
  cursor: pointer;
}

.video-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  background: #d8d5d1;
}

.video-panel {
  position: relative;
  margin: 0;
  overflow: hidden;
  background: #101114;
}

.video-panel figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 2.4rem;
  padding: 0.52rem 0.7rem;
  color: white;
  background: #282b31;
}

.video-panel figcaption span {
  font-family: "Google Sans", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
}

.video-panel figcaption small {
  color: #aaadb4;
  font-size: 0.72rem;
}

.stateplay-panel figcaption {
  background: linear-gradient(90deg, #175e96, #2079bf);
}

.stateplay-panel figcaption small {
  color: #d9efff;
}

.video-panel video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #111;
  object-fit: cover;
}

.comparison-group[hidden] {
  display: none;
}

.citation-section {
  background: transparent;
}

.citation-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}

.citation-heading .title {
  margin-bottom: 0;
}

.copy-button {
  padding: 0.5rem 0.9rem;
  border: 1px solid #d7d3ce;
  border-radius: 8px;
  color: #3f424a;
  background: white;
  font-family: "Google Sans", sans-serif;
  font-weight: 600;
  cursor: pointer;
}

#bibtex {
  margin: 0;
  padding: 1.15rem 1.25rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: #e8e9ec;
  background: #202228;
  font-size: 0.82rem;
  line-height: 1.65;
}

.placeholder-note {
  margin-top: 0.8rem;
  color: #777b84;
  font-size: 0.78rem;
}

.footer {
  padding: 2.5rem 1.5rem;
  border-top: 1px solid var(--line);
  background: transparent;
}

.footer-note {
  color: var(--muted);
  font-size: 0.8rem;
}

@media (max-width: 1023px) {
  .project-nav .navbar-menu {
    border-top: 1px solid var(--line);
    box-shadow: none;
  }

  .project-nav .navbar-menu.is-active {
    display: block;
  }

  .publication-header .hero-body {
    padding-top: 3.8rem;
  }

  .comparison-grid {
    grid-template-columns: 1fr;
    max-width: 820px;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  .win-note,
  .lose-note {
    white-space: normal;
  }

  .publication-header .hero-body {
    padding: 3.1rem 1rem 2.4rem;
  }

  .publication-title {
    font-size: clamp(0.76rem, 4.1vw, 2.55rem) !important;
  }

  .section {
    padding: 3.7rem 1rem;
  }

  .teaser .hero-body {
    padding: 2rem 0.75rem 3.2rem;
  }

  .teaser-caption {
    font-size: 1rem !important;
  }

  .result-heading {
    display: block;
  }

  .result-heading > p {
    margin-top: 0.7rem;
    text-align: left;
  }

  .category-tabs {
    display: grid;
    grid-template-columns: 1fr;
    max-width: 360px;
  }

  .category-tab {
    justify-content: center;
  }

  .video-columns {
    grid-template-columns: 1fr;
  }

  .video-panel figcaption small {
    font-size: 0.72rem;
  }

  .publication-links .button {
    flex-direction: column;
    gap: 0.22rem;
    height: 4.15rem;
    min-height: 4.15rem;
    padding: 0.35rem 0.2rem;
    font-size: 0.72rem;
  }

  .publication-links .resource-icon {
    margin-right: 0;
  }

  .resource-label {
    display: block;
    line-height: 1;
    text-align: center;
  }

  .resource-label small {
    display: block;
    margin-top: 0.18rem;
    font-size: 0.65em;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
