:root {
  --bg: #ffffff;
  --paper: #f7f7f4;
  --text: #1f2933;
  --muted: #5f6b7a;
  --line: #e5e7eb;
  --blue: #2f5f9f;
  --blue-soft: #edf3fb;
  --soft-panel: #fbfcfe;
  --max: 1040px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.68;
  counter-reset: page-section;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 58px;
  padding: 10px max(18px, calc((100vw - var(--max)) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
}

.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
}

.topbar-brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.topbar nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 16px;
  font-size: 14px;
}

.language-switch {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(31, 41, 51, 0.05);
  font-size: 13px;
  font-weight: 750;
}

.language-switch a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 28px;
  border-radius: 999px;
  padding: 3px 10px;
  color: var(--muted);
}

.language-switch a:hover {
  text-decoration: none;
  color: var(--blue);
}

.language-switch a.active {
  background: var(--blue);
  color: #fff;
}

.hero,
.content-section,
.figure-section,
.footer {
  width: min(calc(100% - 34px), var(--max));
  margin: 0 auto;
}

.hero {
  padding: 48px 0 24px;
  text-align: center;
}

.hero-logo {
  width: min(280px, 58vw);
  height: auto;
  margin-bottom: 20px;
}

.project-name {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

h1 {
  max-width: 930px;
  margin: 0 auto 18px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: 0;
}

.tagline {
  max-width: 800px;
  margin: 0 auto 20px;
  color: var(--muted);
  font-size: 19px;
}

.authors {
  max-width: 850px;
  margin: 22px auto 6px;
  color: var(--text);
  font-size: 17px;
}

.affiliation {
  margin: 0 auto 8px;
  color: var(--muted);
}

.emails {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 12px;
  margin: 0 auto 24px;
  color: var(--muted);
  font-size: 15px;
}

.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.78rem;
  margin: 1.55rem auto 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.62rem;
  min-height: 46px;
  border: 1px solid rgba(47, 95, 159, 0.16);
  border-radius: 999px;
  padding: 0.56rem 1.05rem 0.56rem 0.62rem;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  color: var(--text);
  font-size: 0.94rem;
  font-weight: 750;
  letter-spacing: 0;
  line-height: 1;
  box-shadow: 0 8px 22px rgba(31, 41, 51, 0.08);
  transition:
    border-color 150ms ease,
    transform 150ms ease,
    background 150ms ease,
    box-shadow 150ms ease;
}

.btn:hover {
  border-color: rgba(47, 95, 159, 0.42);
  box-shadow: 0 14px 28px rgba(47, 95, 159, 0.15);
  text-decoration: none;
  transform: translateY(-1px);
}

.btn.is-open {
  border-color: rgba(47, 95, 159, 0.42);
  background: linear-gradient(180deg, #edf3fb, #ffffff);
  box-shadow: 0 14px 30px rgba(47, 95, 159, 0.14);
}

.btn.primary {
  border-color: rgba(47, 95, 159, 0.56);
  background: linear-gradient(180deg, #356aa9, #244f88);
  color: #fff;
  box-shadow: 0 14px 30px rgba(47, 95, 159, 0.24);
}

.btn.ghost {
  background: linear-gradient(180deg, #ffffff, #fbfcfe);
}

.btn.disabled {
  cursor: default;
  color: var(--muted);
  opacity: 0.9;
}

.btn.disabled:hover {
  border-color: var(--line);
  box-shadow: 0 8px 22px rgba(31, 41, 51, 0.06);
  transform: none;
}

.btn .i {
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(47, 95, 159, 0.16);
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
}

.btn.primary .i {
  border-color: rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.btn.disabled .i {
  border-color: var(--line);
  background: #f3f5f7;
  color: var(--muted);
}

.btn svg {
  display: block;
  width: 16px;
  height: 16px;
}

.btn svg path,
.btn svg rect {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn .github-mark path {
  fill: currentColor;
  stroke: none;
}

.btn .arxiv-mark text {
  fill: currentColor;
  font: 800 7px/1 Georgia, "Times New Roman", serif;
}

.figure-section {
  padding: 18px 0 34px;
}

.presentation-embed {
  max-height: 0;
  overflow: hidden;
  border-top: 1px solid transparent;
  border-bottom: 1px solid transparent;
  background: linear-gradient(180deg, #f7f9fc, #ffffff);
  transition:
    max-height 420ms ease,
    border-color 220ms ease;
}

.presentation-embed.open {
  max-height: min(86vw, 980px);
  border-color: var(--line);
}

.presentation-pad {
  width: min(calc(100% - 34px), 1120px);
  margin: 0 auto;
  padding: 18px 0 30px;
}

.presentation-frame {
  overflow: hidden;
  border: 1px solid rgba(47, 95, 159, 0.18);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(31, 41, 51, 0.12);
}

.presentation-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}

.presentation-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.presentation-eyebrow .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 5px rgba(47, 95, 159, 0.12);
}

.presentation-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.presentation-action {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid rgba(47, 95, 159, 0.18);
  border-radius: 999px;
  padding: 5px 11px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.presentation-action:hover {
  border-color: rgba(47, 95, 159, 0.42);
  color: var(--blue);
  text-decoration: none;
}

.presentation-stage {
  background: #101827;
}

.presentation-stage iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  background: #101827;
}

.content-section {
  counter-increment: page-section;
  padding: 36px 0;
  border-top: 1px solid var(--line);
}

.content-section h2 {
  margin: 0 0 16px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.2;
}

.content-section h2::before {
  content: counter(page-section, decimal-leading-zero);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 24px;
  margin-right: 12px;
  border: 1px solid rgba(47, 95, 159, 0.22);
  border-radius: 999px;
  color: var(--blue);
  background: var(--blue-soft);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 800;
  vertical-align: 0.18em;
}

.content-section p {
  max-width: 850px;
  margin: 0 0 16px;
  color: var(--text);
  font-size: 16px;
}

.section-head-center {
  max-width: 820px;
  margin: 0 auto 24px;
  text-align: center;
}

.section-head-center h2 {
  margin-bottom: 12px;
}

.section-head-center p {
  max-width: 760px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

.demo-section {
  padding-top: 42px;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.video-card {
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(31, 41, 51, 0.08);
}

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

.video-card figcaption {
  display: grid;
  gap: 4px;
  padding: 13px 14px 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.42;
}

.video-card figcaption strong {
  color: var(--text);
  font-size: 15px;
}

.video-card figcaption span {
  display: block;
}

.insight-grid,
.idea-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.insight-card,
.idea-card {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px 18px 20px;
  background: var(--soft-panel);
}

.insight-card span,
.idea-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 24px;
  margin-bottom: 12px;
  border: 1px solid rgba(47, 95, 159, 0.2);
  border-radius: 999px;
  padding: 2px 10px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 12px;
  font-weight: 800;
}

.insight-card p,
.idea-card p {
  max-width: none;
  margin: 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
}

.idea-card h3 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 17px;
  line-height: 1.28;
}

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

.two-column > div,
.note-grid p {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 20px 22px;
  background: var(--soft-panel);
}

.two-column p {
  max-width: none;
  margin-bottom: 0;
}

.section-intro {
  display: grid;
  grid-template-columns: minmax(180px, 250px) minmax(0, 1fr);
  align-items: start;
  gap: 28px;
  margin-bottom: 18px;
}

.section-intro h2 {
  margin-bottom: 0;
}

.section-intro p {
  max-width: none;
  margin-top: 4px;
}

.paper-figure-frame {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
  background: #fff;
  box-shadow: 0 10px 32px rgba(31, 41, 51, 0.07);
}

.paper-figure-frame picture {
  display: block;
}

.paper-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 3px;
  background: var(--paper);
}

.teaser-section {
  width: min(calc(100% - 34px), var(--max));
  margin: 18px auto 36px;
  padding: 0;
  display: grid;
  justify-items: center;
}

.teaser-card {
  width: 100%;
  margin: 0 auto !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
}

.teaser-card picture {
  display: block;
  width: min(100%, 960px);
  margin: 0 auto;
}

.teaser-card .paper-image {
  margin: 0 auto;
}

.teaser-caption {
  width: min(100%, 900px);
  margin-left: auto;
  margin-right: auto;
}

.method-frame {
  margin: 14px 0 20px;
}

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

.note-grid p {
  max-width: none;
  margin-bottom: 0;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(360px, 1.08fr);
  align-items: center;
  gap: 26px;
}

.split-copy p {
  max-width: none;
}

.compact-list {
  margin: 16px 0 0;
  padding-left: 20px;
  color: var(--text);
}

.compact-list li {
  margin: 9px 0;
}

.side-frame {
  align-self: start;
}

.caption {
  max-width: 900px;
  margin: 12px auto 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.table-wrap {
  overflow-x: auto;
  margin: 20px 0 18px;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 15px;
}

th,
td {
  padding: 11px 12px;
  border: 1px solid var(--line);
  text-align: left;
}

th {
  background: var(--blue-soft);
  color: #173b68;
  font-weight: 700;
}

.figure-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 26px;
}

pre {
  overflow-x: auto;
  margin: 18px 0 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 16px;
  background: #f8fafc;
  color: #111827;
  font-size: 13px;
  line-height: 1.55;
}

.copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  background: #fff;
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.footer {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 28px 0 44px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.footer img {
  width: 58px;
  max-height: 52px;
  object-fit: contain;
  height: auto;
}

.footer div {
  display: grid;
  flex: 1;
  line-height: 1.35;
}

.footer strong {
  color: var(--text);
}

@media (prefers-reduced-motion: no-preference) {
  @keyframes heroFloatIn {
    from {
      opacity: 0;
      transform: translate3d(0, 18px, 0);
    }
    to {
      opacity: 1;
      transform: translate3d(0, 0, 0);
    }
  }

  @keyframes topbarDropIn {
    from {
      opacity: 0;
      transform: translate3d(0, -12px, 0);
    }
    to {
      opacity: 1;
      transform: translate3d(0, 0, 0);
    }
  }

  @keyframes paperFloat {
    0% {
      transform: translate3d(0, 0, 0);
    }
    50% {
      transform: translate3d(0, -7px, 0);
    }
    100% {
      transform: translate3d(0, 0, 0);
    }
  }

  html.js-enabled.page-loading .topbar,
  html.js-enabled.page-loading .hero > *,
  html.js-enabled.page-loading .teaser-section {
    opacity: 0;
  }

  html.js-enabled.page-ready .topbar {
    animation: topbarDropIn 420ms 40ms ease-out both;
  }

  html.js-enabled.page-ready .hero > * {
    animation: heroFloatIn 520ms ease-out both;
  }

  html.js-enabled.page-ready .hero-logo {
    animation-delay: 70ms;
  }

  html.js-enabled.page-ready .hero h1 {
    animation-delay: 120ms;
  }

  html.js-enabled.page-ready .tagline {
    animation-delay: 170ms;
  }

  html.js-enabled.page-ready .authors {
    animation-delay: 220ms;
  }

  html.js-enabled.page-ready .affiliation {
    animation-delay: 260ms;
  }

  html.js-enabled.page-ready .emails {
    animation-delay: 300ms;
  }

  html.js-enabled.page-ready .links {
    animation-delay: 350ms;
  }

  html.js-enabled.page-ready .teaser-section {
    animation: heroFloatIn 560ms 430ms ease-out both;
  }

  html.js-enabled.page-ready .teaser-card {
    animation: paperFloat 6.5s 1.7s ease-in-out infinite;
    transform-origin: center;
  }

  .video-card,
  .insight-card,
  .idea-card,
  .result-card,
  .paper-figure-frame,
  .note-grid p,
  .two-column > div {
    transition:
      transform 190ms ease,
      box-shadow 190ms ease,
      border-color 190ms ease;
  }

  .video-card:hover,
  .insight-card:hover,
  .idea-card:hover,
  .result-card:hover,
  .paper-figure-frame:hover,
  .note-grid p:hover,
  .two-column > div:hover {
    border-color: rgba(47, 95, 159, 0.26);
    box-shadow: 0 16px 38px rgba(31, 41, 51, 0.11);
    transform: translate3d(0, -3px, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }

}

@media (max-width: 860px) {
  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar nav {
    justify-content: flex-start;
    gap: 10px 14px;
  }

  .presentation-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .presentation-actions {
    justify-content: flex-start;
  }

  .language-switch {
    align-self: flex-start;
  }

  .two-column,
  .section-intro,
  .note-grid,
  .split-layout,
  .figure-grid,
  .video-grid,
  .insight-grid,
  .idea-cards {
    grid-template-columns: 1fr;
  }

  .split-layout {
    gap: 24px;
  }
}

@media (max-width: 560px) {
  .hero {
    padding-top: 36px;
  }

  .hero-logo {
    width: min(220px, 68vw);
  }

  .links {
    display: grid;
    grid-template-columns: 1fr;
  }

  .btn {
    justify-content: flex-start;
  }

  .paper-figure-frame {
    padding: 9px;
  }

  .footer {
    align-items: flex-start;
    flex-direction: column;
  }
}
