/* Motion for four moments (Miguel, 2026-11-23): the first photo step, the wait,
   the plans sheets, and a first save or a purchase. Words and prices are untouched;
   everything here is decoration and switches off under prefers-reduced-motion. */

/* 1. First photo step: one card turns from an original to a finished look. */
#firstFlip[hidden]{display:none}
#firstFlip{margin:0 0 10px;cursor:pointer}
#wiz.first-flip-on .first-offer-example{display:none}
.first-flip-look{margin:0 0 6px;text-align:center;min-height:24px}
.first-flip-look span{display:inline-block;padding:3px 11px;border-radius:999px;background:var(--tint,#F2F4FB);color:var(--cobalt,#1A56DB);font-size:12px;font-weight:600;line-height:1.5;transition:opacity .3s}
.first-flip-stage{perspective:900px;max-width:300px;margin:0 auto}
.first-flip-card{position:relative;aspect-ratio:3/2;transform-style:preserve-3d;transition:transform .7s cubic-bezier(.3,1.35,.5,1)}
/* Whole images, never cropped: finished looks carry their burnt-in staging label. */
.first-flip-card figure{position:absolute;inset:0;margin:0;overflow:hidden;border-radius:12px;background:#eef0f2;backface-visibility:hidden;-webkit-backface-visibility:hidden;box-shadow:0 10px 26px rgba(20,20,20,.16)}
.first-flip-card figure+figure{transform:rotateY(180deg)}
.first-flip-card img{display:block;width:100%;height:100%;object-fit:cover}
.first-flip-card figcaption{position:absolute;top:6px;padding:3px 7px;border-radius:5px;background:rgba(20,20,20,.72);color:#fff;font-size:11px;font-weight:600;line-height:1.2}
.first-flip-card figure:first-child figcaption{inset-inline-start:6px}
.first-flip-card figure+figure figcaption{inset-inline-end:6px;background:var(--cobalt,#1A56DB)}
@media(max-height:700px){.first-flip-stage{max-width:228px}}
/* The card takes the room the big upload box had, so the box stays above the fixed
   Continue bar, in the app too (stage/first-offer.css does the same for the offer). */
@media(max-width:719px){
  #wiz.first-flip-on #wizDrop{min-height:60px!important;padding:10px!important;gap:2px}
  #wiz.first-flip-on[data-step=photo] #wizPhotoMount #wizDrop::before{display:none!important}
}
/* The smallest phones keep the upload box first, as the offer example does. */
@media(max-height:600px){#firstFlip{display:none}}

/* 2. The wait: what is happening to this photo, one line at a time. */
#currentDesignStep{margin:6px 0 0;min-height:1.4em;font-size:15px;font-weight:600;color:var(--ink,#141414);transition:opacity .25s,transform .25s}
#currentDesignStep[hidden]{display:none}
#currentDesignStep.changing{opacity:0;transform:translateY(4px)}
/* The picture clears from a blur; its settle from 1.02 to 1 is in stage/motion-principles.js. */
#currentDesignImages img{animation:motion-arrive var(--m-max,300ms) var(--m-ease-in,cubic-bezier(.2,.7,.3,1)) backwards}
@keyframes motion-arrive{from{opacity:0;filter:blur(10px)}to{opacity:1;filter:none}}

/* 3. Plans: the sheet arrives, then its lines one after another. Display rules stay
   where they are (stage/iap.js, index.html); only the entrance is added.
   Shared numbers (stage/motion-tokens.css, 2026-11-24): the sheet takes --m-max, each
   line --m-base, 35 ms apart. The entrance moves the translate and scale properties,
   never transform, so a swipe that sets transform can start at once without a jump.
   The website panel (#upPanel .up-sheet) grows from the button that opened it
   (stage/motion-principles.js); a sideways start would put its close button off a phone. */
#appPaywall.on .pw{animation:motion-sheet-up var(--m-max,300ms) var(--m-ease-in,cubic-bezier(.2,.7,.3,1)) backwards}
#appPaywall.on .pw-benefits li{animation:motion-line-in var(--m-base,240ms) var(--m-ease-in,cubic-bezier(.2,.7,.3,1)) backwards}
#appPaywall.on .pw-benefits li:nth-child(1){animation-delay:.14s}
#appPaywall.on .pw-benefits li:nth-child(2){animation-delay:.175s}
#appPaywall.on .pw-benefits li:nth-child(3){animation-delay:.21s}
#appPaywall.on .pw-benefits li:nth-child(n+4){animation-delay:.245s}
#appPaywall.on .pw-benefits li::before{animation:motion-pop var(--m-base,240ms) var(--m-spring,cubic-bezier(.3,1.5,.5,1)) backwards;animation-delay:inherit}
#appPaywall.on .pw-opt{animation:motion-line-in var(--m-base,240ms) var(--m-ease-in,cubic-bezier(.2,.7,.3,1)) backwards}
#appPaywall.on .pw-opt:nth-child(1){animation-delay:.21s}
#appPaywall.on .pw-opt:nth-child(2){animation-delay:.245s}
#appPaywall.on .pw-opt:nth-child(n+3){animation-delay:.28s}
#upPanel.on .up-row{animation:motion-line-in var(--m-base,240ms) var(--m-ease-in,cubic-bezier(.2,.7,.3,1)) backwards}
#upPanel.on .up-row:nth-of-type(1){animation-delay:.1s}
#upPanel.on .up-row:nth-of-type(2){animation-delay:.135s}
#upPanel.on .up-row:nth-of-type(3){animation-delay:.17s}
#upPanel.on .up-row:nth-of-type(n+4){animation-delay:.205s}
@keyframes motion-sheet-up{from{translate:0 100%}to{translate:0 0}}
@keyframes motion-line-in{from{opacity:0;translate:0 10px}to{opacity:1;translate:0 0}}
@keyframes motion-pop{from{scale:0}to{scale:1}}

/* 5. A first save, or a purchase: one short burst. Never blocks a tap. */
.motion-confetti{position:fixed;inset:0;z-index:700;pointer-events:none;overflow:hidden}
.motion-confetti i{position:absolute;left:50%;top:38%;width:7px;height:11px;border-radius:2px;opacity:0}
.motion-saved{animation:motion-saved .5s cubic-bezier(.3,1.4,.5,1)}
@keyframes motion-saved{0%{transform:scale(1)}40%{transform:scale(.96)}100%{transform:scale(1)}}

@media(prefers-reduced-motion:reduce){
  .first-flip-card,.first-flip-look span,#currentDesignStep{transition:none}
  #currentDesignImages img,#appPaywall.on .pw,#appPaywall.on .pw-benefits li,#appPaywall.on .pw-benefits li::before,#appPaywall.on .pw-opt,#upPanel.on .up-row,.motion-saved{animation:none}
  .motion-confetti{display:none}
}
