/* CodecMem method figure for the web: every part visible at once, the panels loop.
   Design canvas 1120 x 552 units; 1 unit = 1/1120 of the figure's width (container query units), so the figure
   scales as one picture. Pixels: codecmem/viz/methodfig/loop/web_clips.py. Markup: viz/methodfig/loop/snippet.html. */
.mfl { margin: 8px 0 42px; }
.mfl-scroll { overflow-x: auto; overflow-y: hidden; }
.mfl-stage {
  --u: calc(100cqw / 1120);
  aspect-ratio: 1120 / 552; container-type: inline-size; min-width: 820px; position: relative; width: 100%;
}
.mfl-stage > * {
  box-sizing: border-box; color: var(--ink-soft, #d6d6d6); font-family: var(--font-sans, Arial, Helvetica, sans-serif);
  font-size: calc(13 * var(--u)); height: calc(var(--h) * var(--u)); left: calc(var(--x) * var(--u)); line-height: 1.3;
  margin: 0; position: absolute; top: calc(var(--y) * var(--u)); width: calc(var(--w) * var(--u));
}
.mfl-stage b { color: var(--ink, #f7f7f7); }
.mfl-stage .mfl-g { color: var(--accent-light, #9bdc2a); }
.mfl-stage .mfl-m { color: var(--ink-muted, #a7a7a7); }

/* top row */
.mfl-head b { display: block; font-size: 1.25em; line-height: 1.25; }
.mfl-head span { color: var(--ink-muted, #a7a7a7); display: block; white-space: nowrap; }
.mfl-pan { aspect-ratio: 800 / 576; background: #111; border-radius: calc(3 * var(--u)); overflow: hidden; }
.mfl-pan img {
  display: block; height: 100%; max-width: none; transform: translateX(calc(var(--j, 0) * -100% / var(--n)));
  width: calc(var(--n) * 100%);
}
.mfl-ticks { display: flex; gap: calc(6 * var(--u)); }
.mfl-ticks span {
  color: #6b6d70; flex: 1 1 0; font-size: 0.9em; padding-top: calc(7 * var(--u)); position: relative; text-align: center;
  transition: color .12s;
}
.mfl-ticks span::before {
  background: #3e4044; content: ""; height: calc(3 * var(--u)); left: 0; position: absolute; right: 0; top: 0;
  transition: background-color .12s;
}
.mfl-ticks span.on { color: var(--ink, #f7f7f7); }
.mfl-ticks span.on::before { background: #ebebeb; }
.mfl-nobox { border: calc(1.6 * var(--u)) dashed #fff; height: 11.111%; left: 74%; position: absolute; top: 22.222%; width: 8%; }
.mfl-nolab {
  color: #fff; font-size: 0.92em; line-height: 1.2; position: absolute; right: 2.5%; text-align: right;
  text-shadow: 0 0 3px #000, 0 0 6px #000; top: 2.5%;
}
.mfl-heat i {
  background: linear-gradient(to right, #000 0%, rgb(64,12,8) 12%, rgb(120,26,10) 24%, rgb(180,54,14) 36%,
              rgb(236,108,22) 48%, rgb(250,150,46) 62%, rgb(254,192,86) 76%, rgb(255,222,140) 88%, rgb(255,246,210) 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); display: block; height: calc(7 * var(--u)); position: relative;
}
.mfl-heat i::after {
  background: #fff; content: ""; height: calc(13 * var(--u)); left: 48%; position: absolute; top: calc(-3 * var(--u));
  width: calc(2 * var(--u));
}
.mfl-heat span { color: var(--ink-muted, #a7a7a7); font-size: 0.92em; position: absolute; top: calc(11 * var(--u)); }
.mfl-heat span:nth-of-type(1) { left: 0; }
.mfl-heat span:nth-of-type(2) { color: var(--ink, #f7f7f7); left: 48%; transform: translateX(-50%); white-space: nowrap; }
.mfl-heat span:nth-of-type(3) { right: 0; }

/* bottom row */
.mfl-hd b { font-size: 1.15em; }
.mfl-r { text-align: right; }
.mfl-c { text-align: center; }
.mfl-stage video { background: #050505; display: block; height: auto; max-width: none; }
.mfl-win { border: calc(1.6 * var(--u)) solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.35); pointer-events: none; }
.mfl-box {
  align-items: center; background: #16181b; border: 1px solid rgba(255,255,255,.32); border-radius: calc(5 * var(--u));
  display: flex; flex-direction: column; justify-content: center; text-align: center;
}
.mfl-vae span { font-size: 1.08em; transform: rotate(180deg); white-space: nowrap; writing-mode: vertical-rl; }
.mfl-dit { border-color: rgba(255,255,255,.6); border-width: calc(1.5 * var(--u)); border-radius: calc(9 * var(--u)); }
.mfl-dit b { font-size: 2em; line-height: 1.15; margin-bottom: calc(4 * var(--u)); }
.mfl-dit span { color: var(--ink-muted, #a7a7a7); font-size: 1.05em; }
.mfl-chip {
  align-items: center; border-radius: calc(4 * var(--u)); display: flex; font-size: calc(14 * var(--u)) !important;
  justify-content: center;
}
.mfl-act {
  align-items: center; border: 1px dashed rgba(255,255,255,.5); border-radius: calc(4 * var(--u));
  color: var(--ink-muted, #a7a7a7) !important; display: flex; font-size: calc(12 * var(--u)) !important; justify-content: center;
}
.mfl-chip { flex-direction: column; line-height: 1.2; }
.mfl-chip small { font-size: 0.78em; opacity: .78; }
.mfl-sink { background: #a9abae; color: #111 !important; }
.mfl-recent { background: #4a8fe3; color: #07172c !important; }
.mfl-mem { display: flex; flex-direction: column; justify-content: space-between; }
.mfl-mem i { background: var(--accent, #76b900); display: block; height: calc(6.25 * var(--u)); }
.mfl-tok { align-items: flex-end; display: flex; gap: calc(6 * var(--u)); }
.mfl-tok figure { margin: 0; text-align: center; }
.mfl-tok figure img { display: block; height: auto; margin: 0 auto; max-width: none; }
.mfl-tok figcaption { color: var(--ink-muted, #a7a7a7); font-size: 0.88em; line-height: 1.2; margin-top: calc(2 * var(--u)); }
.mfl-tok .mfl-arrow { color: #9a9a9a; font-size: 1.2em; line-height: 1; padding-bottom: calc(19 * var(--u)); }
.mfl-tok .mfl-2x2 {
  display: grid; flex: none; gap: calc(2 * var(--u)); grid-template-columns: 1fr 1fr; margin-bottom: calc(18 * var(--u));
  width: calc(17 * var(--u));
}
.mfl-tok .mfl-2x2 i { aspect-ratio: 1; background: var(--accent, #76b900); display: block; }
/* drawn as background colours: keep them when printing without background graphics and in forced-colors mode (set on
   these parts only, as for the page's bar charts: the chips' <small> labels inherit it, harmlessly; set on an
   ancestor it would also print the dark boxes) */
.mfl-mem i, .mfl-tok .mfl-2x2 i, .mfl-heat i, .mfl-sink, .mfl-recent {
  -webkit-print-color-adjust: exact; print-color-adjust: exact; forced-color-adjust: none;
}
/* forced-colors mode paints the tick bars' backgrounds as Canvas: keep the bar under the current frame visible */
@media (forced-colors: active) {
  .mfl-ticks span::before { background: GrayText; forced-color-adjust: none; }
  .mfl-ticks span.on::before { background: Highlight; }
}
.mfl-tok p { color: var(--ink-muted, #a7a7a7); flex: none; line-height: 1.2; margin: 0 0 calc(18 * var(--u)); white-space: nowrap; }
.mfl-wires { height: 100% !important; left: 0 !important; overflow: visible; pointer-events: none; top: 0 !important; width: 100% !important; }
.mfl > figcaption { color: var(--ink-muted, #a7a7a7); font-size: 14px; line-height: 1.6; margin-top: 10px; }
.mfl > figcaption b { color: var(--ink, #f7f7f7); }
/* First view, a spotlight along the loop: the figure starts dimmed (mfl-pre is in the markup, so the dimmed layout is
   there from the first paint); loop.js marks each part .mfl-in when its step comes and its pictures are decoded, and
   the part lights up to full strength (0.65 s, Material 3 "standard" easing). Dimming is instant (no transition).
   Without the script (the snippet's noscript style and the script's onerror) or with reduced motion everything is
   at full strength. */
.mfl { --mfl-dim: .18; }
.mfl [data-s] { transition: opacity .65s cubic-bezier(.2, 0, 0, 1); }
.mfl .mfl-wires [data-s] { transition-duration: .35s; }   /* an arrow, quicker than a part */
.mfl.mfl-pre [data-s]:not(.mfl-in) { opacity: var(--mfl-dim); transition: none; }
.mfl-pan img { will-change: transform; }  /* the clock moves the strips: a compositor move, no repaint */
.mfl-h { margin-top: 8px; }
@media (prefers-reduced-motion: reduce) {
  .mfl-ticks span, .mfl-ticks span::before, .mfl [data-s] { transition: none; }
  .mfl.mfl-pre [data-s]:not(.mfl-in) { opacity: 1; }
}
/* print: every part, and the whole figure scaled to the page (paper cannot scroll sideways) */
@media print {
  .mfl.mfl-pre [data-s]:not(.mfl-in) { opacity: 1; transition: none; }
  .mfl-stage { min-width: 0; }
}
