/* Shared styling for the "field guide to rendering" stepped demos.
   These are embedded inline in the prose, so the widget deliberately has no
   frame of its own: no panel, no border, no shadow, no surface colour. The
   canvas is transparent and the page background is the site background
   (demo-theme.css), so the demo reads as part of the post rather than as a
   boxed-off applet. Chrome colours below track the theme; the canvas
   drawing palette lives in demo-stepper.js. */
:root {
  --ink: var(--text);
  --ink-dim: #7d818a;
  --line: #3d434e;
  --hover: rgba(214, 215, 217, 0.07);
  --accent: #f9a825;
}

:root[data-theme="light"] {
  --ink-dim: #6e737d;
  --line: #c8c4bb;
  --hover: rgba(33, 36, 42, 0.05);
  --accent: #96650a;
}

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  user-select: none;
}
/* Centred in the frame, matching how the post centres its figures. */
#app {
  max-width: 760px;
  margin: 12px auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: var(--ink);
  box-sizing: border-box;
}
canvas {
  display: block;
  width: 100%;
  height: auto;
  background: transparent;
  touch-action: none;
}
.stepper {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  min-height: 28px;
  flex-wrap: wrap;
}
/* Hairline outlines here are control affordances, not container chrome -
   a button still has to read as pressable against bare prose. */
.stepper button {
  background: transparent;
  color: var(--ink-dim);
  border: 1px solid var(--line);
  padding: 5px 14px;
  border-radius: 4px;
  cursor: pointer;
  font: inherit;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.stepper button:hover {
  color: var(--ink);
  border-color: var(--ink-dim);
  background: var(--hover);
}
.stepper input[type=range] { flex: 1; min-width: 120px; accent-color: var(--accent); }
.stepper .count { color: var(--ink-dim); font-size: 12px; min-width: 48px; text-align: right; }
.stepper button:focus-visible,
.stepper input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Reads as a figure caption in the surrounding prose, not a console. */
#caption {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  color: var(--ink-dim);
  font: 13px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  min-height: 40px;
  white-space: pre-wrap;
}
