<div class="wrapper">
  <div class="box"></div>
</div>
@import url("https://fonts.googleapis.com/css2?family=Exo:wght@600&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  width: 100vw;
  min-height: 100vh;
  font-family: "Exo", Arial, sans-serif;
  background-color: #557;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
}

.wrapper {
  width: min(100%, 760px);
  display: flex;
  justify-content: center;
}

.box {
  width: 100%;
  height: max(40vh, 200px);
  background-color: #09f;
}

.box {
  --min-radius: 0px;
  --max-radius: 8px;
  --ideal-radius: 4px;
  border-radius: max(
    var(--min-radius),
    min(var(--max-radius), (100vw - var(--ideal-radius) - 100%) * 9999)
  );
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.