/* ============================================
   FLOW DEMO — shell. The reusable part of the looping phone walkthroughs:
   the phone (black stroke + radii measured from the still phone mock-ups),
   how it sizes inside a gallery card, the positioned-text helper, and the
   finger indicator. Each flow brings its own stylesheet for its screens
   (see flow-rocket-equity.css) and its own script (see flow-demo.js).
   ============================================ */
.flow-demo { margin: 0; }
/* one phone, sized like a single phone from the 3-up galleries (436/1828 of the card) */
.fd-fit { position: relative; width: 23.85%; margin: 0 auto; }
.fd-fallback { display: block; width: 100%; max-width: 404px; margin: 0 auto; height: auto; }

/* The phone: a 393x852 screen inside a pure-black stroke. Measured from
   setting-goals-01.png (a circle fit to its corners): stroke 6px of a 436px
   phone (≈5.5 in screen units), outer radius 66px (≈61), inner radius
   concentric, 60px (≈55.5). */
.fd-device {
  position: absolute; left: 0; top: 0; width: 404px; height: 863px;
  transform-origin: 0 0;
}
.fd-bezel {
  position: absolute; inset: 0; border-radius: 61px; background: #000;
  box-shadow: 0 20px 40px rgba(23, 24, 28, 0.16);
}
/* the screen clips its children; its own fill lives in .fd-base so the rounded
   edge is anti-aliased once (no light seam against the stroke) */
.fd-screen {
  position: absolute; left: 5.5px; top: 5.5px; width: 393px; height: 852px;
  border-radius: 55.5px; overflow: hidden; isolation: isolate;
}
.fd-base { position: absolute; inset: 0; background: #fff; }

.fd-stage {
  position: absolute; inset: 0; overflow: hidden;
  font-family: var(--fd-font, system-ui, -apple-system, "Segoe UI", sans-serif);
  color: #111;
  user-select: none; -webkit-user-select: none;
  transition: opacity calc(0.45s * var(--t, 1)) ease;
}
.fd-stage[data-fade="1"] { opacity: 0; }
.fd-stage *, .fd-stage *::before, .fd-stage *::after { box-sizing: border-box; }
.fd-stage.fd-instant *, .fd-stage.fd-instant { transition: none !important; }

/* positioned text: --x ink-left origin, --b baseline, --s size, --w weight */
.fd-stage .t {
  position: absolute; margin: 0; white-space: nowrap; line-height: 0;
  left: calc(var(--x) * 1px);
  top: calc(var(--b) * 1px - 0.35em);
  font-size: calc(var(--s) * 1px);
  font-weight: var(--w, 500);
  letter-spacing: var(--ls, 0);
  color: var(--c, #111);
}
.fd-stage .px { position: absolute; display: block; max-width: none; pointer-events: none; }
/* the site gives every .journey-panel img a drop-shadow; the demo draws its own */
.flow-demo .fd-stage img { filter: none; }
.fd-stage .ico { position: absolute; overflow: visible; }

/* the finger indicator (off unless the figure has data-touch="true") */
.fd-touch {
  position: absolute; left: 0; top: 0; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%;
  background: rgba(17, 17, 17, 0.16);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8), 0 0 0 3px rgba(17, 17, 17, 0.14);
  opacity: 0; pointer-events: none;
  transform: translate(var(--tx, 300px), var(--ty, 600px)) scale(var(--sc, 1));
  transition: transform calc(0.6s * var(--t, 1)) cubic-bezier(0.4, 0, 0.2, 1), opacity calc(0.25s * var(--t, 1)) ease;
}
.fd-touch.is-on { opacity: 1; }
.fd-touch.is-down { --sc: 0.78; transition: transform calc(0.14s * var(--t, 1)) ease, opacity calc(0.25s * var(--t, 1)) ease; }

/* small screens: the 3-up phones shrink to thumbnails; keep this one usable */
@media (max-width: 700px) {
  .journey-panel.flow-panel { padding: 1.5rem 0.75rem; }
  .fd-fit { width: min(100%, 240px); }
}
