:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary-color: #64748b;
  --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);
  --border-radius: 12px;
  --border-radius-lg: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  --basic-color: #2563eb;
  --basic-bg: #eff6ff;
  --compound-color: #7c3aed;
  --compound-bg: #f5f3ff;
  --additional-color: #059669;
  --additional-bg: #ecfdf5;
}

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


/* ========= BUTTONS ========= */
.button {
  border-radius: var(--border-radius) !important;
  font-weight: 600 !important;
  transition: var(--transition) !important;
  border: 2px solid transparent !important;
  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;
}
.link-block a { margin: 8px 4px; }

/* ========= HERO ========= */
.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-header .hero-body { padding: 4rem 1.5rem 3rem; }
.publication-title {
  font-family: 'Inter', sans-serif !important;
  font-weight: 800 !important;
  color: var(--text-primary) !important;
  margin-bottom: 1rem !important;
  line-height: 1.15 !important;
  font-size: 2.8rem !important;
}
.uos-logo-wrap {
  margin-bottom: 1.5rem;
}
.uos-logo {
  max-width: 360px;
  height: auto;
}
.publication-authors {
  font-family: 'Inter', sans-serif !important;
  font-weight: 500;
  margin-bottom: 0.5rem;
}
.publication-authors a {
  color: var(--primary-color) !important;
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}
.publication-authors a:hover { color: var(--primary-hover) !important; }
.author-large {
  font-size: 1.5rem !important;
  margin-bottom: 0.5rem;
}
.author-large a {
  color: var(--accent-color) !important;
  font-weight: 500 !important;
}
.tldr-text {
  max-width: 650px;
  margin: 1.5rem auto 0;
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1.7;
}

/* ========= INTERACTIVE DEMO ========= */
.interactive-cta {
  text-align: center;
  margin-top: 1.5rem;
}
.interactive-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.interactive-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: white;
  border: none;
  border-radius: var(--border-radius);
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}
.interactive-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: white;
}
.interactive-btn i { font-size: 1.2rem; }
.interactive-btn-install {
  background: var(--primary-color);
}
.interactive-btn-install:hover { background: var(--primary-hover); }
.interactive-btn-local {
  background: var(--secondary-color);
}
.interactive-btn-local:hover { background: #475569; }
.interactive-note {
  max-width: 560px;
  margin: 1rem auto 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  text-align: center;
}
.interactive-note p { margin-bottom: 0.75rem; }
.interactive-note kbd {
  background: var(--background-accent);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
  font-family: 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
  font-size: 0.75rem;
  font-weight: 600;
}
.key-hints {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--text-light);
}
.key-hints span { display: inline-flex; align-items: center; gap: 0.3rem; }
/* ========= INSTALL MODAL ========= */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-overlay.show { display: flex; }
.modal-box {
  background: var(--background-primary);
  border-radius: var(--border-radius-lg);
  padding: 2rem;
  max-width: 560px;
  width: 90%;
  position: relative;
  box-shadow: var(--shadow-xl);
  animation: fadeInUp 0.3s ease-out;
}
.modal-box h3 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}
.modal-box > p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 0.75rem; }
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-light);
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { color: var(--text-primary); }
.copy-block {
  display: flex;
  align-items: center;
  background: var(--text-primary);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  gap: 0.5rem;
}
.copy-block code {
  flex: 1;
  color: #e2e8f0 !important;
  background: none !important;
  font-size: 0.8rem;
  word-break: break-all;
  line-height: 1.5;
}
.copy-cmd-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}
.copy-cmd-btn:hover { background: rgba(255,255,255,0.3); }
.modal-sub {
  font-size: 0.8rem !important;
  color: var(--text-light) !important;
  margin-bottom: 1rem !important;
}
.modal-reqs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.modal-reqs i { color: #10b981; margin-right: 0.25rem; }
.modal-repo-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary-color);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}
.modal-repo-link:hover { color: var(--primary-hover); }

.local-only-note {
  margin-top: 0.75rem !important;
  font-size: 0.78rem;
  color: var(--text-light);
  font-style: italic;
}

/* ========= TEASER ========= */
.teaser .hero-body { padding-top: 2rem; padding-bottom: 3rem; }
.teaser-single {
  max-width: 900px;
  margin: 0 auto;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}
.teaser-single video { width: 100%; display: block; }

/* ========= SECTION TITLES ========= */
.title.is-3 {
  font-family: 'Inter', sans-serif !important;
  font-weight: 700 !important;
  color: var(--text-primary);
  margin-bottom: 1rem !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: linear-gradient(135deg, var(--primary-color), var(--compound-color));
  border-radius: 2px;
}
.content.has-text-justified {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

/* ========= PIPELINE ========= */
.pipeline-flow {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin: 0 auto;
}
.pipeline-stage {
  flex: 1;
  background: var(--background-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
  text-align: center;
  position: relative;
  transition: var(--transition);
}
.pipeline-stage:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.stage-highlight { border-color: var(--primary-color); border-width: 2px; }
.stage-contribution {
  border-color: var(--compound-color);
  border-width: 2px;
  background: linear-gradient(135deg, #faf5ff, #f5f3ff);
}
.stage-number {
  position: absolute;
  top: -0.75rem;
  left: 50%;
  transform: translateX(-50%);
  width: 1.5rem;
  height: 1.5rem;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stage-contribution .stage-number { background: var(--compound-color); }
.stage-icon {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 0.75rem;
}
.stage-contribution .stage-icon { color: var(--compound-color); }
.pipeline-stage h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.pipeline-stage p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 0.75rem;
}
.stage-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.detail-tag {
  background: var(--background-accent);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.7rem;
  color: var(--text-primary);
}
.pipeline-arrow {
  display: flex;
  align-items: center;
  padding: 0 0.5rem;
  color: var(--text-light);
  font-size: 1.2rem;
}


/* ========= EMOTION TAXONOMY ========= */
.taxonomy-tier { margin-bottom: 2.5rem; }
.tier-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.tier-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.basic-badge { background: var(--basic-bg); color: var(--basic-color); }
.compound-badge { background: var(--compound-bg); color: var(--compound-color); }
.additional-badge { background: var(--additional-bg); color: var(--additional-color); }
.tier-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}
.emotion-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}
.emotion-card {
  background: var(--background-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1rem;
  transition: var(--transition);
}
.emotion-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.basic-card { border-left: 3px solid var(--basic-color); }
.compound-card { border-left: 3px solid var(--compound-color); }
.additional-card { border-left: 3px solid var(--additional-color); }
.emotion-name {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}
.emotion-aus {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary-color);
  font-family: 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
}
.emotion-desc {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 0.25rem;
  line-height: 1.4;
}

/* (removed: classifier, heatmap, control-vector styles) */
.basic-text { color: var(--basic-color); }
.compound-text { color: var(--compound-color); }
.additional-text { color: var(--additional-color); }
.heatmap-caption {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 1rem;
  line-height: 1.5;
  text-align: center;
}

/* ========= VIDEO GALLERY ========= */
.gallery-filters { display: flex; justify-content: center; gap: 0.5rem; flex-wrap: wrap; }
.gallery-filter {
  background: var(--background-accent);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 0.4rem 1.2rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
  color: var(--text-secondary);
}
.gallery-filter:hover { border-color: var(--primary-color); color: var(--primary-color); }
.gallery-filter.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}
.video-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}
.video-gallery-wide {
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}
.gallery-item {
  background: var(--background-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  overflow: hidden;
  transition: var(--transition);
}
.gallery-item:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.gallery-item.hidden { display: none; }
.gallery-item video { width: 100%; display: block; }
.gallery-label {
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.gallery-emotion {
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
}
.basic-bg { background: var(--basic-bg); color: var(--basic-color); }
.compound-bg { background: var(--compound-bg); color: var(--compound-color); }
.additional-bg { background: var(--additional-bg); color: var(--additional-color); }
.gallery-aus {
  font-size: 0.75rem;
  color: var(--text-light);
  font-family: 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
}

/* ========= RESULTS CARDS ========= */
.results-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}
.result-card {
  background: var(--background-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 2rem 1.5rem;
  text-align: center;
  transition: var(--transition);
}
.result-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.result-value {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary-color);
  line-height: 1;
  margin-bottom: 0.5rem;
}
.result-label {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.result-detail {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ========= BIBTEX ========= */
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-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; }

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

/* ========= FOOTER ========= */
.footer {
  background: var(--background-secondary);
  border-top: 1px solid var(--border-color);
  padding: 2.5rem 1.5rem;
}
.footer .content { color: var(--text-secondary); line-height: 1.7; font-size: 0.9rem; }
.footer a { color: var(--primary-color); text-decoration: none; transition: var(--transition); }
.footer a:hover { color: var(--primary-hover); text-decoration: underline; }

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

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

/* ========= RESPONSIVE ========= */
@media screen and (max-width: 768px) {
  .publication-header .hero-body { padding: 3rem 1rem 2rem; }
  .publication-title { font-size: 2rem !important; line-height: 1.2 !important; }
  .teaser-single { max-width: 100%; }
  .pipeline-flow { flex-direction: column; }
  .pipeline-arrow { transform: rotate(90deg); padding: 0.5rem 0; }
  .emotion-cards { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .video-gallery, .video-gallery-wide { grid-template-columns: 1fr; }
  .results-cards { grid-template-columns: repeat(2, 1fr); }
}

@media screen and (max-width: 480px) {
  .publication-title { font-size: 1.7rem !important; }
  .teaser-grid { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .results-cards { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
  .result-value { font-size: 2rem; }
  .video-gallery, .video-gallery-wide { grid-template-columns: 1fr; }
  .hero-body { padding: 3rem 0.75rem 2rem; }
}

.au-explainer {
  max-width: 700px;
  margin: 0 auto 2rem;
  padding: 1rem 1.5rem;
  background: rgba(37, 99, 235, 0.06);
  border-left: 3px solid var(--primary-color);
  border-radius: 0 8px 8px 0;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-primary);
  text-align: left !important;
}

.au-explainer a {
  color: var(--primary-color);
  text-decoration: none;
}

.au-explainer a:hover {
  text-decoration: underline;
}

.acknowledgements-text {
  max-width: 800px;
  margin: 0 auto 1.5rem;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-primary);
}

.acknowledgements-text a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
}

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

.references-list {
  max-width: 800px;
  margin: 0 auto;
}

.reference-item {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

.ref-number {
  font-weight: 600;
  color: var(--primary-color);
  white-space: nowrap;
  min-width: 2rem;
}

.ref-text {
  color: var(--text-primary);
  font-size: 0.95rem;
}

.ref-link {
  display: inline-block;
  margin-left: 0.5rem;
  font-size: 0.85rem;
  color: var(--primary-color);
  text-decoration: none;
  white-space: nowrap;
}

.ref-link:hover {
  text-decoration: underline;
}

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