/* Modern CSS Variables for consistent theming */
:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary-color: #64748b;
  --accent-color: #0ea5e9;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-light: #64748b;
  --background-primary: #ffffff;
  --background-secondary: #f8fafc;
  --background-accent: #f1f5f9;
  --border-color: #cbd5e1;
  --shadow-sm: 0 1px 2px 0 rgb(15 23 42 / 0.04);
  --shadow-md: 0 1px 3px 0 rgb(15 23 42 / 0.06), 0 1px 2px -1px rgb(15 23 42 / 0.04);
  --shadow-lg: 0 2px 6px -1px rgb(15 23 42 / 0.08), 0 1px 3px -1px rgb(15 23 42 / 0.05);
  --shadow-xl: 0 4px 12px -2px rgb(15 23 42 / 0.09), 0 2px 4px -2px rgb(15 23 42 / 0.06);
  --gradient-primary: #4f46e5;
  --gradient-accent: #4f46e5;
  --gradient-subtle: #f8fafc;
  --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: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, 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;
}


/* 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(--text-primary) !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(--primary-color);
    transform: translateY(-2px);
}

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

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


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

.hero.is-light {
  background: var(--background-primary);
}

/* Sections: generous top padding acts as the breather between sections.
   Visual break is carried by the title's hairline bracket (see .title.is-3 below). */
main > section:not(:first-child):not(.hero-figure) {
  padding-top: 2rem;
}

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

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

.section {
  padding: 1.25rem 1.5rem;
}

.teaser {
  font-family: 'Inter', sans-serif;
}


/* Publication Content Styling */
.publication-title {
    font-family: 'Inter', sans-serif !important;
    font-weight: 800 !important;
    color: var(--text-primary) !important;
    margin-bottom: 0.9rem !important;
    line-height: 1.15 !important;
    font-size: 2.1rem !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: 2.5rem 1.5rem 1.5rem;
}

.publication-authors {
    font-family: 'Inter', sans-serif !important;
    font-weight: 500;
    font-size: 1.05rem !important;
    margin-bottom: 0.75rem;
}

.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(--primary-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(--primary-hover) !important;
}

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

/* Affiliation list below authors */
.publication-affiliations {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.15rem 1rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  max-width: 920px;
  margin: 0 auto 0.6rem;
}

.publication-affiliations sup {
  margin-right: 0.1rem;
}

/* Venue badge (e.g., ICLR 2026) */
.publication-venue-badge {
  display: inline-block;
  background: #eef2ff;
  color: #4f46e5;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(79, 70, 229, 0.2);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  margin: 0.25rem 0 1rem;
}

/* Equal contribution / corresponding author notes */
.publication-notes {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

/* Hero / overview figure placed under the title block */
.hero-figure {
  padding: 0.5rem 1.5rem 1rem;
}

.hero-figure .publication-figure {
  max-width: 780px;
}

.publication-figure {
  margin: 0 auto;
  max-width: 100%;
}

.publication-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.publication-figure figcaption {
  margin-top: 0.6rem;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-secondary);
  text-align: justify;
}

.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.82rem;
  color: var(--text-light);
  font-style: italic;
}

/* Section Titles — modern hairline bracket: top + bottom rules at title width */
.title.is-3 {
  font-family: 'Inter', sans-serif !important;
  font-weight: 700 !important;
  font-size: 1.5rem !important;
  color: var(--text-primary);
  display: block;
  width: fit-content;
  margin: 0 auto 1rem !important;
  padding: 0.4rem 0.4rem 0.35rem !important;
  border-top: 1px solid var(--text-primary);
  border-bottom: 1px solid var(--text-primary);
  line-height: 1.15;
  letter-spacing: -0.005em;
}

.title.is-3::after {
  content: none;
}

/* Content Improvements */
.content.has-text-justified {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-primary);
}

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

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

.footer .content {
  color: var(--text-secondary);
  line-height: 1.7;
}

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

.footer a:hover {
  color: var(--primary-hover);
  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.92rem !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;
}

/* Citation modal */
.cite-modal[hidden] { display: none; }

.cite-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.cite-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.cite-modal-panel {
  position: relative;
  z-index: 1;
  background: var(--background-primary);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: var(--shadow-xl);
  padding: 1.5rem 1.5rem 1.25rem;
  max-width: 680px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
}

.cite-modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-light);
  cursor: pointer;
  font-size: 0.92rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}

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

.cite-modal-title {
  font-family: 'Inter', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.75rem;
  padding-right: 2rem;
}

.cite-modal-apa {
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0 0 1rem;
}

.cite-modal-apa a {
  color: var(--primary-color);
  text-decoration: none;
}

.cite-modal-apa a:hover {
  text-decoration: underline;
}

/* BibTeX Section Improvements */
.bibtex-wrap {
  max-width: 720px;
  margin: 1rem auto 0;
}

.bibtex-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.bibtex-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-light);
}

.copy-bibtex-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  padding: 0.75rem 1rem;
  font-size: 0.92rem;
  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;
}

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

/* Figure sizing helpers */
.publication-figure.figure-wide {
  max-width: 660px;
}

.publication-figure.figure-compact {
  max-width: 660px;
}

.publication-figure.figure-tiny {
  max-width: 310px;
}

.publication-figure figcaption {
  font-size: 0.78rem;
  line-height: 1.55;
}

.figure-row {
  display: grid;
  gap: 1rem;
  align-items: start;
  margin: 0 auto;
  max-width: 860px;
}

.figure-row.figure-compact {
  max-width: 660px;
}

.figure-row > .publication-figure {
  margin: 0;
  max-width: 100%;
}

.figure-row.three-col {
  grid-template-columns: 1fr 1fr 1fr;
}

.figure-row.step-time {
  grid-template-columns: 2fr 1fr;
}

.figure-row.two-col {
  grid-template-columns: 1fr 1fr;
  max-width: 860px;
}

/* Generic two-column block (mixed content: text/figures/tables) */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: center;
  max-width: 860px;
  margin: 1rem auto 0;
}

/* Synthesizability table + baseline chart: give table more room */
.two-col.synth-split {
  grid-template-columns: 1.55fr 1fr;
}

/* Autoencoder figure + reconstruction table side-by-side */
.two-col.ae-split {
  grid-template-columns: 1.6fr 1fr;
  align-items: start;
  gap: 1.75rem;
}

.two-col.ae-split .result-table-wrap.ae-recon-table {
  max-width: 100%;
  margin: 0.5rem 0 0;
}

.two-col > * {
  min-width: 0;
  margin: 0;
}

.two-col .publication-figure,
.two-col .schematic-wrap,
.two-col .result-table-wrap {
  max-width: 100%;
}

@media screen and (max-width: 768px) {
  .figure-row.three-col,
  .figure-row.step-time,
  .figure-row.two-col,
  .two-col {
    grid-template-columns: 1fr;
  }
}

/* Schematic wrapper (inline SVG diagrams) */
.schematic-wrap {
  max-width: 660px;
  margin: 1rem auto 0.5rem;
  padding: 0.6rem 0.75rem 0.5rem;
  background: var(--background-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
}

.schematic-wrap.schematic-wide {
  max-width: 860px;
  padding: 1rem 1.25rem 0.75rem;
}

.schematic-wrap svg {
  display: block;
  width: 100%;
  height: auto;
}

.schematic-wrap figcaption {
  margin-top: 0.5rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-secondary);
  text-align: center;
}

/* Compact result tables (e.g., fragment-bag generalization) */
.result-table-wrap {
  max-width: 720px;
  margin: 1rem auto 0;
  overflow-x: auto;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--background-primary);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  font-size: 0.82rem;
}

.result-table thead th {
  background: var(--background-accent);
  color: var(--text-primary);
  font-weight: 600;
  text-align: right;
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.result-table thead th:first-child,
.result-table tbody td:first-child {
  text-align: left;
}

.result-table tbody td {
  padding: 0.5rem 0.65rem;
  text-align: right;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  white-space: nowrap;
}

.result-table tbody tr:last-child td {
  border-bottom: none;
}

.result-table tbody tr.highlight td {
  background: #eef2ff;
  color: var(--text-primary);
}

.result-table .no-retrain {
  color: var(--primary-color);
  font-weight: 500;
  font-size: 0.82rem;
  margin-left: 0.25rem;
}

.table-caption {
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 0.5rem;
}

/* ===== Benchmark tables (MOSES / GuacaMol / NPGen) ===== */
.result-table-wrap.bench-table {
  max-width: 860px;
  margin: 1.25rem auto 0;
}

.result-table-wrap.bench-table + .result-table-wrap.bench-table {
  margin-top: 1.75rem;
}

.table-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
  padding-left: 0.15rem;
}

.table-label-sub {
  font-weight: 500;
  color: var(--text-light);
  font-size: 0.72rem;
}

.result-table.result-bench {
  font-size: 0.72rem;
}

.result-table.result-bench thead th,
.result-table.result-bench tbody td {
  padding: 0.35rem 0.5rem;
}

.result-table.result-bench thead th {
  text-align: center;
  vertical-align: middle;
}

.result-table.result-bench thead th:first-child {
  text-align: left;
}

.result-table.result-bench tbody td {
  text-align: center;
}

.result-table.result-bench tbody td:first-child {
  text-align: left;
  font-weight: 600;
}

.result-table.result-bench tbody tr.row-training td {
  background: var(--background-accent);
  color: var(--text-secondary);
  font-style: italic;
}

.result-table.result-bench tbody tr.model-ar td:first-child {
  color: #a1334a;
}

.result-table.result-bench tbody tr.model-os td:first-child {
  color: #3b82f6;
}

.result-table.result-bench tbody tr.highlight td {
  background: #eef2ff;
  color: var(--text-primary);
  font-weight: 700;
}

/* ==== Benchmark-browser (tabs around a set of tables) ==== */
.model-browser.benchmark-browser {
  max-width: 860px;
}

.model-browser.benchmark-browser .model-pane {
  padding: 1rem 1.1rem 1.2rem;
  overflow-x: auto;
}

.pane-table-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.55rem;
  padding-left: 0.1rem;
}

.pane-intro {
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0 0 0.8rem;
  padding-left: 0.1rem;
}

/* ==== Compact AE reconstruction table ==== */
.result-table-wrap.ae-recon-table {
  max-width: 460px;
  margin: 1.25rem auto 0;
}

.result-table-wrap.ae-recon-table .result-bench thead th {
  text-align: center;
}

.result-table-wrap.ae-recon-table .result-bench tbody td:not(:first-child) {
  font-variant-numeric: tabular-nums;
}

.result-table.result-bench tbody tr.highlight td:first-child {
  color: #4f46e5;
}

.result-table.result-bench .no-retrain {
  font-weight: 500;
  color: inherit;
  opacity: 0.75;
  margin-left: 0.15rem;
}

/* Inline legend dots for the intro paragraph */
.legend-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  vertical-align: baseline;
  margin: 0 0.15rem 0 0.1rem;
  transform: translateY(1px);
}
.legend-dot.legend-ar { background: #a1334a; }
.legend-dot.legend-os { background: #3b82f6; }
.legend-text {
  font-weight: 600;
  margin-right: 0.1rem;
}

/* ===== Sample molecule gallery — stacked single column ===== */
.sample-gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  max-width: 720px;
  margin: 1rem auto 0;
}

.sample-gallery > .publication-figure {
  margin: 0;
  max-width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  background: var(--background-primary);
  display: flex;
  flex-direction: column;
}

.sample-gallery .sample-header {
  margin: 0;
  padding: 0.45rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: var(--background-accent);
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

.sample-gallery .publication-figure img {
  padding: 0.5rem 0.75rem;
  background: var(--background-primary);
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 1;
  object-fit: contain;
  flex: 1;
  min-height: 0;
}

.sample-gallery .sample-subheader {
  margin: 0;
  padding: 0.3rem 0.9rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-light);
  background: #fafbfc;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

.sample-gallery .sample-subheader:first-of-type {
  border-top: none;
}

.sample-gallery .publication-figure img + .sample-subheader {
  margin-top: 0;
}

/* ===== Contributions blocks (HTML recreation of summary figure) ===== */
.contrib-block {
  max-width: 920px;
  margin: 1.25rem auto 0;
}

.contrib-eyebrow {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 0.6rem;
  padding-left: 0.15rem;
}

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

@media screen and (max-width: 768px) {
  .contrib-grid-3 {
    grid-template-columns: 1fr;
  }
}

/* --- Cards (row 1: comparison) --- */
.contrib-card {
  background: var(--background-primary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.85rem 0.95rem 0.9rem;
  display: flex;
  flex-direction: column;
}

.contrib-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.contrib-card-head h3 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.contrib-mini {
  width: 82px;
  height: 32px;
  flex-shrink: 0;
}

.contrib-card-neg {
  background: #fafafa;
}

.contrib-card-pos {
  background: #eef2ff;
  border-color: rgba(79, 70, 229, 0.25);
}

.contrib-card-pos .contrib-quote {
  flex: 1;
  display: flex;
  align-items: center;
}

.contrib-card-pos h3 {
  color: #4f46e5;
}

.contrib-pill {
  display: inline-block;
  background: #4f46e5;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
}

.contrib-sublabel {
  font-size: 0.72rem;
  font-style: italic;
  color: var(--text-light);
  margin-bottom: 0.3rem;
}

.contrib-bullets {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.contrib-bullets li {
  position: relative;
  padding-left: 0.85rem;
}

.contrib-bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-light);
}

.contrib-quote {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-primary);
  font-style: italic;
}

/* --- Row 2: What FragFM solves --- */
.contrib-solve {
  background: var(--background-primary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.contrib-solve-top,
.contrib-solve-bot {
  padding: 0.75rem 0.95rem 0.8rem;
  flex: 1;
}

.contrib-solve-top {
  border-bottom: 1px solid var(--border-color);
}

.contrib-solve-bot {
  background: #eef2ff;
}

.contrib-tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}

.contrib-tag-accent {
  color: #4f46e5;
}

.contrib-problem {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary);
  line-height: 1.3;
}

.contrib-solution {
  font-weight: 700;
  font-size: 0.92rem;
  color: #4f46e5;
  line-height: 1.3;
}

/* --- Row 3: What FragFM shows (outcomes) --- */
.contrib-outcome {
  background: #eef2ff;
  border: 1px solid rgba(79, 70, 229, 0.2);
  border-radius: 10px;
  padding: 0.85rem 0.9rem;
  text-align: center;
  font-weight: 700;
  font-size: 0.92rem;
  color: #4f46e5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
}

.contrib-outcome i {
  font-size: 0.92rem;
  opacity: 0.8;
}

/* 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: 1.6rem !important;
    line-height: 1.25 !important;
    margin-bottom: 1rem !important;
  }

  .publication-authors {
    font-size: 1rem !important;
  }

  .button {
    margin: 0.25rem !important;
    font-size: 0.82rem !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.82rem;
  }

  .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;
  }

  /* Prevent horizontal scroll on the page */
  html, body {
    overflow-x: hidden;
    max-width: 100%;
  }
  #main-content, main {
    overflow-x: hidden;
    max-width: 100vw;
  }
  *, *::before, *::after {
    box-sizing: border-box;
  }

  /* Section padding tightens on narrow screens */
  .section {
    padding: 2rem 0.75rem !important;
  }
  .section.hero-figure {
    padding: 0.5rem 0.75rem 0.75rem !important;
  }
  .hero .hero-body {
    padding: 2rem 0.75rem;
  }

  /* Containers lose huge side padding */
  .container,
  .container.is-max-desktop {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    max-width: 100%;
    width: 100%;
  }

  /* Neutralize Bulma's negative margin on columns to stop viewport overflow */
  .columns {
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-top: 0 !important;
  }
  .column {
    padding: 0.5rem !important;
  }

  /* Section titles scale down */
  .title.is-3 {
    font-size: 1.35rem !important;
    padding-left: 0.7rem !important;
    margin-bottom: 1.25rem !important;
    line-height: 1.25;
  }
  .subsection-title {
    font-size: 1rem;
  }

  /* Tabs wrap instead of overflowing a row */
  .model-tabs {
    flex-wrap: wrap;
    gap: 0.35rem;
  }
  .model-tab {
    flex: 0 1 auto;
    font-size: 0.72rem;
    padding: 0.4rem 0.6rem;
    white-space: nowrap;
  }

  /* Model-browser / pane-wrap must let inner tables scroll, not overflow */
  .model-browser,
  .model-browser.benchmark-browser {
    max-width: 100% !important;
  }
  .model-pane-wrap {
    overflow: hidden;
    max-width: 100%;
  }
  .model-browser.benchmark-browser .model-pane {
    padding: 0.8rem 0.5rem !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
  .result-table-wrap.bench-table,
  .result-table-wrap {
    max-width: 100% !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .result-table.result-bench {
    font-size: 0.66rem;
    min-width: 480px;
  }
  .result-table.result-bench thead th,
  .result-table.result-bench tbody td {
    padding: 0.28rem 0.35rem;
  }
  /* Plain (non-bench) result tables: let them shrink */
  .result-table:not(.result-bench) {
    font-size: 0.72rem;
    width: 100%;
  }

  /* AE split / synth split stack vertically */
  .two-col.ae-split,
  .two-col.synth-split,
  .two-col {
    grid-template-columns: 1fr !important;
    gap: 1rem;
    max-width: 100% !important;
  }

  /* Formula callouts avoid overflowing */
  .formula-callout {
    padding: 0.85rem 0.7rem;
    max-width: 100%;
  }
  .formula-math {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 0.8rem;
    max-width: 100%;
  }
  .formula-legend {
    font-size: 0.78rem;
  }

  /* Figures never exceed viewport */
  .publication-figure,
  .publication-figure.figure-wide,
  .publication-figure.figure-compact,
  .publication-figure.figure-tiny,
  .figure-row,
  .figure-row.figure-compact,
  .figure-row.two-col,
  .figure-row.three-col,
  .figure-row.step-time,
  .two-col,
  .schematic-wrap,
  .schematic-wrap.schematic-wide,
  .bibtex-wrap,
  .hero-figure .publication-figure {
    max-width: 100% !important;
    width: 100%;
  }
  .publication-figure img,
  .sample-gallery img {
    max-width: 100%;
    height: auto;
  }
  .publication-figure figcaption {
    font-size: 0.72rem;
    text-align: left;
  }

  /* Inline long content like pane-table-label + long sublabels wraps cleanly */
  .pane-table-label {
    font-size: 0.78rem;
    line-height: 1.35;
    white-space: normal;
    word-break: break-word;
  }
  .table-label-sub {
    display: inline;
  }

  /* Body paragraphs: allow word breaks so long tokens don't push width */
  .content,
  .content p {
    overflow-wrap: break-word;
    word-wrap: break-word;
  }

  /* Contributions block: smaller, stacking handled elsewhere */
  .contrib-card,
  .contrib-solve {
    padding: 0.75rem 0.85rem;
  }

  /* Hide inline SVG that is wider than viewport gracefully */
  .schematic-wrap svg {
    max-width: 100%;
    height: auto;
  }

  /* Bibtex code block scrolls inside its box */
  #bibtex-code,
  .bibtex-wrap pre {
    font-size: 0.68rem;
    padding: 0.75rem;
    overflow-x: auto;
    max-width: 100%;
    white-space: pre;
  }

  /* Cite modal fits viewport */
  .cite-modal-panel {
    max-width: calc(100vw - 1.5rem);
    padding: 1rem 0.9rem 0.85rem;
  }

  /* TOC drawer uses more of the viewport */
  .toc-drawer-panel {
    width: min(85vw, 300px);
  }
}

@media screen and (max-width: 480px) {
  .publication-title {
    font-size: 1.4rem !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;
  }
}

/* ==== Model browser (interactive tabs for NPGen samples) ==== */
.model-browser {
  max-width: 720px;
  margin: 1rem auto 0;
}

.model-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  margin-bottom: 0.85rem;
}

.model-tab {
  appearance: none;
  cursor: pointer;
  background: #ffffff;
  border: 1px solid var(--border-color, #cbd5e1);
  color: var(--text-secondary, #334155);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.model-tab:hover {
  border-color: #94a3b8;
  color: var(--text-primary, #0f172a);
}

.model-tab.is-active {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #ffffff;
  box-shadow: 0 2px 6px -2px rgba(79, 70, 229, 0.45);
}

/* FragFM "ours" tab — always emphasized */
.model-tab-ours {
  border-color: #4f46e5;
  color: #4f46e5;
}

.model-tab-ours:hover {
  border-color: #4f46e5;
  color: #4f46e5;
  background: #f5f3ff;
}

.model-tab-ours .ours-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.4rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffffff;
  background: #4f46e5;
  border-radius: 999px;
  vertical-align: middle;
  line-height: 1.4;
}

.model-tab-ours.is-active .ours-badge {
  background: #ffffff;
  color: #4f46e5;
}

.model-pane-wrap {
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: 10px;
  overflow: hidden;
  background: var(--background-primary, #ffffff);
}

.model-pane {
  display: none;
}

.model-pane.is-active {
  display: block;
}

.model-pane > img {
  display: block;
  width: 100%;
  height: auto;
  padding: 0.5rem 0.75rem;
  background: var(--background-primary, #ffffff);
  aspect-ratio: 3 / 1;
  object-fit: contain;
}

.model-pane .sample-subheader {
  margin: 0;
  padding: 0.3rem 0.9rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-light, #64748b);
  background: #fafbfc;
  border-bottom: 1px solid var(--border-color, #cbd5e1);
  text-align: left;
}

.model-pane .sample-subheader:not(:first-child) {
  border-top: 1px solid var(--border-color, #cbd5e1);
}

/* ==== Formula callout (typeset equation + legend) ==== */
.formula-callout {
  max-width: 720px;
  margin: 1rem auto 1.5rem;
  padding: 1.1rem 1.25rem 1rem;
  background: var(--background-primary, #ffffff);
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: 12px;
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(15, 23, 42, 0.04));
}

.formula-math {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.25rem 0 0.5rem;
  font-size: 0.92rem;
  color: var(--text-primary, #0f172a);
  text-align: center;
}

.formula-math mjx-container {
  margin: 0 auto;
}

.formula-legend {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border-color, #cbd5e1);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-secondary, #334155);
}

.formula-legend .lbl-accent {
  display: inline-block;
  padding: 0 0.35rem;
  margin-right: 0.35rem;
  background: #eef2ff;
  color: #4f46e5;
  border-radius: 4px;
  font-weight: 700;
  font-style: italic;
}

/* ==== Subsection within a top-level section ==== */
.subsection {
  margin-top: 3.25rem;
}
.subsection:first-of-type {
  margin-top: 1.5rem;
}
.subsection-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  text-align: center;
  margin: 0 0 1.1rem;
  letter-spacing: 0.005em;
  font-family: 'Inter', sans-serif;
  line-height: 1.3;
}
.subsection-title::before {
  content: '';
  display: block;
  width: 30px;
  height: 2px;
  background: #4f46e5;
  margin: 0 auto 0.55rem;
  border-radius: 2px;
}

/* ==== Section TOC FAB + drawer (all viewports) ==== */
.toc-fab {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: #4f46e5;
  color: #ffffff;
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 60;
  box-shadow: 0 6px 18px -4px rgba(79, 70, 229, 0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.toc-fab:hover { transform: translateY(-2px); box-shadow: 0 8px 22px -4px rgba(79, 70, 229, 0.5); }
.toc-fab:active { transform: translateY(0); }

.toc-drawer[hidden] { display: none; }

.toc-drawer {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  justify-content: flex-end;
}

.toc-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: toc-fade 0.18s ease-out;
}

.toc-drawer-panel {
  position: relative;
  z-index: 1;
  width: min(80vw, 320px);
  height: 100%;
  background: #ffffff;
  box-shadow: -6px 0 24px -6px rgba(15, 23, 42, 0.25);
  display: flex;
  flex-direction: column;
  animation: toc-slide-in 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.toc-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem 0.85rem;
  border-bottom: 1px solid var(--border-color);
}

.toc-drawer-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-light);
}

.toc-drawer-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-light);
  font-size: 0.92rem;
  cursor: pointer;
  border-radius: 8px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

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

.toc-drawer-list {
  display: flex;
  flex-direction: column;
  padding: 0.6rem 0.5rem;
  overflow-y: auto;
}

.toc-drawer-list a {
  display: block;
  padding: 0.7rem 0.85rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 8px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.toc-drawer-list a:hover {
  background: var(--background-accent);
  color: var(--text-primary);
}

.toc-drawer-list a.active {
  background: #eef2ff;
  color: #4f46e5;
}

@keyframes toc-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes toc-slide-in {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

/* ===================================================
   MOBILE OVERRIDES — placed at end to win cascade over
   any same-specificity rule defined later in this file
   =================================================== */
@media screen and (max-width: 768px) {
  html, body {
    overflow-x: hidden !important;
    max-width: 100% !important;
    -webkit-text-size-adjust: 100%;
  }
  #main-content, main {
    overflow-x: hidden;
    max-width: 100vw;
  }
  *, *::before, *::after {
    box-sizing: border-box;
  }

  /* Section & container widths */
  .section {
    padding: 2rem 0.75rem !important;
  }
  .section.hero-figure {
    padding: 0.5rem 0.75rem 0.75rem !important;
  }
  .hero .hero-body {
    padding: 2rem 0.75rem !important;
  }
  .container,
  .container.is-max-desktop {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  /* Bulma columns would otherwise extend -0.75rem past parent */
  .columns {
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-top: 0 !important;
  }
  .column {
    padding: 0.5rem !important;
  }
  .column.is-four-fifths,
  .column.is-8 {
    flex: none !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Titles scale down */
  .publication-title {
    font-size: 1.45rem !important;
    line-height: 1.25 !important;
  }
  .title.is-3 {
    font-size: 1.25rem !important;
    padding: 0.3rem 0.5rem 0.28rem !important;
    margin-bottom: 1.1rem !important;
    line-height: 1.2 !important;
  }
  .subsection-title {
    font-size: 0.98rem !important;
    line-height: 1.3 !important;
    padding: 0 0.25rem !important;
    word-break: keep-all;
  }
  .subsection-title::before {
    margin-bottom: 0.4rem !important;
  }

  /* Content body */
  .content.has-text-justified,
  .content.has-text-justified p {
    font-size: 0.9rem !important;
    line-height: 1.55 !important;
    overflow-wrap: break-word;
    word-wrap: break-word;
  }
  .content,
  .content p {
    max-width: 100% !important;
  }

  /* Tabs wrap, shrink */
  .model-tabs {
    flex-wrap: wrap !important;
    gap: 0.3rem !important;
    justify-content: flex-start !important;
  }
  .model-tab {
    flex: 0 1 auto !important;
    font-size: 0.7rem !important;
    padding: 0.35rem 0.55rem !important;
    white-space: nowrap;
  }
  .model-tab-ours .ours-badge {
    font-size: 0.55rem !important;
    padding: 0.05rem 0.3rem !important;
  }

  /* Model browser containers */
  .model-browser,
  .model-browser.benchmark-browser {
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  .model-pane-wrap {
    max-width: 100% !important;
    overflow: hidden;
  }
  .model-browser.benchmark-browser .model-pane,
  .model-pane {
    padding: 0.8rem 0.5rem !important;
    max-width: 100% !important;
  }
  .model-browser.benchmark-browser .model-pane {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  .model-pane > img {
    padding: 0.25rem !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Tables */
  .result-table-wrap,
  .result-table-wrap.bench-table,
  .result-table-wrap.ae-recon-table {
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  .result-table.result-bench {
    font-size: 0.64rem !important;
    min-width: 460px;
  }
  .result-table.result-bench thead th,
  .result-table.result-bench tbody td {
    padding: 0.25rem 0.3rem !important;
  }
  .result-table:not(.result-bench) {
    font-size: 0.7rem !important;
    width: 100% !important;
  }

  /* Two-col / three-col / step-time all stack */
  .two-col,
  .two-col.ae-split,
  .two-col.synth-split,
  .figure-row.two-col,
  .figure-row.three-col,
  .figure-row.step-time {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
    max-width: 100% !important;
  }

  /* Formulas */
  .formula-callout {
    max-width: 100% !important;
    padding: 0.85rem 0.75rem !important;
  }
  .formula-math {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    font-size: 0.78rem !important;
    max-width: 100% !important;
  }
  .formula-legend {
    font-size: 0.76rem !important;
  }

  /* Figures */
  .publication-figure,
  .publication-figure.figure-wide,
  .publication-figure.figure-compact,
  .publication-figure.figure-tiny,
  .figure-row,
  .figure-row.figure-compact,
  .schematic-wrap,
  .schematic-wrap.schematic-wide,
  .bibtex-wrap,
  .hero-figure .publication-figure {
    max-width: 100% !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  .publication-figure img,
  .sample-gallery img,
  figure img {
    max-width: 100% !important;
    height: auto !important;
  }
  .publication-figure figcaption {
    font-size: 0.72rem !important;
    text-align: left;
  }
  .schematic-wrap {
    padding: 0.5rem !important;
  }
  .schematic-wrap svg {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }

  /* Pane label wraps cleanly */
  .pane-table-label {
    font-size: 0.78rem !important;
    line-height: 1.35 !important;
    white-space: normal !important;
    word-break: break-word;
  }
  .table-label-sub {
    display: inline;
  }

  /* Contributions */
  .contrib-card,
  .contrib-solve {
    padding: 0.7rem 0.8rem !important;
  }

  /* BibTeX */
  #bibtex-code,
  .bibtex-wrap pre {
    font-size: 0.66rem !important;
    padding: 0.6rem !important;
    overflow-x: auto !important;
    max-width: 100% !important;
    white-space: pre;
  }
  .cite-modal-panel {
    max-width: calc(100vw - 1.5rem) !important;
    padding: 1rem 0.9rem 0.85rem !important;
  }

  /* TOC drawer uses more viewport */
  .toc-drawer-panel {
    width: min(85vw, 300px) !important;
  }
}
