/* Web / desktop variant of the demo board: a browser window instead of a phone.
   Load after frame.css with <body class="web">. web.js renders the page at desktop width and scales it to fit. */
.web .side {
  max-width: 220px;
}
.browser {
  --avail: calc(100vw / var(--z) - 56px - 2 * (220px + var(--gap)));
  grid-area: center;
  justify-self: center;
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1180px, var(--avail));
  height: clamp(520px, calc(100vh / var(--z) - 150px), 900px);
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
  background: var(--card);
  box-shadow:
    0 40px 80px -30px rgba(38, 36, 31, 0.45),
    0 0 0 1px rgba(0, 0, 0, 0.04);
}
.browser::before {
  content: "";
  position: absolute;
  inset: -90px -160px;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(closest-side, var(--bg) 55%, transparent);
}
.browser-bar {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  border-bottom: 1px solid var(--rule);
  font: 400 12px/1 var(--sans);
  color: var(--mute);
}
.browser-bar i {
  width: 10px;
  height: 10px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--rule);
}
.browser-bar span {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 14px;
  border-radius: 6px;
  background: var(--bg);
}
.viewport {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.viewport iframe {
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 100%;
  border: 0;
  transform-origin: 0 0;
}

/* narrower desktops: the window takes the full width, the two cards sit under it */
@media (min-width: 900px) and (max-width: 1359px) {
  .web .frame {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "top top" "title title" "center center" "left right";
  }
  .browser {
    width: min(1180px, calc(100vw / var(--z) - 56px));
    height: clamp(460px, calc(100vh / var(--z) - 150px), 820px);
  }
  .web .side {
    margin-top: 28px;
  }
  .web .side::after {
    display: none;
  }
}

/* phones: the page fills the screen in its own mobile layout */
@media (max-width: 899px) {
  .browser::before,
  .browser-bar {
    display: none;
  }
  .browser {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
}
