:root {
  --bg: #fffaf6;
  --surface: #fffdfb;
  --surface-alt: #f6eee7;
  --ink: #1c2833;
  --muted: #576574;
  --line: #e6d9cf;
  --accent: #b14d2d;
  --accent-deep: #7f351d;
  --accent-soft: #f6e4db;
  --warning-bg: #fff1d8;
  --warning-line: #d2871e;
  --shadow: 0 16px 40px rgba(28, 40, 51, 0.08);
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Noto Sans', sans-serif;
}

a {
  color: var(--accent-deep);
}

a:hover {
  color: var(--accent);
}

.page-nav {
  background: rgba(255, 250, 246, 0.92);
  border-bottom: 1px solid rgba(230, 217, 207, 0.9);
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(8px);
}

.page-nav .navbar-item,
.page-nav .navbar-link {
  color: var(--ink);
  font-family: 'Google Sans', sans-serif;
}

.page-nav .navbar-item:hover,
.page-nav .navbar-link:hover {
  background: transparent;
  color: var(--accent);
}

.nav-home {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.publication-header {
  background:
    radial-gradient(circle at top left, rgba(177, 77, 45, 0.12), transparent 34%),
    linear-gradient(180deg, #fbf6f0 0%, #fffaf6 65%, #fffdfb 100%);
}

.publication-header .hero-body {
  padding-top: 4.5rem;
  padding-bottom: 3.25rem;
}

.publication-title {
  color: var(--ink);
  font-family: 'Castoro', serif;
  font-size: 2rem !important;
  line-height: 1.12;
  margin-bottom: 1rem !important;
}

.publication-tagline {
  color: var(--muted);
  font-size: 1.15rem;
  margin: 0 auto 1.5rem;
  max-width: 42rem;
}

.publication-authors,
.publication-affiliations {
  font-family: 'Google Sans', sans-serif;
  margin: 0 auto;
  max-width: 56rem;
}

.publication-authors {
  font-size: 0.9rem;
  margin-bottom: 0.85rem;
}

.publication-authors a {
  color: inherit;
  text-decoration: none;
}

.publication-authors a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.publication-affiliations {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.65rem;
}

.affiliation-row {
  display: block;
  margin-bottom: 0.15rem;
}

.publication-note {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1.4rem;
}

.author-block {
  display: inline-block;
  margin: 0 0.2rem 0.3rem;
}

.publication-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  justify-content: center;
}

.link-block a {
  margin: 0;
}

.button.is-dark {
  background: var(--ink);
}

.button.is-dark:hover {
  background: var(--accent-deep);
}

.section {
  padding-top: 3.25rem;
  padding-bottom: 3.25rem;
}

.section-compact {
  padding-top: 0;
  padding-bottom: 1rem;
}

.benchmark-section,
.bibtex-section {
  background: var(--surface-alt);
}

.section-title {
  color: var(--ink);
  font-family: 'Castoro', serif;
  margin-bottom: 1rem !important;
}

.abstract-section .section-title {
  text-align: center;
}

.section-intro,
.lead-copy p {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.78;
}

.warning-banner {
  background: var(--warning-bg);
  border-left: 5px solid var(--warning-line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  color: #5f4600;
  font-size: 1rem;
  line-height: 1.7;
  padding: 1rem 1.15rem;
}

.figure-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
  padding: 1rem;
}

.large-figure {
  padding: 1.25rem;
}

.feature-image {
  display: block;
  height: auto;
  margin: 0 auto;
  width: 100%;
}

.figure-caption {
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.75;
  margin: 1rem auto 0;
  max-width: 54rem;
  text-align: left;
}

.showcase-section {
  background:
    radial-gradient(circle at center, rgba(177, 77, 45, 0.06), transparent 40%),
    linear-gradient(180deg, #fffaf7 0%, #fffdfb 100%);
}

.showcase-wrap {
  margin: 0 auto;
  max-width: min(1180px, calc(100vw - 32px));
  text-align: center;
}

.showcase-title {
  font-family: 'Google Sans', sans-serif;
  margin-bottom: 0.75rem !important;
}

.showcase-intro {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
  margin: 0 auto 1.5rem;
  max-width: 50rem;
}

.trajectory-selector {
  display: flex;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.trajectory-selector .tabs {
  width: 100%;
  max-width: 1180px;
}

.trajectory-selector .tabs ul {
  border-bottom: 1px solid #ddd3c9;
  flex-wrap: wrap;
  justify-content: center;
}

.trajectory-tab {
  cursor: pointer;
}

.trajectory-tab a {
  align-items: center;
  border-bottom: 2px solid transparent;
  color: #5b6673;
  display: flex;
  font-family: 'Google Sans', sans-serif;
  font-size: 0.92rem;
  justify-content: center;
  line-height: 1.25;
  min-height: 3.35rem;
  padding-left: 0.95rem;
  padding-right: 0.95rem;
  text-align: center;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.trajectory-tab:hover a {
  color: #2f3944;
}

.trajectory-tab.is-active a {
  border-bottom-color: #8d4b36;
  color: #8d4b36;
}

.trajectory-container {
  background: #fff;
  border: 1px solid #e2dbd1;
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.09);
  display: flex;
  overflow: hidden;
  width: 100%;
  max-height: 484px;
}

.trajectory-sidebar {
  background: #f9f8f6;
  border-right: 1px solid #e2dbd1;
  display: flex;
  flex-direction: column;
  flex: 0 0 300px;
  overflow: hidden;
  width: 300px;
}

.user-query-section {
  background: #f9f8f6;
  border-bottom: 1px solid #e2dbd1;
  flex: 0 0 auto;
  max-height: 236px;
  overflow: hidden;
  padding: 10px;
}

.query-marker {
  align-items: center;
  display: flex;
  gap: 0.5rem;
  margin-bottom: 8px;
}

.query-marker .dot {
  background: #666;
  border-radius: 50%;
  display: block;
  height: 8px;
  width: 8px;
}

.query-marker .label {
  color: #556277;
  font-family: 'Google Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: none;
}

.query-content {
  background: #fff;
  border: 1px solid #eee6dc;
  border-radius: 6px;
  max-height: 188px;
  overflow-y: auto;
  padding: 12px;
  text-align: left;
  scrollbar-width: thin;
}

.query-section-label,
.query-risk-label {
  font-family: 'Google Sans', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.query-section-label {
  color: #556277;
  margin: 0 0 0.35rem;
}

#traj-instruction {
  color: #333;
  font-size: 0.81rem;
  line-height: 1.5;
  margin: 0;
}

.query-risk-box {
  border-top: 1px solid #eee6dc;
  margin-top: 0.75rem;
  padding-top: 0.7rem;
  text-align: left;
}

.query-risk-label {
  color: #9a3412;
  margin-bottom: 0.25rem;
}

#traj-risk {
  color: #7c2d12;
  font-size: 0.75rem;
  line-height: 1.45;
  margin: 0;
}

.step-pane {
  flex: 1;
  overflow-y: auto;
  background: #f9f8f6;
  min-height: 0;
}

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

.step-list-item {
  background: #f9f8f6;
  border-bottom: 1px solid #ece6dd;
  cursor: pointer;
  padding: 8px 12px 10px;
  text-align: left;
  transition: background-color 0.2s ease;
}

.step-list-item:hover {
  background: #f0f0f0;
}

.step-list-item.active {
  background: #ededed;
  border-left: 3px solid #8a8a8a;
  padding-left: 9px;
}

.step-header {
  align-items: center;
  display: flex;
  width: 100%;
}

.step-left {
  align-items: flex-start;
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 8px;
  overflow: visible;
}

.step-number {
  color: #666;
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}

.step-title {
  color: #333;
  flex: 1;
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.35;
  overflow: visible;
  text-overflow: unset;
  word-break: break-word;
}

.step-action-details {
  box-sizing: border-box;
  margin-top: 6px;
  width: 100%;
}

.step-action-details code {
  background: transparent;
  border: none;
  border-radius: 0;
  color: inherit;
  display: block;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
  font-size: 0.73rem;
  line-height: 1.35;
  margin: 0;
  padding: 0;
  white-space: normal;
  word-break: break-word;
}

.step-action-details .action-type {
  background: #666;
  border-radius: 12px;
  color: #fff;
  display: inline-block;
  font-size: 0.69rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
  margin-right: 6px;
  min-width: 58px;
  padding: 3px 8px;
  text-align: center;
  text-transform: uppercase;
}

.step-action-details .action-copy {
  color: #555;
  font-size: 0.72rem;
}

.step-thought {
  margin-top: 4px;
}

.step-thought summary {
  color: #666;
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 600;
  list-style: none;
  line-height: 1.35;
  user-select: none;
}

.step-thought summary::-webkit-details-marker {
  display: none;
}

.step-thought summary::before {
  content: '▸';
  margin-right: 4px;
  transition: transform 0.2s ease;
}

.step-thought[open] summary::before {
  transform: rotate(90deg);
}

.step-thought pre {
  background: #f3f3f3 !important;
  border-left: 3px solid #d4d4d4;
  border-radius: 4px;
  color: #444 !important;
  font-family: 'Noto Sans', sans-serif;
  font-size: 0.74rem;
  line-height: 1.35;
  margin-top: 4px;
  margin-bottom: 0;
  padding: 6px 8px !important;
  white-space: pre-wrap;
  word-break: break-word;
}

.trajectory-main {
  align-items: center;
  background: #000;
  display: flex;
  flex: 1;
  justify-content: center;
  min-height: 484px;
  overflow: hidden;
  padding: 0;
  position: relative;
}

.trajectory-main img {
  display: block;
  height: auto;
  margin: 0 auto;
  max-height: 484px;
  max-width: 100%;
  object-fit: contain;
  width: 100%;
}

.trajectory-main img.is-animating {
  animation: showcaseFade 0.28s ease;
}

.controls-container {
  display: flex;
  align-items: center;
  background: #f5f5f5;
  border: 1px solid #e2dbd1;
  border-radius: 0 0 12px 12px;
  border-top: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.09);
  justify-content: center;
  margin-bottom: 20px;
  padding: 12px 0;
}

.step-controls {
  display: flex;
  gap: 15px;
}

.control-btn {
  align-items: center;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  color: #666;
  cursor: pointer;
  display: inline-flex;
  height: 36px;
  justify-content: center;
  transition: background-color 0.2s ease, opacity 0.2s ease;
  width: 36px;
}

.control-btn:hover:not(:disabled) {
  background: #f0f0f0;
}

.control-btn:disabled {
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.45;
}

#play-steps {
  color: #666;
  height: 44px;
  width: 44px;
}

#replay-step {
  color: #3273dc;
}

.showcase-footnote {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.65;
  margin-top: 0.95rem;
  text-align: center;
}

@keyframes showcaseFade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 1.2rem 1.1rem;
}

.stat-value {
  color: var(--accent-deep);
  font-family: 'Castoro', serif;
  font-size: 1.9rem;
  line-height: 1;
  margin-bottom: 0.45rem;
}

.stat-label {
  color: var(--muted);
  font-size: 0.95rem;
}

.finding-grid {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.finding-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 1.35rem 1.2rem;
}

.finding-index {
  color: var(--accent-deep);
  font-family: 'Google Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 0.65rem;
  text-transform: uppercase;
}

.finding-card h3 {
  color: var(--ink);
  font-family: 'Castoro', serif;
  font-size: 1.28rem;
  line-height: 1.3;
  margin-bottom: 0.75rem;
}

.finding-card p:last-child {
  color: var(--muted);
  line-height: 1.72;
  margin-bottom: 0;
}

.result-metric-grid {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 1.5rem;
}

.result-metric-card {
  background: linear-gradient(135deg, rgba(177, 77, 45, 0.09), rgba(127, 53, 29, 0.03));
  border: 1px solid rgba(177, 77, 45, 0.14);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 1.25rem 1.15rem;
}

.metric-value {
  color: var(--accent-deep);
  font-family: 'Castoro', serif;
  font-size: 1.8rem;
  line-height: 1.1;
  margin-bottom: 0.45rem;
}

.metric-label {
  color: var(--ink);
  line-height: 1.7;
  margin: 0;
}

.contact-line {
  margin-top: 1rem;
}

pre {
  background: #1f2933 !important;
  border-radius: 18px;
  color: #f8fafc !important;
  padding: 1.25rem !important;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media screen and (max-width: 1023px) {
  .page-nav .navbar-menu {
    background: rgba(255, 250, 246, 0.98);
    box-shadow: none;
  }

  .page-nav .navbar-end {
    padding-bottom: 0.5rem;
  }

  .showcase-wrap {
    max-width: min(100vw - 20px, 1180px);
  }

  .trajectory-container {
    flex-direction: column;
    max-height: none;
  }

  .trajectory-sidebar {
    border-right: none;
    border-bottom: 1px solid #e2dbd1;
    width: 100%;
    flex-basis: auto;
  }

  .step-pane {
    max-height: 22rem;
  }

  .trajectory-main {
    min-height: 0;
  }

  .trajectory-main img {
    max-height: none;
  }

  .stats-grid,
  .finding-grid,
  .result-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media screen and (max-width: 768px) {
  .publication-header .hero-body {
    padding-top: 3.4rem;
    padding-bottom: 2.4rem;
  }

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

  .publication-tagline {
    font-size: 1.15rem;
  }

  .showcase-wrap {
    max-width: calc(100vw - 16px);
  }

  .trajectory-selector .tabs ul {
    justify-content: flex-start;
  }

  .trajectory-tab a {
    padding-left: 0.8rem;
    padding-right: 0.8rem;
  }

  .step-controls {
    gap: 0.65rem;
  }

  .control-btn {
    height: 2.9rem;
    width: 2.9rem;
  }

  .stats-grid,
  .finding-grid,
  .result-metric-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
  }

  .figure-panel,
  .large-figure,
  .stat-card,
  .finding-card,
  .result-metric-card {
    border-radius: 16px;
  }
}
