/* SWIFT project page — a self-contained stylesheet.
   The root font scale and the rem values mirror the Minimal Mistakes theme
   (16px -> 18px -> 20px -> 22px across breakpoints), so the proportions match
   a Minimal Mistakes "single, wide" page with the same custom rules on top. */

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

@media (min-width: 48em) {
  html { font-size: 18px; }
}

@media (min-width: 64em) {
  html { font-size: 20px; }
}

@media (min-width: 80em) {
  html { font-size: 22px; }
}

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

body {
  margin: 0;
  background: #ffffff;
  color: #262626;
  font-family: Georgia, "Times New Roman", Times, serif;
  line-height: 1.5;
}

a {
  color: #0b7fd1;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

sup {
  font-size: 0.72em;
  line-height: 0;
  vertical-align: baseline;
  position: relative;
  top: -0.45em;
}

/* ---------- page frame ---------- */

.page {
  width: 100%;
  padding-inline: 1.5rem;
  padding-bottom: 3rem;
}

@media (min-width: 64em) {
  .page {
    padding-inline: 8rem;
  }
}

.page__title {
  max-width: 980px;
  margin: 3rem auto 0.65rem;
  text-align: center;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 1.85rem;
  font-weight: 500;
  line-height: 1.12;
  color: #111827;
}

.page__content {
  max-width: 900px;
  margin-inline: auto;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 0.88rem;
  font-weight: 400;
  line-height: 1.5;
  color: #262626;
}

.page__content p,
.page__content li {
  margin: 0 0 0.72rem;
}

.page__content ul {
  padding-left: 1.3em;
  margin: 0 0 0.72rem;
}

.page__content hr {
  margin: 1.55rem 0 1.15rem;
  border: 0;
  border-top: 1px solid rgba(15, 23, 42, 0.09);
}

.page__content h3 {
  margin: 1.4rem 0 0.6rem;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: #0f172a;
}

.page__content strong {
  color: #111827;
}

/* ---------- top bar: back link ---------- */

.home-heading {
  position: fixed;
  inset: 0 0 auto;
  z-index: 30;
  display: flex;
  align-items: center;
  height: 2.15rem;
  margin: 0;
  padding-left: max(1.5rem, calc((100vw - 980px) / 2));
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  background: rgba(255, 255, 255, 0.94);
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 0.8rem;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.home-heading a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.16);
  color: #64748b;
  text-decoration: none;
  background: transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.home-heading a:hover {
  color: #334155;
  border-color: rgba(15, 23, 42, 0.34);
  text-decoration: none;
}

.home-heading a:focus-visible {
  outline: 2px solid rgba(15, 23, 42, 0.24);
  outline-offset: 2px;
}

/* ---------- header block ---------- */

.button-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin: 0.65rem 0 1.25rem;
}

/* outlined pills: the color is in the icon, not in the fill */
.button-row a.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.42em;
  margin: 0;
  border: 1px solid rgba(15, 23, 42, 0.2);
  border-radius: 999px;
  padding: 0.36rem 0.9rem;
  background-color: #ffffff;
  color: #1f2937;
  font-family: "Avenir Next", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-decoration: none;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.button-row a.btn svg {
  width: 1.15em;
  height: 1.15em;
  flex: none;
}

.button-row a.btn.btn--arxiv svg {
  color: #b31b1b;
}

.button-row a.btn.btn--pdf svg {
  color: #c2410c;
}

.button-row a.btn.btn--alphaxiv svg {
  width: 1.45em;
  color: #9a2036;
}

.button-row a.btn.btn--hf svg {
  width: 1.3em;
  height: 1.3em;
}

.button-row a.btn.btn--slides svg {
  color: #6d28d9;
}

.button-row a.btn:hover {
  border-color: rgba(15, 23, 42, 0.5);
  background-color: #f8fafc;
  text-decoration: none;
}

.button-row a.btn:focus-visible {
  outline: 2px solid rgba(15, 23, 42, 0.35);
  outline-offset: 2px;
}

/* a link that does not exist yet */
.button-row a.btn.btn--soon {
  border-style: dashed;
  color: #64748b;
  pointer-events: none;
  cursor: default;
}

.button-row a.btn.btn--soon svg {
  color: #94a3b8;
}

.button-row a.btn.btn--soon .soon {
  font-weight: 400;
  font-style: italic;
  color: #94a3b8;
}

.author-row {
  margin: 0 0 0.3rem;
  text-align: center;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.4;
}

.affiliation-row {
  margin: 0 0 1rem;
  text-align: center;
  font-family: Georgia, "Times New Roman", Times, serif;
  color: #475569;
  font-size: 0.74rem;
  line-height: 1.3;
}

/* keep a name and its marks, or one affiliation, on one line when wrapping */
.author,
.aff {
  white-space: nowrap;
}

.affiliation-row .aff + .aff {
  margin-left: 0.9em;
}

.note-row {
  margin: -0.7rem 0 1rem;
  text-align: center;
  font-family: Georgia, "Times New Roman", Times, serif;
  color: #64748b;
  font-size: 0.68rem;
  line-height: 1.3;
}

.note-row span + span {
  margin-left: 1.2em;
}

.author-link,
.author-link:visited {
  font-weight: 500;
  font-style: italic;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: #0f172a;
  padding-bottom: 0.15rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.3);
  transition: color 0.18s ease, border-color 0.18s ease;
}

.author-link:hover {
  color: #0b7fd1;
  border-color: rgba(11, 127, 209, 0.6);
  text-decoration: none;
}

.page__content .tldr-box {
  margin: 1rem auto 1.15rem;
  padding: 0.65rem 0.85rem;
  width: 100%;
  border-left: 3px solid #0b7fd1;
  background: #f8fafc;
  color: #0f172a;
  font-family: "Avenir Next", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.82rem;
  line-height: 1.38;
  font-style: italic;
  font-weight: 400;
}

.page__content .tldr-box strong {
  font-style: normal;
}

/* ---------- section lead-ins ---------- */

.page__content .lead-italic {
  margin: 1.35rem 0 0.48rem;
  padding-left: 0.55rem;
  border-left: 3px solid #111827;
  font-size: 0.98rem;
  line-height: 1.3;
  font-style: italic;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #0f172a;
}

/* ---------- figures ---------- */

.page__content img {
  display: block;
  margin-inline: auto;
}

.feature-figure {
  margin-top: 0.25rem;
  margin-bottom: 0.3rem;
}

/* figures open at full resolution in a new tab */
a.figure-link {
  display: block;
  cursor: zoom-in;
}

a.figure-link:hover {
  text-decoration: none;
}

/* links to cited papers inside the prose */
.page__content p a.cite,
.page__content li a.cite {
  color: #1f4f7a;
  text-decoration: underline;
  text-decoration-color: rgba(31, 79, 122, 0.35);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.14em;
}

.page__content p a.cite:hover,
.page__content li a.cite:hover {
  text-decoration-color: rgba(31, 79, 122, 0.9);
}

.feature-figure.figure--narrow {
  max-width: min(100%, 650px);
}

.page__content p.figure-caption {
  margin: 0.36rem auto 0.05rem;
  max-width: 100%;
  text-align: center;
  font-family: Georgia, "Times New Roman", Times, serif;
  color: #4b5563;
  font-size: 0.8rem;
  line-height: 1.28;
}

/* a paragraph after a caption keeps its distance */
.page__content p.figure-caption + p,
.page__content p.figure-caption + ul {
  margin-top: 0.9rem;
}


/* ---------- the method equation ---------- */

.page__content .eq-box {
  margin: 0.9rem auto 0.9rem;
  padding: 0.55rem 0.9rem;
  width: fit-content;
  max-width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 6px;
  background: #fcfcfd;
  overflow-x: auto;
}

/* ---------- expandable notes ---------- */

.inline-note-trigger {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  color: #385a7c;
  font-weight: 500;
  letter-spacing: 0;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.12em;
}

.inline-note-trigger:hover {
  color: #1f4f7a;
}

.inline-note-trigger:focus-visible {
  outline: 2px solid rgba(15, 23, 42, 0.2);
  outline-offset: 2px;
}

.inline-note-body {
  margin: -0.18rem 0 0.72rem;
  padding: 0.12rem 0 0.12rem 0.7rem;
  border-left: 2px solid #cbd5e1;
  color: #334155;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 0.78rem;
  font-style: normal;
  line-height: 1.42;
}

.inline-note-body[hidden] {
  display: none;
}

.inline-note-body strong {
  color: #1f2937;
  font-style: normal;
  font-weight: 600;
}

.inline-note-body a {
  color: #1f4f7a;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.12em;
}

.inline-note-body p:last-child {
  margin-bottom: 0;
}

/* ---------- results table ---------- */

.page__content table {
  margin: 0.4rem auto 0.3rem;
  border-collapse: collapse;
  font-family: "Avenir Next", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.74rem;
  line-height: 1.3;
  color: #1f2937;
}

.page__content th,
.page__content td {
  padding: 0.3rem 0.6rem;
  text-align: center;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  white-space: nowrap;
}

.page__content th {
  font-weight: 600;
  color: #0f172a;
  border-bottom: 1px solid rgba(15, 23, 42, 0.35);
}

.page__content th.group {
  font-weight: 500;
  color: #475569;
  border-bottom: 0;
  padding-bottom: 0;
}

.page__content td:first-child,
.page__content th:first-child {
  text-align: left;
}

.page__content td.best {
  font-weight: 700;
  color: #0b7fd1;
}

.page__content tr.sep td {
  border-top: 1px solid rgba(15, 23, 42, 0.25);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

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

.page__content pre {
  margin: 0 0 0.72rem;
  padding: 0.7rem 0.9rem;
  overflow-x: auto;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 6px;
  background: #f8fafc;
  font-family: Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.68rem;
  line-height: 1.45;
  color: #1f2937;
}

.page__content code {
  font-family: Menlo, Consolas, "Liberation Mono", monospace;
}

.bibtex {
  position: relative;
}

.bibtex .copy-btn {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  padding: 0.15rem 0.55rem;
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 999px;
  background: #ffffff;
  color: #475569;
  font-family: "Avenir Next", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.66rem;
  line-height: 1.4;
  cursor: pointer;
}

.bibtex .copy-btn:hover {
  border-color: rgba(15, 23, 42, 0.45);
  color: #0f172a;
}

/* ---------- math sizing ---------- */

mjx-container:not([display="true"]) {
  font-size: 90% !important;
}

mjx-container[display="true"] {
  font-size: 94% !important;
  margin: 0.2em 0 !important;
}

/* ---------- small screens ---------- */

@media (max-width: 50em) {
  .page {
    padding-inline: 1rem;
  }

  .page__title {
    margin-top: 2.8rem;
    font-size: 1.45rem;
  }

  .home-heading {
    padding-left: 1rem;
  }

  .page__content {
    font-size: 0.84rem;
  }

  .page__content .lead-italic {
    font-size: 0.9rem;
  }

  /* figures take the full column on small screens */
  .page__content img.feature-figure {
    width: 100% !important;
  }
}

/* ---------- results table: group rows and a short caption ---------- */

.page__content table.results tr.group-row td {
  padding: 0.55rem 0.6rem 0.25rem;
  text-align: left;
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #64748b;
  border-bottom: 1px solid rgba(15, 23, 42, 0.12);
}

.page__content p.table-caption {
  max-width: 640px;
  margin-top: 0.5rem;
}

/* keep a figure that follows a caption clear of it */
.page__content p.figure-caption + a.figure-link {
  margin-top: 1.5rem;
}

/* ---------- BibTeX, styled like a highlighted code block ---------- */

.page__content h3.bibtex-title {
  margin: 1.6rem 0 0.45rem;
  font-family: -apple-system, BlinkMacSystemFont, Roboto, "Segoe UI", "Helvetica Neue", "Lucida Grande", Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #262626;
}

.page__content .bibtex pre {
  margin: 0 0 0.6rem;
  padding: 0.6rem 0.75rem;
  border: 0;
  border-radius: 4px;
  background: #263238;
  color: #eeffff;
  font-family: Monaco, Consolas, "Lucida Console", monospace;
  font-size: 0.63rem;
  line-height: 1.8;
  overflow-x: auto;
}

.page__content .bibtex code {
  font-family: inherit;
  color: inherit;
}

.bibtex .nc { color: #ffcb6b; }
.bibtex .na { color: #82aaff; }
.bibtex .s  { color: #c3e88d; }
.bibtex .nl,
.bibtex .p  { color: #eeffff; }

.bibtex .copy-btn {
  top: 0.4rem;
  right: 0.4rem;
  border: 1px solid rgba(238, 255, 255, 0.25);
  background: rgba(38, 50, 56, 0.9);
  color: #b0bec5;
  opacity: 0;
  transition: opacity 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.bibtex:hover .copy-btn,
.bibtex .copy-btn:focus-visible {
  opacity: 1;
}

.bibtex .copy-btn:hover {
  color: #eeffff;
  border-color: rgba(238, 255, 255, 0.55);
}

@media (hover: none) {
  .bibtex .copy-btn { opacity: 1; }
}

/* ---------- results table, booktabs style (overrides the generic table rules) ---------- */

.page__content table.results {
  margin: 0.7rem auto 0.35rem;
  border-collapse: collapse;
  border-top: 1.6px solid #0f172a;
  border-bottom: 1.6px solid #0f172a;
  font-family: "IBM Plex Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums lining-nums;
  line-height: 1.3;
  color: #1f2937;
}

.page__content table.results th,
.page__content table.results td {
  padding: 0.36rem 0.8rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.07);
  text-align: center;
  white-space: nowrap;
}

.page__content table.results thead tr.h1 th {
  padding-top: 0.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 0;
  font-weight: 600;
  color: #0f172a;
}

/* short rules under each column group, with gaps between groups */
.page__content table.results thead tr.h1 th[colspan] {
  background: linear-gradient(#94a3b8, #94a3b8) bottom center / calc(100% - 1.1rem) 1px no-repeat;
}

.page__content table.results thead tr.h2 th {
  padding-top: 0.3rem;
  font-weight: 500;
  color: #475569;
  border-bottom: 1px solid #0f172a;
}

.page__content table.results th.rep {
  vertical-align: bottom;
  text-align: left;
  font-weight: 600;
  color: #0f172a;
  border-bottom: 1px solid #0f172a;
}

.page__content table.results td.rep {
  text-align: left;
  font-weight: 500;
  color: #1f2937;
}

.page__content table.results th.sw,
.page__content table.results td.sw {
  background-color: #eef5ff;
}

.page__content table.results thead tr.h2 th.sw {
  color: #1d5fb4;
  font-weight: 600;
}

.page__content table.results td.sw .v {
  font-weight: 600;
  color: #1d5fb4;
}

.page__content table.results td.sw .d {
  display: inline-block;
  min-width: 2.6em;
  margin-left: 0.45em;
  font-size: 0.8em;
  font-weight: 500;
  color: #15803d;
  text-align: right;
}

.page__content table.results tr.group-row td {
  padding: 0.5rem 0.8rem 0.3rem;
  background: #f8fafc;
  text-align: left;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
}

.page__content table.results tbody tr:last-child td {
  border-bottom: 0;
}

@media (max-width: 50em) {
  .page__content table.results { font-size: 0.68rem; }
  .page__content table.results th,
  .page__content table.results td { padding: 0.32rem 0.5rem; }
}
