@import url('https://fonts.googleapis.com/css?family=Google+Sans|Noto+Sans|Castoro|Cormorant+Garamond:600,700');

/* Global Styles */
body {
  font-family: 'Noto Sans', sans-serif;
  line-height: 1.6;
  color: #333;
  margin: 0;
  padding: 0;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 50px 20px 10px 20px;
  background: #fdfdfd;
}

.paper-title {
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-size: 2.2rem;
  font-weight: 400;
  margin-bottom: 10px;
}

.authors {
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-size: 1.2rem;
  color: #555;
  margin-bottom: 20px;
  text-align: center;
}

.authors a {
  color: #0066cc;
  text-decoration: none;
}

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

.affiliations {
  font-style: italic;
  margin-bottom: 30px;
  text-align: center;
}

/* Links Section */
.links {
  margin-bottom: 18px;
}

.link-btn {
  display: inline-block;
  padding: 10px 20px;
  margin: 5px;
  background: #333;
  color: white;
  text-decoration: none;
  border-radius: 25px;
  transition: background 0.3s ease;
  font-weight: 500;
}

.link-btn:hover {
  background: #555;
}

/* Section Styles */
.section-title {
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-weight: 400;
  border-bottom: 1px solid #ddd;
  padding-bottom: 10px;
  margin-top: 50px;
  font-size: 1.8rem;
}

h3 {
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-weight: 400;
}

mjx-container[display="true"] {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

/* Media Styles */
.video-container {
  text-align: center;
  margin: 30px 0;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.video-card video {
  width: 100%;
  display: block;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  background: #000;
}

.video-card p {
  margin: 10px 0 0;
  text-align: center;
  font-size: 0.95rem;
  color: #555;
}

.youtube-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 30px 0 20px;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  background: #000;
}

.youtube-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.demo-frame-wrap {
  margin: 0 0 10px;
  border: 1px solid #ddd;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  background: #fff;
}

.demo-frame {
  display: block;
  width: 100%;
  height: 765px;
  border: 0;
}

.teaser-img {
  width: 100%;
  height: auto;
  margin: 20px 0;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.figure-scroll {
  width: 100%;
}

.methodology-figure {
  margin: 20px 0 0;
  border-radius: 0;
  box-shadow: none;
}

.teaser-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 10px;
  margin: 20px 0;
}

.teaser-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.teaser-caption {
  font-size: 1.05rem;
  line-height: 1.7;
}

.teaser-caption-title {
  font-family: inherit;
  font-size: 1em;
  font-weight: 700;
  letter-spacing: normal;
  text-transform: none;
  color: #1f1f1f;
}

.teaser-container button {
  background: #333;
  color: white;
  border: none;
  padding: 10px;
  font-size: 20px;
  cursor: pointer;
  border-radius: 5px;
  margin: 0 10px;
  flex: 0 0 auto;
}

.teaser-container button:hover {
  background: #555;
}

.grid-cell {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.left-cell {
  align-self: start;
}

.left-cell img {
  width: 100%;
  height: auto;
  display: block;
}

.right-cell {
  background: #f0f0f0;
}

.zoom-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 5px;
  width: 100%;
  height: 100%;
}

.zoom-cell {
  position: relative;
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
}

.zoom-display {
  width: 100%;
  height: 100%;
  background-repeat: no-repeat;
  background-position: 0 0;
}

.zoom-cell label {
  position: absolute;
  bottom: 5px;
  left: 5px;
  color: white;
  font-size: 12px;
  line-height: 1.1;
  background: rgba(0, 0, 0, 0.7);
  padding: 2px 5px;
  border-radius: 2px;
  pointer-events: none;
}

.red-box {
  position: absolute;
  width: 40px;
  height: 40px;
  box-sizing: border-box;
  border: 2px solid red;
  pointer-events: none;
  display: none;
}

/* Pyramid Image Wrapper */
.pyramid-wrapper {
  float: left;
  width: 350px;
  margin-right: 20px;
  margin-bottom: 15px;
}

.pyramid-wrapper img {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

/* Text alignment and spacing */
p {
  text-align: justify;
  word-spacing: normal;
  letter-spacing: normal;
}

/* Code Block Styles */
pre {
  background: hsl(0, 0%, 96%);
  padding: 15px;
  overflow-x: auto;
  border-radius: 5px;
  font-size: 0.9rem;
  line-height: 1.4;
}

code {
  font-family: 'Courier New', monospace;
}

/* Footer Styles */
footer {
  text-align: center;
  padding: 40px;
  color: #888;
  border-top: 1px solid #eee;
  margin-top: 60px;
}

footer a {
  color: #0066cc;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
  .video-grid {
    grid-template-columns: 1fr;
  }

  .demo-frame {
    height: 790px;
  }

  .teaser-grid {
    grid-template-columns: 1fr;
    flex: 1 1 auto;
    min-width: 0;
  }

  .right-cell {
    padding: 5px;
  }

  .zoom-grid {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: none;
    height: auto;
  }

  .zoom-cell {
    aspect-ratio: 1 / 1;
  }

  .zoom-cell label {
    bottom: 4px;
    left: 4px;
    max-width: calc(100% - 8px);
    font-size: 10px;
    padding: 2px 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .teaser-caption {
    text-align: center;
  }

  mjx-container[display="true"] {
    font-size: 0.92em;
  }

  .paper-title {
    font-size: 1.5rem;
  }

  .authors {
    font-size: 1rem;
  }

  .link-btn {
    padding: 8px 14px;
    margin: 4px;
    font-size: 0.9rem;
    border-radius: 20px;
  }

  .container {
    padding: 10px;
  }

  .figure-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .methodology-figure {
    display: block;
    width: min(210vw, 860px);
    min-width: 0;
    max-width: none;
    margin-bottom: 0;
  }
}
