/* Light, white-background style in the spirit of other SRL project pages
   (e.g. srl-ethz.github.io/Electrohydraulic-Musculoskeletal-Robotic-Leg/). */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --band: #f5f5f5;
  --title: #363636;
  --ink: #363636;
  --muted: #4a4a4a;
  --soft: #7a7a7a;
  --line: #e4e6ea;
  --line-strong: #d0d4da;
  --panel: #ffffff;
  --link: #3273dc;
  --author: hsl(204, 86%, 53%);
  --accent: #1a7f5a;
  --red: #c3474b;
  --btn: #363636;
  --btn-hover: #222222;
  --table-head: #fafafa;
  --table-hl: #eef7f2;
  --code-bg: #f5f5f5;
  --shadow: 0 1px 2px rgba(10, 10, 10, 0.06), 0 4px 14px rgba(10, 10, 10, 0.05);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: "Noto Sans", Arial, sans-serif;
  background: var(--bg);
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

.section {
  width: min(1040px, 92vw);
  margin: 0 auto;
  padding: 3rem 0;
}

/* Full-bleed light grey band behind a section. */
.band {
  background: var(--band);
  box-shadow: 0 0 0 100vmax var(--band);
  clip-path: inset(0 -100vmax);
}

h1, h2, h3 {
  font-family: "Google Sans", "Noto Sans", Arial, sans-serif;
  margin: 0;
  font-weight: 600;
  color: var(--title);
  letter-spacing: 0;
}

h1 { font-size: 2.75rem; line-height: 1.15; max-width: 30ch; margin: 0 auto; overflow-wrap: anywhere; }
h2 { font-size: 2rem; font-weight: 500; margin-bottom: 1.2rem; text-align: center; }
h3 { font-size: 1.15rem; }

p { margin: 0; }

/* ---------- Hero ---------- */
.hero { text-align: center; padding-top: 3.2rem; padding-bottom: 1.6rem; position: relative; }

.hero-logos {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.6rem;
  margin-bottom: 1.8rem;
}
.hero-logos a { display: inline-flex; opacity: 0.85; transition: opacity 150ms ease; }
.hero-logos a:hover { opacity: 1; }
.hero-logos img { height: 34px; width: auto; display: block; filter: invert(1); }

.authors {
  font-family: "Google Sans", "Noto Sans", Arial, sans-serif;
  margin: 1.1rem auto 0;
  max-width: 80ch;
  font-size: 1.1rem;
  color: var(--muted);
}
.authors a { color: var(--author); }
.author { display: inline-block; }

.affiliations {
  font-family: "Google Sans", "Noto Sans", Arial, sans-serif;
  margin-top: 0.4rem;
  font-size: 1rem;
  color: var(--muted);
}
.aff-line { display: inline-block; margin: 0 0.6rem; }

.venue { margin-top: 0.5rem; font-style: italic; color: var(--muted); font-family: "Google Sans", "Noto Sans", Arial, sans-serif; font-size: 1.05rem; }

.actions { margin-top: 1.2rem; display: flex; justify-content: center; flex-wrap: wrap; gap: 0.5rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.5rem;
  padding: 0.45rem 1.1rem;
  border: 0;
  border-radius: 999px;
  background: var(--btn);
  color: #ffffff;
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background-color 150ms ease, transform 150ms ease;
}
.btn:hover { background: var(--btn-hover); color: #fff; text-decoration: none; transform: translateY(-1px); }
.btn i { font-size: 1rem; }
.btn-disabled { background: #b5b5b5; cursor: not-allowed; pointer-events: none; }
.btn small { font-size: 0.7rem; opacity: 0.85; }

.lead {
  margin: 1.6rem auto 0;
  max-width: 78ch;
  font-family: "Google Sans", "Noto Sans", Arial, sans-serif;
  font-size: 1.2rem;
  color: var(--muted);
}

.abstract { max-width: 80ch; margin: 0 auto; text-align: justify; }

.subtle { color: var(--soft); font-size: 0.92rem; }

.body + .body { margin-top: 0.8rem; }

.bullets { margin: 0.85rem 0 0; padding-left: 1.2rem; }
.bullets li { margin: 0.4rem 0; }
.bullets b, .body b { color: var(--ink); }

.section-intro { max-width: 80ch; margin: -0.4rem auto 0.6rem; text-align: center; }

/* ---------- Layout ---------- */
.two-col { display: grid; gap: 2rem; grid-template-columns: 0.95fr 1.05fr; align-items: center; }
.two-col.flip { grid-template-columns: 1.05fr 0.95fr; }

.cards { display: grid; gap: 1rem; margin-top: 0.8rem; }
.cards.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  padding: 1rem;
  box-shadow: var(--shadow);
}
.card-title { margin: 0 0 0.4rem; }

.highlight-card { padding: 0.6rem 0.6rem 1rem; }
.highlight-card .media-wrap { margin-bottom: 0.8rem; }
.highlight-card .card-title, .highlight-card p { padding: 0 0.4rem; }
.tag {
  display: inline-block;
  margin: 0 0.4rem 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Key results: plain, like the Bulma title/subtitle pairs. */
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; text-align: center; }
.metric {
  font-family: "Google Sans", "Noto Sans", Arial, sans-serif;
  font-size: 2.5rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--title);
}
.metric small { font-size: 1.2rem; margin-left: 0.1rem; }
.metric-label { margin-top: 0.4rem; font-size: 0.95rem; color: var(--muted); }

/* ---------- Figures & media ---------- */
.figure { margin: 1rem 0 0; }
.two-col .figure { margin-top: 0; }
.wide-figure { max-width: 900px; margin-left: auto; margin-right: auto; }

.media { border-radius: 8px; overflow: hidden; background: #fff; }
.figure-media { border: 1px solid var(--line); padding: 0.35rem; }
.figure-media img { width: 100%; height: auto; max-height: 820px; object-fit: contain; display: block; }

figcaption { margin-top: 0.5rem; color: var(--soft); font-size: 0.9rem; text-align: center; }
figcaption b { color: var(--muted); }

.video-grid, .figure-grid { display: grid; gap: 1rem; margin-top: 1rem; }
.video-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.video-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.figure-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.figure-grid.tight { margin-top: 0; gap: 0.5rem; }

.video-card { background: transparent; }
.video-card h3 { margin-top: 0.6rem; font-size: 1.05rem; }
.video-card p { margin-top: 0.25rem; font-size: 0.92rem; }

.media-wrap { border-radius: 10px; overflow: hidden; background: #000; }
.media-wrap img, .media-wrap video, .media-wrap iframe {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #000;
}
.media-wrap.contain video { object-fit: contain; }
.media-wrap iframe { height: 100%; border: 0; }

.teaser-wrap { max-width: 1000px; margin: 0 auto; }
.summary-video-wrap { max-width: 860px; margin: 0 auto; }
.summary-video-wrap video { object-fit: contain; }

/* ---------- Self-sensing ---------- */
.equation {
  margin: 1.1rem 0;
  padding: 0;
  background: none;
  border: 0;
  text-align: center;
  font-family: "Cambria Math", "STIX Two Math", "Latin Modern Math", "Times New Roman", serif;
  font-style: italic;
  font-size: 1.45rem;
  color: var(--ink);
  overflow-x: auto;
}
.equation .note { display: block; margin-top: 0.4rem; font-style: normal; font-family: "Noto Sans", Arial, sans-serif; font-size: 0.85rem; color: var(--soft); }

.compare-label {
  display: inline-block;
  margin-top: 0.7rem;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  border: 1px solid currentColor;
}
.compare-label.good { color: var(--accent); }
.compare-label.bad { color: var(--red); }

/* ---------- Table ---------- */
.table-wrap { margin-top: 2rem; overflow-x: auto; }
.results-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 0.95rem;
  border: 1px solid var(--line);
}
.results-table caption { caption-side: bottom; padding-top: 0.5rem; color: var(--soft); font-size: 0.9rem; }
.results-table th, .results-table td {
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.results-table th { background: var(--table-head); color: var(--ink); font-weight: 700; }
.results-table td:first-child { color: var(--ink); font-weight: 700; white-space: nowrap; }
.results-table .ours { background: var(--table-hl); color: var(--ink); }
.results-table tr:last-child td { border-bottom: 0; }

/* ---------- Citation & footer ---------- */
pre {
  margin: 0 auto;
  max-width: 900px;
  border-radius: 6px;
  background: var(--code-bg);
  padding: 1rem 1.2rem;
  overflow-x: auto;
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.5;
}
#copyBibtex { display: flex; margin: 0.9rem auto 0; }

.footer { text-align: center; padding-top: 2rem; padding-bottom: 3rem; border-top: 1px solid var(--line); }
.footer p + p { margin-top: 0.4rem; }

.reveal { opacity: 0; transform: translateY(8px); transition: opacity 400ms ease, transform 400ms ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .two-col, .two-col.flip, .cards.three { grid-template-columns: 1fr; }
  .video-grid.four, .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.6rem; }
  .video-grid.two, .figure-grid { grid-template-columns: 1fr; }
  .figure-grid.tight { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .section { padding: 2.2rem 0; }
  .hero { padding-top: 2rem; }
  h1 { font-size: 1.6rem; }
  .authors { font-size: 1rem; }
  .lead { font-size: 1.05rem; }
  .hero-logos img { height: 28px; }
  .abstract { text-align: left; }
  .metric { font-size: 2rem; }
}

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