/* Color system */
:root {
  --bg-primary: #f5f7fb;
  --bg-secondary: #ffffff;
  --bg-tertiary: #e7ecff;
  --bg-contrast: #0f172a;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-inverse: #ffffff;
  --accent-primary: #2563eb;
  --accent-secondary: #f97316;
  --border-color: rgba(15, 23, 42, 0.08);
  --panel-border: rgba(37, 99, 235, 0.12);
  --panel-shadow: 0 24px 50px -32px rgba(15, 23, 42, 0.5);
}

[data-theme='dark'] {
  --bg-primary: #020617;
  --bg-secondary: #0b1222;
  --bg-tertiary: #111a33;
  --bg-contrast: #182642;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5f5;
  --text-muted: #94a3c1;
  --text-inverse: #0f172a;
  --accent-primary: #60a5fa;
  --accent-secondary: #fb923c;
  --border-color: rgba(148, 163, 209, 0.18);
  --panel-border: rgba(96, 165, 250, 0.2);
  --panel-shadow: 0 24px 50px -32px rgba(9, 16, 33, 0.9);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: radial-gradient(circle at 0 0, rgba(37, 99, 235, 0.12), transparent 35%),
    radial-gradient(circle at 100% 0, rgba(249, 115, 22, 0.14), transparent 40%),
    var(--bg-primary);
  transition: background 0.4s ease, color 0.4s ease;
}

main {
  display: block;
}

html {
  scroll-behavior: smooth;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(245, 247, 251, 0.9);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(14px);
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

[data-theme='dark'] .header {
  background: rgba(8, 14, 30, 0.85);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.project-menu {
  position: relative;
  display: inline-flex;
}

.project-menu summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-secondary);
  border: 1px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, border 0.2s ease;
}

.project-menu summary::-webkit-details-marker {
  display: none;
}

.project-menu summary:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.4);
  outline-offset: 2px;
}

.project-menu[open] summary,
.project-menu summary:hover {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.2);
  color: var(--accent-primary);
}

.project-menu summary i {
  font-size: 1rem;
}

.project-menu-panel {
  position: absolute;
  top: calc(100% + 0.6rem);
  right: 0;
  min-width: 220px;
  background: var(--bg-secondary);
  border-radius: 16px;
  border: 1px solid var(--panel-border);
  box-shadow: 0 24px 48px -24px rgba(15, 23, 42, 0.35);
  padding: 1rem 0.75rem;
  z-index: 1001;
}

.project-menu-panel ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.project-menu-panel a {
  display: block;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  color: var(--text-secondary);
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.project-menu-panel a:hover,
.project-menu-panel a:focus-visible {
  background: rgba(37, 99, 235, 0.12);
  color: var(--accent-primary);
}

.logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: transparent;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  border: none;
  padding: 0;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.logo:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 18px 32px -18px rgba(37, 99, 235, 0.2);
}

.logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: inherit;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.75rem;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 1rem;
  position: relative;
  transition: color 0.2s ease;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -0.35rem;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 999px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.nav-links a:hover {
  color: var(--accent-primary);
}

.nav-links a:hover::after,
.nav-links a:focus-visible::after {
  transform: scaleX(1);
}

/* Main layout */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 140px 2rem 6rem;
}

.title-section {
  margin-bottom: 4.5rem;
}

.hero-shell {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.75rem;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), transparent 55%),
    linear-gradient(200deg, rgba(15, 23, 42, 0.05), transparent 65%),
    var(--bg-secondary);
  border-radius: 28px;
  border: 1px solid var(--panel-border);
  box-shadow: var(--panel-shadow);
  padding: 3rem;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  text-align: center;
}

.hero-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  width: 100%;
}

.hero-title-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.hero-tag {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-secondary);
}

.hero-logo {
  height: 72px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  border-radius: 0;
  background: none;
  padding: 0;
  box-shadow: none;
}

.main-title {
  margin: 0;
  font-size: clamp(2.7rem, 4vw, 3.9rem);
  font-weight: 800;
  line-height: 1.05;
  color: var(--text-primary);
}

.hero-subtitle {
  margin: 0;
  font-size: 1.2rem;
  max-width: min(62rem, 90%);
  color: var(--text-secondary);
}

.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.hero-copy .action-buttons {
  justify-content: center;
}

.hero-actions {
  margin-top: 0.5rem;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-inverse);
  background: linear-gradient(135deg, var(--accent-primary), rgba(37, 99, 235, 0.8));
  box-shadow: 0 12px 20px -14px rgba(37, 99, 235, 0.8);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 24px -16px rgba(37, 99, 235, 0.9);
}

.action-btn i {
  font-size: 1.1rem;
}

.authors {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1.5rem;
  font-size: 1.05rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin: 0;
  max-width: none;
}

.authors span {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
}

.authors sup {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.author-link {
  color: var(--text-primary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.author-link:hover {
  border-color: var(--accent-primary);
}

.affiliations {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: min(64rem, 92%);
  margin: 0.5rem auto 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.25rem;
}

.affiliations div {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
}

.affiliations sup {
  font-size: 0.7rem;
  margin-right: 0.35rem;
  color: var(--accent-primary);
}

/* Section scaffolding */
.section-block {
  margin-bottom: 6rem;
}

.section-header {
  text-align: left;
  font-size: clamp(2rem, 2.6vw, 2.8rem);
  font-weight: 800;
  margin-bottom: 2rem;
  color: var(--text-primary);
}

.section-card {
  background: var(--bg-secondary);
  border-radius: 24px;
  border: 1px solid var(--panel-border);
  padding: 2.2rem;
  box-shadow: 0 24px 40px -32px rgba(15, 23, 42, 0.35);
}

.emphasis-card {
  background: linear-gradient(120deg, rgba(37, 99, 235, 0.18), rgba(249, 115, 22, 0.12)), var(--bg-secondary);
}

.section-lead {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 860px;
  margin: 0 auto 1.5rem;
  text-align: center;
}

.section-block.align-left .section-header,
.section-block.align-left .section-lead {
  text-align: left;
}

.section-block.align-left .section-lead {
  margin-left: 0;
}

.section-block.align-left .section-card,
.section-block.align-left .tab-content,
.section-block.align-left .tab-pane-inner {
  text-align: left;
}

.section-block.align-left .body-copy {
  margin-left: 0;
  margin-right: auto;
}

.section-block.align-left .figure-caption {
  text-align: left;
}

.section-group {
  margin-top: 2rem;
  text-align: left;
}

.section-group:first-child {
  margin-top: 0;
}

.section-group h3 {
  margin-bottom: 1rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.section-group .section-lead {
  text-align: left;
  margin: 0 0 1.5rem;
}

.section-group .body-copy {
  text-align: left;
}

.figure-block {
  margin: 0 auto 1.75rem;
}

.figure-block:last-child {
  margin-bottom: 0;
}

.figure-block img {
  width: 100%;
  height: auto;
  border-radius: 16px;
}

.body-copy {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.75;
  max-width: 860px;
  margin: 0 auto 1rem;
}

.body-copy strong {
  color: var(--text-primary);
}

/* Tabbed sections */
.tab-shell {
  display: grid;
  gap: 1.5rem;
}

.tab-group > h3 {
  margin: 0 0 1rem;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
}

.section-block.align-left .tab-group > h3 {
  text-align: left;
}

.tab-navigation {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.4rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(37, 99, 235, 0.08);
  color: var(--text-secondary);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border 0.2s ease, transform 0.2s ease;
}

.tab-btn i {
  font-size: 1rem;
}

.tab-btn.active {
  color: var(--text-inverse);
  background: linear-gradient(135deg, var(--accent-primary), rgba(37, 99, 235, 0.9));
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 16px 24px -18px rgba(37, 99, 235, 0.7);
}

.tab-content {
  background: var(--bg-secondary);
  border-radius: 24px;
  border: 1px solid var(--panel-border);
  padding: 2.25rem;
  box-shadow: var(--panel-shadow);
}

.tab-pane {
  display: none;
  opacity: 0;
  transform: translateY(18px);
}

.tab-pane.active {
  display: block;
  animation: fadeInUp 0.65s ease forwards;
}

.tab-pane-inner {
  max-width: 880px;
  margin: 0 auto;
  text-align: center;
  display: grid;
  gap: 1.5rem;
}

.tab-pane-inner img {
  max-width: 100%;
  height: auto;
  border-radius: 20px;
  box-shadow: 0 18px 32px -24px rgba(15, 23, 42, 0.55);
}

/* Results & evaluation blocks */
.results-content {
  display: grid;
  gap: 2.5rem;
}

.single-column {
  max-width: 1000px;
  margin: 0 auto;
}

.results-image {
  background: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: 24px;
  border: 1px solid var(--panel-border);
  box-shadow: 0 20px 34px -28px rgba(15, 23, 42, 0.45);
}

.results-image img {
  width: 100%;
  height: auto;
  border-radius: 16px;
}

.figure-caption-wrap {
  text-align: center;
}

.figure-caption {
  font-size: 0.98rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 820px;
  margin: 0.75rem auto 0;
}

.detail-tabs {
  margin-top: 4rem;
  display: grid;
  gap: 1.5rem;
}

.detail-tabs h3 {
  text-align: center;
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0;
}

.results-tab-navigation {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.results-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.6rem;
  border-radius: 14px;
  border: 1px solid var(--panel-border);
  background: rgba(37, 99, 235, 0.08);
  color: var(--text-secondary);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.results-tab-btn i {
  font-size: 1rem;
}

.results-tab-btn.active {
  color: var(--text-inverse);
  background: linear-gradient(135deg, var(--accent-primary), rgba(37, 99, 235, 0.9));
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 16px 24px -18px rgba(37, 99, 235, 0.7);
}

.results-tab-content {
  background: var(--bg-secondary);
  border-radius: 24px;
  border: 1px solid var(--panel-border);
  padding: 2.25rem;
  box-shadow: var(--panel-shadow);
}

.results-tab-pane {
  display: none;
  opacity: 0;
  transform: translateY(18px);
}

.results-tab-pane.active {
  display: block;
  animation: fadeInUp 0.65s ease forwards;
}

.results-tab-pane .tab-pane-inner {
  gap: 1.5rem;
}

/* BibTeX */
.bibtex-card {
  max-width: 820px;
  margin: 0 auto;
  background: var(--bg-secondary);
  border-radius: 20px;
  border: 1px solid var(--panel-border);
  padding: 2rem;
  box-shadow: 0 24px 40px -32px rgba(15, 23, 42, 0.4);
  font-family: 'Fira Code', Menlo, Consolas, 'Courier New', monospace;
  font-size: 0.95rem;
  color: var(--text-secondary);
  overflow: auto;
}

.bibtex-card pre {
  margin: 0;
  white-space: pre-wrap;
}

/* Footer */
.site-footer {
  margin-top: 6rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Transitions for theme changes */
img,
.section-card,
.hero-shell,
.hero-media,
.results-image,
.bibtex-card,
.results-tab-content,
.tab-content {
  transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

/* Simple fade utilities */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up,
.fade-in-delay-1,
.fade-in-delay-2,
.fade-in-delay-3,
.fade-in-delay-4,
.fade-in-delay-5 {
  animation: fadeInUp 0.8s ease forwards;
  opacity: 0;
}

.fade-in-delay-1 { animation-delay: 0.15s; }
.fade-in-delay-2 { animation-delay: 0.3s; }
.fade-in-delay-3 { animation-delay: 0.45s; }
.fade-in-delay-4 { animation-delay: 0.6s; }
.fade-in-delay-5 { animation-delay: 0.75s; }

/* Responsive adjustments */
@media (max-width: 1024px) {
  .hero-shell {
    padding: 2.5rem;
  }
}

@media (max-width: 768px) {
  .header-container {
    padding: 0.75rem 1.25rem;
  }

  .nav-links {
    gap: 1rem;
  }

  .main-content {
    padding: 120px 1.25rem 4rem;
  }

  .hero-shell {
    padding: 2rem;
  }

  .hero-title-row {
    gap: 1.25rem;
    justify-content: center;
  }

  .hero-copy {
    align-items: center;
    text-align: center;
  }

  .hero-title-block {
    align-items: center;
  }

  .authors {
    justify-content: center;
  }

  .affiliations div {
    text-align: center;
  }

  .header-right {
    gap: 1rem;
  }

  .project-menu summary {
    padding: 0.45rem 0.75rem;
  }

  .action-buttons {
    gap: 0.75rem;
  }

  .hero-copy .action-buttons {
    justify-content: center;
  }

  .tab-content,
  .results-tab-content {
    padding: 1.75rem;
  }

  .section-card {
    padding: 1.75rem;
  }

  .section-header {
    font-size: 2rem;
  }

  .detail-tabs h3 {
    font-size: 1.5rem;
  }

  .footer-inner {
    padding: 2rem 1.25rem;
  }
}

@media (max-width: 560px) {
  .header-right {
    display: none;
  }

  .hero-shell {
    padding: 1.75rem;
  }

  .hero-title-row {
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
  }

  .hero-copy {
    align-items: center;
    text-align: center;
  }

  .hero-title-block {
    align-items: center;
  }

  .authors {
    justify-content: center;
  }

  .affiliations {
    margin: 0.5rem auto 0;
  }

  .affiliations div {
    text-align: center;
  }

  .project-menu summary {
    padding: 0.4rem 0.65rem;
  }

  .tab-navigation,
  .results-tab-navigation {
    gap: 0.5rem;
  }

  .tab-btn,
  .results-tab-btn {
    width: 100%;
    justify-content: center;
  }

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

  .hero-copy .action-buttons {
    justify-content: center;
  }
}
