:root {
  --primary-color: #b3a369;
  --primary-hover: #9c8f57;
  --secondary-color: #64748b;
  --accent-color: #003057;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-light: #94a3b8;
  --background-primary: #ffffff;
  --background-secondary: #f8fafc;
  --background-accent: #f1f5f9;
  --border-color: #e2e8f0;
  --button-bg: #1e293b;
  --figure-bg: #ffffff;
  --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, #b3a369 0%, #003057 100%);
  --border-radius: 12px;
  --border-radius-lg: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

:root[data-theme="dark"] {
  --primary-color: #d3c48b;
  --primary-hover: #e0d4a4;
  --secondary-color: #94a3b8;
  --accent-color: #7fb2e8;
  --text-primary: #e7ecf3;
  --text-secondary: #a8b4c4;
  --text-light: #74839a;
  --background-primary: #0d1420;
  --background-secondary: #131c2c;
  --background-accent: #182338;
  --border-color: #26324a;
  --button-bg: #1c2942;
  --figure-bg: #f4f6f9;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.45), 0 4px 6px -4px rgb(0 0 0 / 0.45);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.5), 0 8px 10px -6px rgb(0 0 0 / 0.5);
  --gradient-accent: linear-gradient(135deg, #d3c48b 0%, #7fb2e8 100%);
}

html {
  scroll-behavior: smooth;
  background-color: var(--background-primary);
}

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);
  transition: background-color 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

.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);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

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

.publication-header .hero-body { padding: 5rem 1.5rem 3rem; }

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

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

.publication-authors a {
  color: var(--accent-color) !important;
  text-decoration: underline;
  font-weight: 500;
  transition: var(--transition);
}

.publication-authors a:hover { color: var(--primary-hover) !important; }

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

.abstract-hero-row { margin-top: 2.5rem; }

@media screen and (min-width: 1024px) {
  .abstract-hero-row .abstract-col {
    flex: none;
    width: 65%;
  }

  .abstract-hero-row .hero-fig-col {
    flex: none;
    width: 35%;
  }
}

.abstract-heading {
  margin-bottom: 1rem !important;
  padding-bottom: 0.6rem !important;
}

.publication-banner {
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  background: var(--figure-bg);
  margin: 0 0 1rem;
}

.publication-banner img {
  width: 100%;
  display: block;
  border-radius: var(--border-radius-lg);
}

.caption-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 900px;
  margin: 1rem auto 0;
  line-height: 1.6;
}

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

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

.title.is-3.abstract-heading::after {
  left: 0 !important;
  transform: none !important;
}

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

section.section img {
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  background: var(--figure-bg);
  width: 100%;
  display: block;
  transition: box-shadow 0.3s ease;
}

.footer {
  background: var(--background-secondary);
  border-top: 1px solid var(--border-color);
  padding: 3rem 1.5rem;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.footer .content { color: var(--text-secondary); line-height: 1.7; }
.footer a { color: var(--accent-color); text-decoration: none; }
.footer a:hover { color: var(--primary-hover); text-decoration: underline; }

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);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

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

.bibtex-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  flex-wrap: wrap;
}

.copy-bibtex-btn {
  background: var(--button-bg);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  padding: 0.6rem 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); }
.copy-bibtex-btn.copied { background: #10b981; }

.scroll-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background: var(--button-bg);
  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); }
.scroll-to-top.visible { opacity: 1; visibility: visible; }

.theme-toggle {
  position: fixed;
  bottom: 2rem;
  right: 5.5rem;
  width: 50px;
  height: 50px;
  background: var(--button-bg);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: var(--shadow-lg);
}

.theme-toggle:hover { background: var(--primary-hover); transform: translateY(-3px); }

@media screen and (max-width: 768px) {
  .hero-body { padding: 2rem 1rem; }
  .publication-header .hero-body { padding: 3rem 1rem 2rem; }
  .publication-title { font-size: 2rem !important; line-height: 1.2 !important; }
  .publication-authors { font-size: 1rem !important; }
  .button { margin: 0.25rem !important; font-size: 0.875rem !important; }
  .content.has-text-justified { font-size: 1rem; }
  .bibtex-header { flex-direction: column; align-items: flex-start; }
}
