body > main {
  min-height: 100%;
  background-color: #fff;
  font-family: "Open Sans", sans-serif;
  color: #333;
  margin: 0 2em;
  box-sizing: border-box;
  line-height: 1.5em;
}

#preface-section {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  transition: height 1s ease, opacity 1s ease;
}

#preface-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.7);
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-family: Lato, sans-serif;
  z-index: 1;
}

#video-preface.hidden {
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.preface-title {
  font-size: 2em;
  font-family: "Michroma", sans-serif;
  text-align: center;
  line-height: 1.5em;
  margin-bottom: 0.5em;
}

.fade-transition {
  height: 15em;
  background: linear-gradient(to bottom, #c7c7c7, #ffffff);
}

h1 {
  font-size: 2em;
  text-align: center;
  line-height: 1.5em;
  margin-bottom: 0.5em;
}

h2 {
  text-align: left;
  font-size: 1.3em;
  font-weight: 600;
}

a,
a:link,
a:visited {
  color: inherit;
}

section {
  padding-bottom: 1em;
  max-width: 50em;
  margin: 0 auto;
}

p {
  font-size: 1.1em;
  line-height: 1.5em;
  margin-left: auto;
  margin-right: auto;
  text-align: justify;
}

button {
  background: #fff;
  border-radius: 0.5em;
  border: 1.5px solid #333;
  padding: 0.5em 2em;
  text-align: center;
  text-decoration: none;
  color: #333;
  display: inline-block;
  font-size: 16px;
  cursor: pointer;
  min-width: 12em;
}

#authors {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75em 1.5em;
  text-align: center;
  font-weight: 600;
  color: #666;
  max-width: 35em;
  margin: 0 auto;
}

#affiliations {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  text-align: center;
  justify-content: center;
  gap: 0.4em 1.25em;
  margin: 0 auto;
  font-weight: 400;
}

#links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1em;
}

.tldr {
  text-align: center;
  font-size: 1.1em;
  line-height: 1.5em;
  margin: 2em auto;
  max-width: 41em;
}

.tldr em {
  font-style: italic;
  font-weight: 400;
  display: inline;
  white-space: normal;
}

/* Center the MuJoCo container with 16:9 ratio */
#mujoco-container {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* MuJoCo simulator within the container */
#mujoco {
  position: relative;
  width: 100%;
  max-width: 800px;
}

/* Floating Control Panel (top-right corner) */
#mujoco-controls {
  position: absolute;
  top: 0;
  right: 0;
}

/* Video section for consistent layout */
section > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1em;
  max-width: 800px;
  margin: 0 auto;
}

/* Video element */
.video-container {
  position: relative;
  width: 100%;
  max-width: 800px;
  padding-top: 56.25%;
}
.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

figcaption {
  font-size: 1.1em;
  line-height: 1.5em;
  margin-left: auto;
  margin-right: auto;
  text-align: justify;
}

.code-snippet {
  background-color: #f5f8fa;
  padding: 1em;
  border-radius: 6px;
  font-family: "Courier New", monospace;
  font-size: 0.95em;
  overflow-x: auto;
  white-space: pre;
  line-height: 1.5em;
  color: #222;
  max-width: 100%;
}
