/* Figure 3. Run out of resolution. Every class is prefixed rgf3- and every token is scoped to the figure.
   Color carries meaning, as on the rest of the page: cyan is where a test's reading changes (the pixel edges), magenta
   is an observable point (c's resolution cell), ink is a configuration. Text blocks are divs, so a host page's paragraph rules can't restyle them. */
.rgf3 {
  --rgf3-paper: #faf8f3; --rgf3-ink: #1d1d1b; --rgf3-body: #2a2926; --rgf3-soft: #3c3a36; --rgf3-hair: #8a8a8a;
  --rgf3-rule: #d9d5cb; --rgf3-cyan: #009fe3; --rgf3-magenta: #e6007e;
  --rgf3-cyan-text: #0473a5; --rgf3-magenta-text: #c4006b;
  --rgf3-tint: color-mix(in srgb, var(--rgf3-magenta) 13%, transparent);
  --rgf3-text: "InterVariable", "Inter", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --rgf3-display: "Inter Display", "InterVariable", "Inter", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --rgf3-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  container-type: inline-size;
  margin: 0; padding: clamp(1rem, 2.4vw, 1.5rem); background: var(--rgf3-paper); color: var(--rgf3-body);
  border: 1px solid var(--rgf3-ink); font: 420 1rem/1.42 var(--rgf3-text); font-optical-sizing: auto; box-sizing: border-box;
}
@media (prefers-color-scheme: dark) {
  .rgf3 { --rgf3-paper: #141413; --rgf3-ink: #faf8f3; --rgf3-body: #e9e6df; --rgf3-soft: #c9c5bc; --rgf3-rule: #3a3833;
    --rgf3-cyan: #2bb3f0; --rgf3-magenta: #ff3d9e; --rgf3-cyan-text: #2bb3f0; --rgf3-magenta-text: #ff5aad;
    --rgf3-tint: color-mix(in srgb, var(--rgf3-magenta) 20%, transparent); }
}
.rgf3 *, .rgf3 *::before, .rgf3 *::after { box-sizing: border-box; }
.rgf3-label { margin: 0; font: 700 .72rem/1.3 var(--rgf3-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--rgf3-soft); }
.rgf3-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem 1rem; align-items: baseline;
  padding-bottom: .7rem; border-bottom: 1px solid var(--rgf3-rule); }
.rgf3-live { color: var(--rgf3-ink); }
.rgf3-live::before { content: ""; display: inline-block; width: .5rem; height: .5rem; margin-right: .45rem; background: var(--rgf3-magenta); vertical-align: .05rem; }
.rgf3-tag { padding: .05rem .35rem; border: 1px solid var(--rgf3-rule); color: var(--rgf3-ink); }
.rgf3-lede { margin: .8rem 0 0; max-width: 46rem; font-size: 1rem; font-weight: 450; line-height: 1.36; color: var(--rgf3-ink); }

/* the test chooser */
.rgf3-tests { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 0; }
@container (max-width: 420px) { .rgf3-tests { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); } .rgf3-test { padding: .45rem .5rem; } }
.rgf3-test { display: inline-flex; flex-direction: column; align-items: flex-start; gap: .1rem; min-height: 2.9rem; padding: .45rem .75rem;
  border: 1px solid var(--rgf3-hair); background: transparent; color: var(--rgf3-ink); font: 600 .95rem/1.2 var(--rgf3-text); cursor: pointer; text-align: left; }
.rgf3-test-sub { font: 400 .66rem/1.2 var(--rgf3-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--rgf3-soft); }
.rgf3-test[aria-pressed="true"] { border-color: var(--rgf3-ink); box-shadow: inset 0 0 0 1px var(--rgf3-ink); }
.rgf3-test[aria-pressed="true"] .rgf3-test-name::before { content: ""; display: inline-block; width: .5rem; height: .5rem; margin-right: .4rem; background: var(--rgf3-cyan); vertical-align: .08rem; }
.rgf3-test:hover { border-color: var(--rgf3-ink); }

/* layout: drawing and readouts side by side when there is room */
.rgf3-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.1rem; margin-top: 1rem; align-items: start; }
@container (min-width: 600px) { .rgf3-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 1.5rem; } }
.rgf3-figcol { min-width: 0; }
.rgf3-svg { display: block; width: 100%; max-width: 30rem; height: auto; margin: 0 auto; overflow: visible; touch-action: pan-y; user-select: none; -webkit-user-select: none; }

/* the drawing */
.rgf3-frame { fill: none; stroke: var(--rgf3-ink); stroke-width: 1.5; }
.rgf3.is-dragging .rgf3-view { position: relative; max-width: 30rem; margin: 0 auto; outline: none; }
.rgf3-view:focus-visible { outline: 3px solid var(--rgf3-ink); outline-offset: 3px; }
.rgf3-svg { max-width: none; }
.rgf3-vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rgf3-dot { fill: var(--rgf3-ink); stroke: none; }
.rgf3-dot.is-out { fill: var(--rgf3-hair); }
.rgf3-dot.is-cell { fill: var(--rgf3-magenta); }
.rgf3-dot.is-cell.is-out { fill: color-mix(in srgb, var(--rgf3-magenta) 45%, var(--rgf3-paper)); }
.rgf3-cell { fill: var(--rgf3-tint); stroke: none; }
.rgf3-pixline { stroke: var(--rgf3-cyan); stroke-width: 1.6; }
.rgf3-u { fill: none; stroke: var(--rgf3-ink); stroke-width: 2.2; stroke-dasharray: 7 5; }
.rgf3-c { fill: var(--rgf3-paper); stroke: var(--rgf3-ink); stroke-width: 2.6; }
.rgf3-c.is-cell { stroke: var(--rgf3-magenta); }
.rgf3-ctext, .rgf3-utag { font: italic 700 calc(17px * var(--rgf3-u, 1)) var(--rgf3-text); fill: var(--rgf3-ink); paint-order: stroke; stroke: var(--rgf3-paper); stroke-width: calc(5px * var(--rgf3-u, 1)); stroke-linejoin: round; letter-spacing: 0; }
.rgf3-chit { fill: transparent; cursor: grab; touch-action: none; }
.rgf3.is-dragging .rgf3-chit { cursor: grabbing; }
.rgf3-svglabel { paint-order: stroke; stroke: var(--rgf3-paper); stroke-width: calc(5px * var(--rgf3-u, 1)); stroke-linejoin: round; font-size: calc(12px * var(--rgf3-u, 1)); }
.rgf3-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.rgf3-btn-quiet { border-color: var(--rgf3-hair); }
.rgf3-scale { font: 700 .72rem/1.3 var(--rgf3-mono); letter-spacing: .1em; color: var(--rgf3-soft); }
.rgf3-ladk { margin-top: .2rem; }
.rgf3-ladnote { font-size: .8rem; color: var(--rgf3-soft); }
.rgf3-lad { display: block; width: 100%; max-width: 22rem; height: auto; overflow: visible; }
.rgf3-bar { fill: var(--rgf3-hair); }
.rgf3-bar.is-cur { fill: var(--rgf3-ink); }
.rgf3-barnum { font: 700 10px var(--rgf3-mono); fill: var(--rgf3-soft); }
.rgf3-barnum.is-cur { fill: var(--rgf3-ink); }
.rgf3-barax { font: 700 10px var(--rgf3-mono); fill: var(--rgf3-soft); letter-spacing: .06em; }
.rgf3-base { stroke: var(--rgf3-ink); stroke-width: 1; }
.rgf3-curmark { fill: var(--rgf3-ink); }
.rgf3-tally { display: flex; flex-wrap: wrap; gap: .4rem 1.3rem; }
.rgf3-tally-i { display: flex; align-items: baseline; gap: .45rem; }
.rgf3-tally-n { font: 700 1.05rem/1 var(--rgf3-mono); color: var(--rgf3-ink); }
.rgf3-svglabel { font: 700 calc(11px * var(--rgf3-u, 1)) var(--rgf3-mono); letter-spacing: .12em; fill: var(--rgf3-soft); }

/* readouts */
.rgf3-side { min-width: 0; display: flex; flex-direction: column; gap: .9rem; }
.rgf3-nums { display: flex; align-items: flex-end; gap: .9rem; padding-bottom: .8rem; border-bottom: 1px solid var(--rgf3-rule); }
.rgf3-numbox { min-width: 0; }
.rgf3-num { font: 860 clamp(2.6rem, 9cqi, 3.6rem)/.86 var(--rgf3-display); letter-spacing: -.05em; color: var(--rgf3-ink);
  font-variant-numeric: tabular-nums lining-nums; margin-bottom: .35rem; }
.rgf3-numbox.is-read .rgf3-num { color: var(--rgf3-ink); }
.rgf3-nums { gap: 1.6rem; }
.rgf3-rule { font-size: .95rem; color: var(--rgf3-body); }
.rgf3-ctl { display: flex; flex-direction: column; gap: .75rem; max-width: 30rem; margin: .9rem auto 0; }
.rgf3-slider { display: flex; flex-direction: column; gap: .3rem; }
.rgf3-slider[hidden] { display: none; }
.rgf3-slider-top { display: flex; justify-content: space-between; gap: .5rem; align-items: baseline; }
.rgf3-slider-out { font: 700 .8rem/1.2 var(--rgf3-mono); color: var(--rgf3-ink); }
.rgf3-slider input { width: 100%; margin: 0; min-height: 1.75rem; accent-color: var(--rgf3-cyan); }
.rgf3-hint { font-size: .85rem; color: var(--rgf3-soft); }
.rgf3-btn { min-height: 2.75rem; padding: .55rem 1rem; border: 1px solid var(--rgf3-ink); background: transparent;
  color: var(--rgf3-ink); font: 600 .95rem/1.2 var(--rgf3-text); cursor: pointer; }
.rgf3-btn:hover { box-shadow: inset 0 0 0 1px var(--rgf3-ink); }
.rgf3-btn[aria-pressed="true"] { background: var(--rgf3-ink); color: var(--rgf3-paper); }
.rgf3-btn:disabled { opacity: .45; cursor: default; box-shadow: none; }
.rgf3-caption { margin-top: 1rem; padding-top: .75rem; border-top: 1px solid var(--rgf3-rule); min-height: 3.1em; font-size: .98rem; color: var(--rgf3-ink); }
.rgf3 :is(button, input):focus-visible { outline: 3px solid var(--rgf3-ink); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) { .rgf3 * { transition: none !important; animation: none !important; } }
@media (forced-colors: active) {
  .rgf3 { border-color: CanvasText; }
  .rgf3-live::before, .rgf3-test[aria-pressed="true"] .rgf3-test-name::before { forced-color-adjust: none; background: CanvasText; }
  .rgf3-frame, .rgf3-u { stroke: CanvasText; }
  .rgf3-pixline { stroke: LinkText; }
  .rgf3-dot { fill: CanvasText; }
  .rgf3-dot.is-out { fill: GrayText; }
  .rgf3-dot.is-cell { fill: Highlight; }
  .rgf3-cell { fill: none; stroke: Highlight; stroke-width: 3; }
  .rgf3-c { fill: Canvas; stroke: CanvasText; }
  .rgf3-c.is-cell { stroke: Highlight; }
  .rgf3-ctext, .rgf3-utag, .rgf3-svglabel { fill: CanvasText; stroke: Canvas; }
  .rgf3-test[aria-pressed="true"] { border-color: Highlight; outline: 3px solid Highlight; outline-offset: -5px; }
  .rgf3-bar { fill: GrayText; } .rgf3-bar.is-cur, .rgf3-curmark { fill: Highlight; } .rgf3-barnum, .rgf3-barax { fill: CanvasText; } .rgf3-base { stroke: CanvasText; }
}
@media print {
  .rgf3 { break-inside: avoid; --rgf3-paper: #fff; --rgf3-ink: #000; --rgf3-body: #000; --rgf3-soft: #222; background: #fff; }
  .rgf3-ctl, .rgf3-btn { display: none; }
  }
