/* ===== Base ===== */
body {
  font-family: 'Noto Sans', sans-serif;
  background: #fafafa;
}

/* ===== Section reveal (MoGe2-like fold-in load) ===== */
.reveal {
  opacity: 0;
  transform: translateY(22px) scale(0.99);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal.is-visible {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ===== Typography ===== */
.publication-title {
  font-family: 'Space Grotesk', 'Google Sans', sans-serif;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  background: linear-gradient(120deg, #1a1a2e 0%, #1a6fb3 40%, #0e9a74 80%, #19b35a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.title.is-3 {
  font-family: 'Space Grotesk', 'Google Sans', sans-serif;
  font-weight: 700;
  letter-spacing: -0.015em;
  position: relative;
  display: inline-block;
  padding-bottom: 0.35em;
}
.title.is-3::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 2.4em; height: 4px;
  border-radius: 3px;
  background: linear-gradient(90deg, #1a6fb3 0%, #0e9a74 60%, #19b35a 100%);
  box-shadow: 0 2px 10px rgba(14, 154, 116, 0.25);
}

.publication-authors {
  font-family: 'Google Sans', sans-serif;
}
.publication-authors a {
  color: hsl(204, 86%, 53%) !important;
}
.publication-authors a:hover { text-decoration: underline; }
.author-block { display: inline-block; }

.authors-line {
  white-space: nowrap;
  font-size: clamp(0.78rem, 1.55vw, 1.25rem) !important;
  text-align: center;
}
.authors-line .author-block { white-space: nowrap; }

.title-hero .publication-title { margin-bottom: 0.35rem !important; }
.title-hero .publication-authors { margin-top: -0.1em; }

.banner { font-variant: small-caps; font-weight: 700; }

/* ===== Links / Buttons ===== */
.link-block a { margin-top: 5px; margin-bottom: 5px; }
.footer .icon-link { font-size: 25px; color: #000; }

/* ===== Teaser ===== */
.teaser-caption {
  font-size: clamp(1.05rem, 1.35vw, 1.45rem) !important;
  line-height: 1.55;
  color: #2c2c2c;
}
.teaser-caption .banner { font-weight: 700; font-size: 1.1em; }
.teaser .hero-body { padding-top: 0; padding-bottom: 3rem; }

/* ===== Section backgrounds ===== */
section.section-light { background: #f0f4f8; }

/* ===== Task grid ===== */
.task-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  width: 100%;
}
@media (max-width: 768px) {
  .task-grid { grid-template-columns: 1fr; }
}

.task-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(26, 111, 179, 0.10);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.task-card video {
  width: 100%;
  display: block;
  border-radius: 14px 14px 0 0;
}
.task-video-carousel {
  position: relative;
  width: 100%;
}
.task-video-carousel .task-carousel-video {
  width: 100%;
  display: block;
  border-radius: 14px 14px 0 0;
}
.task-carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(15, 25, 45, 0.55);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: background 0.2s ease, transform 0.2s ease;
}
.task-carousel-btn.left {
  left: 10px;
}
.task-carousel-btn.right {
  right: 10px;
}
.task-carousel-btn:hover {
  background: rgba(14, 154, 116, 0.85);
}
.task-carousel-btn:active {
  transform: translateY(-50%) scale(0.95);
}
.task-n-indicator {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 2;
  background: rgba(14, 154, 116, 0.88);
  color: #fff;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.task-card .task-label {
  padding: 0.75rem 1rem 0.9rem;
  font-weight: 600;
  font-size: 0.97rem;
  color: #1a1a2e;
  line-height: 1.4;
}
.task-card .task-tag {
  display: inline-block;
  background: linear-gradient(90deg, #1a6fb3 0%, #0e9a74 100%);
  color: #fff;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.18em 0.6em;
  margin-bottom: 0.3em;
  letter-spacing: 0.04em;
}

/* ===== Result table ===== */
.result-table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  box-shadow: 0 2px 16px rgba(26, 111, 179, 0.08);
}
.result-table-wrapper table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}
.result-table-wrapper th, .result-table-wrapper td {
  padding: 0.65rem 1rem;
  text-align: center;
  border-bottom: 1px solid #e8edf2;
  font-size: 0.92rem;
}
.result-table-wrapper th {
  background: #f0f4f8;
  font-weight: 700;
  color: #1a1a2e;
  font-family: 'Space Grotesk', sans-serif;
}
.result-table-wrapper td:first-child { text-align: left; font-weight: 600; }
.result-table-wrapper tr.ours td {
  background: linear-gradient(90deg, rgba(26,111,179,0.06) 0%, rgba(14,154,116,0.06) 100%);
  font-weight: 700;
  color: #0e6a4f;
}
.result-table-wrapper tr.section-sep td {
  background: #f8fafc;
  font-size: 0.82rem;
  color: #666;
  font-style: italic;
  padding: 0.35rem 1rem;
  text-align: left;
}

/* ===== Method figure ===== */
.method-figure {
  width: 100%;
  border-radius: 14px;
  box-shadow: 0 4px 24px rgba(14, 154, 116, 0.12);
}

/* ===== BibTeX ===== */
.bibtex-block {
  background: #1a1a2e;
  color: #d0e8ff;
  border-radius: 12px;
  padding: 1.4rem 1.6rem;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.88rem;
  line-height: 1.7;
  overflow-x: auto;
  position: relative;
}
.bibtex-copy-btn {
  position: absolute;
  top: 0.8rem; right: 0.9rem;
  background: rgba(255,255,255,0.12);
  border: none;
  color: #d0e8ff;
  border-radius: 7px;
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s;
}
.bibtex-copy-btn:hover { background: rgba(255,255,255,0.22); }

/* ===== Teaser video ===== */
.teaser-video {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 18px;
  box-shadow: 0 12px 40px rgba(26, 111, 179, 0.18), 0 4px 14px rgba(14, 154, 116, 0.12);
  border: 1px solid rgba(14, 154, 116, 0.15);
}

/* ===== Force plot row ===== */
.force-plot-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 0.5rem;
}
@media (max-width: 768px) {
  .force-plot-row { grid-template-columns: 1fr; }
}
.force-plot-row img {
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(26,111,179,0.10);
}

/* ===== Abstract ===== */
.abstract-box {
  background: #fff;
  border-radius: 14px;
  padding: 1.6rem 2rem;
  box-shadow: 0 2px 16px rgba(26, 111, 179, 0.08);
  line-height: 1.75;
  color: #222;
  font-size: 1.05rem;
}
.abstract-box p { margin-bottom: 0; }

/* ===== Text size increases ===== */
.section p, .section li, .section ul { font-size: 1.05rem; line-height: 1.7; color: inherit; }
.section-light p, .section-light li, .section-light ul { color: inherit; }
.result-table-wrapper th, .result-table-wrapper td { font-size: 0.98rem; padding: 0.75rem 1.1rem; }
figcaption { font-size: 1.05rem !important; line-height: 1.7; color: inherit; }

/* ===== Takeaways section ===== */
.takeaway-intro,
.takeaway-outro {
  max-width: 920px;
  margin: 0.2rem auto 1rem;
}

/* Keep the short outro sentence in one line on desktop. */
@media (min-width: 1024px) {
  .takeaway-outro p {
    white-space: nowrap;
  }
}

.takeaway-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.2rem;
}

.takeaway-card {
  background: #ffffff;
  border: 1px solid rgba(26, 111, 179, 0.12);
  border-radius: 14px;
  padding: 1rem 1rem 1.05rem;
  box-shadow: 0 6px 22px rgba(26, 111, 179, 0.08);
}

.takeaway-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0e9a74;
  background: rgba(14, 154, 116, 0.12);
  margin-bottom: 0.55rem;
}

.takeaway-card h3 {
  margin: 0 0 0.4rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.02rem;
  font-weight: 700;
  color: #1a1a2e;
}

.takeaway-card p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.65;
  color: #2f3244;
}

@media (max-width: 900px) {
  .takeaway-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Buttons (Bulma overrides for dark mode) ===== */
.button.is-dark {
  background-color: #363636;
  border-color: transparent;
  color: #fff;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.button.is-dark:hover,
.button.is-dark.is-hovered {
  background-color: #2f2f2f;
  border-color: transparent;
  color: #fff;
}
.button.is-dark:focus,
.button.is-dark.is-focused {
  border-color: transparent;
  color: #fff;
  box-shadow: 0 0 0 2px rgba(54, 54, 54, 0.5);
}
.button.is-dark:active,
.button.is-dark.is-active {
  background-color: #262626;
  border-color: transparent;
  color: #fff;
}
html.dark-mode .button.is-dark {
  background-color: rgba(150, 130, 230, 0.2);
  border-color: rgba(180, 160, 255, 0.3);
  color: #cfc9f9;
  box-shadow: 0 4px 12px rgba(150, 130, 230, 0.2);
}
html.dark-mode .button.is-dark:hover,
html.dark-mode .button.is-dark.is-hovered {
  background-color: rgba(150, 130, 230, 0.35);
  border-color: rgba(180, 160, 255, 0.5);
  color: #e6dcff;
  box-shadow: 0 6px 16px rgba(150, 130, 230, 0.35);
}
html.dark-mode .button.is-dark:focus,
html.dark-mode .button.is-dark.is-focused {
  border-color: rgba(180, 160, 255, 0.6);
  color: #e6dcff;
  box-shadow: 0 0 0 3px rgba(150, 130, 230, 0.25);
}
html.dark-mode .button.is-dark:active,
html.dark-mode .button.is-dark.is-active {
  background-color: rgba(150, 130, 230, 0.45);
  border-color: rgba(180, 160, 255, 0.6);
  color: #ffffff;
}

/* ===== Authors info colors ===== */
.publication-authors { color: #3a3a3a; }
.publication-authors.affiliation-line { color: #666; }
.publication-authors.equal-contrib-line { color: #666; }
html.dark-mode .publication-authors { color: #e8f0ff; }
html.dark-mode .publication-authors.affiliation-line { color: #d0e2ff; }
html.dark-mode .publication-authors.affiliation-line sup { color: #88d9f9; font-weight: 700; }
html.dark-mode .publication-authors.equal-contrib-line { color: #c8d9ff; }
html.dark-mode .publication-authors.equal-contrib-line sup { color: #88d9f9; font-weight: 700; }
html.dark-mode .publication-authors a { color: #7ec8ff !important; }
html.dark-mode .publication-authors a:hover { color: #a8e0ff !important; }

/* ===================================================================
   Dark mode theme
   =================================================================== */
html {
  transition: background 0.4s ease;
}
html.dark-mode {
  background: linear-gradient(180deg,
    #0c0e1c 0%,
    #101124 30%,
    #14122a 55%,
    #120f24 78%,
    #0d0f1f 100%);
}
html.dark-mode body {
  background: transparent;
  color: #d9dbe6;
}
html.dark-mode section.section-light {
  background: linear-gradient(180deg, rgba(28, 28, 48, 0.55) 0%, rgba(20, 18, 38, 0.5) 100%);
  border-top: 1px solid rgba(150, 130, 230, 0.18);
  border-bottom: 1px solid rgba(150, 130, 230, 0.14);
}
html.dark-mode .section p,
html.dark-mode .section li,
html.dark-mode .section ul {
  color: #d8dcf0;
}
html.dark-mode .section-light p,
html.dark-mode .section-light li,
html.dark-mode .section-light ul {
  color: #d8dcf0;
}
html.dark-mode .section p em,
html.dark-mode .section-light p em {
  color: #e6f0ff;
  font-style: italic;
}
html.dark-mode .section p b,
html.dark-mode .section p strong,
html.dark-mode .section-light p b,
html.dark-mode .section-light p strong {
  color: #ffffff;
  font-weight: 700;
}
html.dark-mode .publication-title {
  background: linear-gradient(120deg, #9fb4ff 0%, #8aa0ff 30%, #b98cff 65%, #ff7ad0 100%);
  -webkit-background-clip: text;
  background-clip: text;
}
html.dark-mode .title.is-3 {
  color: #eef0fb;
  background: linear-gradient(120deg, #9fb4ff 0%, #b98cff 55%, #ff7ad0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
html.dark-mode .title.is-3::after {
  background: linear-gradient(90deg, #6f86ff 0%, #b98cff 55%, #ff7ad0 100%);
  box-shadow: 0 2px 14px rgba(150, 120, 255, 0.55);
}
html.dark-mode .task-card {
  background: rgba(30, 32, 54, 0.65);
  color: #d9dbe6;
}
html.dark-mode .task-card .task-label { color: #d9dbe6; }
html.dark-mode .result-table-wrapper table { background: rgba(30, 32, 54, 0.5); }
html.dark-mode .result-table-wrapper th { background: rgba(40, 42, 70, 0.6); color: #e6ecfb; }
html.dark-mode .result-table-wrapper td { color: #d4d6e2; border-color: rgba(150, 130, 230, 0.15); }
html.dark-mode .result-table-wrapper td:first-child { color: #e6ecfb; }
html.dark-mode .result-table-wrapper tr.ours td {
  background: linear-gradient(90deg, rgba(99,102,241,0.15) 0%, rgba(168,85,247,0.1) 100%);
  color: #b79bff;
}
html.dark-mode .result-table-wrapper tr.section-sep td {
  background: rgba(50, 50, 80, 0.7);
  color: #a8a8d0;
}
html.dark-mode .abstract-box {
  background: rgba(30, 32, 54, 0.6);
  color: #d8dcf0;
}
html.dark-mode .abstract-box p { color: #d8dcf0; }
html.dark-mode .abstract-box b,
html.dark-mode .abstract-box strong { color: #ffffff; }
html.dark-mode .method-figure { box-shadow: 0 4px 24px rgba(150, 120, 255, 0.2); }
html.dark-mode figcaption { 
  color: #d8dcf0; 
  font-size: 1.05rem;
  line-height: 1.7;
}
html.dark-mode figcaption b,
html.dark-mode figcaption strong {
  color: #ffffff;
  font-weight: 700;
}
html.dark-mode .bibtex-block {
  background: rgba(20, 18, 38, 0.8);
  color: #c3d9f0;
  border: 1px solid rgba(150, 130, 230, 0.25);
}
html.dark-mode .bibtex-copy-btn {
  background: rgba(150, 130, 230, 0.2);
  color: #b79bff;
}
html.dark-mode .bibtex-copy-btn:hover { background: rgba(150, 130, 230, 0.4); }
html.dark-mode .teaser-caption { color: #d4d6e2; }
html.dark-mode .force-plot-row img { box-shadow: 0 2px 10px rgba(0,0,0,0.4); }

/* ===== Takeaways section (dark mode) ===== */
html.dark-mode .takeaway-card {
  background: rgba(30, 32, 54, 0.7);
  border-color: rgba(150, 130, 230, 0.25);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

html.dark-mode .takeaway-icon {
  color: #9fd8ff;
  background: rgba(120, 170, 255, 0.16);
}

html.dark-mode .takeaway-card h3 {
  color: #ecf1ff;
}

html.dark-mode .takeaway-card p,
html.dark-mode .takeaway-intro p,
html.dark-mode .takeaway-outro p {
  color: #d8dcf0;
}

html.dark-mode .takeaway-card b,
html.dark-mode .takeaway-intro b,
html.dark-mode .takeaway-outro b {
  color: #ffffff;
}

/* ===================================================================
   Right-side rail: dark mode toggle + section navigation
   =================================================================== */
.right-rail {
  position: fixed;
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

/* ---- Dark mode toggle button ---- */
.theme-toggle {
  height: 44px;
  padding: 0 6px;
  border-radius: 22px;
  border: 1px solid rgba(14, 154, 116, 0.18);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #0e9a74;
  cursor: pointer;
  display: inline-flex;
  flex-direction: row-reverse;
  align-items: center;
  box-shadow: 0 8px 28px rgba(14, 154, 116, 0.14);
  transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease, transform 0.15s ease, border-color 0.25s ease;
}
.theme-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(14, 154, 116, 0.22);
}
.theme-toggle:active { transform: translateY(0) scale(0.98); }
.theme-toggle:focus-visible {
  outline: none;
  border-color: rgba(14, 154, 116, 0.5);
  box-shadow: 0 0 0 4px rgba(14, 154, 116, 0.16);
}
.theme-toggle-icon-wrap {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.theme-icon {
  width: 22px;
  height: 22px;
  display: block;
}
.theme-toggle .theme-icon-sun { display: none; }
.theme-toggle .theme-icon-moon { display: block; }
.theme-toggle-label {
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: max-width 0.3s ease, opacity 0.24s ease, padding 0.3s ease;
}
.theme-toggle:hover .theme-toggle-label,
.theme-toggle:focus-visible .theme-toggle-label {
  max-width: 120px;
  opacity: 1;
  padding-left: 10px;
}
html.dark-mode .theme-toggle {
  background: rgba(28, 30, 52, 0.62);
  border-color: rgba(150, 130, 230, 0.3);
  color: #ffd479;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}
html.dark-mode .theme-toggle:hover {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
}
html.dark-mode .theme-toggle .theme-icon-sun { display: block; }
html.dark-mode .theme-toggle .theme-icon-moon { display: none; }

/* ---- Section navigation ---- */
.section-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 8px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 28px rgba(14, 154, 116, 0.14);
  border: 1px solid rgba(14, 154, 116, 0.14);
}
.section-nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  text-decoration: none;
  color: #0e6a4f;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background 0.2s ease, color 0.2s ease;
  justify-content: flex-end;
}
.section-nav-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: rgba(14, 154, 116, 0.32);
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.section-nav-label {
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: max-width 0.28s ease, opacity 0.22s ease;
}
.section-nav:hover .section-nav-label,
.section-nav-link:focus-visible .section-nav-label {
  max-width: 120px;
  opacity: 1;
}
.section-nav-link:hover {
  background: rgba(14, 154, 116, 0.1);
  color: #0e9a74;
}
.section-nav-link:hover .section-nav-dot {
  background: #0e9a74;
}
.section-nav-link.is-active {
  color: #0e9a74;
}
.section-nav-link.is-active .section-nav-dot {
  background: linear-gradient(120deg, #1a6fb3, #0e9a74);
  transform: scale(1.35);
  box-shadow: 0 0 0 4px rgba(14, 154, 116, 0.14);
}
html.dark-mode .section-nav {
  background: rgba(28, 30, 52, 0.62);
  border-color: rgba(150, 130, 230, 0.22);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}
html.dark-mode .section-nav-link { color: #c3b9ef; }
html.dark-mode .section-nav-dot { background: rgba(160, 140, 235, 0.4); }
html.dark-mode .section-nav-link:hover {
  background: rgba(150, 130, 230, 0.16);
  color: #ff8ed6;
}
html.dark-mode .section-nav-link:hover .section-nav-dot { background: #b79bff; }
html.dark-mode .section-nav-link.is-active { color: #ff8ed6; }
html.dark-mode .section-nav-link.is-active .section-nav-dot {
  background: linear-gradient(120deg, #9fb4ff, #ff7ad0);
  box-shadow: 0 0 0 4px rgba(255, 122, 208, 0.18);
}

/* Hide navigation on small screens */
@media (max-width: 900px) {
  .section-nav { display: none; }
  .right-rail {
    top: 16px;
    transform: none;
  }
}
