/* MultINav project page - self-contained stylesheet */

:root {
  --ink: #17223b;
  --ink-soft: #4d5871;
  --muted: #69748c;
  --line: #e0e6f0;
  --line-strong: #cbd5e4;
  --paper: #ffffff;
  --band: #f6f8fc;
  --chip: #f2f5fa;

  --blue: #2f5f9e;
  --blue-deep: #234b80;
  --blue-soft: #eef4fc;
  --orange: #b96234;
  --orange-soft: #fdf2ea;

  --wrap: 1180px;
  --wrap-narrow: 860px;
  --radius: 10px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(23, 34, 59, 0.04), 0 8px 24px rgba(23, 34, 59, 0.05);

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --mono: "SFMono-Regular", ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img,
video { max-width: 100%; display: block; }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--chip);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.05em 0.35em;
  color: var(--blue-deep);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 50;
}
.skip-link:focus { left: 0; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 1.5rem;
}
.wrap-narrow { max-width: var(--wrap-narrow); }

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0.55rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
  flex: none;
}
.brand:hover { text-decoration: none; }

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: var(--blue);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 0.98rem; letter-spacing: 0.01em; }
.brand-text span { font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.14em; }

.topnav {
  display: flex;
  gap: 1.1rem;
  overflow-x: auto;
  scrollbar-width: none;
  font-size: 0.88rem;
}
.topnav::-webkit-scrollbar { display: none; }

.topnav a {
  color: var(--ink-soft);
  white-space: nowrap;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}
.topnav a:hover { color: var(--blue); text-decoration: none; }
.topnav a.is-active { color: var(--blue-deep); border-bottom-color: var(--blue); font-weight: 600; }

/* ---------- Hero ---------- */

.hero { padding: 3.5rem 0 3rem; border-bottom: 1px solid var(--line); }

.hero-inner { text-align: center; }

.eyebrow {
  margin: 0 0 1rem;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--orange);
}

.paper-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 2.6rem;
  line-height: 1.16;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--ink);
  text-wrap: balance;
}

.title-sub {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.72em;
  color: var(--ink-soft);
}

.authors {
  margin: 1.6rem 0 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1.15rem;
  font-size: 1.02rem;
}

.author { white-space: nowrap; }
.author sup { font-size: 0.62em; color: var(--muted); }

.affiliations {
  margin: 0.85rem 0 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.2rem 1.1rem;
  font-size: 0.86rem;
  color: var(--ink-soft);
}
.affiliations sup { color: var(--muted); }
.affiliations.note { margin-top: 0.4rem; font-size: 0.78rem; color: var(--muted); }

.link-row {
  margin-top: 1.7rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.btn:hover { text-decoration: none; border-color: var(--blue); color: var(--blue-deep); }
.btn:active { transform: translateY(1px); }

.btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--blue-deep); border-color: var(--blue-deep); color: #fff; }

.btn-small { padding: 0.4rem 0.85rem; font-size: 0.82rem; }

/* ---------- Figures ---------- */

.teaser {
  margin-top: 2.8rem;
  margin-bottom: 0;
}

.teaser img,
.figure img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.teaser a,
.figure a { display: block; }
.teaser a:hover,
.figure a:hover { text-decoration: none; }

figcaption {
  margin-top: 0.8rem;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--muted);
  text-align: left;
}
figcaption strong { color: var(--ink); }

.figure { margin: 2.6rem 0 0; }

/* Figures placed directly under a heading carry their own caption spacing. */
.figure-top { margin-top: 1.1rem; }

/* ---------- Sections ---------- */

.section,
.band {
  padding: 4rem 0;
  scroll-margin-top: 72px;
}

.band {
  background: var(--band);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-title {
  margin: 0 0 0.9rem;
  text-align: center;
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--ink);
}

.section-title.left { text-align: left; margin-bottom: 0; }

.section-lead {
  max-width: 800px;
  margin: 0 auto 2rem;
  text-align: center;
  color: var(--ink-soft);
  font-size: 1rem;
}

.sub-title {
  margin: 2.2rem 0 0.7rem;
  font-size: 1.14rem;
  font-weight: 700;
  color: var(--ink);
}
.sub-title.mt-lg { margin-top: 3rem; }

.prose p {
  margin: 0 0 1rem;
  color: var(--ink-soft);
  line-height: 1.8;
}
.prose strong { color: var(--ink); }

.math { font-family: var(--serif); font-style: italic; white-space: nowrap; }

/* ---------- Cards ---------- */

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.3rem 1.35rem;
}

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

.card-index {
  display: block;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--orange);
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  line-height: 1.4;
}

.card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.94rem;
  line-height: 1.65;
}

/* ---------- Benchmark ---------- */

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.stat {
  padding: 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.stat + .stat { border-left: 1px solid var(--line); }

.stat b {
  font-size: 1.45rem;
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
}

.stat span {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

.taxonomy .card { border-top-width: 3px; }
.card-channel { border-top-color: var(--blue); }
.card-container { border-top-color: var(--orange); }
.card-mixed { border-top-color: #6b7fa8; }

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 0.45rem;
  vertical-align: 0.08em;
}
.dot-channel { background: var(--blue); }
.dot-container { background: var(--orange); }
.dot-mixed { background: #6b7fa8; }

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

.cols p { margin: 0 0 0.9rem; color: var(--ink-soft); line-height: 1.75; }

.callout {
  margin: 2.4rem 0 0;
  padding: 1.05rem 1.3rem;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.callout strong { color: var(--ink); }

/* ---------- Stages ---------- */

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

.stage { border-top: 3px solid var(--line-strong); }
.stage:nth-child(1) { border-top-color: var(--blue); }
.stage:nth-child(2) { border-top-color: #4a7fb5; }
.stage:nth-child(3) { border-top-color: var(--orange); }

.stage-num {
  display: block;
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 0.55rem;
}

/* ---------- Tables ---------- */

.table-scroll {
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  -webkit-overflow-scrolling: touch;
}

.table-scroll:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 640px;
}

.table th,
.table td {
  padding: 0.62rem 0.8rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.table thead th {
  background: var(--band);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.84rem;
  white-space: nowrap;
}

.table tbody tr:last-child th,
.table tbody tr:last-child td { border-bottom: 0; }

.table tbody th { font-weight: 600; color: var(--ink); }

.table-metrics td:first-of-type,
.table-metrics th:nth-child(2) { white-space: nowrap; }

.table-results th:not(:first-child),
.table-results td { text-align: center; }
.table-results tbody th { text-align: left; white-space: nowrap; }

.table-results thead .group-nav { background: #eef5ff; color: #1e40af; }
.table-results thead .group-int { background: #fff5eb; color: #9a3412; }
.table-results thead .group-cost { background: #f1f4f9; color: #334155; }

.table-results thead tr:first-child th { border-bottom: 1px solid #dbe2ea; }
.table-results thead tr:last-child th { border-bottom: 2px solid #334155; }

.col-divider {
  border-left: 1px solid #dbe2ea !important;
}

.row-head th { background: #fbfcfe; }
.row-sub th { padding-left: 1.7rem; font-weight: 500; color: var(--ink-soft); font-size: 0.85rem; }
.table tr.ours { background: var(--blue-soft); }
.table tr.ours th { color: var(--blue-deep); }
.table tr.ours strong { color: var(--blue-deep); }

.table.compact { min-width: 460px; }
.table.table-compact { min-width: 100%; }
@media (max-width: 560px) {
  .table.table-compact { min-width: 100%; width: 100%; }
  .table.table-compact th,
  .table.table-compact td {
    padding: 0.45rem 0.25rem;
    font-size: 0.78rem;
  }
}

.table-bench { min-width: 900px; font-size: 0.85rem; }
.table-bench .c { text-align: center; }
.table-bench .row-group th {
  background: var(--chip);
  font-style: italic;
  font-weight: 600;
  color: var(--ink-soft);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

.table-note {
  max-width: 900px;
  margin: 0.55rem 0 0;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.6;
}
.left-note { margin-left: 0; }

.table-narrow { max-width: 680px; }

/* ---------- Videos ---------- */

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

.video-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.video-card {
  margin: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.6rem;
  display: flex;
  flex-direction: column;
}

.video-card video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: #101827;
}

.video-card figcaption {
  margin-top: 0.65rem;
  padding: 0 0.2rem 0.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.video-card figcaption strong { font-size: 0.92rem; }
.video-card figcaption span { font-size: 0.84rem; color: var(--muted); line-height: 1.5; }

/* ---------- BibTeX ---------- */

.bibtex-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.bibtex {
  margin: 0;
  padding: 1.1rem 1.25rem;
  background: var(--band);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.62;
  color: var(--ink);
}
.bibtex code { background: none; border: 0; padding: 0; white-space: pre; color: inherit; }

/* ---------- Footer ---------- */

.footer {
  padding: 2.2rem 0 2.6rem;
  border-top: 1px solid var(--line);
  background: #fff;
}

.footer p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.7;
  text-align: center;
}

/* ---------- Responsive ---------- */

@media (max-width: 1000px) {
  .paper-title { font-size: 2.15rem; }
  .highlights,
  .taxonomy,
  .stages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .stat:nth-child(4) { border-top: 1px solid var(--line); }
}

@media (max-width: 820px) {
  body { font-size: 16px; }
  .topbar-inner { flex-direction: column; align-items: flex-start; gap: 0.4rem; padding-bottom: 0.35rem; }
  .topnav {
    width: 100%;
    gap: 0.35rem 0.75rem;
    font-size: 0.82rem;
    flex-wrap: wrap;
    overflow: visible;
    padding-bottom: 0.15rem;
  }
  .hero { padding: 2.4rem 0 2.2rem; }
  .paper-title { font-size: 1.75rem; }
  .title-sub { font-size: 0.78em; }
  .authors { font-size: 0.95rem; gap: 0.2rem 0.85rem; }
  .affiliations { font-size: 0.8rem; }
  .section-title { font-size: 1.65rem; }
  .section,
  .band { padding: 2.8rem 0; scroll-margin-top: 122px; }
  .highlights,
  .taxonomy,
  .stages,
  .cols,
  .video-grid,
  .video-grid-2 { grid-template-columns: minmax(0, 1fr); }
  .table-narrow { max-width: none; }
  .cols { gap: 1.2rem; }
}

@media (max-width: 560px) {
  .wrap { padding: 0 1.1rem; }
  .topbar-inner { padding-left: 1.1rem; padding-right: 1.1rem; }
  .paper-title { font-size: 1.5rem; }
  .stat-strip { grid-template-columns: minmax(0, 1fr); }
  .stat + .stat { border-left: 0; border-top: 1px solid var(--line); }
  .bibtex-head { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}
