/*
 * Shared shell for the standalone demos.
 *
 * These run in an iframe inside a case study, the same arrangement the banners
 * use, and for the same reason: they are self-contained pages that predate this
 * site and reproducing them as components would be a rewrite with nothing to
 * show for it. The iframe is also a real boundary — a demo that runs its own
 * requestAnimationFrame loop and listens on the window cannot reach the page
 * around it.
 *
 * They were written against the old site's Tailwind build, which does not exist
 * here, so the handful of utilities they actually used are written out below in
 * this site's tokens instead. Kept deliberately small: everything specific to
 * one demo lives in that demo's own page.
 *
 * The font is a system stack rather than the site's. The page face is loaded
 * through next/font, which has no stable URL to point an iframe at, and a
 * webfont request per demo is a poor trade for type nobody is reading.
 */

:root {
  --paper: #fbfaf4;
  --ink: rgb(20, 20, 18);
  --ink-2: rgba(54, 54, 48, 0.78);
  --ink-3: rgba(54, 54, 48, 0.7);
  --line: rgba(54, 54, 48, 0.1);
  --control: rgba(54, 54, 48, 0.7);
  --accent: #c44400;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
  /* The frame is sized by the page around it; nothing here should scroll. */
  overflow: hidden;
}

.demo {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100vh;
  padding: 12px;
}

.demo__stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
}

/* One row of controls under the stage, so the stage keeps the height. */
.demo__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  flex: none;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
}

.demo__bar > .spacer {
  flex: 1;
}

/*
 * Matches the .cta--quiet control on the site, including the reason it looks
 * like this: a 4.71:1 border rather than a hairline, because a control you
 * cannot find is not a control.
 */
button.demo__btn {
  padding: 6px 12px;
  border: 1px solid var(--control);
  border-radius: 2px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition:
    background 160ms ease,
    color 160ms ease;
}

button.demo__btn:hover {
  background: var(--ink);
  color: var(--paper);
}

button.demo__btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.demo__read {
  font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
  button.demo__btn {
    transition: none;
  }
}
