/* Regular polytopes: the picture beside its readouts, the list of polytopes and tilings
   under it; beside it (on a phone under it) the chamber with its point x, the Coxeter
   diagram and the numbers of the group, then the name and the readouts. */

/* Data colours by meaning; main.js reads the same names through MM.color. The edges take the
   site's blue, as Root systems' mirrors. A face takes the colour of the corner of the
   chamber it lies round, that is of the part of the regular polytope it comes from: its
   faces, its vertices, its edges; a snub's triangles a colour of their own. */
body {
  --edge: var(--c1);
  --face-1: var(--c1);   /* from the faces of {p, q} */
  --face-2: var(--c2);   /* from its vertices */
  --face-3: var(--c3);   /* from its edges */
  --face-4: var(--c4);   /* the triangles of a snub */
  --face-1-fill: color-mix(in srgb, var(--c1) 22%, var(--surface));
  --face-2-fill: color-mix(in srgb, var(--c2) 28%, var(--surface));
  --face-3-fill: color-mix(in srgb, var(--c3) 24%, var(--surface));
  --face-4-fill: color-mix(in srgb, var(--c4) 24%, var(--surface));
  --dual-face: var(--c6);
  --dual-face-fill: color-mix(in srgb, var(--c6) 24%, var(--surface));
  --wall: var(--ink-3);  /* the mirrors (drawn lighter) */
  --wall-line: color-mix(in srgb, var(--ink-3) 45%, var(--surface));
  --cell-mid: color-mix(in srgb, var(--accent) 17%, var(--surface));  /* four dimensions: the cell in the middle */
  --tile-thick: color-mix(in srgb, var(--c1) 30%, var(--surface));
  --tile-thin: color-mix(in srgb, var(--c2) 36%, var(--surface));
  --tile-kite: var(--tile-thick);
  --tile-dart: var(--tile-thin);
  --tile-thick-fill: var(--tile-thick);
  --tile-thin-fill: var(--tile-thin);
  --tile-kite-fill: var(--tile-thick);
  --tile-dart-fill: var(--tile-thin);
  --pen-larger-2: color-mix(in srgb, var(--edge) 56%, var(--surface));  /* the tiles two and four levels up */
  --pen-larger-4: color-mix(in srgb, var(--edge) 30%, var(--surface));
  --arc-1: var(--c5);
  --arc-2: var(--c3);
}

.rp { --split-main: 1.3fr; --split-below: 190px; }
.rp.rp-sections { --split-below: 350px; }
@media (max-width: 899.98px) {
  .rp > .split-main, .rp > .split-side { display: contents; }
  /* the picture, the list under it, then the name, the chamber and the rest */
  .rp .rp-stage, .rp .rp-sec { order: 1; }
  .rp .strip-block { order: 2; }
  .rp .rp-name { order: 3; }
  .rp .rp-chamber-block { order: 4; }
  .rp .side-block:not(.rp-chamber-block):not(.rp-name) { order: 5; }
}
/* the list's two controls side by side: the dimension, then which kind */
.rp .strip-head { justify-content: flex-start; }

/* the picture, and the handle over it (four dimensions) */
.rp-stage { position: relative; aspect-ratio: 1; }
.rp-stage > canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.rp-handle.rp-return { transition: transform .28s ease-out; }
.rp-stage.on-mirror { cursor: pointer; }

/* the sections' chart under the picture: the volume against t, t's handle on the curve */
.rp-sec { margin: 6px 0 4px; }
.rp-sec-chart { display: block; width: 100%; max-width: 560px; height: auto; margin: 0 auto; overflow: visible; cursor: pointer; }
.rp-sec-grid { stroke: var(--rule-2); stroke-width: 1; }
.rp-sec-axis { stroke: var(--rule); stroke-width: 1; }
.rp-sec-num { font-size: 12.5px; fill: var(--ink-3); }
.rp-sec-curve { fill: none; stroke: var(--edge); stroke-width: 2.2; stroke-linejoin: round; }
.rp-sec-level { fill: var(--ink-3); }
.rp-sec-guide { stroke: var(--rule); stroke-width: 1; stroke-dasharray: 2 2; }
.rp-sec-handle { cursor: ew-resize; --handle-ring: var(--ink-2); }
.rp-sec-hit { fill: transparent; }

/* the chamber with x (an SVG drawn by main.js), the Coxeter diagram under it */
.rp-chamber { display: block; width: 100%; max-width: 280px; overflow: hidden; }
.rp-chamber.is-turnable { max-width: 320px; cursor: grab; }
.rp-chamber.is-turnable:active { cursor: grabbing; }
.rp-cox-head { display: flex; align-items: baseline; gap: 12px; margin-top: 10px; }
.rp-cox-head .label { margin: 0; }
.rp-cox-link { font-size: var(--text-label); }
.rp-ch-c { fill: color-mix(in srgb, var(--accent) 12%, var(--surface)); stroke: none; }
.rp-ch-flap { fill: var(--sunken); stroke: var(--rule); stroke-width: 1; }
.rp-ch-face { fill: color-mix(in srgb, var(--accent) 7%, transparent); stroke: none; }
.rp-ch-side { fill: none; stroke: var(--ink-2); stroke-width: 1.3; stroke-linejoin: round; }
.rp-ch-side.back { stroke-dasharray: 3 3; stroke: var(--ink-3); stroke-width: 1; }
.rp-ch-arc { fill: none; stroke: var(--ink-2); stroke-width: 1.5; }
.rp-ch-dot { fill: var(--ink-3); }
.rp-ch-dot.snub { fill: var(--ink-3); opacity: .8; }
.rp-ch-dot.echo { opacity: .22; }  /* a point of C mirrored into a grey chamber */
.rp-ch-tint { stroke: none; }
.rp-ch-label { font-size: 12.5px; text-anchor: middle; fill: var(--ink-2); }
.rp-chamber-handle { cursor: grab; outline: none; }
.rp-chamber-handle:active { cursor: grabbing; }
.rp-sliders { margin-top: 6px; max-width: 320px; }
.rp-sch { margin: 14px 0 0; }

/* a legend mark of several dots: the dual's vertices, in the colours of the faces they stand for */
.rp-dots { display: inline-flex; gap: 2px; margin-right: 6px; }

/* the Coxeter diagram: a click on a node rings it or takes its ring off */
.rp-coxeter { display: block; overflow: visible; margin-top: 4px; }
.cx-bond { stroke: var(--ink); stroke-width: 1.4; }
.cx-label { font-size: 13px; text-anchor: middle; fill: var(--ink-2); font-style: normal; }
.cx-node { cursor: pointer; outline: none; }
.cx-hit { fill: transparent; }
.cx-dot { fill: var(--ink); }
.cx-dot.hollow { fill: var(--surface); stroke: var(--ink); stroke-width: 1.4; }
.cx-ring { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.cx-node:hover .cx-dot:not(.hollow), .cx-node:hover .cx-ring { fill-opacity: .7; stroke-opacity: .7; }
.cx-node .focus-ring { fill: none; }
.rp-ch-ring { fill: none; stroke-width: 1.4; }
.rp-ch-ring.same { stroke: var(--accent); }
.rp-ch-ring.like { stroke: var(--ink-3); stroke-opacity: .5; }

/* the figure in the text: a flag of the cube and its chamber, its walls' numbers to click */
.rp-ff { display: block; width: 100%; max-width: 340px; height: auto; margin: 0 auto; overflow: visible; }
.rp-ff-edge { fill: none; stroke: var(--edge); stroke-width: 1.4; stroke-linecap: round; }
.rp-ff-edge.back { stroke-dasharray: 3 3; stroke-opacity: .45; stroke-width: 1; }
.rp-ff-mirror { fill: none; stroke: var(--wall-line); stroke-width: 1; }
.rp-ff-face { fill: color-mix(in srgb, var(--accent) 7%, transparent); stroke: none; }
.rp-ff-face.back { fill-opacity: .5; }
.rp-ff-chamber { fill: var(--cell-mid); stroke: var(--ink-2); stroke-width: 1.4; stroke-linejoin: round; }
.rp-ff-chamber.back { fill-opacity: .55; stroke-dasharray: 3 3; }
.rp-ff-flag { fill: none; stroke: var(--edge); stroke-width: 3.4; stroke-linecap: round; }
.rp-ff-vertex { fill: var(--edge); }
.rp-ff-lab { font-size: 12.5px; fill: var(--ink-2); text-anchor: middle; }
.rp-ff-wl { cursor: pointer; outline: none; transition: opacity .15s; }
.rp-ff-wl circle { fill: var(--surface); stroke: var(--ink-3); stroke-width: 1; }
.rp-ff-wl:hover circle, .rp-ff-wl:focus-visible circle { stroke: var(--accent); stroke-width: 1.8; }
.rp-ff-wl text { font-size: 13px; text-anchor: middle; fill: var(--ink); pointer-events: none; }
