/* Project page styles. Accent colours are taken from the slide deck (purple / teal). */
:root {
  --text: #1e293b;
  --text-body: #334155;
  --text-muted: #64748b;
  --accent: #6b4f96;
  --accent-hover: #563d7c;
  --accent-soft: #f3effa;
  --accent-line: #e4dcf0;
  --teal: #256f6b;
  --surface-alt: #f8fafc;
  --border: #e5e8ef;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgb(15 23 42 / 0.04);
  --shadow-md: 0 1px 2px rgb(15 23 42 / 0.04), 0 6px 18px -6px rgb(15 23 42 / 0.10);
  --shadow-lg: 0 2px 4px rgb(15 23 42 / 0.05), 0 14px 30px -10px rgb(15 23 42 / 0.16);
  --widget-w: 1080px;
  --nav-h: 52px;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
}

/* Arial scaled to Inter's metrics (same values next/font uses), so text keeps
   its line breaks while the web font loads and nothing jumps when it swaps in. */
@font-face {
  font-family: 'Inter Fallback';
  src: local('Arial'), local('Helvetica Neue'), local('Helvetica');
  ascent-override: 90.44%;
  descent-override: 22.52%;
  line-gap-override: 0%;
  size-adjust: 107.12%;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 12px); /* anchors land below the sticky nav */
}

body {
  font-family: 'Inter', 'Inter Fallback', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-body);
  background: #fff;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--accent-line); }

a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

/* Keyboard focus: a visible ring, never shown for mouse clicks */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
.button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: none;
}

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

/* Inline SVG icons */
.icon svg { display: block; width: 1.05em; height: 1.05em; }
.button.is-small .icon svg { width: 0.95em; height: 0.95em; }


/* ---------- Sticky navigation ---------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgb(255 255 255 / 0.82);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid rgb(226 232 240 / 0.8);
  transition: box-shadow 0.25s, background 0.25s;
}

.site-nav.is-scrolled {
  background: rgb(255 255 255 / 0.9);
  box-shadow: 0 6px 20px -12px rgb(15 23 42 / 0.25);
}

.site-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: 1152px;
  height: var(--nav-h);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.site-nav-brand {
  color: var(--text) !important;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.site-nav-links {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.site-nav-links::-webkit-scrollbar { display: none; }

.site-nav-links a {
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s;
}

.site-nav-links a:hover,
.site-nav-links a.is-active {
  color: var(--accent);
  background: var(--accent-soft);
}


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

.publication-hero {
  /* two faint washes in the slide colours, fading into the page */
  background:
    radial-gradient(60% 70% at 18% 0%, rgb(107 79 150 / 0.07), transparent 70%),
    radial-gradient(50% 60% at 85% 10%, rgb(43 127 123 / 0.06), transparent 70%);
}

.publication-hero .hero-body {
  padding: 4rem 1.5rem 2.2rem;
}

.publication-venue {
  display: inline-block;
  margin-bottom: 1.4rem;
  padding: 0.3em 0.95em;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.7);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.publication-title {
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  font-weight: 800 !important;
  font-size: clamp(1.8rem, 4vw, 2.75rem) !important;
  line-height: 1.16 !important;
  letter-spacing: -0.02em;
  color: var(--text) !important;
  text-wrap: balance;
}

.title.publication-title:not(:last-child) {
  margin-bottom: 1.5rem;
}

.publication-authors {
  font-size: 1.12rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.55rem;
}

.publication-authors a {
  color: var(--accent) !important;
  font-weight: 600;
}

.publication-authors a:hover {
  color: var(--accent-hover) !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.author-block {
  display: inline-block;
  margin: 0 0.15em;
}

.publication-authors sup,
.publication-affiliations sup {
  margin-left: 1px;
  color: var(--text-muted);
  font-weight: 500;
}

.publication-affiliations sup {
  margin-right: 2px;
}

.publication-affiliations {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

.affiliation-block {
  display: inline-block;
  margin: 0 0.6em;
}

.publication-links {
  margin-top: 1.7rem;
}

.link-block .button {
  margin: 5px 4px;
}

.button.is-dark {
  background: var(--text);
  border: 1px solid var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.button.is-dark:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-1px);
}

/* Not yet available: outlined, clearly inactive */
.button.is-soon,
.button.is-soon:hover {
  background: transparent;
  border: 1px dashed #b7bfcc;
  color: var(--text-muted);
  font-weight: 600;
  cursor: default;
  box-shadow: none;
}


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

.section {
  padding: 4.5rem 1.5rem;
}

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

.section-alt {
  background: var(--surface-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-eyebrow {
  margin-bottom: 0.45rem;
  text-align: center;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section-title {
  text-align: center;
  color: var(--text) !important;
  font-weight: 800 !important;
  letter-spacing: -0.015em;
  margin-bottom: 1.4rem !important;
}

.section-lead {
  max-width: 740px;
  margin: 0 auto 3rem;
  color: var(--text-muted);
  text-align: center;
  font-size: 1.06rem;
  line-height: 1.75;
  text-wrap: pretty;
}


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

.anim-figure {
  max-width: var(--widget-w);
  margin: 0 auto 4rem;
}

.anim-figure:last-child {
  margin-bottom: 0;
}

.anim-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.step-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
}

.anim-card {
  overflow: hidden;
  padding: 12px 16px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.3s;
}

.anim-card:hover {
  box-shadow: var(--shadow-lg);
}

.anim-card .ppt-controls {
  padding-top: 8px;
}

/* Before pptanim.js mounts a player, hold its final size (crop ratio plus the
   36px controls bar) so the page does not jump down when the slide appears. */
.ppt-anim:empty::before {
  content: "";
  display: block;
  aspect-ratio: var(--ar, 16 / 9);
}

.ppt-anim:empty:not([data-controls="false"])::after {
  content: "";
  display: block;
  height: 36px;
}

.anim-figure figcaption {
  max-width: 760px;
  margin: 1.1rem auto 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
  text-wrap: pretty;
}

.anim-figure figcaption .hint,
.pair-caption .hint {
  display: block;
  margin-top: 0.35rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-style: italic;
}

.pair-row {
  max-width: var(--widget-w);
  margin: 0 auto !important;
}

.pair-row .anim-figure {
  margin-bottom: 0;
}

.pair-caption {
  max-width: var(--widget-w);
  margin: 0.5rem auto 4rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}


/* ---------- In a nutshell ---------- */

.nutshell {
  max-width: 740px;
  margin: 0 auto;
  font-size: 1.06rem;
  line-height: 1.8;
}

.nutshell .highlights {
  list-style: none;
  margin: 1.6rem 0 0 !important;
  padding: 0;
}

.nutshell .highlights li {
  position: relative;
  margin: 0 0 0.85rem;
  padding-left: 1.6rem;
}

.nutshell .highlights li::before {
  content: "";
  position: absolute;
  left: 0.25rem;
  top: 0.66em;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.nutshell strong {
  color: var(--text);
}


/* ---------- Accordions (abstract, table) ---------- */

.accordion {
  max-width: 740px;
  margin: 2rem auto 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.accordion summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.2rem;
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
  list-style: none;
  border-radius: var(--radius);
  transition: background 0.2s;
}

.accordion summary:hover { background: #fcfbfe; }
.accordion summary::-webkit-details-marker { display: none; }

.accordion summary .chevron {
  flex: none;
  width: 1.2rem;
  height: 1.2rem;
  transition: transform 0.25s;
}

.accordion[open] summary .chevron {
  transform: rotate(180deg);
}

.accordion-body {
  padding: 0.2rem 1.2rem 1.3rem;
  line-height: 1.75;
  text-wrap: pretty;
}


/* ---------- Results ---------- */

/* One card, four figures, hairline dividers. */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: 900px;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-md);
}

.stat {
  padding: 1.6rem 1.1rem 1.4rem;
  text-align: center;
}

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

.stat-value {
  color: var(--accent);
  font-size: 2.15rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  margin-top: 0.55rem;
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.table-intro {
  margin-bottom: 1rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  text-align: left;
}

.results-table-wrap {
  overflow-x: auto;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  border-top: 1.5px solid #334155;
  border-bottom: 1.5px solid #334155;
  color: var(--text-body);
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

table.results-table th,
table.results-table td {
  padding: 0.45em 0.8em;
  border: 0;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

table.results-table .col-left {
  text-align: left;
}

.results-table thead th {
  border-bottom: 1px solid #334155;
  color: var(--text);
  font-weight: 600;
}

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

.results-table tr.group-start th,
.results-table tr.group-start td {
  border-top: 1px solid #dde2ea;
}

.results-table tr.overall td {
  font-weight: 600;
}

.results-table .is-hl,
.results-table tr.overall td.is-hl {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}


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

.section-cite {
  border-top: 1px solid var(--border);
}

.bibtex-block {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
}

/* The copy button only overlaps the short first line, so no right-hand gutter is needed. */
.bibtex-block pre {
  margin: 0;
  padding: 1.3rem 1.5rem;
  overflow-x: auto;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  background: #faf8fd;
  color: #475569;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.75;
  white-space: pre;
}

.bibtex-block code {
  background: none;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  padding: 0;
}

.bib-type  { color: var(--accent); font-weight: 500; }
.bib-key   { color: var(--text); }
.bib-field { color: var(--teal); }

.copy-bibtex.button {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  z-index: 2;
  border: 1px solid var(--accent-line);
  background: rgb(255 255 255 / 0.85);
  color: var(--text-muted);
  font-weight: 500;
  box-shadow: none;
}

.copy-bibtex.button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.copy-bibtex.button.is-success { border-color: #86c5a4; color: #2f7d57; background: #f1faf5; }
.copy-bibtex.button.is-danger  { border-color: #e7a3a3; color: #a33b3b; background: #fdf3f3; }


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

.site-footer {
  padding: 1.6rem 1.5rem 2.2rem;
  text-align: center;
  font-size: 0.85rem;
}

.site-footer a {
  color: var(--text-muted);
}

.site-footer a:hover {
  color: var(--accent);
}


/* ---------- Tablet / phone ---------- */

@media screen and (max-width: 1023px) {
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--border); }
}

@media screen and (max-width: 768px) {
  .pair-row .column + .column { margin-top: 1.5rem; }
  html { font-size: 14px; }
  :root { --nav-h: 46px; }
  .site-nav-inner { padding: 0 0.9rem; gap: 0.75rem; }
  .site-nav-brand { display: none; }
  .site-nav-links { margin: 0 auto; }
  .site-nav-links a { padding: 0.3rem 0.55rem; }
  .section { padding: 2.75rem 0.9rem; }
  .publication-hero .hero-body { padding: 2.5rem 0.9rem 1.2rem; }
  .publication-authors { font-size: 1.02rem; }
  .publication-affiliations { font-size: 0.85rem; line-height: 1.55; }
  .section-title { font-size: 1.6rem !important; }
  .section-lead { text-align: left; font-size: 0.98rem; margin-bottom: 2rem; }
  .nutshell { font-size: 0.98rem; line-height: 1.7; }
  .anim-figure { margin-bottom: 2.75rem; }
  .anim-title { font-size: 1.05rem; }
  .anim-figure figcaption { font-size: 0.88rem; text-align: left; }
  /* Wide slides keep a legible size on phones and scroll sideways instead. */
  .anim-card.anim-wide { overflow-x: auto; padding: 8px; }
  .anim-card.anim-wide .ppt-anim { min-width: 620px; }
  .stat { padding: 1.2rem 0.8rem; }
  .stat-value { font-size: 1.75rem; }
  .bibtex-block pre { padding: 1rem 1rem; }
}
