/* Project page styling in the Nerfies academic-template idiom, on top of Bulma. */

body {
  font-family: 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  color: #363636;
}

.footer,
.is-light-bg {
  background-color: #fafafa;
}

html {
  scroll-behavior: smooth;
}

/* ===== One content width for everything =====
   Bulma's is-max-desktop (960px) plus is-four-fifths (80%) would render prose
   and tables narrower than the teaser image, which reads as a proportion
   mismatch. Collapse both to a single measure so every block lines up. */
.container.is-max-desktop {
  max-width: 880px;
}
.columns.is-centered > .column.is-four-fifths {
  width: 100%;
  flex: none;
}
.section {
  padding: 2.6rem 1.5rem;
}

/* ===== Left index ===== */
.side-toc {
  position: fixed;
  top: 0;
  left: 0;
  width: 232px;
  height: 100vh;
  overflow-y: auto;
  padding: 30px 20px 30px 28px;
  border-right: 1px solid #ededed;
  background: #fff;
  z-index: 30;
}
.side-toc-home {
  display: block;
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: #363636;
  margin-bottom: 1.8rem;
}
.side-toc-home:hover {
  color: #1a56b0;
}
.side-toc-heading {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: #9a9a9a;
  margin-bottom: 0.7rem;
}
.side-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid #ededed;
}
.side-toc li a {
  display: block;
  padding: 6px 0 6px 14px;
  margin-left: -2px;
  border-left: 2px solid transparent;
  font-size: 0.88rem;
  line-height: 1.35;
  color: #6a6a6a;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.side-toc li a:hover {
  color: #1a56b0;
}
.side-toc li a.is-active {
  color: #1a56b0;
  font-weight: 600;
  border-left-color: #1a56b0;
}
.page-body {
  margin-left: 232px;
}
@media screen and (max-width: 1215px) {
  .side-toc {
    display: none;
  }
  .page-body {
    margin-left: 0;
  }
}

/* Bulma's .column is a flex item, so its automatic minimum size is the
   min-content width of whatever it holds. A nowrap table or a wide code block
   would otherwise stretch the whole page instead of scrolling inside its own
   wrapper. Opting out of min-width:auto keeps the page at viewport width. */
.container,
.columns,
.column {
  min-width: 0;
}

/* ===== Hero / title block ===== */
.publication-title {
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-weight: 600;
  line-height: 1.25;
}
.publication-venue {
  display: inline-block;
  margin-bottom: 1.1rem;
  padding: 4px 14px;
  border-radius: 999px;
  background: #e8f0fe;
  color: #1a56b0;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.publication-authors {
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-size: 1.15rem;
}
.publication-authors a {
  color: #1a56b0 !important;
}
.publication-authors a:hover {
  text-decoration: underline !important;
}
.author-block {
  display: inline-block;
  white-space: nowrap;
}
.affiliation-block {
  font-size: 1.02rem;
  margin-top: 0.35rem;
}
.eql-cntrb {
  font-size: 0.86rem;
  color: #7a7a7a;
  margin-top: 0.5rem;
}

.publication-links {
  margin-top: 1.4rem;
}
.publication-links .link-block {
  display: inline-block;
  margin: 4px 3px;
}
.publication-links .button {
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-size: 0.95rem;
}
.external-link.button {
  background-color: #363636;
  border-color: transparent;
  color: #fff;
}
.external-link.button:hover {
  background-color: #1a56b0;
  color: #fff;
}

/* ===== Teaser ===== */
.hero.teaser .hero-body {
  padding-top: 0;
  padding-bottom: 0;
}
.teaser-caption,
.figure-caption {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #5f5f5f;
  margin-top: 0.85rem;
  text-align: left;
}

/* ===== Section headings ===== */
.section-title {
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-weight: 600;
}
.subtitle-kicker {
  display: block;
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #1a56b0;
  margin-bottom: 0.35rem;
}

/* ===== Figures ===== */
.figure {
  margin: 1.6rem auto;
}
.figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
}
.figure.is-bordered img {
  border: 1px solid #ededed;
}
.figure-pair {
  display: flex;
  gap: 26px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.figure-pair > .figure {
  flex: 1 1 300px;
  min-width: 0;
  margin-top: 0;
}
/* Three panels side by side must share the row rather than wrap one panel
   onto its own line at full width. */
.figure-pair.is-trio {
  gap: 16px;
}
.figure-pair.is-trio > .figure {
  flex: 1 1 0;
}
.figure-pair.is-trio .figure-caption {
  text-align: center;
  font-size: 0.85rem;
}

/* ===== Finding callouts ===== */
.finding {
  border-left: 4px solid #1a56b0;
  background: #f5f8ff;
  border-radius: 0 6px 6px 0;
  padding: 14px 18px;
  margin: 1.5rem 0;
}
.finding .finding-label {
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-weight: 600;
  color: #1a56b0;
  display: block;
  margin-bottom: 3px;
}

/* ===== Result tables ===== */
.table-wrap {
  overflow-x: auto;
  margin: 1.4rem 0;
  -webkit-overflow-scrolling: touch;
}
table.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  white-space: nowrap;
}
table.result-table th,
table.result-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #ededed;
  text-align: center;
}
table.result-table thead th {
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-weight: 600;
  border-bottom: 2px solid #d8d8d8;
  color: #4a4a4a;
}
table.result-table td:first-child,
table.result-table th:first-child {
  text-align: left;
  white-space: normal;
  min-width: 220px;
}
table.result-table tbody tr:hover {
  background: #fafbff;
}
table.result-table .saturated {
  color: #a3a3a3;
}
table.result-table .ours {
  font-weight: 700;
  color: #1a56b0;
}
table.result-table col.ours-col,
table.result-table .ours-col {
  background: #f5f8ff;
}
table.result-table tbody tr.group-sep td {
  border-top: 2px solid #d8d8d8;
}
.table-note {
  font-size: 0.85rem;
  color: #7a7a7a;
  line-height: 1.5;
}

/* Inline bar that visualizes the "Ours" column spread */
.spread-bar {
  display: inline-block;
  vertical-align: middle;
  width: 96px;
  height: 8px;
  border-radius: 4px;
  background: #e6ecf8;
  margin-left: 10px;
  position: relative;
  overflow: hidden;
}
.spread-bar > span {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: #1a56b0;
  border-radius: 4px;
}

/* ===== Code blocks ===== */
pre.code-block {
  background: #f5f5f7;
  border-radius: 6px;
  padding: 16px 18px;
  overflow-x: auto;
  font-size: 0.86rem;
  line-height: 1.55;
}
pre.code-block code {
  background: none;
  padding: 0;
  color: #363636;
  font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
}

#BibTeX pre {
  background: #f5f5f7;
  border-radius: 6px;
  padding: 16px 18px;
  overflow-x: auto;
  font-size: 0.86rem;
  text-align: left;
}

/* ===== Method cards ===== */
.method-grid {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  margin: 1.6rem 0;
}
/* Borderless: two boxed cards dropped straight under the abstract read as an
   abrupt interruption. A top rule ties them to the section instead. */
.method-card {
  flex: 1 1 280px;
  min-width: 0;
  border-top: 2px solid #e3e9f5;
  padding: 16px 0 0;
}
.method-card h4 {
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-size: 1.02rem;
  font-weight: 600;
  color: #363636;
  margin: 0 0 0.55rem;
}
.method-card .metric {
  font-size: 1.9rem;
  font-weight: 700;
  color: #1a56b0;
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  line-height: 1.05;
  margin: 0;
}
.method-card .metric-label {
  font-size: 0.84rem;
  line-height: 1.45;
  color: #8a8a8a;
  margin: 0.3rem 0 0;
}
.method-card > p:last-child {
  margin: 0.9rem 0 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* MathJax should scroll rather than widen the page */
mjx-container[display='true'] {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 0;
}

/* ===== Mobile ===== */
@media screen and (max-width: 768px) {
  .publication-title {
    font-size: 1.7rem !important;
  }
  .publication-authors {
    font-size: 1rem;
  }
  .author-block {
    white-space: normal;
  }
  .section {
    padding: 2rem 1.25rem;
  }
  .figure-pair {
    gap: 0;
  }
  /* Stacked panels must not balloon to full screen width — these are small,
     near-square plots whose type is sized for a narrow column. */
  .figure-pair.is-trio > .figure {
    flex: 1 1 100%;
    max-width: 320px;
    margin: 0 auto 1.4rem;
  }
  .figure-pair > .figure {
    margin-bottom: 1.2rem;
  }
  table.result-table {
    font-size: 0.85rem;
  }
  table.result-table td:first-child,
  table.result-table th:first-child {
    min-width: 180px;
  }
  .spread-bar {
    display: none;
  }
}

/* Diagram-style figures carry large baked-in type; at full column width they
   read as oversized next to the body text. */
.figure.is-narrow {
  max-width: 640px;
}

/* ===== Pair lookup ===== */
.lookup {
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  padding: 22px 24px;
  margin: 1.5rem 0 1rem;
  background: #fff;
}
.lookup-controls {
  display: flex;
  align-items: flex-end;
  gap: 14px;
}
.lookup-field {
  flex: 1 1 0;
  min-width: 0;
}
.lookup-field label {
  display: block;
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9a9a9a;
  margin-bottom: 5px;
}
.lookup-field .select,
.lookup-field select {
  width: 100%;
}
.lookup-field select {
  font-family: inherit;
  font-size: 0.95rem;
}
.lookup-vs {
  padding-bottom: 9px;
  color: #b0b0b0;
  font-size: 0.9rem;
  font-style: italic;
}

.lookup-result {
  margin-top: 20px;
}
.lookup-head {
  margin-bottom: 14px;
}
.regime-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  background: #eee;
  color: #555;
}
.regime-badge.is-s1 { background: #eef2f9; color: #3b5b8c; }
.regime-badge.is-xs { background: #fdf3e6; color: #9a6212; }
.regime-badge.is-s2 { background: #fdeee1; color: #a1560f; }
.regime-badge.is-s3 { background: #e9f5ec; color: #2c6b3f; }

.score-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid #f0f0f0;
}
.score-row .score-name {
  flex: 0 0 150px;
  font-size: 0.92rem;
  color: #5f5f5f;
}
.score-row .score-val {
  flex: 0 0 62px;
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  text-align: right;
}
.score-row.is-primary .score-name,
.score-row.is-primary .score-val {
  color: #1a56b0;
}
.score-row.is-primary .score-name {
  font-weight: 600;
}
.score-row .score-na {
  font-size: 0.88rem;
  color: #a5a5a5;
  font-style: italic;
}
.score-bar {
  flex: 1 1 auto;
  height: 9px;
  border-radius: 5px;
  background: #eef1f6;
  position: relative;
  overflow: hidden;
  min-width: 60px;
}
.score-bar > span {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 5px;
  background: #1a56b0;
}
.score-row:not(.is-primary) .score-bar > span {
  background: #7ea3d8;
}

.baseline-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
  font-size: 0.85rem;
  color: #a5a5a5;
}
.baseline-row > span:first-child {
  font-weight: 600;
  color: #8a8a8a;
}

@media screen and (max-width: 768px) {
  .lookup {
    padding: 18px 16px;
  }
  .lookup-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .lookup-vs {
    padding: 0;
    text-align: center;
  }
  .score-row {
    flex-wrap: wrap;
  }
  .score-row .score-name {
    flex: 1 1 auto;
  }
  .score-bar {
    flex: 1 1 100%;
  }
}

/* ===== Tighter vertical rhythm ===== */
body {
  line-height: 1.5;
}
.content p,
.content li {
  line-height: 1.58;
}
.content p:not(:last-child) {
  margin-bottom: 0.85em;
}
.figure-caption,
.table-note {
  line-height: 1.45;
}
.finding {
  line-height: 1.5;
}
.section {
  padding: 2.2rem 1.5rem;
}
.figure {
  margin: 1.3rem auto;
}
.table-wrap {
  margin: 1.15rem 0;
}

/* ===== Uniform white page =====
   The figures carry baked-in white backgrounds, so tinted sections made them
   read as pale rectangles pasted onto grey. Keep one background and separate
   sections with a hairline instead. */
.is-light-bg {
  background-color: #fff;
}
.section.is-light-bg,
.section#lookup,
.section#algorithms {
  border-top: 1px solid #f0f0f0;
}
.lookup {
  background: #fcfcfd;
}

/* ===== Harmonised figure scale =====
   Each figure bakes in its own type size, so sizing them all to the same
   column width makes the side-by-side panels render tiny labels next to the
   full-width ones. Standalone figures are held back to ~620px while the
   multi-panel rows take the full column, which brings the rendered label
   sizes across every figure into roughly the same range. */
.figure {
  max-width: 620px;
}
.hero.teaser .figure {
  max-width: 100%;
}
.figure.is-narrow {
  max-width: 500px;
}
.figure-pair {
  max-width: 100%;
}
.figure-pair > .figure {
  max-width: none;
}

/* ===== Index groups ===== */
.side-toc .toc-group {
  padding: 6px 0 2px 14px;
  font-size: 0.88rem;
  color: #9a9a9a;
}
.side-toc .toc-group > ul {
  border-left: none;
  margin-top: 2px;
}
.side-toc .toc-group li a {
  padding-left: 14px;
  margin-left: 0;
  border-left: 2px solid #f0f0f0;
}
.side-toc .toc-group li a.is-active {
  border-left-color: #1a56b0;
}

/* ===== Tighter headings =====
   The title block was eating most of the first screen. Pull the hero padding
   in and set the display type on a tighter leading. */
.hero .hero-body {
  padding: 2.2rem 1.5rem 1.4rem;
}
.publication-venue {
  margin-bottom: 0.85rem;
  padding: 3px 12px;
  font-size: 0.78rem;
}
.publication-title.title.is-2 {
  font-size: 2.1rem;
  line-height: 1.18;
  margin-bottom: 1.1rem;
}
.publication-authors {
  font-size: 1.08rem;
}
.publication-links {
  margin-top: 1.1rem;
}
.section-title.title.is-3 {
  font-size: 1.6rem;
  line-height: 1.22;
  margin-bottom: 0.7rem;
}
.method-card h4,
.finding .finding-label {
  line-height: 1.3;
}

@media screen and (max-width: 768px) {
  .publication-title.title.is-2 {
    font-size: 1.55rem !important;
  }
  .section-title.title.is-3 {
    font-size: 1.35rem;
  }
}

/* Justified text on a narrow column opens up rivers of white space. */
@media screen and (max-width: 768px) {
  .content.has-text-justified,
  .has-text-justified {
    text-align: left !important;
  }
}

/* ===== Softer, smaller figures =====
   The plot panels sat too large, and the boxed outlines plus section rules
   read as a grid of lines competing with the figures' own axes. */
.figure {
  max-width: 560px;
}
.figure.is-narrow {
  max-width: 460px;
}
.figure-pair {
  max-width: 780px;
  margin-left: auto;
  margin-right: auto;
}
.figure.is-bordered img {
  border: none;
}
.section.is-light-bg,
.section#lookup,
.section#algorithms {
  border-top: 1px solid #f6f6f6;
}
.side-toc {
  border-right-color: #f4f4f4;
}
