/* A restrained gilded moulding, with a dark, two-pixel sight edge. */
.rk-frame {
  box-sizing: border-box;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--gold);
  background: var(--gold-foil);
  box-shadow: inset 0 0 0 1px var(--gold-light),
    inset 0 0 0 3px var(--gold), inset 0 0 0 4px var(--gold-light),
    inset 0 0 9px var(--ink-soft), 0 8px 20px -14px var(--ink-soft);
}
.rk-stage {
  position: relative;
  width: 100%;
  overflow: hidden;
  outline: 2px solid var(--ink);
  background: var(--paper-3);
  isolation: isolate;
  touch-action: pan-y;
}
.rk-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  box-shadow: inset 0 2px 8px var(--ink-soft), inset 0 0 2px var(--ink);
}
.rk-canvas,
.rk-image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.rk-canvas[hidden],
.rk-image[hidden] { display: none; }
.rk-stage:focus-visible,
.rk-button:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 3px;
}
/* Demo styles remain scoped to this component, including the body class. */
.rk-demo {
  margin: 0;
  min-height: 100svh;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  color: var(--ink);
  font-family: var(--font-text);
}
.rk-demo-content { width: 100%; text-align: center; }
.rk-demo-mount {
  /* Default 4:5 stage, plus the 26px moulding; whole frame ≤70vh / 560px. */
  width: min(100%, calc((min(70vh, 560px) - 26px) * .8 + 26px));
  margin-inline: auto;
}
.rk-caption {
  margin: 25px auto 18px;
  max-width: 34rem;
  min-height: 2.8em;
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 400;
  font-size: clamp(1.2rem, 3.5vw, 1.6rem);
  line-height: 1.35;
  text-wrap: balance;
}
.rk-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 28px; }
.rk-button {
  appearance: none;
  border: 0;
  border-bottom: 1px solid var(--hairline-strong);
  border-radius: 0;
  padding: 10px 8px;
  min-height: 44px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-variant-caps: all-small-caps;
  letter-spacing: .12em;
  cursor: pointer;
  font-family: var(--font-ui);
}
.rk-button:hover { border-bottom-color: var(--gold); color: var(--ink-soft); }
