/* Real samples on /slides/ (js/widgets/magic-move.js): before → after pairs played as a Magic Move with live text.
   A scene is a slide in 1920×1080 units, scaled into its 16:9 stage. Its text keeps the fonts' own rendering
   (no antialiasing override, no optimizeLegibility), like Keynote draws it. */

.mm-stage { position: relative; aspect-ratio: 16 / 9; overflow: hidden; isolation: isolate; cursor: pointer;
  background: var(--fog); box-shadow: 0 0 0 1px var(--line); -webkit-tap-highlight-color: transparent; user-select: none; }
.mm-stage:focus-visible { outline-offset: calc(5 * var(--u)); }

/* (the scene's 1920 × 1080 are slide units, scaled into the stage by the script: never the page's scaled pixel) */
.mm-scene { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0; overflow: hidden;
  contain: layout paint; pointer-events: none; background: #fff; opacity: 0; transition: opacity .5s ease-out;
  -webkit-font-smoothing: auto; text-rendering: auto; font-stretch: normal; letter-spacing: 0; }
.mm-stage.is-ready .mm-scene { opacity: 1; }
.mm-scene .layer { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; }
.mm-scene .layer.bg img { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; max-width: none; }
/* fading layers live on their own GPU layers: their opacity changes without repainting; only moving glyphs repaint */
.mm-scene .layer.bg, .mm-scene .layer.boxes, .mm-scene .layer.fade { will-change: opacity; }
.mm-scene .layer.move { will-change: transform; }
.mm-scene .piece { position: absolute; display: block; max-width: none; transform-origin: 50% 50%; }
.mm-scene .g, .mm-probe .g { position: absolute; left: 0; top: 0; line-height: 0; white-space: pre; font-style: normal;
  font-kerning: none; font-variant-ligatures: none; font-synthesis: none; font-feature-settings: normal; letter-spacing: 0; }
.mm-probe { position: absolute; left: -10000px; top: 0; visibility: hidden; -webkit-font-smoothing: auto; text-rendering: auto; font-stretch: normal; }
.mm-scene .box { position: absolute; }
.mm-scene .photo { position: absolute; left: 0; top: 0; overflow: hidden; }
.mm-scene .photo img { display: block; width: 100%; height: 100%; max-width: none; }

/* ---------- #1 the drafts: one stage, three tabs ---------- */
.mm-tabs { position: relative; }
.mm-tabs .tab[aria-pressed="true"] { color: var(--ink); }
.mm-ink { position: absolute; left: 0; bottom: -1px; width: 0; height: calc(2 * var(--u)); background: var(--charcoal); pointer-events: none; }
.mm-ink.is-set { transition: transform .6s var(--ease-io), width .6s var(--ease-io); }

/* ---------- #3 the cases: two to a row ---------- */
.mm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(calc(40 * var(--u)), calc(4.6vw * var(--f)), calc(64 * var(--u))) clamp(calc(20 * var(--u)), calc(2.8vw * var(--f)), calc(40 * var(--u))); }
.mm-card { min-width: 0; margin: 0; }
.mm-bar { display: flex; align-items: center; gap: calc(7 * var(--u)); margin: 0 0 calc(12 * var(--u)); }
.mm-bar button { padding: calc(5 * var(--u)) calc(9 * var(--u)) calc(4 * var(--u)); font-family: var(--mono); font-size: calc(11 * var(--u)); letter-spacing: .14em; line-height: 1; text-transform: uppercase;
  color: var(--ink-3); background: none; border: 1px solid var(--line); border-radius: calc(2 * var(--u)); cursor: pointer;
  transition: color .3s var(--ease-io), border-color .3s var(--ease-io); }
.mm-bar button[aria-pressed="true"] { color: var(--ink); border-color: var(--ink); }
.mm-bar button:hover { color: var(--ink); }
.mm-bar i { font-style: normal; font-size: calc(12 * var(--u)); color: var(--ink-3); }
.mm-cap { display: grid; gap: calc(3 * var(--u)); margin: calc(12 * var(--u)) 0 0; font-size: calc(12 * var(--u)); line-height: 1.45; color: var(--ink-3); }
.mm-cap span + span { color: var(--ink); }

@media (max-width: 760px) {
  .mm-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  /* the three tabs stay on one line, spread across the column */
  .mm-tabs { flex-wrap: nowrap; justify-content: space-between; }
  .mm-tabs .tab { padding: calc(12 * var(--u)) 0 calc(11 * var(--u)); font-size: calc(11 * var(--u)); letter-spacing: .06em; white-space: nowrap; }
}
