/* =================== RESET & BASE =================== */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --color-bg: #ffffff;
  --color-bg-alt: #f7f8fa;
  --color-text: #1f2937;
  --color-muted: #6b7280;
  --color-accent: #1f3a8a;       /* deep blue */
  --color-accent-hover: #1e40af;
  --color-border: #e5e7eb;
  --color-code-bg: #0f172a;
  --color-code-text: #e2e8f0;
  --max-width: 980px;
  --radius: 8px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 6px 24px rgba(0,0,0,0.08);
  --font-sans: "Google Sans", "Noto Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color .15s ease;
}
a:hover { color: var(--color-accent-hover); text-decoration: underline; }

p { margin: 0 0 1em; }
em { font-style: italic; }
strong { font-weight: 600; }

/* =================== LAYOUT =================== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 56px 0;
  border-top: 1px solid var(--color-border);
}
.section--alt {
  background: var(--color-bg-alt);
}
.section--narrow { padding: 32px 0 8px; border-top: none; }

.section-title {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 24px;
  text-align: center;
  letter-spacing: -0.01em;
}

.subsection-title {
  font-size: 20px;
  font-weight: 600;
  margin: 32px 0 12px;
  color: #111827;
}

/* =================== HERO =================== */
.hero {
  padding: 72px 0 40px;
  text-align: center;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.title {
  font-size: 36px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 auto 28px;
  max-width: 920px;
  color: #0f172a;
}

.authors {
  margin-bottom: 8px;
  font-size: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  justify-content: center;
}
.authors .author { white-space: nowrap; }
.authors sup { font-size: 12px; color: var(--color-muted); margin-left: 1px; }

.affiliations {
  margin: 8px 0 28px;
  color: var(--color-muted);
  font-size: 16px;
}
.affiliations p { margin: 4px 0; }
.affiliations .footnote { font-size: 13px; }

/* =================== ACTION BUTTONS =================== */
.buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: #0f172a;
  color: #fff !important;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  transition: background .15s ease, transform .15s ease;
  text-decoration: none !important;
  box-shadow: var(--shadow-sm);
}
.btn:hover {
  background: #1e293b;
  transform: translateY(-1px);
}
.btn i { font-size: 14px; }

/* =================== ABSTRACT =================== */
.abstract {
  font-size: 17px;
  text-align: justify;
  hyphens: auto;
  max-width: 860px;
  margin: 0 auto;
}

/* =================== FIGURES =================== */
.figure {
  margin: 28px auto;
  text-align: center;
}

.figure img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  background: #fff;
}

.video-embed {
  position: relative;
  width: 100%;
  max-width: 960px;
  aspect-ratio: 16 / 9;
  margin: 0 auto;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  background: #000;
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.figure figcaption {
  margin-top: 14px;
  font-size: 14px;
  color: var(--color-muted);
  text-align: justify;
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.55;
}

/* Image-missing fallback (shown if the file is not present yet) */
.img-fallback {
  display: none;
  margin: 0 auto;
  padding: 60px 24px;
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius);
  color: var(--color-muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 14px;
  background: #f1f5f9;
  max-width: 720px;
}
.figure.img-missing img { display: none; }
.figure.img-missing .img-fallback { display: block; }
.figure.img-missing .img-fallback::before { content: "Missing image: "; color: #b91c1c; font-weight: 600; }

.figure-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 28px 0;
}
.figure-grid .figure { margin: 0; }
@media (max-width: 720px) {
  .figure-grid { grid-template-columns: 1fr; }
}

/* =================== PIPELINE LIST =================== */
.pipeline-list {
  max-width: 800px;
  margin: 16px auto 24px;
  padding-left: 22px;
}
.pipeline-list li { margin-bottom: 10px; }

/* =================== EQUATIONS =================== */
.equation {
  margin: 18px auto;
  padding: 14px 20px;
  background: #f1f5f9;
  border-left: 3px solid var(--color-accent);
  border-radius: 6px;
  font-family: "Cambria Math", "Latin Modern Math", Cambria, serif;
  font-size: 17px;
  text-align: center;
  overflow-x: auto;
}

/* =================== TABLES =================== */
.table-wrap {
  overflow-x: auto;
  margin: 16px 0 8px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  background: #fff;
}
.results-table th,
.results-table td {
  padding: 10px 8px;
  text-align: center;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}
.results-table th {
  background: #f1f5f9;
  font-weight: 600;
  color: #0f172a;
}
.results-table tr:last-child td { border-bottom: none; }
.results-table tr.best td {
  background: #fef9c3;
}
.results-table td:first-child,
.results-table th:first-child { text-align: left; }

/* =================== BIBTEX =================== */
.bibtex {
  background: var(--color-code-bg);
  color: var(--color-code-text);
  padding: 20px 22px;
  border-radius: var(--radius);
  font-family: ui-monospace, "SFMono-Regular", Menlo, "Cascadia Code", monospace;
  font-size: 14px;
  line-height: 1.55;
  overflow-x: auto;
}

/* =================== FOOTER =================== */
.footer {
  padding: 32px 0;
  border-top: 1px solid var(--color-border);
  text-align: center;
  font-size: 14px;
  color: var(--color-muted);
}

/* =================== RESPONSIVE =================== */
@media (max-width: 720px) {
  body { font-size: 16px; }
  .title { font-size: 26px; }
  .section-title { font-size: 24px; }
  .subsection-title { font-size: 18px; }
  .section { padding: 40px 0; }
  .hero { padding: 48px 0 24px; }
  .btn { padding: 9px 14px; font-size: 14px; }
}
