/* SCATTER//TIME: the shared lab layout (../assets/theme.css) carries the page. Only what belongs to this page is here:
   the stage pointer, the amber handle, text cases for mathematics, readout colour roles and the compact HUD of small
   frames. Colours come from the tokens (var(--cyan) …), never from literal values. */
/* a size container (local-viz-cards): every child of the stage is absolutely placed and its height comes from the lab
   grid row and min-height, so size containment changes no layout; it lets the HUD read the stage's width and height */
#stage { container-type: size; }
/* only a live stage takes the pointer; a still (cover, cited still) lets touch scroll the page */
.stage:not(.still) #cv { cursor: grab; touch-action: none; }
.stage:not(.still) #cv:active { cursor: grabbing; }
.stage.still #cv { cursor: default; touch-action: auto; }

.logo b { color: var(--cyan); }
.tagline em, .sheet li b { color: var(--cyan); }
.hud-tl .big { color: var(--sigma); }
.hud-tl .big, .hud-tl .sub, .strip .head h2, .strip .head span, .tau { text-transform: none; }
.hud-tl .sub { line-height: 1.4; }

/* the right column: the theory button on top, then parameters, readouts and evidence */
.side > #infoBtn { flex: none; align-self: stretch; text-align: center; padding: 7px 9px; }
#ctlPanel .grp { display: flex; flex-direction: column; gap: 8px; }
dl.ro dd output { font: inherit; color: inherit; }
dl.ro .v dd { color: var(--violet); }
dl.ro .key dd b { color: var(--ink); }

/* the amber handle: a button on the object, so dragging it never turns the camera */
.handle { position: absolute; left: 0; top: 0; z-index: 3; width: 28px; height: 28px; padding: 0; margin: 0; border: 2px solid var(--amber); border-radius: 50%;
  background: color-mix(in srgb, var(--amber) 12%, transparent); transform: translate(-50%, -50%); cursor: grab; touch-action: none;
  user-select: none; -webkit-user-select: none; box-shadow: 0 0 10px color-mix(in srgb, var(--amber) 55%, transparent); }
.handle:active, .handle.dragging { cursor: grabbing; background: color-mix(in srgb, var(--amber) 28%, transparent); }
.stage.still .handle { pointer-events: none; }
:root[data-thumb-mode] .handle, :root[data-shot] .handle { display: none; }

/* stage labels keep their case and their colour role */
.stage .tag.raw { text-transform: none; }
.stage .tag.c-cy { color: var(--cyan); }
.stage .tag.c-mg { color: var(--magenta); }
.stage .tag.c-vi { color: var(--violet); }
.stage .tag.c-am { color: var(--amber); }
.hud-tr .chip { text-transform: none; }

/* small stages (narrow frames of the book, phones): tighter HUD */
@container (max-width: 620px) {
  .hud-tr { gap: 3px; }
  .hud-tr .chip { padding: 3px 5px; font-size: 9.5px; letter-spacing: 0.03em; }
  .hud-tl { left: 12px; max-width: calc(100% - 24px); }
  .hud-tl .big { font-size: 12px; }
  .hud-tl .sub { font-size: 10.5px; line-height: 1.35; }
  .hud-bl { left: 12px; right: 12px; bottom: 9px; gap: 2px 10px; font-size: 10px; }
  .stage .tag.raw { font-size: 10.5px; }
  .handle { width: 24px; height: 24px; }
}
/* short stages (a low frame in the book, a phone held sideways): the same compact HUD, read from the height */
@container (max-height: 320px) {
  .hud-tr { gap: 3px; }
  .hud-tr .chip { padding: 3px 5px; font-size: 9.5px; letter-spacing: 0.03em; }
  .hud-tl { top: 10px; }
  .hud-tl .big { font-size: 12px; }
  .hud-tl .sub { font-size: 10.5px; line-height: 1.35; }
  .hud-bl { bottom: 8px; gap: 2px 10px; font-size: 10px; }
  .stage .tag.raw { font-size: 10.5px; }
}
/* a cited card on a phone: the stage keeps the curves, the scene buttons stay in the full lab */
@media (max-width: 480px) {
  :root[data-embed][data-figure] .stage .hud-tr { display: none; }
}
/* the one-column page (narrow windows, phones): a taller stage, the page scrolls as usual */
@media (max-width: 1080px) {
  :root:not([data-embed]):not([data-thumb-mode]):not([data-shot]) .lab .center { grid-template-rows: minmax(min-content, max(460px, 64vh)) auto auto; }
}
