/* Modern CSS Variables for consistent theming - Dark Theme */
:root {
  --primary-color: #A60000;
  --primary-hover: #8B0000;
  --secondary-color: #00A6A6;
  --accent-color: #00A6A6;
  --text-primary: #e5e7eb;
  --text-secondary: #9ca3af;
  --text-light: #6b7280;
  --background-primary: #0f0f0f;
  --background-secondary: #1a1a1a;
  --background-accent: #262626;
  --border-color: #404040;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.5), 0 2px 4px -2px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.6), 0 4px 6px -4px rgb(0 0 0 / 0.4);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.7), 0 8px 10px -6px rgb(0 0 0 / 0.5);
  --gradient-primary: linear-gradient(135deg, #A60000 0%, #8B0000 100%);
  --gradient-accent: linear-gradient(135deg, #00A6A6 0%, #008B8B 100%);
  --gradient-subtle: linear-gradient(135deg, #262626 0%, #1a1a1a 100%);
  --border-radius: 12px;
  --border-radius-lg: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Smooth scrolling for better UX */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 16px;
  background-color: var(--background-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* All titles and subtitles should be white */
.title, .subtitle, h1, h2, h3, h4, h5, h6 {
  color: #ffffff !important;
}

/* Keyword highlighting styles - brighter colors for better visibility on dark theme */
.keyword-highlight-primary {
  color: #FF4444;
  font-weight: 600;
}

.keyword-highlight-contrary {
  color: #44D4D4;
  font-weight: 600;
}

/* Callout blocks for notes and insights */
.callout {
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  border-left: 4px solid;
  border-radius: 8px;
  background-color: var(--background-secondary);
}

.callout-note {
  border-left-color: #44D4D4;
  background-color: rgba(68, 212, 212, 0.1);
}

.callout-note strong {
  color: #44D4D4;
}

.callout-insight {
  border-left-color: #FF4444;
  background-color: rgba(255, 68, 68, 0.1);
}

.callout-insight strong {
  color: #FF4444;
}

.callout p {
  margin: 0;
  color: var(--text-primary);
  line-height: 1.6;
}


/* Modern Button Styles */
.button {
  border-radius: var(--border-radius) !important;
  font-weight: 600 !important;
  transition: var(--transition) !important;
  border: 2px solid transparent !important;
  position: relative;
  overflow: hidden;
}

.button.is-dark {
  background: var(--background-accent) !important;
  border: none !important;
  color: white !important;
  box-shadow: var(--shadow-md);
}

.button.is-dark:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: var(--primary-color) !important;
}

.button.is-dark:active {
  transform: translateY(0);
  box-shadow: var(--shadow-md);
}

.footer .icon-link {
    font-size: 25px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.footer .icon-link:hover {
    color: var(--secondary-color);
    transform: translateY(-2px);
}

.link-block {
    background: var(--background-accent);
    border-radius: var(--border-radius);
    padding: 4px;
    display: inline-block;
}

.link-block a {
    margin: 8px 4px;
}

.dnerf {
  font-variant: small-caps;
}


/* Hero Section Modernization */
.hero {
  position: relative;
  overflow: hidden;
}

.hero.is-light {
  background: var(--background-secondary);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

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

.teaser .hero-body {
  padding-top: 2rem;
  padding-bottom: 4rem;
}

.teaser {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}


/* Publication Content Styling */
.publication-title {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    margin-bottom: 2rem !important;
    line-height: 1.1 !important;
}

.publication-banner {
  max-height: 70vh;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  margin: 2rem 0;
}

.publication-banner video {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  object-fit: cover;
  width: 100%;
  height: 100%;
  border-radius: var(--border-radius-lg);
}

.publication-header .hero-body {
  padding: 6rem 1.5rem 4rem;
}

.publication-authors {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif !important;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.publication-venue {
    color: var(--text-secondary);
    width: fit-content;
    font-weight: 600;
    background: var(--background-accent);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    margin-top: 1rem;
    display: inline-block;
}

.publication-awards {
    color: #ef4444;
    width: fit-content;
    font-weight: 700;
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    border-left: 4px solid #ef4444;
    margin-top: 1rem;
}

.publication-authors a {
   color: var(--secondary-color) !important;
   text-decoration: none;
   font-weight: 600;
   transition: var(--transition);
   position: relative;
}

.publication-authors a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background: var(--gradient-accent);
    transition: var(--transition);
}

.publication-authors a:hover::after {
    width: 100%;
}

.publication-authors a:hover {
    color: var(--accent-color) !important;
    filter: brightness(1.2);
}

.author-block {
  display: inline-block;
  margin-right: 0.5rem;
}

.publication-banner img {
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
}

.publication-banner img:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-xl);
}

/* Modern Video and Carousel Styling */
.publication-video {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%;
    overflow: hidden;
    border-radius: var(--border-radius-lg) !important;
    box-shadow: var(--shadow-xl);
    transition: var(--transition);
}

.publication-video:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.publication-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: var(--border-radius-lg);
}

.publication-body img {
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.publication-body img:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.results-carousel {
  overflow: hidden;
  padding: 1rem 0;
}

.results-carousel .item {
  margin: 1rem;
  overflow: hidden;
  padding: 1.5rem;
  font-size: 0;
  background: var(--background-primary);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  border: 1px solid var(--border-color);
}

.results-carousel .item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.results-carousel .item img,
.results-carousel video {
  margin: 0;
  border-radius: var(--border-radius);
  width: 100%;
  height: auto;
}

.results-carousel .subtitle {
  font-size: 1rem !important;
  color: var(--text-secondary);
  margin-top: 1rem;
  font-weight: 500;
}

/* Pagination and Misc Improvements */
.slider-pagination .slider-page {
  background: var(--primary-color);
  border-radius: 50%;
  transition: var(--transition);
}

.slider-pagination .slider-page.is-active {
  background: var(--primary-hover);
  transform: scale(1.2);
}

.eql-cntrb { 
  font-size: 0.875rem;
  color: var(--text-light);
  font-style: italic;
}

/* Section Titles */
.title.is-3 {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  margin-bottom: 2rem !important;
  position: relative;
  padding-bottom: 1rem;
}

.title.is-3::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--gradient-accent);
  border-radius: 2px;
}

/* Content Improvements */
.content.has-text-justified {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.content.has-text-justified p {
  margin-bottom: 1.5rem;
}

/* Footer Improvements */
.footer {
  background: var(--background-secondary);
  border-top: 1px solid var(--border-color);
  padding: 3rem 1.5rem;
}

.footer .content {
  color: #c9d1d9;
  line-height: 1.7;
}

.footer .content p {
  color: #c9d1d9 !important;
}

.footer a {
  color: var(--secondary-color);
  text-decoration: none;
  transition: var(--transition);
}

.footer a:hover {
  color: var(--accent-color);
  filter: brightness(1.2);
  text-decoration: underline;
}

/* BibTeX Styling */
pre {
  background: var(--background-accent) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--border-radius) !important;
  padding: 1.5rem !important;
  font-size: 0.9rem !important;
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

code {
  background: var(--background-accent) !important;
  color: var(--text-primary) !important;
  font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace !important;
}

/* BibTeX Section Improvements */
.bibtex-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.copy-bibtex-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.copy-bibtex-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.copy-bibtex-btn.copied {
  background: #10b981;
}

.copy-bibtex-btn.copied .copy-text::after {
  content: "ied!";
}

/* Scroll to Top Button */
.scroll-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: var(--shadow-lg);
}

.scroll-to-top:hover {
  background: var(--primary-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-xl);
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
}


/* More Works Dropdown */
.more-works-container {
  position: fixed;
  top: 2rem;
  right: 2rem;
  z-index: 1000;
}

.more-works-btn {
  background: var(--background-primary);
  color: var(--text-primary);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

.more-works-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: var(--background-secondary);
  border-color: var(--primary-color);
}

.more-works-btn .dropdown-arrow {
  transition: var(--transition);
  font-size: 0.8rem;
}

.more-works-btn.active .dropdown-arrow {
  transform: rotate(180deg);
}

.more-works-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: 400px;
  max-width: 90vw;
  background: var(--background-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-xl);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: var(--transition);
  max-height: 70vh;
  overflow-y: auto;
}

.more-works-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.dropdown-header h4 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.close-btn:hover {
  background: var(--background-accent);
  color: var(--text-primary);
}

.works-list {
  padding: 1rem;
}

.work-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1rem;
  border-radius: var(--border-radius);
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
  margin-bottom: 0.5rem;
}

.work-item:hover {
  background: var(--background-accent);
  transform: translateX(4px);
}

.work-info h5 {
  margin: 0 0 0.5rem 0;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
}

.work-info p {
  margin: 0 0 0.5rem 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.work-venue {
  font-size: 0.8rem;
  color: var(--text-light);
  font-style: italic;
}

.work-item .fas {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-top: 0.2rem;
  flex-shrink: 0;
}


/* Mobile Responsive Improvements */
@media screen and (max-width: 768px) {
  .hero-body {
    padding: 2rem 1rem;
  }
  
  .publication-header .hero-body {
    padding: 3rem 1rem 2rem;
  }
  
  .publication-title {
    font-size: 2.5rem !important;
    line-height: 1.2 !important;
    margin-bottom: 1.5rem !important;
  }
  
  .publication-authors {
    font-size: 1rem !important;
  }
  
  .button {
    margin: 0.25rem !important;
    font-size: 0.875rem !important;
    padding: 0.75rem 1rem !important;
  }
  
  .more-works-container {
    bottom: 2rem;
    right: 1rem;
    top: auto;
  }
  
  .more-works-btn {
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
  }
  
  .more-works-dropdown {
    width: calc(100vw - 2rem);
    right: -1rem;
    bottom: calc(100% + 0.5rem);
    top: auto;
  }
  
  .results-carousel .item {
    margin: 0.5rem;
    padding: 1rem;
  }
  
  .teaser .hero-body {
    padding: 1rem;
  }
  
  .content.has-text-justified {
    font-size: 1rem;
  }
}

@media screen and (max-width: 480px) {
  .publication-title {
    font-size: 2rem !important;
  }
  
  .hero-body {
    padding: 1.5rem 0.75rem;
  }
  
  .more-works-container {
    position: fixed;
    bottom: 2rem;
    right: 1rem;
    z-index: 1000;
  }
  
  .more-works-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
  }
  
  .more-works-dropdown {
    position: absolute;
    bottom: calc(100% + 0.5rem);
    right: 0;
    width: calc(100vw - 2rem);
    max-width: 90vw;
  }
  
  .link-block {
    display: block;
    margin-bottom: 0.5rem;
  }
  
  .button {
    width: 100%;
    justify-content: center;
  }
}

/* Tablet Responsive */
@media screen and (min-width: 769px) and (max-width: 1024px) {
  .hero-body {
    padding: 3rem 2rem;
  }
  
  .publication-header .hero-body {
    padding: 4rem 2rem 3rem;
  }
}

/* Animation for page load */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero, .section {
  animation: fadeInUp 0.6s ease-out;
}

/* Improved focus states for accessibility */
.button:focus,
.related-works-btn:focus,
a:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}


/* Print styles */
@media print {
  .more-works-container {
    display: none;
  }

  .hero, .section {
    animation: none;
  }

  .button {
    background: transparent !important;
    color: var(--text-primary) !important;
    box-shadow: none !important;
  }
}


/* === FWM project page overrides === */

/* Teaser image — make the original white-bg paper figure look like an intentional
   white printed-paper panel against the dark page (rounded corners + glow), so the
   method diagram stays at full readability instead of fighting the dark theme. */
.teaser figure.image {
  margin: 0 auto;
  max-width: 100%;
}
.teaser figure.image img {
  display: block;
  width: 100%;
  height: auto;
  background: #ffffff;
  border-radius: 14px;
  box-shadow:
    0 18px 60px -10px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(255, 255, 255, 0.08);
}

/* Bulma defaults <strong> to dark grey (#363636) which is invisible against the
   dark page. Force white for emphasis throughout body content. */
.content strong,
.content b,
.callout strong,
.subtitle strong {
  color: #ffffff !important;
  font-weight: 700;
}

/* === TL;DR pitch block — magazine-deck presentation (replaces "Abstract") === */
.tldr-block {
  max-width: 820px;
  margin: 0.5rem auto;
  padding: 0.5rem 0 0;
  text-align: center;
}
.tldr-ornament {
  position: relative;
  width: 96px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 220, 220, 0.55), transparent);
  margin: 0 auto 2rem;
}
.tldr-ornament::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(0, 220, 220, 0.9);
  box-shadow: 0 0 12px rgba(0, 220, 220, 0.5);
}
.tldr-lead {
  font-family: 'Open Sans', sans-serif;
  font-size: 1.55rem !important;
  font-weight: 700;
  line-height: 1.45;
  color: #ffffff;
  letter-spacing: -0.005em;
  margin: 0 auto 1.5rem !important;
  max-width: 760px;
}
.tldr-lead em { font-style: italic; color: #ff8c8c; font-weight: 700; }
.tldr-body {
  font-family: 'Open Sans', sans-serif;
  font-size: 1.05rem !important;
  line-height: 1.85 !important;
  color: #d4d4d4 !important;
  max-width: 720px;
  margin: 0 auto 2.25rem !important;
  text-align: center;
}
.tldr-body em { color: #d4d4d4; }
.tldr-body strong { color: #ffffff !important; }

.tldr-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.2rem;
  margin-top: 1.6rem;
  flex-wrap: wrap;
}
.stat-card { text-align: center; padding: 0 0.5rem; }
.stat-num {
  font-family: 'Open Sans', sans-serif;
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: 0.005em;
  margin-bottom: 0.3rem;
  line-height: 1;
}
.stat-card-red   .stat-num { color: #ff5b5b; text-shadow: 0 0 24px rgba(255, 91, 91, 0.25); }
.stat-card-green .stat-num { color: #34d6a0; text-shadow: 0 0 24px rgba(52, 214, 160, 0.25); }
.stat-label {
  font-family: 'Open Sans', sans-serif;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.62);
  font-weight: 500;
}
.stat-divider {
  width: 1px;
  height: 52px;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.18), transparent);
}

@media screen and (max-width: 720px) {
  .tldr-lead { font-size: 1.25rem !important; line-height: 1.4; }
  .tldr-body { font-size: 0.98rem !important; line-height: 1.75 !important; text-align: justify; }
  .stat-num { font-size: 1.9rem; }
  .stat-divider { width: 60px; height: 1px; }
  .tldr-stats { flex-direction: column; gap: 1.2rem; }
}

/* === Algorithm 1 card — academic-paper feel on dark theme === */
.algorithm-card {
  max-width: 880px;
  margin: 1.75rem auto 1.5rem;
  background: linear-gradient(180deg, rgba(38, 38, 38, 0.6), rgba(20, 20, 20, 0.55));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow:
    0 24px 56px -16px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(0, 220, 220, 0.06) inset;
  overflow: hidden;
  color: #e5e7eb;
  font-family: 'Open Sans', sans-serif;
}
.algorithm-card .katex { color: inherit; font-size: 0.96em; }
.algorithm-card .katex .mathdefault, .algorithm-card .katex .mord { color: #e5e7eb; }

.algorithm-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: linear-gradient(90deg, rgba(166, 0, 0, 0.10) 0%, rgba(0, 166, 166, 0.06) 100%);
}
.algorithm-meta { display: flex; align-items: baseline; gap: 0.85rem; flex-wrap: wrap; }
.algorithm-tag {
  font-family: 'Open Sans', sans-serif;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #ff6b6b;
}
.algorithm-title {
  font-family: 'Open Sans', sans-serif;
  font-weight: 700;
  font-size: 1.18rem;
  color: #ffffff;
  letter-spacing: 0.01em;
}
.algorithm-pill {
  display: inline-block;
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: #34d6a0;
  background: rgba(52, 214, 160, 0.10);
  border: 1px solid rgba(52, 214, 160, 0.45);
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: uppercase;
}

.algorithm-body { padding: 1.1rem 1.4rem 1.3rem; font-size: 0.95rem; line-height: 1.7; }

.algorithm-require {
  padding: 0.55rem 0.8rem;
  margin-bottom: 0.85rem;
  background: rgba(0, 220, 220, 0.05);
  border-left: 3px solid rgba(0, 220, 220, 0.5);
  border-radius: 0 8px 8px 0;
  color: #d4d4d4;
}
.algorithm-require .algorithm-kw {
  display: inline-block;
  color: #34d6a0;
  font-weight: 800;
  letter-spacing: 0.06em;
  margin-right: 0.5rem;
}

.algorithm-phase {
  margin: 0.9rem 0 0.35rem;
  padding-bottom: 0.15rem;
}
.algorithm-phase-label {
  font-family: 'Open Sans', sans-serif;
  font-weight: 700;
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding-bottom: 0.25rem;
  border-bottom: 1.5px solid transparent;
}
.algorithm-phase-offline { color: #4fb3c4; border-bottom-color: rgba(79, 179, 196, 0.55); }
.algorithm-phase-online  { color: #ff8888; border-bottom-color: rgba(255, 136, 136, 0.55); }

.algorithm-line {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 0.6rem;
  padding: 0.15rem 0;
  font-family: 'Open Sans', sans-serif;
  color: #d4d4d4;
}
.algorithm-no {
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.32);
  text-align: right;
  user-select: none;
  padding-top: 0.12rem;
}
.algorithm-stmt { font-size: 0.96rem; }
.algorithm-line .algorithm-kw {
  color: #00cccc;
  font-weight: 700;
  font-style: normal;
}
.algorithm-comment {
  color: rgba(255, 255, 255, 0.42);
  font-style: italic;
  font-size: 0.86em;
  margin-left: 0.3rem;
}

.algorithm-line.indent-1 .algorithm-stmt { padding-left: 1.4rem; }
.algorithm-line.indent-2 .algorithm-stmt { padding-left: 2.8rem; }
.algorithm-line.indent-3 .algorithm-stmt { padding-left: 4.2rem; }

@media screen and (max-width: 720px) {
  .algorithm-card { font-size: 0.9rem; max-width: 100%; }
  .algorithm-body { padding: 0.85rem 0.9rem 1rem; }
  .algorithm-line { grid-template-columns: 26px 1fr; gap: 0.4rem; }
  .algorithm-line.indent-1 .algorithm-stmt { padding-left: 0.7rem; }
  .algorithm-line.indent-2 .algorithm-stmt { padding-left: 1.4rem; }
  .algorithm-line.indent-3 .algorithm-stmt { padding-left: 2.1rem; }
  .algorithm-stmt { font-size: 0.86rem; line-height: 1.55; }
}

/* === Simulation OOD scenes — 3 task rows × 4 condition columns === */
.ood-task { margin: 2rem 0 2.5rem; }
.ood-task-title {
  text-align: center;
  font-family: 'Open Sans', sans-serif;
  font-weight: 700 !important;
  font-size: 1.35rem !important;
  color: #ffffff !important;
  margin-bottom: 1.1rem !important;
  letter-spacing: 0.02em;
}
.ood-task-title::before,
.ood-task-title::after {
  content: '';
  display: inline-block;
  vertical-align: middle;
  width: 40px;
  height: 1px;
  margin: 0 0.85rem;
  background: linear-gradient(90deg, transparent, rgba(0, 220, 220, 0.55), transparent);
}
.ood-columns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
}
.ood-col {
  background: rgba(38, 38, 38, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 0.55rem 0.55rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  transition: transform 0.24s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.24s ease, box-shadow 0.24s ease;
}
.ood-col:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 220, 220, 0.4);
  box-shadow: 0 14px 32px -10px rgba(0, 0, 0, 0.5), 0 0 22px -4px rgba(0, 220, 220, 0.22);
}
.ood-col.ood-col-indist {
  border-color: rgba(52, 214, 160, 0.45);
  box-shadow: 0 0 0 1px rgba(52, 214, 160, 0.18) inset;
}
.ood-col-tag {
  text-align: center;
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #cfd6dd;
  padding: 0.2rem 0;
  margin-bottom: 0.2rem;
}
.ood-col.ood-col-indist .ood-col-tag { color: #34d6a0; }
.ood-col img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 7px;
  background: #0b0b0b;
  object-fit: cover;
  aspect-ratio: 16 / 12;
}
.ood-caption {
  text-align: center;
  font-size: 0.85rem !important;
  color: var(--text-secondary) !important;
  margin-top: 0.85rem !important;
  font-style: italic;
}

@media screen and (max-width: 720px) {
  .ood-columns { grid-template-columns: repeat(2, 1fr); gap: 0.65rem; }
  .ood-task-title { font-size: 1.1rem !important; }
  .ood-col-tag { font-size: 0.66rem; }
}

/* === Real-world task demos — A2A-inspired glass morphism + cyan-glow hover === */
:root {
  --demo-baseline: #ff5b5b;
  --demo-ours: #34d6a0;
  --demo-card-bg: rgba(38, 38, 38, 0.55);
  --demo-card-bg-solid: #1a1a1a;
  --demo-glow: rgba(0, 220, 220, 0.55);
}

.demo-tag {
  display: inline-block;
  padding: 0.1em 0.65em;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.92em;
  letter-spacing: 0.01em;
  border: 1px solid;
}
.demo-tag-baseline { background: rgba(255, 91, 91, 0.12); color: var(--demo-baseline); border-color: rgba(255, 91, 91, 0.5); }
.demo-tag-ours     { background: rgba(52, 214, 160, 0.12); color: var(--demo-ours); border-color: rgba(52, 214, 160, 0.5); }

.demo-task {
  margin: 2.75rem 0 3.25rem;
}
.demo-task-title {
  text-align: center;
  font-family: 'Open Sans', sans-serif;
  font-weight: 700 !important;
  font-size: 1.5rem !important;
  color: #ffffff !important;
  margin-bottom: 1.5rem !important;
  letter-spacing: 0.02em;
}
.demo-task-title::before,
.demo-task-title::after {
  content: '';
  display: inline-block;
  vertical-align: middle;
  width: 44px;
  height: 1px;
  margin: 0 0.95rem;
  background: linear-gradient(90deg, transparent, rgba(0, 220, 220, 0.55), transparent);
}

/* 2 columns: Baseline | Ours; each column has 2 stacked videos */
.demo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

/* video-card — A2A glass morphism look */
.demo-card {
  background: var(--demo-card-bg);
  background-color: var(--demo-card-bg-solid);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: var(--border-radius-lg);
  padding: 1.1rem 1.1rem 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.28s ease,
              box-shadow 0.28s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.demo-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 220, 220, 0.55);
  box-shadow:
    0 18px 48px -10px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(0, 220, 220, 0.45),
    0 0 32px -6px var(--demo-glow);
}
.demo-card.demo-card-baseline:hover {
  border-color: rgba(255, 91, 91, 0.55);
  box-shadow:
    0 18px 48px -10px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 91, 91, 0.45),
    0 0 32px -6px rgba(255, 91, 91, 0.4);
}
.demo-card.demo-card-ours:hover {
  border-color: rgba(52, 214, 160, 0.55);
  box-shadow:
    0 18px 48px -10px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(52, 214, 160, 0.45),
    0 0 32px -6px rgba(52, 214, 160, 0.4);
}

/* Card header — method + dot */
.demo-card-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-family: 'Open Sans', sans-serif;
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.demo-card-baseline .demo-card-header { color: var(--demo-baseline); }
.demo-card-ours     .demo-card-header { color: var(--demo-ours); }
.demo-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}
.demo-card-baseline .demo-dot { background: var(--demo-baseline); box-shadow: 0 0 10px var(--demo-baseline); }
.demo-card-ours     .demo-dot { background: var(--demo-ours);     box-shadow: 0 0 10px var(--demo-ours); }

/* Individual video tile inside a card */
.demo-video {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #0b0b0b;
  box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.7);
}
.demo-video video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
  background: #0b0b0b;
}

/* Floating badges */
.demo-video .demo-speed,
.demo-video .demo-view {
  position: absolute;
  font-family: 'Open Sans', sans-serif;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 9px;
  border-radius: 8px;
  font-size: 0.74rem;
  pointer-events: none;
  /* keep badges above native video controls area */
  z-index: 2;
}
.demo-video .demo-speed { top: 10px; right: 10px; font-size: 0.8rem; font-weight: 800; }
.demo-video .demo-view  { top: 10px; left: 10px; font-weight: 500; opacity: 0.92; }

/* Make native video controls slimmer and dark-theme aligned where supported */
.demo-video video::-webkit-media-controls-panel {
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.6) 100%);
}

@media screen and (max-width: 720px) {
  .demo-grid { grid-template-columns: 1fr; gap: 1.1rem; }
  .demo-task-title { font-size: 1.25rem !important; }
}

/* Institution logos — same layout/size as A2A Flow Matching page */
.logo-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 1.5rem auto;
  padding: 1rem 0;
  width: 100%;
  max-width: 420px;
}
.logo-container img {
  transition: var(--transition);
}
.logo-container img.ntu-logo {
  height: 80px;
}
.logo-container img.mars-logo {
  height: 85px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}
.logo-container img:hover {
  transform: scale(1.05);
}
@media screen and (max-width: 480px) {
  .logo-container { gap: 1.5rem; max-width: 320px; }
  .logo-container img.ntu-logo { height: 48px; }
  .logo-container img.mars-logo { height: 52px; }
}

/* Simulated tasks figure — labels drawn in HTML above each photo group */
.sim-tasks-figure { margin: 1rem 0 1.5rem; }
.sim-tasks-labels {
  display: grid;
  grid-template-columns: 55.6fr 44.4fr;
  margin-bottom: 0.55rem;
  pointer-events: none;
}
.sim-label {
  text-align: center;
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 700;
  font-style: italic;
  font-size: 1.45rem;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}
.sim-label-libero    { color: #d97333; }  /* slightly brightened orange for readability on dark */
.sim-label-robomimic { color: #d6a614; }  /* slightly brightened gold for readability on dark */
@media screen and (max-width: 720px) {
  .sim-label { font-size: 1.05rem; }
}

/* Real-world deployment row: photo grid (left, ~62%) + chart (right, ~38%), side-by-side */
.real-world-split {
  display: grid;
  grid-template-columns: 1248fr 748fr;
  align-items: center;
  gap: 1.5rem;
  margin: 1rem 0 1.5rem;
}
.real-world-split figure.image { margin: 0; }
.real-world-split img { width: 100%; height: auto; display: block; }
@media screen and (max-width: 720px) {
  .real-world-split { grid-template-columns: 1fr; }
}

/* Matplotlib-style chart figures: invert lightness (white→dark, black→light) while
   preserving hue, so the chart background blends into the dark page and labels/lines
   become readable in the new context. Use sparingly — DO NOT apply to diagrams that
   contain colored label boxes or photos. */
.chart-darkmode {
  filter: invert(1) hue-rotate(180deg);
}

/* All author NAMES are the same cyan, whether linked or plain text.
   Scope to .is-size-5 so the affiliation row (.is-size-6) stays its subtle gray. */
.publication-authors.is-size-5 .author-block,
.publication-authors.is-size-5 .author-block a {
  color: var(--secondary-color) !important;
  font-weight: 600;
}
/* Affiliation row reverts to muted body color */
.publication-authors.is-size-6 .author-block {
  color: var(--text-secondary) !important;
  font-weight: 400;
}

/* Disabled-style placeholder buttons (for arXiv / Code while not yet released) */
.button.is-dark.is-placeholder {
  opacity: 0.45;
  cursor: not-allowed !important;
  filter: grayscale(0.4);
}
.button.is-dark.is-placeholder:hover {
  transform: none !important;
  background: var(--background-accent) !important;
  box-shadow: var(--shadow-md) !important;
  filter: grayscale(0.4);
}

/* BibTeX header layout: title + copy button on a row */
#BibTeX .bibtex-header {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
#BibTeX .bibtex-header .title.is-3 {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}
#BibTeX .bibtex-header .title.is-3::after {
  display: none; /* hide the gradient underline when title sits inline with button */
}

/* Tighten teaser caption color for readability on the primary dark bg */
.teaser .subtitle {
  color: var(--text-secondary) !important;
  font-size: 1.05rem !important;
  font-weight: 400 !important;
  line-height: 1.7 !important;
  max-width: 920px;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Author line: a touch more breathing room on dark theme */
.publication-authors {
  line-height: 1.8;
}

/* Numbered list (Key Contributions) — more refined spacing */
.content ol li {
  margin-bottom: 0.9rem;
  line-height: 1.8;
}
.content ol li strong {
  color: #ffffff;
}

/* Slightly tone footer text so it doesn't fight the body */
.footer .content {
  font-size: 0.9rem;
}



