/* Figure 1. The twelve, running. Every class is prefixed an1- and every token is scoped to the figure.
   Ink: the experiments, their outcomes and the measured values. Cyan: values that add while nothing is posted.
   Magenta: a mark held, and what is posted and counted. Red: owed. */
.an1 {
  --an-paper: #faf8f3; --an-ink: #1d1d1b; --an-body: #2a2926; --an-soft: #3c3a36; --an-hair: #8a8a8a;
  --an-rule: color-mix(in srgb, var(--an-ink) 18%, var(--an-paper));
  --an-hairfill: color-mix(in srgb, var(--an-ink) 14%, var(--an-paper));
  --an-c: #009fe3; --an-m: #e6007e; --an-ctext: #0072b5; --an-mtext: #c4006b; --an-open: #c8401f; --an-on-open: #ffffff;
  --an-text: "InterVariable", "Inter", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --an-display: "Inter Display", "InterVariable", "Inter", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --an-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  margin: 0; padding: clamp(.9rem, 2vw, 1.5rem); background: var(--an-paper); color: var(--an-body);
  border: 1px solid var(--an-ink); font-family: var(--an-text); font-weight: 420; line-height: 1.42;
  font-optical-sizing: auto; box-sizing: border-box; container-type: inline-size; container-name: an1;
}
@media screen and (prefers-color-scheme: dark) {
  .an1:not(.an1-printing) { --an-paper: #141413; --an-ink: #faf8f3; --an-body: #e9e6df; --an-soft: #c9c5bc;
    --an-c: #2bb3f0; --an-m: #ff3d9e; --an-ctext: #2bb3f0; --an-mtext: #ff6fb6; --an-open: #ff6a3d; --an-on-open: #141413; }
}
.an1 *, .an1 *::before, .an1 *::after { box-sizing: border-box; }
.an1 p { margin: 0; }
.an1-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem 1rem; padding-bottom: .6rem;
  border-bottom: 1px solid var(--an-rule); margin-bottom: .8rem; }
.an1-label { font: 700 .72rem/1.3 var(--an-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--an-soft); }
.an1-live { color: var(--an-ink); margin-right: .6rem; }
.an1-live::before { content: ""; display: inline-block; width: .5rem; height: .5rem; margin-right: .45rem; background: var(--an-m); vertical-align: .05rem; }
.an1 button { font: inherit; color: inherit; }
.an1-pause { appearance: none; border: 1px solid var(--an-ink); border-radius: 0; background: transparent; cursor: pointer; min-height: 36px;
  padding: .4rem .75rem; font: 700 .64rem/1 var(--an-mono) !important; letter-spacing: .12em; text-transform: uppercase; color: var(--an-ink) !important; }
.an1-pause:hover { background: color-mix(in srgb, var(--an-ink) 8%, transparent); }

/* the sheet and, beside it, the count and the one control */
.an1-body { display: grid; grid-template-columns: minmax(0, 1fr) 19.5rem; grid-template-areas: "grid side" "aux side" "tb side"; grid-template-rows: auto auto 1fr;
  gap: .9rem 1.4rem; align-items: start; }
.an1-body > .an1-tb { grid-area: tb; margin: 0 !important; max-width: 46rem; }
.an1-top { grid-area: side; display: flex; flex-direction: column; gap: 1.1rem; }
.an1-aux { grid-area: aux; }   /* the key sits under the tiles it explains */
.an1-aux .an1-key { max-width: 46rem; }
.an1-aux .an1-key { margin-top: 0 !important; }
.an1-aux .an1-key + .an1-key { margin-top: .3rem !important; }
.an1-sw-qs { display: none; }
.an1-grid { grid-area: grid; }
.an1-big { display: flex; align-items: baseline; gap: .55rem; }
.an1-num { font-family: var(--an-display); font-weight: 860; font-size: clamp(3.2rem, 6.4vw, 5.2rem); line-height: .86; letter-spacing: -.05em;
  color: var(--an-ink); font-variant-numeric: tabular-nums lining-nums; min-width: 1.1ch; }
.an1-of { font-family: var(--an-display); font-weight: 780; font-size: clamp(1.3rem, 2.2vw, 1.9rem); letter-spacing: -.02em; color: var(--an-ink); }
.an1-say { margin-top: .55rem !important; max-width: 42rem; font-size: .98rem; line-height: 1.36; color: var(--an-ink); }
.an1-say-k { font-weight: 650; }
.an1-ctl-label { font: 700 .62rem/1.3 var(--an-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--an-soft); margin-bottom: .35rem !important; }
.an1-sws { display: grid; grid-template-columns: minmax(0, 1fr); border: 1px solid var(--an-open); }
.an1-sw { appearance: none; border: 0; border-radius: 0; background: transparent; cursor: pointer; display: flex; align-items: center; gap: .55rem;
  min-height: 44px; padding: .45rem .65rem; text-align: left; font: 700 .64rem/1.2 var(--an-mono) !important; letter-spacing: .1em;
  text-transform: uppercase; color: var(--an-ink) !important; }
.an1-sw + .an1-sw { border-top: 1px solid var(--an-open); }
.an1-sw-n { margin-left: auto; font-family: var(--an-display); font-weight: 860; font-size: 1.15rem; line-height: 1; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums lining-nums; text-transform: none; }
.an1-tb { margin-top: .6rem !important; font-size: .84rem; line-height: 1.38; font-weight: 450; color: var(--an-body); }
.an1-key { margin-top: .5rem !important; font-size: .78rem; line-height: 1.4; color: var(--an-soft); }
.an1-key .an1-nr { font-size: .62rem; }
.an1-sw:hover { background: color-mix(in srgb, var(--an-open) 8%, transparent); }
.an1-sw[aria-checked="true"] { background: var(--an-open); color: var(--an-on-open) !important; }
.an1-sw:focus-visible, .an1-tbtn:focus-visible, .an1-pause:focus-visible, .an1-close:focus-visible { outline: 3px solid var(--an-ink); outline-offset: 2px; }

/* the sheet of twelve */
.an1-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; margin: 0; padding: 0; list-style: none; }
.an1-tile { min-width: 0; transition: opacity .25s; }
.an1-tbtn { appearance: none; display: flex; flex-direction: column; width: 100%; height: 100%; margin: 0; padding: .45rem .5rem .4rem; border: 1px solid var(--an-ink);
  border-radius: 0; background: var(--an-paper); text-align: left; cursor: pointer; }
.an1-tbtn:hover { border-width: 1px; box-shadow: inset 0 0 0 1px var(--an-ink); }
.an1-tbtn[aria-expanded="true"] { box-shadow: inset 0 0 0 2px var(--an-ink); }
.an1-thead { display: flex; align-items: center; gap: .45rem; min-height: 1.05rem; }
.an1-tn { font: 700 .66rem/1.2 var(--an-mono); color: var(--an-soft); }
.an1-tname { display: block; margin-top: .2rem; font-family: var(--an-display); font-weight: 760; font-size: .9rem; line-height: 1.12; letter-spacing: -.01em; color: var(--an-ink); }
.an1-marks { margin-left: auto; }
.an1-nr { display: inline-block; font: 700 .58rem/1.2 var(--an-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--an-open); white-space: nowrap; }

.an1-cv { display: block; width: 100%; height: 100px; margin-top: auto; padding-top: .3rem; box-sizing: content-box; }
.an1-o-cv { padding-top: 0; }
.an1-tread { display: flex; justify-content: space-between; align-items: flex-end; gap: .4rem; margin-top: .25rem; min-height: 1.45rem; }
.an1-grid .an1-tread-l { min-height: 2.5em; display: flex; align-items: flex-end; }
.an1-tread-l { font: 700 .56rem/1.25 var(--an-mono); letter-spacing: .08em; color: var(--an-soft); }
.an1-tread-v { flex: none; font: 700 .8rem/1.1 var(--an-mono); color: var(--an-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* pale: the tile does not wait on the question chosen. Its "Not resolved" keeps full strength: paleness is the choice, not the status */
.an1-tbtn > *, .an1-thead > * { transition: opacity .25s; }
.an1-pale .an1-tbtn > :not(.an1-thead), .an1-pale .an1-thead > :not(.an1-nr) { opacity: .3; }
.an1-pale .an1-tbtn { border-color: color-mix(in srgb, var(--an-ink) 30%, var(--an-paper)); }
.an1-pale:hover .an1-tbtn > :not(.an1-thead), .an1-pale:hover .an1-thead > :not(.an1-nr),
.an1-pale:focus-within .an1-tbtn > :not(.an1-thead), .an1-pale:focus-within .an1-thead > :not(.an1-nr) { opacity: .6; }

/* the four questions as numbered marks, in the switches' order: filled where the paradox waits on that question */
.an1-marks, .an1-key-m { display: inline-flex; gap: 2px; flex: none; }
.an1-marks i, .an1-key-m i { display: inline-flex; align-items: center; justify-content: center; width: .95rem; height: .95rem;
  font: 700 .55rem/1 var(--an-mono); font-style: normal; border: 1px solid var(--an-hair); color: var(--an-soft); }
.an1-marks i.on, .an1-key-m i.on { border-color: var(--an-open); background: var(--an-open); color: var(--an-on-open); }
.an1-sw-k { display: inline-flex; align-items: center; justify-content: center; width: 1.45rem; height: 1.45rem; flex: none;
  border: 1.5px solid var(--an-open); color: var(--an-open); font: 700 .74rem/1 var(--an-mono); letter-spacing: 0; }
.an1-sw[aria-checked="true"] .an1-sw-k { border-color: var(--an-on-open); color: var(--an-on-open); }
.an1-full { margin-top: .35rem !important; font-size: .8rem; line-height: 1.38; color: var(--an-soft); }
.an1-full-k { font-weight: 650; color: var(--an-ink); }
.an1-turned .an1-tbtn { outline: 2px solid var(--an-ink); outline-offset: -2px; }
.an1-key-m { vertical-align: -.02rem; margin-right: .2rem; }
.an1-sw-q { font: 600 .84rem/1.22 var(--an-text); letter-spacing: 0; text-transform: none; text-align: left; }
/* under each question, its subject in the textbook's own terms */
.an1-sw-g { display: block; margin-top: .1rem; font: 400 .74rem/1.25 var(--an-text); color: var(--an-body); }
.an1-sw[aria-checked="true"] .an1-sw-g { color: inherit; }
.an1-aux .an1-pause { margin-top: .7rem; }
.an1-on { color: var(--an-soft); }
.an1-ok { display: inline-flex; align-items: center; justify-content: center; min-width: 1.6rem; height: 1.15rem; margin-right: .4rem; padding: 0 .2rem;
  background: var(--an-open); color: var(--an-on-open); font: 700 .7rem/1 var(--an-text); letter-spacing: .02em; }
.an1-o-owed { flex-direction: column; }
.an1-ok--also { background: transparent; color: var(--an-open); border: 1px solid var(--an-open); }

/* an experiment opened in place */
.an1-open { grid-column: 1 / -1; min-width: 0; }
.an1-o-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem 1.6rem; padding: 1rem; border: 2px solid var(--an-ink); background: var(--an-paper); }
.an1-o-n { font: 700 .66rem/1.3 var(--an-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--an-soft); }
.an1-o-title { margin: .2rem 0 .5rem; font-family: var(--an-display); font-weight: 780; font-size: 1.35rem; line-height: 1.1; letter-spacing: -.02em; color: var(--an-ink); }
.an1-o-cv { height: 300px; }
.an1-o-read { margin-top: .4rem !important; display: flex; justify-content: space-between; gap: 1rem; }
.an1-o-read .an1-tread-v { font-size: 1.05rem; }
.an1-o-k { margin-top: .75rem !important; font: 700 .62rem/1.3 var(--an-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--an-soft); }
.an1-o-k:first-child { margin-top: 0 !important; }
.an1-o-t { margin-top: .2rem !important; font-size: .95rem; line-height: 1.42; color: var(--an-ink); }
.an1-o-meas, .an1-o-owed { margin: .25rem 0 0; padding: 0; list-style: none; font-size: .86rem; line-height: 1.4; }
.an1-mv { font: 700 .82rem/1.3 var(--an-mono); color: var(--an-ink); white-space: nowrap; }
.an1-o-owed { display: flex; flex-wrap: wrap; gap: .3rem 1rem; }
.an1-o-go { margin-top: .9rem !important; }
.an1-o-go a { color: var(--an-ink); font: 700 .74rem/1.4 var(--an-mono); letter-spacing: .1em; text-transform: uppercase; text-decoration: none;
  border-bottom: 2px solid var(--an-c); padding-bottom: .15rem; }
.an1-o-go a:hover { color: var(--an-ctext); }
.an1-close { appearance: none; margin-top: .9rem; border: 1px solid var(--an-ink); border-radius: 0; background: transparent; cursor: pointer;
  min-height: 36px; padding: .4rem .75rem; font: 700 .64rem/1 var(--an-mono) !important; letter-spacing: .12em; text-transform: uppercase; color: var(--an-ink) !important; }
.an1-note { margin-top: .8rem !important; font: 400 .72rem/1.45 var(--an-mono); color: var(--an-soft); max-width: 60rem; }
.an1-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* by the width the figure is given, not the window's */
@container an1 (max-width: 980px) {
  .an1-body { grid-template-columns: minmax(0, 1fr); grid-template-areas: "side" "grid" "aux" "tb"; grid-template-rows: auto; }
  .an1-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .8rem 1.4rem; align-items: end; }
}
@container an1 (max-width: 680px) {
  .an1-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .an1-sws { grid-template-columns: minmax(0, 1fr); }
  .an1-sw:nth-child(2n) { border-left: 0; }
  .an1-sw:nth-child(n+2) { border-top: 1px solid var(--an-open); }
  .an1-sw-q { font-size: .8rem; }
  .an1-o-in { grid-template-columns: minmax(0, 1fr); }
  .an1-top { grid-template-columns: minmax(0, 1fr); }
}
@container an1 (max-width: 520px) {
  .an1-body { gap: .6rem; }
  .an1-top { gap: .55rem; }
  .an1-count { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 .7rem; align-items: center; }
  .an1-big { flex-direction: column; align-items: flex-start; gap: .1rem; }
  .an1-num { font-size: 3rem; }
  .an1-of { font-size: 1.1rem; }
  .an1-say { margin-top: 0 !important; font-size: .9rem; line-height: 1.3; }
  .an1-ctl-label { margin-bottom: .25rem !important; }
  .an1-sw-q { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .an1-sw-qs { display: inline; font: 600 .82rem/1.2 var(--an-text); letter-spacing: 0; text-transform: none; white-space: nowrap; }
  .an1-sw { min-height: 36px; padding: .28rem .55rem; }
  .an1-full { display: none; }
  .an1-thead { flex-wrap: wrap; }
  .an1-thead .an1-nr { order: 3; flex-basis: 100%; margin-top: .15rem; }
  .an1-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; }
  .an1-tname { font-size: .8rem; }
  .an1-sw { padding: .45rem .55rem; letter-spacing: .06em; }
}
@media (prefers-reduced-motion: reduce) { .an1-tile, .an1-tbtn > *, .an1-thead > * { transition: none; } }
@media (forced-colors: active) {
  .an1-sw[aria-checked="true"] { forced-color-adjust: none; background: Highlight; color: HighlightText !important; }
  .an1-marks i, .an1-key-m i { forced-color-adjust: none; border-color: CanvasText; color: CanvasText; }
  .an1-marks i.on, .an1-key-m i.on { background: CanvasText; color: Canvas; }
  .an1-pale .an1-tbtn > :not(.an1-thead), .an1-pale .an1-thead > :not(.an1-nr) { opacity: .45; }
}
@media print {
  .an1 { --an-paper: #fff; --an-ink: #000; --an-body: #111; --an-soft: #333; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .an1-cv { height: auto !important; }   /* keeps its drawn proportions at the paper's width */
  .an1-pause, .an1-close { display: none; }
}
/* while printing (the script sets the class from beforeprint to afterprint): the print colours, read by the drawings */
.an1.an1-printing { --an-paper: #fff; --an-ink: #000; --an-body: #111; --an-soft: #333; }
