/* Picard–Lefschetz formula.
   Wide: the plane of x on the left; on the right the function, its legend and what its level sets
   are, the plane of values with the handle of a, the monodromy and the intersection form.
   Phone: the plane of x, then the same blocks in the same order. */

/* One colour for each vanishing cycle Δ_i, its path γ_i, its critical point and critical value;
   main.js reads the same names through MM.color. */
body {
  --cy-1: var(--c1);
  --cy-2: var(--c2);
  --cy-3: var(--c3);
  --cy-4: var(--c4);
  --cy-5: var(--c5);
  --cy-1-text: var(--c1-text);
  --cy-2-text: var(--c2-text);
  --cy-3-text: var(--c3-text);
  --cy-4-text: var(--c4-text);
  --cy-5-text: var(--c5-text);
  --cy-1-line: var(--c1-line);
  --cy-2-line: var(--c2-line);
  --cy-3-line: var(--c3-line);
  --cy-4-line: var(--c4-line);
  --cy-5-line: var(--c5-line);
  --cy-1-soft: var(--c1-soft);
  --cy-2-soft: var(--c2-soft);
  --cy-3-soft: var(--c3-soft);
  --cy-4-soft: var(--c4-soft);
  --cy-5-soft: var(--c5-soft);
  /* the landscape of |p(x) − z|, light where it is small */
  --land: var(--c1);
}
/* its key in the legend; and that of the curve in 3D, its upper sheet over its lower */
.pl-shade { display: inline-block; width: 13px; height: 13px; border-radius: 3px; flex: none; background: color-mix(in srgb, var(--land) 22%, var(--surface)); }
.pl-sheets { display: inline-block; width: 15px; height: 13px; border-radius: 3px; flex: none; border: 1px solid var(--rule); background: linear-gradient(var(--surface) 50%, color-mix(in srgb, var(--land) 20%, var(--surface)) 50%); }

.pl { --split-main: 1.25fr; --split-below: 40px; }
/* On a phone the legend of the plane of x comes under it, and the plane of values (a little
   smaller) right after, so that both pictures show at once while a is dragged; then the name
   and what the level sets are, and the rest. */
@media (max-width: 899.98px) {
  .pl { gap: 14px; }
  .pl > .split-main, .pl > .split-side, .pl .side-head { display: contents; }
  .pl-main > .hint { margin-top: -6px; }
  .pl .side-head > .legend { order: 1; margin-top: 0; }
  .pl .pl-zblock { order: 2; border-top: 0; padding-top: 0; border-bottom: 1px solid var(--rule-2); padding-bottom: 16px; }
  .pl .pl-zplane { max-width: 250px; }
  .pl .side-title { order: 3; margin: 0; }
  .pl .pl-about { order: 4; margin: 0; }
  .pl .side-block:not(.side-head):not(.pl-zblock) { order: 5; }
}

/* ---------- the plane of x ---------- */
.pl-xplane { position: relative; }
#xcv { display: block; width: 100%; aspect-ratio: 1; }
.pl-over { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.pl-over .pl-pt { pointer-events: auto; }
.pl-pad { fill: transparent; }
/* a critical point: the handle's yellow dot, ringed in its cycle's colour, its number in it */
.pl-pt .handle-point { stroke-width: 2.2; }
.pl-pt:focus-visible { outline: none; }

/* ---------- the plane of values, with the handle of z ---------- */
.pl-zplane { position: relative; max-width: 320px; margin: 0 auto; }
#zcv { display: block; width: 100%; aspect-ratio: 1; }
.pl-zh { --handle-size: 40px; cursor: grab; }
.pl-zh:active { cursor: grabbing; }

/* ---------- readouts ---------- */
/* what the level sets are, under the legend: text to read, smaller than a subtitle */
.pl-about { margin: 12px 0 0; font-size: 14px; line-height: 1.55; color: var(--ink); }
.pl-mono { font-size: 15px; line-height: 1.7; color: var(--ink-2); }
.pl-mono p { margin: 0; }
.pl-rule { margin: 6px 0 0; color: var(--ink-3); font-size: 14px; }
.pl-note { margin: 0; font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.pl-form { font-size: 15px; overflow-x: auto; }
.pl-d { white-space: nowrap; }

/* legend marks drawn as the figure draws them */
.pl-key { display: inline-block; width: 26px; height: 18px; flex: none; overflow: visible; }
.legend-line.pl-multi { overflow: visible; }

/* ---------- the figures in the text ---------- */
.pl-pair { align-items: center; }
.pl-v3 { position: relative; }
#v3-cv { display: block; width: 100%; aspect-ratio: 4 / 3; }
.pl-dialbox { position: relative; width: 170px; margin: 0 auto; }
.pl-dialbox canvas { display: block; width: 170px; height: 170px; }
.pl-dialh { --handle-size: 36px; cursor: grab; }
.pl-zblock .legend { margin-top: 10px; }
.pl-dynbox { display: flex; justify-content: center; }
.pl-eigbox { display: flex; justify-content: center; }
