/* Migration demo component (Views/Shared/_MigrateDemo.cshtml, Content/migrate/demo.js): the two phones, the AI orb, the
   transfer and the reveal. Shared by the /migrate hero and the homepage section, and by the fictional profile phones of
   the /migrate examples. Self-contained tokens (brand colours only), so it works on the blog and the homepage layouts.
   Fixed aspect ratio: the animation changes transforms and opacity only (no layout shift). */
.ml-demo, .lt-blog { --cyan: #02a7df; --cyan-bright: #3ccaf5; --navy: #00427d; --ink: #273552; --night: #07142a; --deep: #0f1d36;
    --coral: #ff6b4a; --sun: #ffc83d; --lilac: #c9b8ff; --mint: #5fe0b5; --cream: #f6f1e7;
    --serif: Georgia, "Times New Roman", serif; --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; --ease: cubic-bezier(.2, .7, .2, 1); }
.ml-demo .bl-sr, .ml-demo .ml-sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ml-demo svg { fill: currentColor; }
/* The demo */
.ml-demo { margin: 0; }
.ml-stage { position: relative; width: 100%; max-width: 620px; margin: 0 auto; aspect-ratio: 10 / 9; container-type: inline-size; }
.ml-demo-badge { position: absolute; top: 0; left: 50%; z-index: 4; transform: translateX(-50%); padding: 5px 12px; border-radius: 999px; background: rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .72); font-size: 12px; white-space: nowrap; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); }
.ml-stage .ml-phone { position: absolute; width: 36%; }
.ml-stage .ml-src { left: 0; top: 10%; }
.ml-stage .ml-dst { right: 0; top: 6%; box-shadow: 0 0 0 1px rgba(60, 202, 245, .35), 0 40px 80px -30px rgba(2, 167, 223, .55); }
.ml-core { position: absolute; left: 36%; width: 28%; top: 22%; z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ml-chip { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; padding: 7px 12px; border-radius: 999px; background: rgba(255, 255, 255, .1); color: #fff; font-size: 12.5px; font-weight: 600; white-space: nowrap; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); }
.ml-demo .ml-chip svg { width: 16px; height: 16px; color: var(--cyan-bright); }
.ml-chip-ok { background: rgba(2, 167, 223, .22); }
.ml-orb { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; margin: 8px 0; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #3ccaf5, #02a7df 45%, #00427d); color: #fff; box-shadow: 0 0 0 8px rgba(2, 167, 223, .12), 0 0 40px rgba(60, 202, 245, .55); }
.ml-demo .ml-orb svg { width: 28px; height: 28px; }
.ml-final { position: absolute; left: 50%; bottom: 0; z-index: 4; transform: translateX(-50%); padding: 14px 24px; border-radius: 18px; background: rgba(7, 20, 42, .82); text-align: center; white-space: nowrap; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14), 0 20px 40px -20px rgba(0, 0, 0, .7); }
.ml-final p { margin: 0; }
.ml-final-a { font-weight: 700; font-size: clamp(14px, 1.5vw, 18px); letter-spacing: -.01em; }
.ml-final-b { margin-top: 2px !important; color: var(--cyan-bright); font-weight: 700; font-size: clamp(18px, 2vw, 24px); }
.ml-tag { position: absolute; z-index: 2; display: inline-flex; align-items: center; gap: 5px; padding: 1.6cqw 3.6cqw; border-radius: 999px; background: var(--deep); color: #fff; font-family: var(--sans); font-size: 4.4cqw; font-weight: 600; letter-spacing: 0; text-transform: none; box-shadow: 0 0 0 1px rgba(60, 202, 245, .6), 0 6px 14px -6px rgba(0, 0, 0, .5); }
.ml-tag::before { content: ""; width: 2.4cqw; height: 2.4cqw; border-radius: 50%; background: var(--cyan-bright); }
.ml-tag-colour { top: 15%; left: 5%; }
.ml-tag-type { top: 38%; right: 5%; }
.ml-tag-btn { top: 56%; left: 4%; }
.ml-tag-links { top: 77%; right: 4%; }
.ml-scan { position: absolute; left: 0; right: 0; top: 0; z-index: 1; height: 22%; background: linear-gradient(180deg, rgba(60, 202, 245, 0), rgba(60, 202, 245, .32) 70%, rgba(60, 202, 245, .9) 100%); opacity: 0; pointer-events: none; }
.ml-ghosts { position: absolute; left: 0; top: 0; z-index: 5; height: 0; container-type: inline-size; color: var(--p-ink); pointer-events: none; }
.ml-ghost { position: absolute; margin: 0 !important; transform-origin: 0 0; box-sizing: border-box; }
.ml-demo-steps { display: grid; grid-template-columns: repeat(2, auto); justify-content: center; gap: 8px; margin: 22px 0 0; padding: 0; list-style: none; counter-reset: mls; }
.ml-demo-steps li { counter-increment: mls; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; color: rgba(255, 255, 255, .7); font-size: 13px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); transition: color .3s, background-color .3s, box-shadow .3s; }
.ml-demo-steps li::before { content: counter(mls); display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(255, 255, 255, .1); font-size: 12px; font-weight: 700; }
.ml-demo-steps li.is-active { color: #fff; background: rgba(2, 167, 223, .18); box-shadow: inset 0 0 0 1px rgba(60, 202, 245, .55); }
.ml-demo-steps li.is-active::before { background: var(--cyan); }
/* Hidden until animated (set before first paint by the inline script, only when motion is allowed) */
.ml-stage.is-pending [data-tag], .ml-stage.is-pending [data-chip], .ml-stage.is-pending [data-review], .ml-stage.is-pending [data-final],
.ml-stage.is-pending .ml-dst .ml-p-body > * { opacity: 0; }

/* ---- the fictional profile phone (hero, examples and Customizer) */
.ml-phone, .ml-ghosts { --p-bg: var(--cream); --p-ink: #3a2c26; --p-btn: var(--coral); --p-btn-ink: #fff; --p-radius: 999px; --p-border: none; --p-font: var(--serif); --p-name-tr: none;
}
.ml-phone { position: relative; container-type: inline-size; aspect-ratio: 9 / 18.5; border-radius: 13% / 6.4%; padding: 2.4%; background: #0f1d36; box-shadow: 0 30px 60px -28px rgba(0, 0, 0, .65); }
.ml-phone-screen { position: relative; height: 100%; overflow: hidden; border-radius: 11.5% / 5.6%; background: var(--p-bg); color: var(--p-ink); transition: background .35s var(--ease); }
.ml-phone-bar { padding: 7cqw 7cqw 0; }
.ml-phone-url { display: block; padding: 1.6cqw 3cqw; overflow: hidden; border-radius: 999px; background: rgba(127, 127, 127, .14); font: 500 3.9cqw/1.3 var(--sans); text-align: center; white-space: nowrap; text-overflow: ellipsis; opacity: .8; }
.ml-p-body { display: flex; flex-direction: column; align-items: center; gap: 3.2cqw; padding: 7cqw 8cqw 0; }
.ml-p-av { width: 22cqw; height: 22cqw; border-radius: 50%; background: radial-gradient(circle at 35% 30%, var(--sun), var(--coral) 70%); box-shadow: 0 0 0 1.2cqw rgba(255, 255, 255, .7); }
.ml-p-name { margin-top: 1cqw; font: 700 7.2cqw/1.1 var(--p-font); text-transform: var(--p-name-tr); letter-spacing: -.01em; transition: font-family .2s; }
.ml-p-bio { max-width: 92%; font: 400 4.1cqw/1.35 var(--sans); text-align: center; opacity: .72; }
.ml-p-social { display: flex; gap: 2.6cqw; margin-bottom: 1.5cqw; }
.ml-p-social i { width: 4.6cqw; height: 4.6cqw; border-radius: 50%; background: currentColor; opacity: .55; }
.ml-p-btn { display: flex; align-items: center; justify-content: center; gap: 2cqw; width: 100%; padding: 3.7cqw 3cqw; border-radius: var(--p-radius); background: var(--p-btn); color: var(--p-btn-ink); box-shadow: var(--p-border); font: 600 4.3cqw/1.2 var(--sans); text-align: center; white-space: nowrap; transition: background-color .3s, border-radius .3s; }
.ml-p-group b { width: 1.9cqw; height: 1.9cqw; margin-top: -1cqw; border-right: .55cqw solid currentColor; border-bottom: .55cqw solid currentColor; transform: rotate(45deg); }
.ml-p-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2cqw; width: 100%; }
.ml-p-grid i { aspect-ratio: 1; border-radius: 3cqw; background: linear-gradient(160deg, var(--sun), var(--coral)); }
.ml-p-grid i:nth-child(2) { background: linear-gradient(160deg, var(--lilac), #8f7cf0); }
.ml-p-grid i:nth-child(3) { background: linear-gradient(160deg, var(--mint), var(--cyan)); }
.ml-p-music { display: flex; align-items: center; gap: 2cqw; width: 100%; padding: 3cqw; border-radius: 4cqw; background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 .4cqw rgba(255, 255, 255, .14); }
.ml-p-music b { flex: 1; font: 700 4.3cqw/1.2 var(--sans); }
.ml-p-music i { width: 6cqw; height: 6cqw; border-radius: 50%; background: var(--mint); }
.ml-p-music i:nth-of-type(2) { background: #fff; opacity: .8; }
.ml-p-music i:nth-of-type(3) { background: var(--cyan-bright); }
.ml-p-foot { position: absolute; left: 0; right: 0; bottom: 4.5cqw; font: 600 3.4cqw/1 var(--sans); text-align: center; opacity: .45; }

@media (max-width: 960px) { .ml-stage { max-width: 540px; } }
@media (max-width: 640px) {
    .ml-stage .ml-phone { width: 40%; }
    .ml-stage .ml-src { top: 12%; }
    .ml-core { left: 40%; width: 20%; top: 20%; gap: 8px; }
    .ml-orb { width: 48px; height: 48px; }
    .ml-demo .ml-orb svg { width: 22px; height: 22px; }
    .ml-final { padding: 10px 16px; }
}
@media (prefers-reduced-motion: reduce) { .ml-phone-screen, .ml-p-btn, .ml-demo-steps li { transition: none; } }
/* A narrow stage shows the chips as icons only (the stage is a size container) */
@container (max-width: 540px) { .ml-chip { padding: 8px; } .ml-chip > span:not(.ph-icon) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } .ml-orb { width: 50px; height: 50px; } }
