/* The motion pass, October 2026 (close levels). Loaded after css/ux/motion.css.
   Price, payment plan, Compare, Summary, Next guest (_audit/mirai-motion-playbook.html sections 10 and 12). The scripted half lives in js/sales.js (price.look / morph / intro,
   summary.morph / handOff), js/plus/close.js (figure keys, eligibility rolls) and js/ux/close.js (Summary entrance, Compare rows). Transform and opacity only;
   nothing here adds a CSS transition to a property GSAP or WAAPI drives on the same element. */

/* ---------- C01 · Price: the payment timeline fills down to "now" on the first reveal ----------
   js/sales.js price.intro adds .fill once the wipe lifts; each stage carries --i. A passed stage's dot pops on the spring and its green line draws down to the next one,
   160ms apart; "Now" slides in after its dot. A re-render (another plan) has no .fill, so nothing replays. */
.px-tl.fill li:is(.done, .cur) .px-dot { animation: px-pop .368s var(--ease-spring) calc(var(--i) * var(--st, 160ms)) backwards; }
.px-tl.fill li.done:not(:last-child)::after { transform-origin: 50% 0; animation: px-draw calc(var(--st, 160ms) + 40ms) linear calc(var(--i) * var(--st, 160ms) + 90ms) backwards; }
.px-tl.fill li.cur .px-now { animation: px-in .32s var(--ease-out) calc(var(--i) * var(--st, 160ms) + 220ms) backwards; }
@keyframes px-pop { from { transform: scale(.3); opacity: 0; } }
@keyframes px-draw { from { transform: scaleY(0); } }
@keyframes px-in { from { opacity: 0; transform: translateX(-6px); } }

/* ---------- C02 · Price: when prices are revealed, the total lands last with a soft glow ----------
   A pre-made layer whose opacity moves (never a text-shadow); js/sales.js price.morph adds .px-glow with --gd = the moment the total's roll lands. */
.px-total { position: relative; }
.px-total::after { content: ""; position: absolute; inset: -.5rem -.9rem; border-radius: 14px; pointer-events: none; z-index: -1; opacity: 0;
  background: radial-gradient(55% 75% at 28% 62%, rgba(110, 168, 242, .3), rgba(110, 168, 242, 0)); }
.px-total.px-glow::after { animation: px-glow 1.12s var(--ease-out) var(--gd, 0ms) both; }
@keyframes px-glow { 0% { opacity: 0; } 22% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- C03 · Price: the loan note's warning colour eases (renderEmi toggles .warn on every slider move; it swapped on the frame) ---------- */
.px-ltv { transition: color var(--dur-quick) var(--ease-out); }

/* ---------- C04 · Compare: the table is the box the leaving rows and columns are ghosted in (js/ux/close.js cmpMotion) ---------- */
#sheet.cmp .cx-cmp { position: relative; }
#sheet.cmp .cx-ghost { position: absolute; margin: 0; pointer-events: none; z-index: 1; }
#sheet.cmp .cx-ghost.cr { background: #fff; }   /* a leaving row covers the rows sliding up under it while it fades */

/* ---------- C05 · Summary: the brochure overlay fades in and out (it appeared with display), the ring's % rolls (js/sales.js summary.brochure) ---------- */
.sm-bro.on { animation: bro-in .208s var(--ease-out) both; }
.sm-bro.on .bro-card { animation: bro-card .368s var(--ease-spring) both; }
.sm-bro.on .bro-card.done { animation: none; }
@keyframes bro-in { from { opacity: 0; } }
@keyframes bro-card { from { opacity: 0; transform: scale(.94); } }

/* ---------- C06 · Next guest: the confirmation is centred by its box, not by translate ----------
   qa-fixes.css centred it with translate: -50% -50%, but GSAP 3.12 folds a CSS translate into its own transform when it tweens the panel (app.sheet's y, the spring
   in js/sales.js summary.nextGuest) and writes translate: none, so the card landed half a card low (and, under reduced motion, half a card right). Auto margins in a
   full inset centre it whatever GSAP does with transform. */
#sheet.ng .sh-panel { inset: 0; margin: auto; height: -webkit-fit-content; height: fit-content; translate: none; }

/* ---------- C07 · Price: "Today" travels down the payment timeline (round 3 · 24) ----------
   js/sales.js price.today glides the current stage's dot down from the first stage (900ms in-out) and sets --st (900ms / its place), so the fill in C01 keeps pace with it.
   The travelling dot does not pop; it rings twice where it lands (a pre-made ring: transform and opacity), then rests. "Now" and the line naming the next stage follow it in. */
.px-tl.fill.today li.cur .px-dot { animation: none; }
.px-tl.today li.cur .px-dot::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--now); opacity: 0; pointer-events: none; animation: px-ring .56s var(--ease-out) .72s 2; }
.px-tl.fill li.cur .px-next { animation: px-in .336s var(--ease-out) calc(var(--i) * var(--st, 160ms) + 400ms) backwards; }
@keyframes px-ring { from { opacity: .8; transform: scale(1); } to { opacity: 0; transform: scale(2.4); } }

/* ---------- reduced motion: values still change, nothing travels ---------- */
@media (prefers-reduced-motion: reduce) {
  .px-tl.fill li .px-dot, .px-tl.fill li::after, .px-tl.fill .px-now, .px-total.px-glow::after, .sm-bro.on, .sm-bro.on .bro-card { animation: none; }
  .px-tl.today li.cur .px-dot::after, .px-tl.fill li.cur .px-next { animation: none; }
  .px-ltv { transition: none; }
}

/* ---------- round 4 · 06 and 16 · sheets (js/ux/sheet-ux.js) ----------
   06: while a sheet is being pulled nothing in it gets selected.
   16: the slim title bar holds the top of a long sheet; it fades in as the big title scrolls away (--sb-p, 0 to 1 over the first 72px). */
#sheet.sh-pulling, #sheet.sh-pulling * { user-select: none; -webkit-user-select: none; }
#sheet .sh-bar { position: sticky; top: 0; z-index: 6; height: 0; margin: calc(var(--sb-pt, 0px) * -1) calc(var(--sb-pr, 0px) * -1) 0 calc(var(--sb-pl, 0px) * -1); pointer-events: none; }
#sheet .sh-bar > div { height: 52px; display: flex; align-items: center; justify-content: center; padding: 0 4.6rem; opacity: var(--sb-p, 0);
  background: rgba(255, 255, 255, .96); box-shadow: 0 1px 0 rgba(22, 22, 27, calc(var(--sb-p, 0) * .1)); }
#sheet .sh-bar b { font: 600 max(1rem, 15px)/1.1 var(--sans); color: #16161b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- round 5 · 07 · the building lights the homes that match (js/modes.js modes.choose.bld): five small elevations right of the filters, one square per home ---------- */
#lv-choose .cx-bld { display: none; }
@media (min-width: 1280px) and (min-aspect-ratio: 1/1) {   /* narrower, the filters would need another row: the compact one below takes over */
  #lv-choose .cx-bld { position: absolute; z-index: 2; top: calc(var(--pad) + var(--safe-t) + 3.9rem); right: calc(var(--pad) + var(--safe-r)); display: grid; justify-items: end; gap: .45rem; cursor: pointer; }
  #lv-choose .cx-filters { padding-right: 16rem; }
  #lv-choose .cx-ch-head .cx-note { margin-right: 18rem; }
}
#lv-choose .cb-cap { margin: 0; font: 500 max(.76rem, 11.5px)/1 var(--sans); color: var(--lg-fg2); white-space: nowrap; }
#lv-choose .cb-cap b { display: inline-block; color: var(--lg-fg); font-weight: 600; font-variant-numeric: tabular-nums; }
#lv-choose .cb-tws { display: flex; align-items: flex-end; gap: .6rem; }
#lv-choose .cb-tw { display: grid; justify-items: center; gap: 1px; }
#lv-choose .cb-fl { display: flex; justify-content: center; gap: 1px; }
#lv-choose .cb-fl i { display: block; width: 4px; height: 4px; border-radius: 1px; background: rgba(22, 22, 27, .11); transition: background-color .24s; }
#lv-choose .cb-fl i.sold { background: rgba(22, 22, 27, .04); box-shadow: inset 0 0 0 .5px rgba(22, 22, 27, .22); }
#lv-choose .cb-fl i.m { background: #3c6fb8; }
#lv-choose .cb-tw b { margin-top: .3rem; font: 600 max(.62rem, 11px)/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--lg-fg3); }

/* ---------- round 5 · 08 · each row points to the stronger home (js/ux/close.js openRows): the better figure's dot pops and an underline draws under it, row by row ---------- */
#sheet .cx-cmp .cx-bv { position: relative; display: inline-block; }
#sheet .cx-cmp .cx-bv::after { content: ""; position: absolute; left: 0; right: 0; bottom: -.2rem; height: 2px; border-radius: 2px; background: currentColor; opacity: .5; transform-origin: 0 50%; transition: transform .288s cubic-bezier(.22, 1, .36, 1) var(--uld, 0ms); }
#sheet .cx-cmp .cv.best .cx-dot { transition: transform .336s cubic-bezier(.22, 1, .36, 1) var(--uld, 0ms); }
#sheet .cx-cmp.ul-wait .cx-bv::after { transform: scaleX(0); transition: none; }
#sheet .cx-cmp.ul-wait .cv.best .cx-dot { transform: scale(0); transition: none; }

/* ---------- round 5 · 09 · a hold seals the home (js/sales.js sealHtml, popHeld): a green seal on the held home's plan, the plan tinted green under the drawing ---------- */
#lv-summary .sm-green { position: absolute; left: 50%; top: 50%; width: 160%; aspect-ratio: 1; margin: -80% 0 0 -80%; border-radius: 50%; background: rgba(47, 125, 87, .16); pointer-events: none; }
#lv-summary .sm-seal { position: absolute; right: .45rem; top: .45rem; z-index: 2; width: 4.4rem; height: 4.4rem; transform: rotate(-12deg); pointer-events: none; }
#lv-summary .sm-seal svg { display: block; width: 100%; height: 100%; overflow: visible; }
#lv-summary .sm-seal circle { fill: rgba(255, 255, 255, .86); stroke: #2f7d57; stroke-width: 3; }
#lv-summary .sm-seal circle.in { fill: none; stroke-width: 1.2; }
#lv-summary .sm-seal text { font: 600 12px/1 var(--sans); letter-spacing: .1em; fill: #2f7d57; }
#lv-summary .sm-seal .tk { fill: none; stroke: #2f7d57; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
#lv-summary .sm-sring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid #2f7d57; opacity: 0; }
/* the compact diagram for 900-1279px landscape tablets: in the filter row's flow, at the end of its last row (or on a line of its own when that row is full),
   the count on its left, squares 3 x 2px, each tower's initial underneath */
@media (min-width: 900px) and (max-width: 1279.98px) and (min-aspect-ratio: 1/1) {
  #lv-choose .cx-bld { position: static; display: flex; align-items: center; gap: .7rem; margin: .15rem 0 .15rem auto; padding-left: 1rem; cursor: pointer; }
  #lv-choose .cb-tws { gap: .45rem; }
  #lv-choose .cb-fl i { width: 3px; height: 2px; }
  #lv-choose .cb-tw b { margin-top: .15rem; font-size: 0; letter-spacing: 0; }   /* the initial only: A to E */
  #lv-choose .cb-tw b::first-letter { font-size: 12px; }   /* (19 October, Phase 6) 11px floor (was 8.5px) */
}

/* ---------- round 6 · 07 · where the home sits on its floor (js/modes.js where): the card's picture turns over to the floor's key plan ---------- */
#lv-choose .cx-key { position: absolute; inset: .6rem; display: none; }
#lv-choose .cx-card.where .cx-key { display: block; }
#lv-choose .cx-card.where .cx-pl > img { visibility: hidden; }
#lv-choose .cx-key svg { width: 100%; height: 100%; }
#lv-choose .cx-key polygon { fill: rgba(110, 140, 190, .14); stroke: rgba(52, 52, 60, .55); stroke-width: 3; stroke-linejoin: round; }
#lv-choose .cx-key polygon.me { fill: rgba(60, 111, 184, .85); stroke: #1f3f73; stroke-width: 5; }
#lv-choose .cx-card [data-hwhere].on, #lv-choose .cx-card.where [data-hwhere] { background: #16161b; color: #fff; }

/* ---------- round 6 · 08 · your payments build the tower (js/sales.js buildTo): in the payment plan's header, a small tower built to the chosen stage and the share paid ---------- */
#lv-price .pb-row { display: flex; align-items: flex-end; justify-content: space-between; gap: .8rem; }
#lv-price .px-plan .pb-row { align-items: flex-start; }   /* (23 October) Payment plan's kicker on the card's top line, level with Cost sheet and Home loan EMI (the paid figure beside it pushed it ~33px down) */
#lv-price .px-build { display: flex; align-items: flex-end; gap: .7rem; margin-bottom: .1rem; }
#lv-price .pb-tw { position: relative; flex: none; width: 2.1rem; height: 3.6rem; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
#lv-price .pb-ground { order: 4; width: 2.6rem; height: 2px; border-radius: 2px; background: rgba(22, 22, 27, .35); }
#lv-price .pb-pit { order: 3; width: 1.9rem; height: 0; border-radius: 0 0 3px 3px; background: #6b5a45; transition: height .32s; }
#lv-price .pb-tw.dug .pb-pit { height: .35rem; }
#lv-price .pb-base { order: 2; width: 1.9rem; height: 0; border-radius: 1px; background: #a99c88; transition: height .32s; }
#lv-price .pb-tw.based .pb-base { height: .2rem; }
#lv-price .pb-fl { order: 1; display: flex; flex-direction: column-reverse; width: 1.5rem; }
#lv-price .pb-fl i { display: block; height: 0; margin-top: 0; background: #cfc6b8; box-shadow: inset 0 0 0 1px rgba(80, 64, 48, .25); transform-origin: 50% 100%; transition: background-color .4s; }
#lv-price .pb-fl i.up { height: 2.6px; margin-top: 1px; }
#lv-price .pb-tw.clad .pb-fl i { background: #e6dccd; }
#lv-price .pb-tw.lit .pb-fl i { background: repeating-linear-gradient(90deg, #e6dccd 0 3px, #7fa6cf 3px 6px, #e6dccd 6px 8px); }
#lv-price .pb-flag { position: absolute; top: -.35rem; left: 50%; width: .7rem; height: .45rem; background: #2f7d57; clip-path: polygon(0 0, 100% 50%, 0 100%); opacity: 0; transition: opacity .32s; }
#lv-price .pb-tw.done .pb-flag { opacity: 1; }
#lv-price .pb-tx { display: grid; justify-items: end; gap: .15rem; margin: 0; text-align: right; }
#lv-price .pb-paid { display: inline-block; font: 600 max(1.25rem, 19px)/1 var(--sans); color: var(--lg-fg); font-variant-numeric: tabular-nums; }
#lv-price .pb-tx span { font: 500 max(.72rem, 11px)/1.2 var(--sans); color: var(--lg-fg3); white-space: nowrap; }
#lv-price .pb-st { font-style: normal; font-weight: 600; color: var(--lg-fg2); }
#lv-price .px-tl > li { cursor: pointer; }
#lv-price .px-tl > li.sel .px-ms b { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
