:root {
  --ink: #141821;
  --muted: #5d6472;
  --line: #e8e9ed;
  --paper: #ffffff;
  --soft: #f5f6f8;
  --coral: #ec3458;
  --blue: #1598ed;
  --purple: #7357d7;
}

html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }
body { color: var(--ink); font-family: "DM Sans", sans-serif; background: var(--paper); }
.title, h1, h2, h3 { font-family: "Manrope", sans-serif; letter-spacing: -0.035em; }
a { color: var(--blue); }

.project-nav { border-bottom: 1px solid rgba(20, 24, 33, .08); background: rgba(255,255,255,.88); backdrop-filter: blur(14px); }
.project-nav .navbar-item { font-weight: 600; color: #343a46; }
.project-nav .navbar-item:hover { color: var(--coral); background: transparent; }
.project-nav .home-link .icon { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 9px; background: #f3f4f6; transition: background .2s ease, color .2s ease; }
.project-nav .home-link:hover .icon { color: #fff; background: linear-gradient(135deg, var(--coral), var(--blue)); }
.project-nav .research-toggle { height: 100%; border: 0; color: #343a46; cursor: pointer; font: inherit; font-weight: 600; background: transparent; }
.project-nav .research-toggle:hover { color: var(--coral); background: transparent; }
.project-nav .navbar-dropdown { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 38px rgba(23,29,44,.12); }
.project-nav .navbar-dropdown .navbar-item { white-space: nowrap; }
.brand-mark { font-family: "Manrope", sans-serif; font-weight: 800 !important; letter-spacing: -.03em; }
.brand-mark span { width: 1.85rem; height: 1.85rem; display: inline-grid; place-items: center; margin-right: .55rem; border-radius: 9px; color: #fff; background: linear-gradient(135deg, var(--coral), var(--blue)); }
.navbar-burger { background: transparent; border: 0; }

.paper-hero { padding-top: 5.75rem; overflow: hidden; position: relative; background: radial-gradient(circle at 20% 10%, rgba(236,52,88,.10), transparent 28%), radial-gradient(circle at 85% 20%, rgba(21,152,237,.13), transparent 30%), #fff; }
.paper-hero::after { content: ""; position: absolute; inset: auto 10% 0; height: 1px; background: linear-gradient(90deg, transparent, #d9dbe2, transparent); }
.paper-hero .hero-body { padding-bottom: 3.25rem; }
.venue-pill { display: inline-flex; padding: .42rem .9rem; margin-bottom: 1.3rem; border: 1px solid #e0e2e8; border-radius: 99px; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; background: rgba(255,255,255,.8); }
.publication-title { max-width: 1040px; margin: 0 auto 1.15rem !important; font-size: clamp(2.25rem, 5vw, 4.5rem) !important; line-height: 1.06 !important; }
.gradient-text { color: transparent; background: linear-gradient(105deg, var(--coral), var(--purple) 50%, var(--blue)); background-clip: text; -webkit-background-clip: text; }
.hero-summary { max-width: 720px; margin: 0 auto 1.7rem; color: var(--muted); font-size: 1.18rem; }
.publication-authors { max-width: 900px; margin: auto; font-size: 1.08rem; line-height: 2; }
.author-block { display: inline-block; margin: 0 .38rem; }
.author-block a { color: var(--ink); border-bottom: 1px solid #a9aeba; }
.affiliations { margin: .8rem auto 1.35rem; color: var(--muted); font-size: .92rem; line-height: 1.6; }
.publication-links { display: flex; justify-content: center; flex-wrap: wrap; gap: .5rem; }
.publication-links .button { padding-left: 1.15rem; padding-right: 1.15rem; font-weight: 600; }
.publication-links .is-static { opacity: .68; }

.teaser-section { padding: 1.5rem 1.5rem 3rem; }
.video-overview { padding-top: 2rem; }
.youtube-frame { position: relative; overflow: hidden; width: 100%; padding-bottom: 56.25%; border-radius: 18px; background: #10131a; box-shadow: 0 20px 55px rgba(23,29,44,.14); }
.youtube-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; }
.paper-figure { margin: 0; padding: .75rem; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 16px 50px rgba(23, 29, 44, .07); }
.paper-figure img { display: block; width: 100%; border-radius: 10px; }
.paper-figure figcaption { padding: .9rem .55rem .25rem; color: var(--muted); text-align: center; font-size: .94rem; }
.hero-figure { max-width: 1240px; margin: auto; }

.section { padding: 5.5rem 1.5rem; }
.section-tinted { background: var(--soft); }
.section-heading { max-width: 780px; margin: 0 auto 2.5rem; }
.section-heading .title { margin-top: .45rem; }
.section-heading em { color: var(--coral); font-style: normal; }
.eyebrow { color: var(--coral); font-size: .78rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.section-lead { color: var(--muted); font-size: 1.08rem; line-height: 1.7; }
.abstract-copy { max-width: 850px; margin: auto; color: #343946; font-size: 1.08rem; line-height: 1.82; text-align: justify; }

.contribution-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 3rem; }
.contribution-card { position: relative; min-height: 235px; padding: 1.6rem; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.card-number { position: absolute; right: 1rem; top: .25rem; color: #f0f1f4; font-family: "Manrope", sans-serif; font-size: 4.5rem; font-weight: 800; }
.contribution-card h3 { position: relative; margin: 3.1rem 0 .7rem; font-size: 1.25rem; font-weight: 800; }
.contribution-card p { position: relative; color: var(--muted); line-height: 1.65; }

.method-detail { align-items: center; margin-top: 4rem !important; }
.sticky-copy { padding: 1.5rem 1rem; }
.sticky-copy p { color: var(--muted); font-size: 1.05rem; line-height: 1.75; }
.compact-figure { padding: .6rem; }
.output-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.4rem; }
.output-tags span { padding: .45rem .8rem; border-radius: 8px; color: #3d4350; font-size: .86rem; font-weight: 700; background: #fff; border: 1px solid #e0e2e7; }
.training-block { margin-top: 5.5rem; }
.stage-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-top: 1.5rem; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--line); }
.stage-grid div { display: flex; align-items: center; gap: .8rem; min-height: 76px; padding: 1rem; background: #fff; }
.stage-grid b { display: grid; place-items: center; flex: 0 0 2rem; height: 2rem; border-radius: 50%; color: #fff; background: linear-gradient(135deg, var(--coral), var(--blue)); }
.stage-grid span { font-size: .9rem; font-weight: 700; line-height: 1.3; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 4.5rem; }
.metric-card { min-height: 150px; display: flex; flex-direction: column; justify-content: space-between; padding: 1.4rem; border-radius: 16px; background: var(--soft); }
.metric-card.accent { color: #fff; background: linear-gradient(135deg, #d92f51, #7255d6 55%, #168edb); }
.metric-value { font-family: "Manrope", sans-serif; font-size: 2.8rem; font-weight: 800; letter-spacing: -.06em; }
.metric-label { max-width: 170px; font-size: .88rem; font-weight: 600; line-height: 1.35; }
.tables-block { margin: 1rem 0 5rem; }
.result-table-panel { margin: .8rem 0; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.result-table-panel summary { padding: 1rem 1.2rem; cursor: pointer; font-family: "Manrope", sans-serif; font-weight: 750; background: #fafafb; }
.result-table-panel[open] summary { border-bottom: 1px solid var(--line); }
.table-scroll { overflow-x: auto; }
.result-table { width: 100%; min-width: 820px; border-collapse: collapse; font-size: .86rem; text-align: center; }
.result-table.compact-table { min-width: 680px; }
.result-table th, .result-table td { padding: .72rem .65rem; border-right: 1px solid #eceef2; border-bottom: 1px solid #eceef2; white-space: nowrap; }
.result-table th:first-child, .result-table td:first-child { text-align: left; font-weight: 650; }
.result-table thead th { color: #3a404c; font-size: .78rem; background: #f7f8fa; }
.result-table .zero-shot { background: #eef0f3; }
.result-table tr.ours td { color: #9c2039; font-weight: 800; background: #fff0f3; }
.result-table small { color: var(--muted); font-weight: 500; }
.result-story { display: grid; grid-template-columns: minmax(240px, .72fr) minmax(0, 1.5fr); align-items: center; gap: 3rem; margin: 4rem 0; }
.result-story.reverse { grid-template-columns: minmax(0, 1.5fr) minmax(240px, .72fr); }
.result-story.reverse > div { order: 2; }
.result-story p { color: var(--muted); line-height: 1.75; }
.image-button { display: block; width: 100%; padding: 0; cursor: zoom-in; border: 0; border-radius: 12px; background: transparent; }
.image-button img { display: block; width: 100%; border: 1px solid var(--line); border-radius: 12px; transition: transform .25s ease, box-shadow .25s ease; }
.image-button:hover img { transform: translateY(-3px); box-shadow: 0 16px 35px rgba(23,29,44,.11); }
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; margin-top: 4rem; }
.gallery-grid.two-up { grid-template-columns: repeat(2, 1fr); }
.gallery-grid figure { margin: 0; }
.gallery-grid figcaption { padding: .75rem .25rem 0; color: var(--muted); font-size: .9rem; font-weight: 600; }
.demo-group { margin-top: 4rem; }
.demo-group > .title { padding-bottom: .8rem; border-bottom: 1px solid #dcdee4; }
.video-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.video-grid.two-up-videos { grid-template-columns: repeat(2, 1fr); }
.video-grid figure { margin: 0; }
.demo-video { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid #dfe1e6; border-radius: 12px; background: #11151d; box-shadow: 0 10px 25px rgba(23,29,44,.08); }
.robot-demo { aspect-ratio: 1920 / 524; }
.video-grid figcaption { padding: .65rem .2rem 0; color: var(--muted); font-size: .88rem; font-weight: 600; line-height: 1.45; }

.robot-section { background: #12151d; color: #fff; }
.robot-section .title, .robot-section .eyebrow { color: #fff; }
.robot-section .eyebrow { opacity: .65; }
.robot-section .section-lead { color: #aeb4c2; }
.robot-highlight { display: grid; grid-template-columns: 1.5fr .7fr; align-items: stretch; gap: 1.25rem; }
.robot-highlight .paper-figure { box-shadow: none; }
.robot-stat { display: flex; flex-direction: column; justify-content: center; padding: 2.3rem; border: 1px solid #323745; border-radius: 18px; background: linear-gradient(145deg, rgba(236,52,88,.18), rgba(21,152,237,.13)); }
.robot-stat span { font-family: "Manrope", sans-serif; font-size: clamp(3rem, 7vw, 5rem); font-weight: 800; letter-spacing: -.07em; }
.robot-stat p { color: #c5cad5; line-height: 1.6; }
.robot-section .gallery-grid img { border-color: #303541; }
.robot-section .gallery-grid figcaption { color: #c5cad5; }
.robot-video-block { margin-top: 5rem; }
.robot-video-block .video-grid figcaption { color: #c5cad5; }
.robot-video-block .demo-video { border-color: #323745; box-shadow: none; }
.reasoning-demo-title { margin-top: 5rem !important; }

.bibtex-wrap { position: relative; }
.bibtex-wrap pre { padding: 1.6rem; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; color: #d9e0ec; background: #171b24; }
.bibtex-wrap code { color: inherit; font-size: .87rem; background: transparent; }
.copy-button { position: absolute; z-index: 2; top: .8rem; right: .8rem; padding: .45rem .7rem; border: 1px solid #3e4554; border-radius: 7px; color: #d9e0ec; cursor: pointer; background: #272d39; }
.project-footer { padding: 2.75rem 1.5rem; color: #858b97; background: #f4f5f7; }
.project-footer p:first-child { color: #333946; font-weight: 700; }
.footer-note { margin-top: .45rem; font-size: .86rem; }

.lightbox { position: fixed; z-index: 1000; inset: 0; display: grid; place-items: center; padding: 4rem 2rem 2rem; background: rgba(8,10,15,.92); }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 96vw; max-height: 90vh; object-fit: contain; border-radius: 8px; background: #fff; }
.lightbox-close { position: fixed; top: 1rem; right: 1.4rem; border: 0; color: #fff; cursor: pointer; font-size: 2.5rem; line-height: 1; background: transparent; }

@media (max-width: 1023px) {
  .project-nav .navbar-menu { padding: .75rem; box-shadow: 0 12px 24px rgba(0,0,0,.08); }
  .project-nav .research-toggle { width: 100%; justify-content: flex-start; padding-left: .75rem; }
  .project-nav .research-menu .navbar-dropdown { display: none; padding-left: .75rem; border: 0; box-shadow: none; }
  .project-nav .research-menu.is-active .navbar-dropdown { display: block; }
  .contribution-grid, .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .video-grid { grid-template-columns: repeat(2, 1fr); }
  .stage-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .section { padding: 4rem 1rem; }
  .paper-hero { padding-top: 4.7rem; }
  .paper-hero .hero-body { padding: 2.5rem 1rem; }
  .publication-title { font-size: clamp(2rem, 10vw, 3rem) !important; }
  .hero-summary { font-size: 1rem; }
  .teaser-section { padding: 1rem .65rem 2.5rem; }
  .paper-figure { padding: .4rem; border-radius: 12px; }
  .contribution-grid, .metric-grid, .gallery-grid, .gallery-grid.two-up, .robot-highlight, .video-grid, .video-grid.two-up-videos { grid-template-columns: 1fr; }
  .result-story, .result-story.reverse { grid-template-columns: 1fr; gap: 1.25rem; }
  .result-story.reverse > div { order: initial; }
  .metric-card { min-height: 125px; }
  .method-detail { margin-top: 2.5rem !important; }
  .training-block { margin-top: 3.5rem; }
  .gallery-grid { gap: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
