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

html, body {
  margin: 0;
  min-height: 100%;
  background: #111;
  color: #eee;
  font-family: system-ui, sans-serif;
}

.container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 16px;
}

.frame {
  flex: 1 1 0;
  max-width: 768px;
  aspect-ratio: 16 / 9;
}

.frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.equation {
  flex: 0 0 auto;
  width: clamp(160px, 18vw, 320px);
  height: auto;
}

/* Stack vertically on narrow screens */
@media (max-width: 900px) {
  .container {
    flex-direction: column;
  }

  .frame {
    width: 100%;
    flex: none;
  }

  .equation {
    width: min(70%, 320px);
  }
}
