/* Figure 2. What looking first costs: two acts, a state, and the weight of one act with and without the other read first.
   Every class is prefixed lg2- and every token is scoped to the figure. */
.lg2 {
  --lg-paper: #faf8f3; --lg-ink: #1d1d1b; --lg-body: #2a2926; --lg-soft: #3c3a36; --lg-hair: #8a8a8a;
  --lg-rule: color-mix(in srgb, var(--lg-ink) 16%, var(--lg-paper));
  --lg-tint: color-mix(in srgb, var(--lg-cyan) 9%, var(--lg-paper));
  --lg-cyan: #009fe3; --lg-cyan-text: #0072b5; --lg-magenta: #e6007e; --lg-magenta-text: #c4006b;
  --lg-text: "InterVariable", "Inter", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --lg-display: "Inter Display", "InterVariable", "Inter", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --lg-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  margin: 0; padding: clamp(1rem, 2.4vw, 1.75rem); background: var(--lg-paper); color: var(--lg-body);
  border: 1px solid var(--lg-ink); font-family: var(--lg-text); font-weight: 420; line-height: 1.42;
  font-optical-sizing: auto; box-sizing: border-box;
}
@media (prefers-color-scheme: dark) {
  .lg2 { --lg-paper: #141413; --lg-ink: #faf8f3; --lg-body: #e9e6df; --lg-soft: #c9c5bc; --lg-hair: #8a8a8a;
    --lg-cyan: #2bb3f0; --lg-cyan-text: #2bb3f0; --lg-magenta: #ff3d9e; --lg-magenta-text: #ff5aae;
    --lg-tint: color-mix(in srgb, var(--lg-cyan) 14%, var(--lg-paper)); }
}
.lg2 *, .lg2 *::before, .lg2 *::after { box-sizing: border-box; }
.lg2-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.lg2-label { margin: 0; font: 700 .72rem/1.3 var(--lg-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--lg-soft); }
.lg2-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem; align-items: center;
  padding-bottom: .75rem; border-bottom: 1px solid var(--lg-rule); }
.lg2-head .lg2-title { color: var(--lg-ink); }
.lg2-live { display: inline-flex; align-items: center; gap: .6rem; }
.lg2-live .lg2-dot { display: inline-block; width: .5rem; height: .5rem; background: var(--lg-cyan); }
.lg2-live.is-paused .lg2-dot { background: transparent; outline: 1px solid var(--lg-soft); }
.lg2 button { appearance: none; border: 1px solid var(--lg-ink); border-radius: 0; background: transparent; color: var(--lg-ink); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; min-width: 34px; min-height: 34px; padding: 0 .65rem;
  font: 700 .62rem/1 var(--lg-mono); letter-spacing: .1em; text-transform: uppercase; }
.lg2 button:hover { background: color-mix(in srgb, var(--lg-ink) 8%, transparent); }
.lg2 button:focus-visible { outline: 2px solid var(--lg-ink); outline-offset: 2px; }
.lg2-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(1rem, 2.5vw, 2.2rem); padding-top: 1rem; }
@media (max-width: 860px) { .lg2-grid { grid-template-columns: minmax(0, 1fr); } }
.lg2-col { min-width: 0; display: flex; flex-direction: column; gap: .9rem; }
.lg2-svg { display: block; width: 100%; overflow: visible; }
.lg2-svg text { font-family: var(--lg-mono); fill: var(--lg-soft); }
.lg2-svg .lg2-t-ink { fill: var(--lg-ink); }
.lg2-svg .lg2-t-c { fill: var(--lg-cyan-text); }
.lg2-svg .lg2-t-b { font-weight: 700; letter-spacing: .1em; }
.lg2-big { display: flex; align-items: baseline; gap: .2rem 1.1rem; flex-wrap: wrap; }
.lg2-num { font-family: var(--lg-display); font-weight: 860; font-size: clamp(3rem, 7vw, 4.6rem); line-height: .86;
  letter-spacing: -.05em; color: var(--lg-ink); font-variant-numeric: tabular-nums lining-nums; }
.lg2-num.is-past { color: var(--lg-cyan-text); }
.lg2-against { display: flex; flex-direction: column; gap: .15rem; }
.lg2-against .lg2-label { color: var(--lg-ink); }
.lg2-sub { margin: 0; font-size: .9rem; color: var(--lg-soft); font-variant-numeric: tabular-nums; }
.lg2-sub b { color: var(--lg-ink); font-weight: 650; }
.lg2-slider { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .1rem .5rem; align-items: center;
  font: 700 .7rem/1.3 var(--lg-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--lg-ink); }
.lg2-slider output { font-weight: 700; letter-spacing: .04em; color: var(--lg-cyan-text); font-variant-numeric: tabular-nums; font-size: .9rem; }
.lg2-slider input { grid-column: 1 / -1; width: 100%; margin: .2rem 0 0; accent-color: var(--lg-cyan); min-height: 32px; cursor: pointer; }
.lg2-slider input:focus-visible { outline: 2px solid var(--lg-ink); outline-offset: 2px; }
.lg2-hint { margin: 0; font: 400 .7rem/1.4 var(--lg-mono); color: var(--lg-soft); }
.lg2-panel { border-top: 1px solid var(--lg-ink); padding-top: .7rem; }
.lg2-plot { touch-action: pan-y pinch-zoom; cursor: crosshair; }
.lg2-tally { width: 100%; border-collapse: collapse; font: 400 .74rem/1.35 var(--lg-mono); font-variant-numeric: tabular-nums; color: var(--lg-body); }
.lg2-tally th { font-weight: 700; letter-spacing: .1em; text-transform: uppercase; font-size: .62rem; color: var(--lg-soft); text-align: right; padding: .2rem 0 .3rem .5rem; border-bottom: 1px solid var(--lg-rule); }
.lg2-tally th:first-child, .lg2-tally td:first-child { text-align: left; padding-left: 0; }
.lg2-tally td { text-align: right; padding: .22rem 0 .22rem .5rem; border-bottom: 1px solid var(--lg-rule); white-space: nowrap; }
.lg2-tally tr.lg2-sum td { border-bottom: 0; color: var(--lg-ink); font-weight: 700; }
.lg2-tally .lg2-ex { color: var(--lg-cyan-text); }
.lg2-foot { margin: .9rem 0 0; padding-top: .7rem; border-top: 1px solid var(--lg-rule); font-size: .86rem; color: var(--lg-soft); max-width: 62rem; }
@media (max-width: 480px) {
  .lg2 { padding-left: .65rem; padding-right: .65rem; }
  .lg2-tally { font-size: .68rem; }
  .lg2-tally .lg2-hide-n { display: none; }
}
@media (forced-colors: active) {
  .lg2 { --lg-paper: Canvas; --lg-ink: CanvasText; --lg-body: CanvasText; --lg-soft: CanvasText; --lg-hair: GrayText;
    --lg-rule: GrayText; --lg-tint: Canvas; --lg-cyan: Highlight; --lg-cyan-text: CanvasText; --lg-magenta: LinkText; --lg-magenta-text: CanvasText; }
  .lg2-live .lg2-dot { forced-color-adjust: none; background: Highlight; }
  .lg2-num.is-past { color: CanvasText; }
}
@media print {
  .lg2 { break-inside: avoid; }
  .lg2 button { display: none; }
}
/* figure 2 */
.lg2 { --lg-magenta: #e6007e; --lg-magenta-text: #c4006b; }
@media (prefers-color-scheme: dark) { .lg2 { --lg-magenta: #ff3d9e; --lg-magenta-text: #ff5aae; } }
@media (forced-colors: active) { .lg2 { --lg-magenta: LinkText; --lg-magenta-text: CanvasText; } }
.lg2-grid { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
.lg2-dial { touch-action: none; cursor: grab; max-width: 360px; margin: 0 auto; }
.lg2-dial:active { cursor: grabbing; }
.lg2-sliders { display: flex; flex-direction: column; gap: .35rem; }
.lg2-slider.is-a output { color: var(--lg-ink); }
.lg2-slider.is-b output { color: var(--lg-magenta-text); }
.lg2-slider.is-b input { accent-color: var(--lg-magenta); }
.lg2-pair { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem 1.2rem; }
.lg2-pair .lg2-num { font-size: clamp(2.2rem, 4.6vw, 3.2rem); }
.lg2-pair .lg2-num.is-f { color: var(--lg-soft); font-size: clamp(1.6rem, 3.2vw, 2.2rem); }
.lg2-lead { margin: 0; font-family: var(--lg-display); font-weight: 780; letter-spacing: -.02em; line-height: 1.15; font-size: clamp(1.15rem, 2.2vw, 1.4rem); color: var(--lg-ink); }
.lg2-presets { display: flex; flex-wrap: wrap; gap: .4rem; }
.lg2-presets button[aria-pressed="true"] { background: var(--lg-ink); color: var(--lg-paper); }
/* forced colours draw a Canvas backplate behind text, which hides Canvas-coloured text on a pressed button: use the system
   highlight pair instead, and opt the pressed button out of forcing so the pair is kept */
@media (forced-colors: active) { .lg2-presets button[aria-pressed="true"] { forced-color-adjust: none; background: Highlight; color: HighlightText; } }
.lg2-svg .lg2-t-b2 { fill: var(--lg-magenta-text); }
.lg2-state { margin: 0; font-size: .92rem; color: var(--lg-ink); }
@media (max-width: 480px) { .lg2-pair { grid-template-columns: 1fr; } }
@media (max-width: 860px) { .lg2-grid { grid-template-columns: minmax(0, 1fr); } .lg2-dial { max-width: 320px; } }
.lg2-formula { margin: .2rem 0 0; font: 400 .82rem/1.4 var(--lg-mono); color: var(--lg-ink); }
.lg2 button[hidden] { display: none; }
.lg2-slider output { text-transform: none; }
