/* Global theme */
:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --accent-color: #0ea5e9;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-light: #94a3b8;
  --background-primary: #ffffff;
  --background-secondary: #f8fafc;
  --background-accent: #f1f5f9;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --gradient-accent: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --border-radius: 12px;
  --border-radius-lg: 18px;
  --transition: all 0.28s ease;
}

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: var(--background-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

.button {
  border-radius: var(--border-radius) !important;
  font-weight: 600 !important;
  transition: var(--transition) !important;
  border: 2px solid transparent !important;
}

.button.is-dark {
  background: var(--text-primary) !important;
  color: #fff !important;
  box-shadow: var(--shadow-md);
}

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

.button .icon {
  font-size: 0.88rem;
}

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

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

.publication-title {
  font-family: 'Inter', sans-serif !important;
  font-weight: 800 !important;
  color: var(--text-primary) !important;
  line-height: 1.08 !important;
}

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

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

.title.is-3 {
  font-family: 'Inter', sans-serif !important;
  font-weight: 700 !important;
  color: var(--text-primary);
  margin-bottom: 2rem !important;
  position: relative;
  padding-bottom: 1rem;
}

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

.content.has-text-justified {
  font-size: 1.08rem;
  line-height: 1.82;
  color: var(--text-secondary);
}

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

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

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

.footer a:hover {
  text-decoration: underline;
}

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

.copy-bibtex-btn {
  background: var(--primary-color);
  color: #fff;
  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 {
  position: fixed;
  right: 2rem;
  bottom: 2rem;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: var(--primary-color);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 999;
  box-shadow: var(--shadow-lg);
}

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

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

.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;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

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

.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.08rem;
  font-weight: 700;
}

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

.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: 600;
  color: var(--text-primary);
}

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

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

.paper-hero {
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 30%),
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.12), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.paper-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.paper-inline-logo {
  width: 86px;
  height: auto;
  flex-shrink: 0;
}

.paper-inline-title {
  margin: 0 !important;
  font-size: 3rem !important;
  text-align: center;
}

.hero-meta-block {
  max-width: 980px;
  margin: 0 auto;
}

.compact-authors {
  line-height: 1.85;
}

.hero-affiliation-row {
  color: var(--text-secondary);
}

.author-sep {
  display: inline-block;
  margin: 0 0.45rem;
  color: var(--text-light);
}

.hero-tagline {
  font-size: 1.08rem;
  line-height: 1.85;
  color: var(--text-secondary);
  margin: 1rem auto 1.5rem;
}

.hero-tagline.narrow {
  max-width: 820px;
}

.hero-action-row {
  margin-bottom: 1.5rem;
}

.hero-metric-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.metric-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  background: var(--background-secondary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.metric-pill strong {
  font-size: 1rem;
}

.metric-pill span {
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.metric-pill.accent {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.16);
}

.section-intro {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 1.75rem;
}

.wide-intro {
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
}

.callout-box {
  padding: 1.25rem 1.35rem;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(148, 163, 184, 0.08));
  border: 1px solid rgba(37, 99, 235, 0.12);
  color: var(--text-primary);
}

.image-card {
  background: #fff;
  padding: 1rem;
  border-radius: 22px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
}

.image-card img {
  display: block;
  width: 100%;
  border-radius: 14px;
}

.image-card figcaption {
  margin-top: 0.9rem;
  color: var(--text-secondary);
  font-size: 0.94rem;
  line-height: 1.65;
}

.hero-figure-card {
  padding: 1.25rem;
}

.visual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.visual-card.wide {
  grid-column: 1 / -1;
}

.snapshot-grid,
.insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.snapshot-card,
.insight-card,
.table-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.snapshot-card:hover,
.insight-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.snapshot-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary-color);
  font-size: 1rem;
  margin-bottom: 1rem;
}

.snapshot-card h3,
.insight-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.snapshot-card p,
.insight-card p {
  color: var(--text-secondary);
  line-height: 1.7;
}

.insight-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary-color);
  background: rgba(37, 99, 235, 0.08);
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.9rem;
}

.results-table-container {
  max-width: 1600px;
}

.centered-table-card {
  padding: 1rem 1rem 1.15rem;
  max-width: 1520px;
  margin: 0 auto;
}

.table-legend {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
}

.legend-item.good {
  color: #166534;
  background: rgba(22, 101, 52, 0.08);
}

.legend-item.bad {
  color: #b91c1c;
  background: rgba(185, 28, 28, 0.08);
}

.table-scroll {
  overflow-x: visible;
}

.centered-scroll {
  display: block;
}

.results-table {
  width: 100%;
  min-width: 0;
  max-width: 1500px;
  margin: 0 auto;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 0.79rem;
}

.results-table th,
.results-table td {
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  padding: 0.6rem 0.34rem;
  text-align: center;
  vertical-align: middle;
  white-space: normal;
  word-break: break-word;
  line-height: 1.32;
  font-variant-numeric: tabular-nums;
  background: #fff;
}

.results-table thead th {
  background: var(--background-accent);
  font-weight: 700;
  color: var(--text-primary);
  text-align: center !important;
  vertical-align: middle !important;
}

.results-table thead tr:first-child th {
  text-align: center !important;
}

.results-table tr th:first-child,
.results-table tr td:first-child {
  border-left: 1px solid var(--border-color);
}

.results-table thead tr:first-child th {
  border-top: 1px solid var(--border-color);
}

.results-table thead tr:first-child th:first-child {
  border-top-left-radius: 14px;
}

.results-table thead tr:first-child th:last-child {
  border-top-right-radius: 14px;
}

.results-table tbody tr:last-child td:first-child {
  border-bottom-left-radius: 14px;
}

.results-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 14px;
}

.results-table tbody tr:nth-child(even) td {
  background: #fbfdff;
}

.results-table .highlight-row td {
  background: rgba(37, 99, 235, 0.06) !important;
}

.delta-good {
  color: #166534;
  font-weight: 700;
}

.delta-bad {
  color: #b91c1c;
  font-weight: 700;
}

.delta-neutral {
  color: var(--text-secondary);
  font-weight: 700;
}

.strong {
  font-size: 1rem;
}

.feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.feature-list li {
  position: relative;
  padding-left: 1.4rem;
  margin-bottom: 1rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.feature-list li::before {
  content: '';
  position: absolute;
  top: 0.75rem;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-color);
}

.mini-visual-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.mini-visual-card {
  padding: 0.8rem;
}

.button:focus,
a:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(26px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media screen and (max-width: 1024px) {
  .paper-inline-title {
    font-size: 2.45rem !important;
  }
}

@media screen and (max-width: 768px) {
  .hero-body {
    padding: 2.2rem 1rem;
  }

  .paper-title-row {
    flex-direction: column;
    gap: 0.75rem;
  }

  .paper-inline-logo {
    width: 72px;
  }

  .paper-inline-title {
    font-size: 2rem !important;
  }

  .hero-tagline {
    font-size: 1rem;
  }

  .visual-grid,
  .snapshot-grid,
  .insight-grid,
  .mini-visual-stack {
    grid-template-columns: 1fr;
  }

  .table-scroll {
    overflow-x: auto;
  }

  .centered-scroll {
    display: block;
  }

  .results-table {
    min-width: 980px;
    font-size: 0.76rem;
    table-layout: auto;
  }

  .results-table th,
  .results-table td {
    white-space: nowrap;
    word-break: normal;
    padding: 0.62rem 0.5rem;
  }

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

  .bibtex-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
  }
}

@media screen and (max-width: 480px) {
  .paper-inline-title {
    font-size: 1.7rem !important;
  }

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

  .link-block {
    display: block;
    margin-bottom: 0.5rem;
  }

  .button {
    width: 100%;
    justify-content: center;
  }

  .scroll-to-top {
    right: 1rem;
    bottom: 1rem;
  }
}

@media print {
  .more-works-container,
  .scroll-to-top {
    display: none;
  }

  .hero,
  .section {
    animation: none;
  }

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