/* ==========================================================================
   Cooperative Learning of Shared Latent Dynamics: project page
   site.css: tokens, base, layout and the page's own elements, after the
   Nerfies project-page template (https://nerfies.github.io/), without Bulma.
   The interactive components style themselves in webots-sim.css (.ws-*)
   and charts.css (.ch-*) with the tokens below.
   ========================================================================== */

:root {
  color-scheme: light;

  /* type */
  --font-display: "Computer Modern Serif", "CMU Serif", "Latin Modern Roman", Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Computer Modern Serif", "CMU Serif", "Latin Modern Roman", Georgia, serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  /* page palette (Nerfies / Bulma greys) */
  --bg: #ffffff;
  --bg-raise: #ffffff;
  --bg-sunken: #f5f5f5;       /* the light band, code boxes */
  --bg-footer: #fafafa;
  --ink: #363636;             /* headings, buttons */
  --ink-soft: #4a4a4a;        /* body text */
  --ink-faint: #6b6b6b;       /* captions (5.3:1 on white, 4.9:1 on the band) */
  --line: #dbdbdb;
  --line-soft: #ededed;
  --line-strong: #b5b5b5;
  /* the reference's author-link hue, hsl(204 86% 53%), darkened to 40% lightness
     so that it passes WCAG AA as text (4.7:1 on white) */
  --link: hsl(204, 86%, 40%);
  --accent: #363636;          /* the dark pills */
  --accent-soft: #f5f5f5;
  --accent-ink: #ffffff;

  /* data colors (Okabe-Ito, as in the paper's figures) */
  --c-coop: #0072b2;          /* together */
  --c-local: #d55e00;         /* alone */
  --c-exact: #56b4e9;
  --c-pers: #6e6e6e;
  --c-cent: #009e73;
  --c-oracle: #363636;
  --c-pooled: #cc79a7;
  --c-recon: #e69f00;
  --c-frozen: #882255;         /* frozen boosts (recommendation section) */
  --c-xstar: #e0a100;         /* the best position x*(t), gold beam */

  /* the six stations / UAVs (same as the Webots scene) */
  --st-1: #e63333;
  --st-2: #338cf2;
  --st-3: #33bf4d;
  --st-4: #f2a61a;
  --st-5: #b34dd9;
  --st-6: #1abfcc;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 0.5em 1em -0.125em rgba(10, 10, 10, 0.1), 0 0 0 1px rgba(10, 10, 10, 0.02);
  --pill: 290486px;

  /* layout: content widths (the side padding comes on top) */
  --gutter: 1.5rem;
  --w-desktop: 960px;
  --w-wide: 1240px;
}

/* ==========================================================================
   Base
   ========================================================================== */

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

html {
  background: var(--bg);
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-width: 300px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-soft);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.125;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--link);
  text-decoration: none;
  cursor: pointer;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

img,
video,
svg {
  max-width: 100%;
}

img,
video {
  height: auto;
}

strong,
b {
  font-weight: 600;
}

ul,
ol {
  margin: 0 0 1em;
  padding-left: 1.25em;
}

code,
kbd,
samp,
pre {
  font-family: var(--font-mono);
}

:not(pre) > code {
  font-size: 0.875em;
  color: var(--ink);
  background: var(--bg-sunken);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

button {
  font: inherit;
}

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

/* sections focused by the in-page links (site.js) get no ring */
section[tabindex="-1"]:focus,
header[tabindex="-1"]:focus {
  outline: none;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.has-text-centered {
  text-align: center;
}

.has-text-justified {
  text-align: justify;
}

/* KaTeX: its default 1.21em is large next to the sans text. */
.katex {
  font-size: 1.1em;
  text-rendering: auto;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.container {
  width: 100%;
  max-width: calc(var(--w-wide) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.container.is-max-desktop {
  max-width: calc(var(--w-desktop) + 2 * var(--gutter));
}

.container.is-wide {
  max-width: calc(var(--w-wide) + 2 * var(--gutter));
}

.section {
  padding: 3rem 0;
}

/* the abstract column: four fifths of the desktop width, as in Nerfies */
.column-narrow {
  margin: 0 auto;
}

@media (min-width: 769px) {
  .column-narrow {
    width: 100%;
  }
}

/* ==========================================================================
   Top bar
   ========================================================================== */

.topbar {
  font-size: 0.9375rem;
}

.topbar .container {
  max-width: calc(var(--w-desktop) + 2 * var(--gutter));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.25rem;
}

.topbar a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--ink-soft);
}

.topbar a:hover {
  color: var(--ink);
}

.topbar .topbar-home {
  font-weight: 600;
  color: var(--ink);
}

/* ==========================================================================
   Hero: title, authors, links
   ========================================================================== */

.hero {
  padding: 1.75rem 0 3rem;
}

.publication-title {
  margin: 0 0 1.5rem;
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.125;
  color: var(--ink);
  text-wrap: balance;
}

.publication-authors {
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.7;
  color: var(--ink-soft);
}

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

.publication-authors a:hover {
  text-decoration: underline;
}

.publication-authors sup {
  font-size: 0.75em;
  line-height: 0;
  position: relative;
  top: -0.45em;
  vertical-align: baseline;
  margin-left: 0.04em;
}

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

.publication-affiliations .author-block + .author-block {
  margin-left: 0.3em;
}

.publication-venue {
  margin: 0.35rem 0 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.publication-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.625rem 0.375rem;
  margin-top: 1.25rem;
}

/* the dark pill buttons (Bulma .button.is-rounded.is-dark) */
.button-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  height: 2.5em;
  padding: 0 1.25em 0 1em;
  border: 1px solid transparent;
  border-radius: var(--pill);
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  white-space: nowrap;
  text-decoration: none;
  vertical-align: top;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease;
}

.button-pill:hover {
  background: #1f1f1f;
  color: var(--accent-ink);
  text-decoration: none;
}

.button-pill:active {
  background: #111;
}

.button-pill:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 1em;
  height: 1em;
  line-height: 1;
}

.icon svg {
  display: block;
  width: 1em;
  height: 1em;
  overflow: visible;
}

/* ==========================================================================
   Teaser sentence and the light band (video)
   ========================================================================== */

.teaser {
  padding: 0.25rem 0 3rem;
}

.subtitle {
  max-width: none;
  margin: 0 auto;
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1.4;
  color: var(--ink-soft);
  text-wrap: balance;
}

.band {
  background: var(--bg-sunken);
  padding: 2rem 0;
}

.figure {
  margin: 0;
  min-width: 0;
}

.figure figcaption {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--ink-faint);
}

.band .figure {
  background: var(--bg-raise);
  border-radius: var(--radius);
  padding: 0.75rem;
}

.band .figure figcaption {
  max-width: none;
  margin: 0.875rem auto 0.25rem;
  padding: 0 0.5rem;
  text-align: center;
  text-wrap: pretty;
}

@media (max-width: 600px) {
  .band .figure figcaption {
    text-align: left;
    padding: 0 0.25rem;
  }
}

.teaser-video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #000;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   Section titles and text
   ========================================================================== */

.title {
  margin: 0 0 1.5rem;
  font-size: 2rem;
  font-weight: 400;
  line-height: 1.125;
  color: var(--ink);
  text-wrap: balance;
}

.title + .lead {
  margin-top: -0.375rem;
}

.lead {
  max-width: none;
  margin: 0 0 1.5rem;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.subtitle-3 {
  margin: 3.25rem 0 0.75rem;
  font-size: 1.35rem;
  font-weight: 400;
  line-height: 1.25;
  color: var(--ink);
}

.title + .subtitle-3 {
  margin-top: 0.5rem;
}

.subtitle-3 + .lead {
  margin-bottom: 1.25rem;
}

.content p:last-child {
  margin-bottom: 0;
}

/* justified like the reference on wide screens; ragged-right on phones, where a
   justified 20-word line has wide gaps */
@media (max-width: 600px) {
  .content.has-text-justified {
    text-align: left;
  }
}

/* ==========================================================================
   Method: the diagram and the three steps
   ========================================================================== */

#method .figure {
  margin: 0.5rem 0 0;
}

#method .figure figcaption {
  text-align: center;
}

/* The three layers at one agent: HTML boxes, math by KaTeX. Wide screens: the input, the agent
   frame with its three boxes, the output, and under boxes 2 and 3 the links to the neighbors;
   the links have the frame's columns and padding, so they sit under the centers of the boxes. */
.pipe {
  --pipe-ink: var(--ink-soft);
  --pipe-top: 2.1rem;            /* frame padding above the boxes: the "agent i" label */
  --pipe-bot: 0.9rem;
  --pipe-x: 0.9rem;
  --pipe-cols: minmax(0, 1fr) 2rem minmax(0, 1fr) 2rem minmax(0, 1fr);
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr) 5.25rem;
  color: var(--ink-soft);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  line-height: 1.45;
  text-align: left;
}

.pipe p {
  margin: 0;
}

.pipe-agent {
  position: relative;
  display: grid;
  grid-template-columns: var(--pipe-cols);
  padding: var(--pipe-top) var(--pipe-x) var(--pipe-bot);
  background: var(--bg-footer);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.pipe-agent-name {
  position: absolute;
  top: 0.55rem;
  left: var(--pipe-x);
  color: var(--ink-faint);
  font-size: 0.8125rem;
}

.pipe-box {
  min-width: 0;
  padding: 0.75rem 0.9rem 0.85rem;
  background: #fff;
  border: 1.25px solid #c8c8c8;
  border-radius: var(--radius);
}

.pipe .pipe-h {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
}

.pipe .step-num {
  width: 1.45rem;
  height: 1.45rem;
  font-size: 0.75rem;
}

.pipe-coop,
.pipe-msg-in {
  color: var(--c-coop);
}

/* arrows: a line with a triangular head */
.pipe-arrow {
  position: relative;
  align-self: center;
  height: 1.5px;
  margin-right: 1px;
  background: var(--pipe-ink);
}

.pipe-arrow::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -1px;
  border-style: solid;
  border-width: 4.5px 0 4.5px 8px;
  border-color: transparent transparent transparent var(--pipe-ink);
  transform: translateY(-50%);
}

/* input and output: the label over an arrow at the height of the boxes' centers */
.pipe-in,
.pipe-out {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  padding: var(--pipe-top) 0 var(--pipe-bot);
}

.pipe-io {
  align-self: end;
  padding-bottom: 0.35rem;
  line-height: 1.35;
}

.pipe-in .pipe-arrow,
.pipe-out .pipe-arrow {
  grid-row: 2;
}

.pipe-in .pipe-arrow {
  margin-right: calc(-1 * var(--pipe-x) - 1px);    /* up to box 1, across the frame's padding */
}

.pipe-out .pipe-io {
  padding-left: 0.75rem;
}

.pipe-out .pipe-arrow {
  margin-left: calc(-1 * var(--pipe-x));           /* from box 3, across the frame's padding */
}

/* the links to the neighbors */
.pipe-net {
  grid-column: 2;
  display: grid;
  grid-template-columns: var(--pipe-cols);
  margin-top: calc(-1 * var(--pipe-bot) - 1px);    /* the links leave from the bottoms of the boxes */
  padding: 0 var(--pipe-x);
}

.pipe-link {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  min-height: 5.25rem;
}

.pipe-link.is-2 {
  grid-column: 3;
}

.pipe-link.is-3 {
  grid-column: 5;
}

.pipe-dash {
  position: relative;
  margin: 8px 0;
  border-left: 1.5px dashed var(--c-coop);
}

.pipe-dash::before,
.pipe-dash::after {
  content: "";
  position: absolute;
  left: -5.25px;
  border-style: solid;
}

.pipe-dash::before {
  top: -8px;
  border-width: 0 4.5px 8px;
  border-color: transparent transparent var(--c-coop);
}

.pipe-dash::after {
  bottom: -8px;
  border-width: 8px 4.5px 0;
  border-color: var(--c-coop) transparent transparent;
}

.pipe-link-t {
  position: absolute;
  top: 50%;
  left: calc(50% + 0.7rem);
  color: var(--c-coop);
  line-height: 1.35;
  white-space: nowrap;
  transform: translateY(-50%);
}

.pipe-link-t small {
  display: block;
  color: var(--ink-faint);
  font-size: 0.8125rem;
}

.pipe-nb {
  grid-column: 3 / 6;
  padding: 0.55rem 1rem;
  color: var(--c-coop);
  text-align: center;
  background: #eef6fb;
  border: 1.25px solid var(--c-coop);
  border-radius: var(--radius);
}

.pipe-msg-in {
  display: none;
}

/* below 900px the boxes would be too narrow side by side: one under the other, and the
   messages to the neighbors inside boxes 2 and 3 */
@media (max-width: 899px) {
  .pipe {
    grid-template-columns: minmax(0, 1fr);
    max-width: 26rem;
    margin: 0 auto;
  }

  .pipe-in,
  .pipe-out {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    text-align: center;
  }

  .pipe-out {
    flex-direction: column-reverse;
  }

  .pipe-io,
  .pipe-out .pipe-io {
    align-self: center;
    padding: 0;
  }

  .pipe-agent {
    grid-template-columns: minmax(0, 1fr);
    padding: 2rem 0.75rem 0.75rem;
  }

  .pipe-arrow,
  .pipe-in .pipe-arrow,
  .pipe-out .pipe-arrow {
    justify-self: center;
    width: 1.5px;
    height: 1.4rem;
    margin: 0;
  }

  .pipe-arrow::after {
    top: auto;
    right: auto;
    bottom: -1px;
    left: 50%;
    border-width: 8px 4.5px 0;
    border-color: var(--pipe-ink) transparent transparent;
    transform: translateX(-50%);
  }

  .pipe-net {
    display: none;
  }

  .pipe-msg-in {
    display: block;
    margin-top: 0.55rem;
    padding-top: 0.45rem;
    border-top: 1px solid var(--line-soft);
    font-size: 0.8125rem;
  }
}

.steps {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.step {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 1.25rem 1.25rem 0.5rem;
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.step h3 {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin: 0 0 0.75rem;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.step p {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.55;
}

.step .eq {
  margin: auto -1.25rem 0;
  padding: 0.875rem 1rem 0.75rem;
  border-top: 1px solid var(--line-soft);
  text-align: center;
  overflow-x: auto;
  overflow-y: hidden;
}

/* wide screens: one row per layer (number and name, one line of text, the equation), with the
   three columns lined up across the rows */
@media (min-width: 900px) {
  .step {
    display: grid;
    grid-template-columns: 12.5rem minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 1.5rem;
    padding: 0.75rem 1.25rem;
  }

  @supports (grid-template-columns: subgrid) {
    .steps {
      grid-template-columns: max-content minmax(0, 1fr) max-content;
    }

    .step {
      grid-column: 1 / -1;
      grid-template-columns: subgrid;
    }
  }

  .step h3,
  .step p {
    margin: 0;
  }

  /* the equation column is as wide as the widest equation: nothing to scroll */
  .step .eq {
    margin: 0;
    padding: 0.25rem 0;
    border-top: 0;
    text-align: right;
    overflow: visible;
    background: none;
  }
}

.eq .katex {
  font-size: 1.05em;
}

/* ==========================================================================
   Guarantees: theorem blocks
   ========================================================================== */

.result {
  margin: 0 0 1.25rem;
  padding: 1.25rem 1.5rem 0.5rem;
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.result:last-child {
  margin-bottom: 0;
}

.result h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem 0.75rem;
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}

.result-ref {
  display: inline-flex;
  align-items: center;
  height: 1.5rem;
  padding: 0 0.625rem;
  border-radius: var(--pill);
  background: var(--bg-sunken);
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.result p {
  margin: 0 0 0.75rem;
}

/* display math scrolls inside its own box instead of widening the page */
.eq-display {
  margin: 0.25rem 0 0.75rem;
  padding: 0.25rem 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

/* scroll shadows: an edge darkens only while content is hidden behind it
   (the white covers scroll with the content, the shadows stay with the box) */
.eq-display,
.step .eq {
  background:
    linear-gradient(to right, #fff 30%, rgba(255, 255, 255, 0)) left center / 2rem 100% no-repeat local,
    linear-gradient(to left, #fff 30%, rgba(255, 255, 255, 0)) right center / 2rem 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(10, 10, 10, 0.16), rgba(10, 10, 10, 0)) left center / 0.75rem 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(10, 10, 10, 0.16), rgba(10, 10, 10, 0)) right center / 0.75rem 100% no-repeat scroll;
}

.eq-display .katex-display {
  margin: 0;
  padding: 0.35rem 0;
}

.eq-display .katex-display > .katex {
  font-size: 1.1em;
}

@media (max-width: 600px) {
  .eq-display .katex-display > .katex {
    font-size: 1em;
  }

  .eq-display .katex-display {
    text-align: left;
  }
}

/* ==========================================================================
   Results: rows of three charts
   ========================================================================== */

.chart-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.75rem 1.25rem;
  margin: 0;
}

@media (min-width: 600px) {
  .chart-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .chart-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.chart-row .figure {
  display: flex;
  flex-direction: column;
}

.chart-row .figure figcaption {
  margin-top: 0.5rem;
  text-wrap: pretty;
}

.chart {
  width: 100%;
  min-width: 0;
}

/* placeholder until the chart script fills the mount, as tall as the drawn chart (charts.js: a
   32px legend line above a plot 74% of the width tall, clamped to 196-320px), so nothing moves */
.chart:empty {
  padding-top: calc(32px + clamp(196px, 74%, 320px));
  background: var(--bg-footer);
  border-radius: var(--radius);
}

/* the simulation's mount: never wider than its column */
#webots-sim {
  min-width: 0;
  max-width: 100%;
}

/* ==========================================================================
   Code and BibTeX
   ========================================================================== */

.code-block,
.bibtex pre {
  margin: 0;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  white-space: pre;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  tab-size: 2;
  /* scroll shadows on the grey box, as for the equations */
  background:
    linear-gradient(to right, #f5f5f5 30%, rgba(245, 245, 245, 0)) left center / 2rem 100% no-repeat local,
    linear-gradient(to left, #f5f5f5 30%, rgba(245, 245, 245, 0)) right center / 2rem 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(10, 10, 10, 0.12), rgba(10, 10, 10, 0)) left center / 0.75rem 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(10, 10, 10, 0.12), rgba(10, 10, 10, 0)) right center / 0.75rem 100% no-repeat scroll,
    var(--bg-sunken);
}

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

#code .code-block + p {
  margin: 1.5rem 0 0;
}

.bibtex {
  position: relative;
}

.copy-button {
  position: absolute;
  top: 0.625rem;
  right: 0.625rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5rem;
  height: 2.5rem;
  padding: 0 1rem;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--bg-raise);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.copy-button:hover {
  background: var(--bg-footer);
  border-color: var(--line-strong);
}

.copy-button.is-copied {
  border-color: var(--c-cent);
  color: #006b4f;
}

@media (max-width: 600px) {
  .copy-button {
    position: static;
    display: flex;
    margin: 0.625rem 0 0 auto;
  }

  .code-block,
  .bibtex pre {
    padding: 1rem 1.125rem;
    font-size: 0.8125rem;
  }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  background: var(--bg-footer);
  padding: 3rem 0 4.5rem;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

.footer p {
  margin: 0 0 0.5rem;
}

.footer p:last-child {
  margin-bottom: 0;
}

.footer-note {
  font-size: 0.875rem;
  color: var(--ink-faint);
}

/* ==========================================================================
   Small screens
   ========================================================================== */

@media (max-width: 768px) {
  .hero {
    padding-top: 1.25rem;
  }

  .publication-title {
    font-size: 1.8rem;
  }

  .section {
    padding: 2.5rem 0;
  }

  .title {
    font-size: 1.75rem;
    margin-bottom: 1.25rem;
  }

  .subtitle-3 {
    margin-top: 2.5rem;
  }

  .band {
    padding: 1.25rem 0;
  }

  .band .figure {
    padding: 0.5rem;
  }

  .result {
    padding: 1rem 1.125rem 0.375rem;
  }
}

@media (max-width: 400px) {
  :root {
    --gutter: 1.25rem;
  }

  .button-pill {
    padding: 0 1em 0 0.875em;
  }
}

/* ==========================================================================
   Motion and print
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .button-pill,
  .copy-button {
    transition: none;
  }
}

@media print {
  html,
  body {
    background: #fff;
    color: #000;
  }

  /* the interactive simulation has nothing to print */
  .topbar,
  .copy-button,
  #simulation {
    display: none !important;
  }

  .section,
  .band,
  .hero,
  .teaser {
    padding: 1rem 0;
  }

  .band {
    background: none;
  }

  .button-pill {
    background: none;
    color: #000;
    border: 1px solid #999;
  }

  .figure,
  .step,
  .result,
  .code-block,
  .bibtex pre {
    break-inside: avoid;
  }

  .title,
  .subtitle-3 {
    break-after: avoid;
  }

  .code-block,
  .bibtex pre {
    white-space: pre-wrap;
    overflow: visible;
    background: var(--bg-sunken);
  }

  /* no scrolling on paper: fit the display equation and drop the scroll shadows */
  .eq-display,
  .step .eq {
    overflow: visible;
    background: none;
  }

  .eq-display .katex-display > .katex {
    font-size: 0.92em;
  }

  .footer {
    background: none;
    padding: 1rem 0;
  }
}

/* paper figures in the Results section */
.paper-figure { margin: 0.5rem 0 2rem; }
.paper-figure img { display: block; width: 100%; height: auto; }
.paper-figure figcaption { text-align: left; }

/* chart "Data" disclosure button */
.chart .ch-data-btn {
  font: inherit; font-size: 0.8rem; color: #6b6b6b;
  background: none; border: 0; padding: 0.25rem 0; cursor: pointer;
  text-decoration: underline; text-underline-offset: 0.2em;
}
.chart .ch-data-btn:hover { color: #363636; }


/* full lines: the title and the summary use the whole width instead of balanced short lines */
.publication-title,
.subtitle,
.title,
.band .figure figcaption,
.lead {
  text-wrap: wrap;
}
