/* Forward-pass teaser. */
#tz { --tz-ink: var(--ink, #17252d); --tz-slate: var(--slate, #6a7479); --tz-block: var(--block, #dae0e3); --tz-block-2: var(--block-2, #c3ccd0);
  --tz-green: var(--green, #00a86b); --tz-green-ink: var(--green-ink, #007a4e); --tz-green-2: #5cc69a; --tz-green-3: #006b44;
  --tz-violet: var(--violet, #7c3aed); --tz-violet-tint: var(--violet-tint, #efe8fd); --tz-wire: #9aa5ab;
  font-family: var(--sans); color: var(--tz-ink); }
/* sized by its container (the column beside the abstract), never by the viewport */
#tz .tz-root { width: 100%; container-type: inline-size; }

/* ---------------------------------------------------------------- figure */
#tz .tz-stage { position: relative; width: 100%; aspect-ratio: 640 / 532; }
@container (width < 470px) {
  #tz .tz-stage { aspect-ratio: 400 / 600; }
}
#tz .tz-stage noscript img { width: min(100%, 384px); border-radius: 6px; }
#tz .tz-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; display: block; }
#tz .tz-ph { fill: #cfd6da; }
#tz .tz-frame { fill: none; stroke: rgba(23, 37, 45, .18); stroke-width: 1; }
#tz .tz-hit { fill: transparent; cursor: zoom-in; }
#tz .tz-hit:focus-visible { outline: none; stroke: var(--tz-green-ink); stroke-width: 3; }
#tz .tz-arr { fill: none; stroke: var(--tz-wire); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#tz .tz-arr.live { stroke: var(--tz-ink); stroke-width: 2.6; }
#tz .tz-ahp { fill: var(--tz-wire); }
#tz .tz-ahp.hot { fill: var(--tz-ink); }
#tz .tz-adot { fill: var(--tz-ink); stroke: #fff; stroke-width: 2; }
#tz .tz-bracket, #tz .tz-lead { fill: none; stroke: var(--tz-ink); stroke-width: 1.2; }

/* blocks: frozen grey, looped green, the running block ink */
#tz .tz-cell { fill: var(--tz-block); }
#tz .tz-b.done .tz-cell { fill: var(--tz-block-2); }
#tz .tz-b.loop .tz-cell { fill: var(--tz-green-2); }
#tz .tz-b.loop.done .tz-cell { fill: var(--tz-green); }
#tz .tz-b.on .tz-cell { fill: var(--tz-ink); }
#tz .tz-b.loop.on .tz-cell { fill: var(--tz-green-3); }
#tz .tz-th { fill: color-mix(in srgb, var(--tz-violet-tint) calc(100% - var(--th, 0) * 100%), #c9b0fa); }
#tz .tz-tht { font-family: var(--serif); font-style: italic; font-size: 11px; fill: var(--tz-violet); }
#tz.tz-narrow .tz-tht { font-size: 14px; }
#tz .tz-times { font-family: var(--sans); font-size: 12.5px; font-weight: 700; fill: var(--tz-green-ink); font-variant-numeric: tabular-nums; }
#tz.tz-narrow .tz-times { font-size: 12px; }
#tz .tz-b.again .tz-times { fill: var(--tz-ink); }
#tz .tz-rl { stroke: var(--tz-green); stroke-width: 1.6; fill: none; }
#tz .tz-num { font-family: var(--sans); font-size: 9px; fill: var(--tz-slate); font-variant-numeric: tabular-nums; pointer-events: none; }
#tz .tz-b.on .tz-num { fill: #fff; }
#tz .tz-pd { fill: transparent; }
#tz .tz-b.loop .tz-pd.show { fill: rgba(255, 255, 255, .5); }
#tz .tz-b.loop .tz-pd.hit { fill: #fff; }

/* labels over the figure */
#tz .tz-labs { position: absolute; inset: 0; pointer-events: none; }
#tz .tz-lbl { position: absolute; width: max-content; max-width: 10.5rem; font-size: clamp(11.5px, 2.15cqi, 13.5px); line-height: 1.3; font-weight: 500; color: var(--tz-ink); opacity: 0; white-space: normal; }
#tz .tz-lbl[data-a="tl"] { transform: none; }
#tz .tz-lbl[data-a="tr"] { transform: translateX(-100%); text-align: right; }
#tz .tz-lbl[data-a="t"] { transform: translateX(-50%); text-align: center; }
#tz .tz-lbl[data-a="b"] { transform: translate(-50%, -100%); text-align: center; }
#tz .tz-lbl[data-a="l"] { transform: translateY(-50%); }
#tz .tz-lbl[data-a="r"] { transform: translate(-100%, -50%); text-align: right; }
#tz .tz-lbl:not(.tz-l-cmpL, .tz-l-cmpR) { padding: 1px 4px; background: rgba(255, 255, 255, .94); border-radius: 2px; }
#tz .tz-l-chip { max-width: 18rem; box-shadow: 0 1px 2px rgba(23, 37, 45, .2); }
#tz .tz-l-loop { max-width: min(9rem, 24cqi); }
#tz .tz-l-cmpL, #tz .tz-l-cmpR { font-size: 15px; font-weight: 600; color: var(--tz-slate); }
#tz .tz-ours { color: var(--tz-green-ink); }

/* Keep the narration close to the animation as it changes length. */
#tz .tz-sub {
  display: grid; align-content: end; min-height: 2lh; max-width: 44rem;
  margin: 0 auto 6px; text-align: center; font-size: clamp(15px, 2.6cqi, 16.5px);
  line-height: 1.5; text-wrap: balance;
}
@container (width < 470px) {
  #tz .tz-sub { font-size: 15.5px; min-height: 3lh; }
}
@media (prefers-reduced-motion: reduce) {
  @container (width < 550px) {
    #tz .tz-sub { min-height: 3lh; }
  }
  @container (width < 410px) {
    #tz .tz-sub { min-height: 4lh; }
  }
  @container (width < 310px) {
    #tz .tz-sub { min-height: 5lh; }
  }
}

/* ---------------------------------------------------------------- controls */
#tz .tz-ctl { min-height: 63px; margin: 10px 0 0; }
@media (prefers-reduced-motion: reduce) {
  #tz .tz-ctl { min-height: 55px; }
}
#tz .tz-row { display: flex; align-items: center; gap: 12px; }
#tz .tz-btn { flex: none; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--tz-ink); background: var(--paper, #fff); display: grid; place-items: center; cursor: pointer; padding: 0; color: var(--tz-ink); }
#tz .tz-btn:hover { background: var(--tz-ink); color: #fff; }
#tz .tz-btn svg { width: 15px; height: 15px; fill: currentColor; }
#tz .tz-btn svg .st { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
#tz :is(.tz-replay, .tz-step-btn) { width: 32px; height: 32px; border-color: var(--tz-block-2); }
#tz .tz-replay svg { width: 14px; height: 14px; }
#tz .tz-prog { position: relative; flex: 1; height: 28px; display: flex; align-items: center; gap: 3px; cursor: pointer; touch-action: none; border-radius: 4px; }
#tz .tz-prog:focus-visible { outline: 2px solid var(--tz-green-ink); outline-offset: 2px; }
#tz .tz-seg { position: relative; height: 5px; flex-basis: 0; background: var(--tz-block); border-radius: 1px; overflow: hidden; transition: height 120ms; }
#tz .tz-seg i { position: absolute; inset: 0; transform: scaleX(0); transform-origin: left; background: var(--tz-ink); }
#tz .tz-prog:hover .tz-seg, #tz .tz-prog.drag .tz-seg { height: 8px; }
#tz .tz-knob { position: absolute; top: 50%; left: 0; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--tz-ink); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--tz-ink); pointer-events: none; }
#tz .tz-tip { position: absolute; bottom: 30px; transform: translateX(-50%); background: var(--tz-ink); color: #fff; font-size: 12.5px; padding: 3px 8px; border-radius: 4px; white-space: nowrap; pointer-events: none; }
#tz .tz-meta { display: flex; justify-content: space-between; gap: 12px; margin: 2px 0 0 50px; padding-right: 44px; font-size: 14px; color: var(--tz-slate); }
#tz .tz-step { color: var(--tz-ink); font-weight: 500; }
#tz .tz-step i { font-family: var(--serif); }
#tz .tz-chap { font-weight: 500; }

/* reduced motion: a step slider instead of the player */
#tz .tz-rm { display: block; }
#tz .tz-range { --p: 0%; width: 100%; margin: 0; appearance: none; -webkit-appearance: none; background: transparent; height: 30px; cursor: pointer; }
#tz .tz-range::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--tz-ink) var(--p), var(--tz-block) var(--p)); }
#tz .tz-range::-moz-range-track { height: 4px; border-radius: 2px; background: var(--tz-block); }
#tz .tz-range::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--tz-ink); }
#tz .tz-range::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 50%; background: #fff; border: 2px solid var(--tz-ink); }
#tz .tz-range::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid var(--tz-ink); }
#tz .tz-rm + .tz-meta { margin-left: 0; padding-right: 0; }

/* caption under the player: Fig. 1, verbatim */
#tz-cap { max-width: 46rem; margin: 14px 0 0; font-size: 15px; line-height: 1.55; color: var(--ink-2, #3a464e); font-variation-settings: "opsz" 10; }

/* narrow layout: the class is set from the container width in teaser.js */
#tz.tz-narrow .tz-lbl { font-size: 12.5px; max-width: 9rem; }
#tz.tz-narrow .tz-l-chip { max-width: 16rem; }
#tz.tz-narrow .tz-l-cmpL, #tz.tz-narrow .tz-l-cmpR { font-size: 14px; }
#tz.tz-narrow .tz-row { gap: 8px; }
#tz.tz-narrow .tz-meta { margin-left: 46px; padding-right: 40px; font-size: 13px; }
