/* Adapted from get-ball-rolling and yenchiah/project-website-template.
 * See LICENSE for the original template's BSD 2-Clause license. */

:root {
  color-scheme: dark;
  font-family: 'Source Sans Pro', Helvetica, Arial, sans-serif;
  font-size: 16px;
  color: #fff;
  background: #000;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  line-height: 1.5;
}

a {
  color: #6eb4ff;
}

a:focus-visible,
video:focus-visible,
pre:focus-visible,
.equation:focus-visible {
  outline: 3px solid #6eb4ff;
  outline-offset: 5px;
}

.video-banner {
  background: #000;
}

.header-video {
  display: block;
  width: 100%;
  height: auto;
  max-height: 410px;
  object-fit: contain;
}

.banner {
  background: #007894;
}

.banner-table {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 30px;
}

h1,
h2,
h3 {
  font-family: 'Open Sans', Helvetica, Arial, sans-serif;
  font-weight: 700;
}

h1 {
  margin: 0 0 10px;
  font-size: 1.5rem;
  line-height: 1.4;
}

h2 {
  margin: 0 0 10px;
  font-size: 1.125rem;
}

.text {
  margin: 10px 0 0;
}

.publication-meta {
  margin: 10px 0 24px;
}

.authors {
  font-size: 1.25rem;
}

.author {
  display: inline-block;
}

.affiliations,
.author-notes {
  font-size: 0.875rem;
}

.publication-meta a {
  color: #fff;
  text-decoration: none;
}

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

.publication-meta a:focus-visible {
  outline-color: #fff;
}

.content {
  max-width: 900px;
  margin: 0 auto;
  padding-bottom: 40px;
}

.content-table {
  padding: 40px 30px;
}

.gallery {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 30px;
  margin-bottom: 25px;
}

.gallery a {
  display: block;
  max-width: 100%;
  padding: 15px 0;
}

.gallery img {
  display: block;
  width: 260px;
  max-width: 100%;
  height: 100px;
  object-fit: contain;
}

.control-group {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.custom-button-flat {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: 1px solid #777;
  border-radius: 48px;
  font-family: 'Open Sans', Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  color: #000;
  background: #fff;
}

.custom-button-flat[aria-disabled="true"] {
  cursor: default;
}

.custom-button-flat small {
  display: block;
  color: #555;
  font-size: 0.875rem;
}

.method-section {
  margin-top: 45px;
  padding-top: 30px;
  border-top: 1px solid #444;
}

.method-section h2,
.method-section h3 {
  color: #66afc0;
}

.method-section h3 {
  margin: 30px 0 10px;
  font-size: 1.125rem;
}

.system-figure {
  max-width: 640px;
  margin: 25px auto 30px;
}

.system-figure a,
.system-figure img {
  display: block;
}

.system-figure img {
  width: 100%;
  height: auto;
  background: #fff;
}

.system-figure figcaption {
  margin-top: 10px;
  color: #b4b4b4;
  font-size: 0.875rem;
  text-align: center;
}

.equation {
  max-width: 100%;
  overflow-x: auto;
  margin: 16px 0;
  padding: 8px 0;
  font-size: 1.125rem;
}

.equation math {
  width: max-content;
  min-width: 100%;
  margin: 0;
}

.citation pre {
  margin: 0;
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.875rem;
  line-height: 1.6;
}

/* The simulation is self-contained; its heavy assets are fetched on request. */
.demo-section {
  margin-top: 48px;
  padding-top: 30px;
  border-top: 1px solid #444;
}

.demo-heading,
.demo-statusbar,
.demo-paper-heading,
.demo-toolbar,
.demo-jacobian-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.demo-eyebrow {
  margin: 0 0 5px;
  color: #66afc0;
  font-size: 0.875rem;
}

.demo-heading h2 {
  margin: 0;
  font-size: 1.4rem;
}

.demo-tag,
.demo-footnote,
.demo-measure {
  color: #a6b2c2;
  font-size: 0.875rem;
}

.demo-intro {
  max-width: 690px;
  color: #d7dde5;
}

.demo-card {
  margin-top: 22px;
  overflow: hidden;
  border: 1px solid #354256;
  border-radius: 10px;
  background: #111924;
}

.demo-card [hidden] { display: none !important; }

.demo-gate {
  position: relative;
  min-height: 300px;
  aspect-ratio: 7 / 4;
  overflow: hidden;
  background: #141c29;
}

.demo-poster {
  width: 100%;
  height: 100%;
  position: absolute;
  object-fit: cover;
  filter: blur(5px) brightness(0.7);
  transform: scale(1.035);
}

.demo-gate-content {
  position: absolute;
  inset: 0;
  padding: 25px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(0deg, #0d14266b, transparent);
}

.demo-gate-content p {
  margin: 16px 0 0;
  max-width: 450px;
  color: #d3deed;
  font-size: 0.875rem;
}

.demo-section button,
.demo-section input,
.demo-section select {
  font: inherit;
}

.demo-section button,
.demo-section select {
  min-height: 40px;
  padding: 8px 13px;
  border: 1px solid #45546a;
  border-radius: 5px;
  background: #1c293a;
  color: #eff5ff;
  font-size: 0.875rem;
  cursor: pointer;
}

.demo-section button:hover { border-color: #a6b2c2; background: #26384e; }
.demo-section button:disabled { opacity: 0.5; cursor: default; }
.demo-section button[aria-pressed="true"] { border-color: #65bed4; background: #124859; }
.demo-section :is(button, input, select, summary):focus-visible { outline: 3px solid #6eb4ff; outline-offset: 3px; }

.demo-section .demo-load {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 25px;
  border-color: #d3e5f2;
  border-radius: 7px;
  background: #f1f7fc;
  color: #142336;
  font-size: 1.125rem;
  font-weight: 700;
  box-shadow: 0 5px 30px #0004;
}

.demo-section .demo-load:hover { background: white; }
.demo-play { font-size: 0.875rem; color: #007894; }
.demo-statusbar { padding: 13px 18px; gap: 8px; font-size: 0.875rem; }
.demo-status-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; }
#demo-live:fullscreen { width: 100%; height: 100%; overflow-y: auto; background: #111924; }
#demo-live:fullscreen .demo-canvas { height: clamp(330px, 54vh, 900px); }
#demo-live:fullscreen #demo-plot { flex: 1; min-height: 240px; }
#demo-phase { font-weight: 700; }
#demo-error { color: #b6d8ff; font-variant-numeric: tabular-nums; font-weight: 400; }
#demo-progress { display: block; width: 100%; height: 3px; border: 0; appearance: none; background: #273448; accent-color: #55acc1; }
#demo-progress::-webkit-progress-bar { background: #273448; }
#demo-progress::-webkit-progress-value { background: #55acc1; }
#demo-progress::-moz-progress-bar { background: #55acc1; }
.demo-views { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.demo-world { position: relative; min-width: 0; }
.demo-canvas { width: 100%; height: 355px; }
.demo-canvas canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.demo-camera { position: absolute; left: 14px; top: 14px; display: flex; gap: 5px; }
.demo-camera button { min-height: 34px; padding: 5px 10px; background: #111c2be6; }
.demo-orbit-hint { position: absolute; bottom: 12px; left: 14px; color: #a6b2c2; font-size: 0.75rem; pointer-events: none; }
.demo-paper { min-width: 0; padding: 16px; border-left: 1px solid #354256; background: #111b2a; display: flex; flex-direction: column; }
.demo-paper-heading { gap: 4px; font-size: 0.875rem; }
.demo-paper-heading span:last-child { color: #879bb4; font-size: 0.75rem; }
#demo-plot { width: 100%; height: 245px; min-height: 0; display: block; margin: 12px 0; }
.demo-legend { display: flex; gap: 15px; justify-content: center; flex-wrap: wrap; color: #b9c7d9; font-size: 0.75rem; }
.demo-legend span { display: inline-flex; gap: 6px; align-items: center; }
.demo-swatch { display: inline-block; width: 16px; height: 2px; }
.demo-swatch.target { background: #f3a45c80; }
.demo-swatch.actual { background: #57a9ff; }
.demo-controls { padding: 20px; border-top: 1px solid #354256; }
.demo-write-form label { display: block; margin-bottom: 8px; font-weight: 700; }
.demo-input-row { display: flex; gap: 10px; }
.demo-input-row input { width: 100%; min-width: 0; padding: 10px 12px; background: #0b121c; border: 1px solid #45546a; border-radius: 5px; color: white; }
#demo-text { text-transform: uppercase; }
.demo-input-row input::placeholder { color: #8496ad; }
.demo-section .demo-primary { flex: 0 0 auto; background: #007894; border-color: #258ba3; font-size: 1rem; }
.demo-section .demo-primary:hover { background: #0987a4; }
.demo-toolbar { gap: 12px; margin-top: 18px; padding-top: 18px; border-top: 1px solid #2f3e51; }
.demo-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.demo-select-label { display: inline-flex; align-items: center; gap: 8px; font-size: 0.875rem; color: #a6b2c2; }
.demo-select-label select { padding: 7px; }
.demo-footnote { margin: 12px 0 0; line-height: 1.6; }
.demo-jacobian { padding: 16px 20px 20px; border-top: 1px solid #354256; background: #0e1723; }
.demo-jacobian-heading { margin-bottom: 12px; gap: 6px 16px; }
.demo-jacobian-heading h3 { margin: 0; font-size: 0.875rem; }
.demo-jacobian-heading span { color: #a6b2c2; font-size: 0.875rem; }
.demo-matrix-scroll { max-width: 100%; overflow-x: auto; border: 1px solid #2f3e51; border-radius: 5px; }
.demo-matrix-scroll:focus-visible { outline: 3px solid #6eb4ff; outline-offset: 3px; }
#demo-jacobian { width: 100%; border-collapse: collapse; font-size: 0.875rem; white-space: nowrap; }
#demo-jacobian th, #demo-jacobian td { padding: 9px 10px; text-align: right; border-bottom: 1px solid #253346; }
#demo-jacobian th { color: #a6b2c2; font-weight: 400; }
#demo-jacobian td { color: #c7e5ef; font-family: ui-monospace, monospace; font-variant-numeric: tabular-nums; }
#demo-jacobian tr:last-child td, #demo-jacobian tbody tr:last-child th { border-bottom: 0; }
#demo-jacobian th:first-child { position: sticky; left: 0; background: #142030; text-align: left; color: #e4edf7; }

@media (max-width: 720px) {
  .demo-views { grid-template-columns: 1fr; }
  .demo-canvas { height: 330px; }
  .demo-paper { border-left: 0; border-top: 1px solid #354256; }
  #demo-plot { height: 240px; }
  .demo-controls { padding: 16px; }
  .demo-jacobian { padding: 16px; }
}

@media (max-width: 420px) {
  .demo-input-row { flex-direction: column; }
  .demo-canvas { height: 280px; }
}

@media (max-width: 600px) {
  .banner-table {
    padding: 25px 20px;
  }

  .content-table {
    padding: 25px 20px;
  }

  .gallery {
    gap: 20px;
  }

  .gallery a {
    flex: 1 1 120px;
  }

  .gallery img {
    width: 100%;
    height: 80px;
  }

  .control-group {
    gap: 10px;
  }
}
