/* DD-CAM project page. Colours follow the conference poster. */
:root {
  --blue: #0064B1;        /* poster header band */
  --blue-deep: #004B8D;   /* poster emphasis text */
  --blue-tint: #DCEBF7;   /* poster highlight fill */
  --panel: #F2F6FA;       /* poster panel background */
  --orange: #F58025;      /* poster accent stripe */
  --ink: #1B2733;
  --ink-2: #4A5A68;
  --ink-3: #66727E;
  --line: #D5DEE6;
  --surface: #FFFFFF;
  --bar-neutral: #84909D;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgb(16 42 67 / 0.06);
  --shadow-md: 0 4px 12px rgb(16 42 67 / 0.12);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  line-height: 1.6;
  font-size: 16px;
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--blue);
}

a:hover {
  color: var(--blue-deep);
}

strong {
  color: inherit;
  font-weight: 700;
}

var {
  font-style: italic;
  font-family: Georgia, 'Times New Roman', serif;
}

abbr[title] {
  text-decoration: none;
  cursor: help;
}

:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 1000;
  background: var(--surface);
  color: var(--blue-deep);
  font-weight: 600;
  padding: 0.6rem 1rem;
  border-radius: 0 0 8px 8px;
  box-shadow: var(--shadow-md);
}

.skip-link:focus {
  top: 0;
}


/* ---------- Hero ---------- */
.page-hero {
  background: var(--blue);
  color: #fff;
  border-bottom: 6px solid var(--orange);
  padding: 3.5rem 1.5rem 3rem;
  text-align: center;
}

.venue-chip {
  display: inline-block;
  background: #fff;
  color: var(--blue-deep);
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  padding: 0.3rem 0.95rem;
  border-radius: 999px;
  margin-bottom: 1.25rem;
}

.publication-title {
  color: #fff;
  font-weight: 800;
  font-size: clamp(1.7rem, 1rem + 2.4vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin-bottom: 1.5rem;
}

.title-break {
  display: none;
}

.publication-authors {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.publication-affiliations {
  font-size: 0.975rem;
  color: rgb(255 255 255 / 0.9);
}

.author-block {
  display: inline-block;
  margin: 0 0.3rem;
}

.page-hero a:not(.btn) {
  color: #fff;
  text-decoration: underline;
  text-decoration-color: rgb(255 255 255 / 0.5);
  text-underline-offset: 3px;
}

.page-hero a:not(.btn):hover {
  text-decoration-color: #fff;
}

.page-hero :focus-visible {
  outline-color: #fff;
}

.publication-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 1.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  border: 2px solid #fff;
  background: #fff;
  color: var(--blue-deep);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.btn:hover {
  background: var(--blue-tint);
  border-color: var(--blue-tint);
  color: var(--blue-deep);
  transform: translateY(-1px);
}

.btn.is-ghost {
  background: transparent;
  border-color: rgb(255 255 255 / 0.55);
  color: #fff;
}

.btn.is-ghost:hover {
  background: rgb(255 255 255 / 0.14);
  border-color: #fff;
  color: #fff;
}


/* ---------- Sections ---------- */
.section {
  padding: 3.5rem 1.5rem;
}

.section[id] {
  scroll-margin-top: 1rem;
}

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

.title.is-3 {
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.section-title {
  text-align: center;
  position: relative;
  padding-bottom: 0.9rem;
  margin-bottom: 2rem !important;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 56px;
  height: 4px;
  background: var(--orange);
  border-radius: 2px;
}

.lead {
  max-width: 44rem;
  margin: 0 auto 1.75rem;
  text-align: center;
  text-wrap: balance;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--blue-deep);
}

h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 0.35rem;
}

.bullets {
  list-style: none;
  margin: 0;
  padding: 0;
}

.bullets li {
  position: relative;
  padding-left: 1.1rem;
  margin-top: 0.4rem;
}

.bullets li::before {
  content: '';
  position: absolute;
  left: 0.1rem;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orange);
}


/* ---------- Figures ---------- */
.figure-card {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 0;
}

.figure-card img {
  display: block;
  width: 100%;
  height: auto;
}

.figure-card a.zoom {
  display: block;
  cursor: zoom-in;
}

.figure-card figcaption {
  margin-top: 1rem;
  text-align: center;
  text-wrap: balance;
  font-style: italic;
  font-weight: 600;
  color: var(--blue);
}

.figure-card figcaption var {
  font-weight: 400;
}

/* photographic strips sit on white rather than the panel tint */
.figure-card.is-plain {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 1rem;
  margin-top: 2rem;
}

.strip-scroll {
  overflow-x: auto;
}

.strip-scroll a.zoom + a.zoom {
  margin-top: 0.25rem;
}

/* JS adds .is-overflowing to a scroll container only when its content is wider than it */
.scroll-hint {
  display: none;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: var(--ink-3);
  text-align: right;
}

.is-overflowing + .scroll-hint {
  display: block;
}

.zoom-hint {
  display: none;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: var(--ink-3);
  text-align: center;
}

.nw {
  white-space: nowrap;
}


/* ---------- Motivation ---------- */
.idea-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
  margin: 2rem 0;
}

.callout {
  background: var(--blue-tint);
  border-radius: var(--radius);
  padding: 1.1rem 1.4rem;
  font-size: 1.1rem;
  color: var(--ink);
}

.callout strong {
  color: var(--blue-deep);
}


/* ---------- Tables ---------- */
.table-scroll {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.data-table caption {
  caption-side: top;
  text-align: left;
  padding: 0.85rem 1rem 0.2rem;
  font-size: 0.875rem;
  color: var(--ink-2);
}

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

.data-table thead th {
  font-weight: 700;
  color: var(--ink);
  border-bottom: 2px solid var(--ink-2);
  white-space: nowrap;
}

.data-table tbody th {
  font-weight: 700;
  white-space: nowrap;
}

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

.related-table {
  min-width: 760px;
}

.related-table th:nth-child(3),
.related-table td:nth-child(3) {
  min-width: 15rem;
}

.related-table td:nth-child(4) {
  min-width: 14rem;
}

.related-table tr.is-ours th,
.related-table tr.is-ours td {
  background: var(--blue-tint);
  color: var(--blue-deep);
  font-weight: 700;
}

.faith-table {
  min-width: 820px;
}

.faith-table th,
.faith-table td {
  padding-left: 0.7rem;
  padding-right: 0.7rem;
}

.faith-table td {
  white-space: nowrap;
}

.faith-table td.is-ahead {
  background: var(--blue-tint);
}

.faith-table .score {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.faith-table td.is-ahead .score {
  color: var(--blue-deep);
}

.faith-table .baseline {
  display: block;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}

.faith-table .dir {
  font-weight: 400;
}

.table-note {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--ink-2);
}

.table-note .swatch {
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  margin-right: 0.4em;
  vertical-align: -0.08em;
  border-radius: 2px;
  background: var(--blue-tint);
  border: 1px solid #B9D3EA;
}


/* ---------- Approach ---------- */
.split {
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 1.75rem;
  align-items: center;
  margin-top: 2rem;
}

.split .figure-card {
  padding: 1rem;
}

.split-text h3 {
  font-size: 1.2rem;
}

.split-text p + h3 {
  margin-top: 1.5rem;
}


/* ---------- Experimental setup ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.info-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
}


/* ---------- Ranked bar charts (Localization) ---------- */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.chart-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem 1rem;
}

.barchart {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.barchart caption {
  caption-side: top;
  text-align: left;
  padding-bottom: 0.7rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}

.barchart tbody th {
  width: 1%;
  padding: 0 0.6rem 0 0.35rem;
  text-align: right;
  font-weight: 500;
  white-space: nowrap;
  color: var(--ink-2);
  vertical-align: middle;
  border-radius: 4px 0 0 4px;
}

/* the cell is the track: bar grows from the left baseline, value sits at its tip */
.barchart tbody td {
  padding: 4px 0.35rem 4px 0;
  vertical-align: middle;
  line-height: 1;
  white-space: nowrap;
  border-left: 1px solid var(--line);
  border-radius: 0 4px 4px 0;
}

.barchart .bar {
  display: inline-block;
  vertical-align: middle;
  height: 14px;
  width: calc(var(--v) / var(--max) * (100% - 3.6em));
  min-width: 2px;
  background: var(--bar-neutral);
  border-radius: 0 4px 4px 0;
}

.barchart .val {
  display: inline-block;
  vertical-align: middle;
  margin-left: 0.45em;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}

.barchart tr.is-ours .bar {
  background: var(--blue);
}

.barchart tr.is-ours th,
.barchart tr.is-ours .val {
  font-weight: 700;
  color: var(--ink);
}

.barchart tbody tr:hover th,
.barchart tbody tr:hover td {
  background: var(--panel);
}

.barchart tbody tr:hover th,
.barchart tbody tr:hover .val {
  color: var(--ink);
}


/* ---------- Stability ---------- */
.stat-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  max-width: 44rem;
  margin: 0 auto 1.5rem;
}

.stat {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  text-align: center;
}

.stat-value {
  font-size: 3.25rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--blue);
}

.stat-label {
  margin-top: 0.5rem;
  color: var(--ink-2);
}

.stability-text {
  max-width: 44rem;
  margin: 0 auto;
  text-align: center;
  text-wrap: balance;
  font-size: 1.05rem;
}


/* ---------- Takeaways ---------- */
.takeaways {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 0;
  padding: 0;
}

.takeaways li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 5px solid var(--orange);
  border-radius: 6px var(--radius) var(--radius) 6px;
  padding: 1rem 1.25rem;
}

.takeaways strong {
  display: block;
  color: var(--blue);
}


/* ---------- BibTeX ---------- */
.bibtex-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.bibtex-header .title {
  margin-bottom: 0;
}

pre {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  font-size: 0.875rem;
  overflow-x: auto;
}

code,
pre code {
  background: none;
  color: var(--ink);
  font-family: 'SF Mono', 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
}

.copy-bibtex-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.copy-bibtex-btn:hover {
  background: var(--blue-deep);
}

.copy-bibtex-btn.copied {
  background: #18794E;
}


/* ---------- Footer ---------- */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 2.5rem 1.5rem;
  font-size: 0.875rem;
  color: var(--ink-2);
  text-align: center;
}


/* ---------- Scroll to top ---------- */
.scroll-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 999;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  box-shadow: var(--shadow-md);
  transition: opacity 0.2s ease, visibility 0.2s ease, background-color 0.15s ease;
}

.scroll-to-top:hover {
  background: var(--blue-deep);
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
}


/* ---------- Responsive ---------- */
@media screen and (min-width: 1024px) {
  .title-break {
    display: inline;
  }
}

@media screen and (max-width: 900px) {
  .idea-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .split,
  .chart-grid {
    grid-template-columns: 1fr;
  }

  /* keep nine-panel comparison strips legible: scroll instead of shrinking */
  .strip-scroll a.zoom {
    width: 860px;
  }
}

@media screen and (max-width: 640px) {
  .page-hero {
    padding: 2.5rem 1.1rem 2.25rem;
  }

  .section {
    padding: 2.5rem 1.1rem;
  }

  .publication-authors {
    font-size: 1.05rem;
  }

  .lead {
    font-size: 1.1rem;
  }

  .figure-card,
  .split .figure-card {
    padding: 0.7rem;
  }

  .zoom-hint {
    display: block;
  }

  .card-grid,
  .takeaways,
  .stat-row {
    grid-template-columns: 1fr;
  }

  .stat-value {
    font-size: 2.75rem;
  }

  .chart-card {
    padding: 1rem 0.85rem 0.9rem;
  }

  .barchart {
    font-size: 0.75rem;
  }

  .barchart tbody th {
    padding-left: 0;
    padding-right: 0.45rem;
  }
}

/* phones: wrap the header buttons in even pairs instead of leaving one stranded */
@media screen and (max-width: 480px) {
  .publication-links {
    max-width: 17rem;
    margin-left: auto;
    margin-right: auto;
  }
}

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

  .btn,
  .scroll-to-top,
  .copy-bibtex-btn {
    transition: none;
  }
}

@media print {
  .scroll-to-top,
  .skip-link,
  .publication-links,
  .scroll-hint {
    display: none;
  }

  .page-hero {
    background: none;
    color: var(--ink);
    border-bottom: 2px solid var(--ink);
  }

  .publication-title {
    color: var(--ink);
  }

  .publication-affiliations {
    color: var(--ink-2);
  }
}
