/* Project page styles (loaded after bulma.min.css).
   Colors are variables so dark mode only swaps the values below.
   The theme is shared with the homepage: same localStorage key ('theme')
   and the same data-theme="dark" attribute on <html>. */

:root {
  /* Accent colors: the only block that differs between project pages. */
  --main: #2f4bbf;
  --main-soft: #f1f4fd;
  --main-border: #cfd8f5;
  --warm: #b8323a;

  --bg: #ffffff;
  --bg-alt: #f4f5f7;
  --card: #ffffff;
  --card-border: #e1e6ea;
  --heading: #1f252b;
  --text: #333a42;
  --text-soft: #5d6672;
  --venue: #ff0066;
  --shadow: 0 6px 18px rgba(36, 55, 87, 0.10);
}

html[data-theme="dark"] {
  --main: #8ea6ff;
  --main-soft: #1a2038;
  --main-border: #313c66;
  --warm: #ff8f8f;

  --bg: #1c1d1f;
  --bg-alt: #242629;
  --card: #1f2125;
  --card-border: #33373e;
  --heading: #f0f2f5;
  --text: #d6d9de;
  --text-soft: #a9afb8;
  --shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
}

/* ── Base (override Bulma's fixed colors) ── */
html,
body,
.hero,
.section,
.footer {
  background: var(--bg);
}

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

.content,
.footer .content {
  color: var(--text);
}

strong {
  color: inherit;
}

.title,
.content h1,
.content h2,
.content h3,
.content h4 {
  color: var(--heading);
}

a {
  color: var(--main);
}
a:hover {
  color: var(--warm);
}

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

.section.is-alt {
  background: var(--bg-alt);
}

/* ── Top controls ── */
.top-btn {
  position: fixed;
  z-index: 20;
  top: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  background: var(--card);
  color: var(--text-soft);
  font-size: 1rem;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(36, 55, 87, 0.12);
  cursor: pointer;
  transition: border-color 150ms ease, transform 150ms ease;
}
.top-btn:hover {
  border-color: var(--main);
  color: var(--main);
  transform: translateY(-1px);
}
.top-btn:focus-visible {
  outline: 3px solid var(--main-border);
  outline-offset: 3px;
}
.home-link { left: 1rem; }
.theme-toggle { right: 1rem; }

/* ── Hero ── */
.hero .hero-body {
  padding-top: 4rem;
  padding-bottom: 1.5rem;
}

.publication-title,
.publication-authors {
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
}

.publication-title {
  line-height: 1.2;
}

.publication-authors {
  color: var(--text);
}

.publication-authors.venue-line {
  margin-bottom: 1rem;
  color: var(--venue);
  font-weight: 700;
}

.publication-authors a {
  color: hsl(204, 86%, 53%) !important;
}
.publication-authors a:hover {
  text-decoration: underline;
}

.author-block {
  display: inline-block;
}

.author-note {
  color: var(--text-soft);
}

.link-block a {
  margin-top: 5px;
  margin-bottom: 5px;
}

html[data-theme="dark"] .button.is-dark {
  background: #e8eaed;
  color: #1c1d1f;
}

/* ── Figures ── */
.fig {
  margin: 0 auto;
  text-align: center;
}

.fig img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 8px;
}

.fig.is-narrow img { width: 70%; }
.fig.is-mid img { width: 85%; }

.fig figcaption {
  margin-top: 0.8rem;
  color: var(--text-soft);
  font-size: 0.92rem;
  font-style: italic;
  line-height: 1.5;
}

.fig + .fig,
.table-wrap + .fig,
.fig + .table-wrap {
  margin-top: 2rem;
}

/* Paper figures are drawn for white paper: keep them on a white tile. */
html[data-theme="dark"] .fig img {
  box-sizing: border-box;
  padding: 0.4rem;
  background: #fff;
}

.teaser-section {
  padding-top: 0.5rem;
}

/* ── TL;DR / abstract ── */
.narrow {
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

.tldr-card,
.abstract-card {
  padding: 1.4rem 1.7rem;
  border-left: 5px solid var(--main);
  border-radius: 6px;
  background: var(--card);
  text-align: left;
}

.tldr-card {
  color: var(--heading);
  font-size: 1.14rem;
  font-weight: 600;
  line-height: 1.6;
}

.abstract-card {
  color: var(--text-soft);
  font-size: 1.02rem;
  line-height: 1.7;
}

.abstract-card p + p {
  margin-top: 0.9rem;
}

.pill {
  padding: 0.08em 0.4em;
  border-radius: 4px;
  background: var(--main);
  color: var(--bg);
  white-space: nowrap;
}

.hl-main { color: var(--main); }
.hl-warm { color: var(--warm); }

.block-title {
  margin: 2.2rem 0 1rem;
  text-align: center;
}

/* ── Headline numbers ── */
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.4rem;
}

.stat {
  padding: 1rem 1.1rem;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: var(--card);
  text-align: center;
}

.stat-value {
  display: block;
  color: var(--main);
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.2;
}

.stat-label {
  display: block;
  margin-top: 0.3rem;
  color: var(--text-soft);
  font-size: 0.9rem;
  line-height: 1.4;
}

/* ── Section headers ── */
.sec-header {
  margin-bottom: 1.6rem;
}

.sec-header.is-sub {
  margin-top: 2.6rem;
}

.badge {
  display: inline-block;
  margin-bottom: 0.6rem;
  padding: 0.28rem 0.8rem;
  border-radius: 3px;
  background: var(--main);
  color: var(--bg);
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.sec-title {
  margin-bottom: 0.45rem;
  color: var(--heading);
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.18;
}

.sec-subtitle {
  color: var(--text-soft);
  font-size: 1.08rem;
  line-height: 1.55;
}

.sub-heading {
  margin: 2rem 0 1rem;
  color: var(--heading);
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.25;
}

/* ── Callout ── */
.callout {
  margin-bottom: 1.6rem;
  padding: 1.3rem 1.6rem;
  border: 1px solid var(--main-border);
  border-radius: 6px;
  background: var(--main-soft);
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.7;
}

.callout.is-after {
  margin-top: 1.6rem;
  margin-bottom: 0;
}

.formula {
  margin-top: 0.7rem;
  font-family: 'Castoro', Georgia, 'Times New Roman', serif;
  font-size: 1.2rem;
  text-align: center;
}

/* ── Cards ── */
.card-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1.6rem;
}

.card-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  position: relative;
  min-width: 0;
  padding: 1rem 1.1rem;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: var(--card);
  box-shadow: none;
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.card h3 {
  margin-bottom: 0.45rem;
  color: var(--heading);
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}

.card p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.55;
}

.card .card-tag {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--text-soft);
  font-size: 0.82rem;
  font-style: italic;
}

.card.is-ours {
  border: 2px solid var(--main-border);
  background: var(--main-soft);
}

.card.is-ours h3 {
  color: var(--main);
}

.card.is-ours p {
  color: var(--text);
}

@media (hover: hover) and (pointer: fine) {
  .card:hover {
    z-index: 1;
    border-color: var(--main-border);
    background: var(--main-soft);
    transform: scale(1.025);
  }
}

/* ── Numbered method steps ── */
.step-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: var(--main);
  color: var(--bg);
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
}

.step-title {
  color: var(--main);
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.25;
}

/* ── Result tables ── */
.table-wrap {
  margin-top: 1.6rem;
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: var(--card);
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

table.results-table th,
table.results-table td {
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid var(--card-border);
  color: var(--text);
  text-align: center;
  vertical-align: middle;
}

table.results-table thead th {
  color: var(--heading);
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-weight: 700;
}

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

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

table.results-table .group-start {
  border-left: 1px solid var(--card-border);
}

.results-table .muted {
  color: var(--text-soft);
  font-size: 0.82rem;
}

table.results-table tr.is-ours td {
  background: var(--main-soft);
  color: var(--heading);
}

table.results-table tr.is-ours td:first-child {
  color: var(--main);
  font-weight: 700;
}

table.results-table tr.is-ref td {
  color: var(--text-soft);
}

.table-caption {
  margin-top: 0.8rem;
  color: var(--text-soft);
  font-size: 0.92rem;
  font-style: italic;
  line-height: 1.5;
  text-align: center;
}

/* ── BibTeX / footer ── */
#BibTeX pre {
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: var(--bg-alt);
  color: var(--text);
}

#BibTeX code {
  background: transparent;
  color: inherit;
}

.footer {
  padding: 2.5rem 1.5rem;
  color: var(--text-soft);
}

.footer .content {
  color: var(--text-soft);
  font-size: 0.9rem;
  text-align: center;
}

/* ── Phone layout ── */
@media screen and (max-width: 768px) {
  .hero .hero-body {
    padding-top: 4.2rem;
  }

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

  .sec-title {
    font-size: 1.55rem;
  }

  .card-grid.cols-2,
  .card-grid.cols-3,
  .card-grid.cols-4,
  .stat-row {
    grid-template-columns: 1fr;
  }

  .fig.is-narrow img,
  .fig.is-mid img {
    width: 100%;
  }

  .tldr-card,
  .abstract-card,
  .callout {
    padding: 1.1rem 1.2rem;
  }

  .tldr-card {
    font-size: 1.05rem;
  }
}
