:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-light: #94a3b8;
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-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);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --gradient-accent: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --border-radius: 12px;
  --border-radius-lg: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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(--bg-primary);
  -webkit-font-smoothing: antialiased;
}

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

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

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

.hero { position: relative; overflow: hidden; }
.hero.is-light { background: var(--bg-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; }

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

.publication-authors {
  font-family: 'Inter', sans-serif !important;
  font-weight: 500;
  margin-bottom: 1.5rem;
}
.publication-authors a {
  color: var(--primary-color) !important;
  text-decoration: none !important;
  font-weight: 600;
  transition: var(--transition);
}
.publication-authors a:hover { color: var(--primary-hover) !important; }

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

.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;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--gradient-accent);
  border-radius: 2px;
}

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

.center-image { display: block; margin-left: auto; margin-right: auto; }
.center-caption { text-align: center; font-size: 0.95rem; color: var(--text-secondary); margin-top: 0.75rem; font-style: italic; }

pre {
  background: var(--bg-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 {
  font-family: 'SF Mono', 'Monaco', 'Cascadia Code', monospace !important;
}

.bibtex-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.copy-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.copy-btn:hover { background: var(--primary-hover); transform: translateY(-2px); }
.copy-btn.copied { background: #10b981; }

.scroll-top {
  position: fixed;
  bottom: 2rem; right: 2rem;
  width: 48px; height: 48px;
  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.1rem;
  box-shadow: var(--shadow-lg);
}
.scroll-top.visible { opacity: 1; visibility: visible; }
.scroll-top:hover { background: var(--primary-hover); transform: translateY(-3px); }

.footer {
  background: var(--bg-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; }

/* Table styling */
.results-table {
  width: 100%;
  margin: 1.5rem 0;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.results-table thead th {
  background: var(--bg-accent);
  color: var(--text-primary);
  font-weight: 600;
  padding: 0.6rem 0.5rem;
  text-align: center;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}
.results-table tbody td {
  padding: 0.5rem;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-primary);
}
.results-table tbody tr:last-child td { border-bottom: none; }
.results-table tbody tr:hover td { background: var(--bg-secondary); }
.results-table tbody tr.highlight td {
  background: #eff6ff;
  font-weight: 600;
  border-top: 2px solid var(--primary-color);
  border-bottom: 2px solid var(--primary-color);
}
.results-table tbody tr.highlight td:first-child {
  border-left: 3px solid var(--primary-color);
}
.results-table .best { font-weight: 700; color: var(--primary-color); }
.results-table .second { text-decoration: underline; font-weight: 500; }
.results-table .method-col { text-align: left; font-weight: 500; white-space: nowrap; }
.results-table .metric-col { font-size: 0.8rem; color: var(--text-secondary); text-align: center; }

/* Metric badge */
.metric-tag {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 50px;
  font-weight: 600;
}
.metric-green { background: #dcfce7; color: #166534; }
.metric-red { background: #fee2e2; color: #991b1b; }

/* Vertical metric label */
.rotated-header {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
}

@media screen and (max-width: 768px) {
  .hero-body { padding: 2rem 1rem; }
  .publication-title { font-size: 2rem !important; }
  .publication-authors { font-size: 1rem !important; }
  .button { margin: 0.25rem !important; font-size: 0.85rem !important; }
  .results-table { font-size: 0.75rem; }
  .teaser .hero-body { padding: 1rem; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero, .section { animation: fadeInUp 0.6s ease-out; }

@media print { .scroll-top { display: none; } .hero, .section { animation: none; } }
