/* Act 09 · dual nature and uncertainty (scenes: chem1102-a09-buildup, -orbitwave, -packet). Type is never coloured:
   every colour here is a stroke, a fill or a swatch. */

/* pinned scrubs: the stage head stays in the left column on desktop, clear of the drawings */
@media (min-width: 900px) {
  .a09-bu .xs-stagehead, .a09-ow .xs-stagehead, .a09-pk .xs-stagehead { right: auto; max-width: min(32%, 26rem); }
  .a09-bu .xp-cap, .a09-ow .xp-cap, .a09-pk .xp-cap { left: var(--xp-g); max-width: min(30%, 24rem); }
}

/* the electron build-up: the footage sits in a frame (top set by the module under the stage head on phones); the
   canvas over it draws the first dots and the profile below */
.a09-bu .a09-bu-frame { position: absolute; z-index: 1; left: 0; right: 0; top: calc(var(--xp-bar) + 120px); aspect-ratio: 800 / 348; background: #000; opacity: 0; }
.a09-bu .a09-bu-frame .xp-film { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.a09-bu .xp-canvas { z-index: 2; pointer-events: none; }
.a09-bu .a09-bu-credit { top: calc(100% + 3px); bottom: auto; right: 8px; font-size: 10px; line-height: 12px; max-width: 80%; }
@media (min-width: 900px) {
  .a09-bu .a09-bu-frame { left: 38%; right: var(--xp-g); top: calc(var(--xp-bar) + 6svh); max-width: 900px; margin-left: auto; }
}
html.xp-reduced .a09-bu .a09-bu-frame, html:not(.xp-js) .a09-bu .a09-bu-frame { position: relative; top: auto; left: auto; right: auto; opacity: 1; margin: calc(var(--xp-bar) + 140px) var(--xp-g) 0; }
html.xp-reduced .a09-bu .xp-canvas, html:not(.xp-js) .a09-bu .xp-canvas { height: 26svh; }

/* the wave on the orbit: a live count of wavelengths in the stage head; a swatch lights when it is whole */
.a09-fit { margin: 2px 0 0; display: flex; align-items: baseline; gap: 10px; }
.a09-fit b { font-size: clamp(1.9rem, 8vw, 4.5rem); line-height: 1; letter-spacing: -0.045em; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--mix-3); transition: color .3s var(--xp-out); }
.a09-fit.whole b { color: var(--bone); }
.a09-fit .u { font-size: var(--text-sm); color: var(--mix-4); }
.a09-fit .xs-sw { opacity: 0; transition: opacity .3s var(--xp-out); align-self: center; }
.a09-fit.whole .xs-sw { opacity: 1; }
@media (min-width: 900px) { .a09-fit { flex-wrap: wrap; } }
html.xp-reduced .a09-fit, html:not(.xp-js) .a09-fit { display: none; }

/* worked examples: long values are HTML and may wrap */
.a09-sci { font-size: clamp(2rem, 9vw, 3.6rem) !important; white-space: normal; }
.a09-sci sup { font-size: .45em; vertical-align: .9em; }
.a09-two { display: grid; gap: 18px; }
.a09-two > div { display: grid; gap: 6px; padding-top: 12px; border-top: 1px solid var(--hairline); }
.a09-two p:last-child { font-size: var(--text-sm); line-height: 1.45; color: var(--mix-2); max-width: 36ch; }

/* Rive pieces inside sections: a framed object, never taller than about half a phone screen */
.a09-rive g-rive .gr-stage, .xs g-rive .gr-stage { width: auto; margin-left: 0; }
.xs g-rive .gr-frame { width: min(100%, calc(54svh * var(--gr-ratio))); border-radius: 12px; }
@media (min-width: 900px) { .xs g-rive .gr-frame { width: min(100%, calc(74svh * var(--gr-ratio))); } }

/* the back room's wave sketch: one wavelength forever vs a mix of many */
.a09-wp .a09-wp-l { fill: none; stroke: var(--xp-minus); stroke-width: 2; stroke-linejoin: round; }
.xp-paper .a09-wp .a09-wp-l { stroke: var(--xp-minus); }

/* closed drawers and answers lay out nothing (Chrome lays out closed <details> content, so a wide equation inside
   would count as page overflow); the Rive piece's visually hidden title and prompt stay inside their 1px box */
.xp-body details:not([open]) > :not(summary) { display: none; }
.xs g-rive .gr-quiet > * { max-width: 1px; white-space: normal; overflow: hidden; }

/* smaller stat numbers stay small on desktop too (the kit's desktop .xs-num size would win otherwise); a Rive piece
   fills its visual column instead of shrinking to nothing in a centred grid */
.xs .xs-num.xs-num-s { font-size: clamp(2.6rem, 9vw, 5.5rem); }
.xs-vis > g-rive, .xs-vis g-rive { width: 100%; justify-self: stretch; }

/* the back room is a 680 px column on desktop: two-column sections there get a headline sized for half of it */
@media (min-width: 900px) {
  .xp-paper .xs-split .xs-h, .xp-paper .xs-spread .xs-h, .xp-paper .xs-stat .xs-h { font-size: clamp(1.9rem, 2.6vw, 2.6rem); max-width: none; }
  .xp-paper .xs-spread .xs-quote { font-size: clamp(1.4rem, 2vw, 1.9rem); max-width: none; }
}

/* reduced motion: stage heads join the flow above their canvas (no overlap with the drawing) */
html.xp-reduced .a09-bu .xs-stagehead, html.xp-reduced .a09-ow .xs-stagehead, html.xp-reduced .a09-pk .xs-stagehead,
html:not(.xp-js) .a09-bu .xs-stagehead, html:not(.xp-js) .a09-ow .xs-stagehead, html:not(.xp-js) .a09-pk .xs-stagehead { position: relative; top: auto; left: auto; right: auto; order: -1; margin: calc(var(--xp-bar) + 16px) var(--xp-g) 0; max-width: none; }
html.xp-reduced .a09-bu .a09-bu-frame, html:not(.xp-js) .a09-bu .a09-bu-frame { order: -1; margin: 16px var(--xp-g) 0; }
html.xp-reduced .a09-bu .xs-stagehead, html:not(.xp-js) .a09-bu .xs-stagehead { order: -2; }

/* a flipped card's hook: bold words keep the card's ink (site.css makes .prose b bone, which vanishes on a bone card) */
.xs-flip .b b { color: inherit; }
