/* My Big Little Wins website: motion (v2, 2 October 2026)
   Load after tokens.css and site.css. Plain CSS, no libraries.
   Every moment has a still: under prefers-reduced-motion the final frame shows and interactions still work. */

:root {
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-standard: cubic-bezier(.4, 0, .2, 1);
  --spring-soft: cubic-bezier(.34, 1.3, .5, 1);   /* postcard settle */
  --spring-dot: cubic-bezier(.34, 1.6, .5, 1);    /* one-tap dot */
}

/* ---------- The celebration (logo) ----------
   Markup: see reference/sections.html. Size is set with --s on .celebrate (e.g. --s: 160px).
   Geometry, all relative to --s: halo 100%, sage circle 58%, coral dot 20%, ring 62%, burst dot 3.6%. */
.celebrate { position: relative; width: var(--s); height: var(--s); flex: none; }
.celebrate > * { position: absolute; border-radius: 50%; }
.celebrate .halo  { inset: 0; background: var(--sun-wash); }
.celebrate .sage  { inset: 21%; background: var(--calm); }
.celebrate .dot   { left: 40%; top: 40%; width: 20%; height: 20%; background: var(--add-win); }
.celebrate .spark { background: var(--celebrate); }
.celebrate .s1 { left: 8%;  top: 22%; width: 4.2%; height: 4.2%; --i: 0; }
.celebrate .s2 { left: 82%; top: 13%; width: 5.6%; height: 5.6%; --i: 1; }
.celebrate .s3 { left: 90%; top: 68%; width: 3.2%; height: 3.2%; --i: 2; }
.celebrate .ring  { inset: 19%; border: max(2px, calc(var(--s) * .012)) solid var(--celebrate); opacity: 0; }
.celebrate .burst { left: 48.2%; top: 48.2%; width: 3.6%; height: 3.6%; transform: rotate(var(--a)); }
.celebrate .burst::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--celebrate); opacity: 0; }
.celebrate .fall  { top: -6%; width: 3%; height: 3%; background: var(--celebrate); opacity: 0; }

/* Playing: JS adds .is-playing and a movement class (.mv-drop, .mv-pop, .mv-orbit, .mv-shower, .mv-ripple, .mv-bloom).
   To replay, remove .is-playing, force a reflow (el.offsetWidth), add it again. */
.celebrate.is-playing .halo  { animation: mblw-halo 400ms var(--ease-out) both; }
.celebrate.is-playing .spark { animation: mblw-spark 240ms var(--ease-out) both; animation-delay: calc(var(--rest) + var(--i) * 60ms); }

.celebrate.mv-drop   { --rest: 800ms; }
.celebrate.mv-drop.is-playing .dot   { animation: mblw-drop 1000ms linear 200ms both; }

.celebrate.mv-pop    { --rest: 1300ms; }
.celebrate.mv-pop.is-playing .dot    { animation: mblw-pop 520ms var(--ease-out) 350ms both; }
.celebrate.mv-pop.is-playing .burst::after { animation: mblw-burst 900ms cubic-bezier(.2,.7,.3,1) 450ms both; }

.celebrate.mv-orbit  { --rest: 2100ms; }
.celebrate.mv-orbit.is-playing .dot  { animation: mblw-orbit 1200ms var(--ease-out) 250ms both; }
.celebrate.mv-orbit.is-playing .burst::after { animation: mblw-burst 900ms cubic-bezier(.2,.7,.3,1) 1350ms both; }

.celebrate.mv-shower { --rest: 1600ms; }
.celebrate.mv-shower.is-playing .dot { animation: mblw-drop 1000ms linear 350ms both; }
.celebrate.mv-shower.is-playing .fall { animation: mblw-fall 1500ms cubic-bezier(.4,0,.8,.6) both; animation-delay: calc(150ms + var(--i) * 110ms); }

.celebrate.mv-ripple { --rest: 1900ms; }
.celebrate.mv-ripple.is-playing .dot { animation: mblw-grow 900ms var(--ease-out) 300ms both; }
.celebrate.mv-ripple.is-playing .ring { animation: mblw-ring 1500ms cubic-bezier(.2,.6,.3,1) both; animation-delay: calc(650ms + var(--i) * 380ms); }

.celebrate.mv-bloom  { --rest: 2300ms; }
.celebrate.mv-bloom.is-playing .halo { animation: mblw-halo 400ms var(--ease-out) both, mblw-beat 900ms ease-in-out 1100ms both; }
.celebrate.mv-bloom.is-playing .dot  { animation: mblw-drop 1000ms linear 200ms both; }
.celebrate.mv-bloom.is-playing .burst::after { animation: mblw-burst 900ms cubic-bezier(.2,.7,.3,1) 950ms both; }
.celebrate.mv-bloom.is-playing .ring { animation: mblw-ring 1500ms cubic-bezier(.2,.6,.3,1) both; animation-delay: calc(1000ms + var(--i) * 380ms); }
.celebrate.mv-bloom.is-playing .fall { animation: mblw-fall 1500ms cubic-bezier(.4,0,.8,.6) both; animation-delay: calc(300ms + var(--i) * 110ms); }

@keyframes mblw-halo  { 0% { transform: scale(.6); opacity: 0 } 100% { transform: scale(1); opacity: 1 } }
@keyframes mblw-beat  { 0%,100% { transform: scale(1) } 20% { transform: scale(1.08) } 40% { transform: scale(1) } 60% { transform: scale(1.05) } }
@keyframes mblw-drop  {
  0%   { transform: translateY(-420%); animation-timing-function: cubic-bezier(.5,0,1,1) }
  45%  { transform: translateY(0);     animation-timing-function: cubic-bezier(0,0,.4,1) }
  60%  { transform: translateY(-34%);  animation-timing-function: cubic-bezier(.5,0,1,1) }
  72%  { transform: translateY(0);     animation-timing-function: cubic-bezier(0,0,.4,1) }
  82%  { transform: translateY(-14%);  animation-timing-function: cubic-bezier(.5,0,1,1) }
  90%  { transform: translateY(0) } 95% { transform: translateY(-4%) } 100% { transform: translateY(0) } }
@keyframes mblw-pop   { 0% { transform: scale(0) } 55% { transform: scale(1.4) } 78% { transform: scale(.9) } 100% { transform: scale(1) } }
@keyframes mblw-orbit { 0% { transform: rotate(0) translateX(150%) rotate(0); opacity: 0 } 10% { opacity: 1 } 100% { transform: rotate(540deg) translateX(0) rotate(-540deg); opacity: 1 } }
@keyframes mblw-grow  { 0% { transform: scale(0) } 100% { transform: scale(1) } }
@keyframes mblw-spark { 0% { transform: scale(0); opacity: 0 } 100% { transform: scale(1); opacity: 1 } }
@keyframes mblw-burst { 0% { transform: translateX(0) scale(1); opacity: 0 } 10% { opacity: 1 } 100% { transform: translateX(1150%) scale(.6); opacity: 0 } }
@keyframes mblw-fall  { 0% { top: -6%; opacity: 0 } 15% { opacity: 1 } 80% { opacity: .9 } 100% { top: 96%; opacity: 0 } }
@keyframes mblw-ring  { 0% { transform: scale(.9); opacity: .9 } 100% { transform: scale(1.62); opacity: 0 } }

/* ---------- Scroll reveal ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(12px); transition: opacity 320ms var(--ease-out), transform 320ms var(--ease-out); }
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- Hero phone ---------- */
.hero-halo { animation: mblw-halo 600ms var(--ease-out) both; }
.phone-sheet { transform: translateY(105%); transition: transform 320ms var(--ease-standard); }
.phone-sheet.is-up { transform: none; transition: transform 420ms var(--ease-out); }
.phone-sheet .line, .phone-sheet .quote, .phone-sheet .done { opacity: 0; transform: translateY(8px); transition: opacity 320ms var(--ease-out), transform 320ms var(--ease-out); }
.phone-sheet.is-up .line  { opacity: 1; transform: none; transition-delay: 1000ms; }
.phone-sheet.is-up .quote { opacity: 1; transform: none; transition-delay: 1100ms; }
.phone-sheet.is-up .done  { opacity: 1; transform: none; transition-delay: 1200ms; }

/* ---------- One-tap chip ---------- */
.chip { transition: background-color 200ms ease, border-color 200ms ease, transform 120ms ease; }
.chip:active { transform: scale(.96); }
.chip .mark { transform: scale(0); transition: transform 200ms var(--ease-out); }
.chip .mark-dot { opacity: 0; transform: translateY(-8px); }
.chip .plus { transition: opacity 150ms ease; }
.chip[aria-pressed="true"] { background: var(--calm); border-color: var(--calm); font-weight: 800; }
.chip[aria-pressed="true"] .mark { transform: scale(1); }
.chip[aria-pressed="true"] .mark-dot { opacity: 1; transform: none; transition: transform 260ms var(--spring-dot) 180ms, opacity 120ms ease 180ms; }
.chip[aria-pressed="true"] .plus { opacity: 0; }
.landed-row { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 320ms var(--ease-out); }
.landed-row > div { overflow: hidden; min-height: 0; }
.landed-row.is-in { grid-template-rows: 1fr; }
.landed-row .row { background: var(--warm); transition: background-color 1200ms ease 400ms; }
.landed-row.is-settled .row { background: transparent; }

/* ---------- I Need a Win card ---------- */
.handed { transition: opacity 320ms ease, transform 320ms var(--ease-out); }
.handed.is-out { opacity: 0; transform: translateX(-24px); transition: opacity 240ms ease, transform 240ms var(--ease-out); }
.handed.is-pre { opacity: 0; transform: translateY(12px) scale(.96); transition: none; }

/* ---------- Remember this? postcard ---------- */
.postcard { opacity: 0; transform: rotate(6deg) translateY(16px); transition: transform 520ms var(--spring-soft), opacity 320ms ease; }
.postcard.is-in { opacity: 1; transform: rotate(-2.5deg); }
.postcard .postmark { transform: rotate(-8deg); transition: transform 200ms ease; }
.postcard.is-swapping .postmark { transform: rotate(-14deg); }
.postcard .words, .postcard .date { transition: opacity 150ms ease; }
.postcard.is-swapping .words, .postcard.is-swapping .date { opacity: 0; }

/* ---------- Reduced motion: final frames, no movement ---------- */
@media (prefers-reduced-motion: reduce) {
  .celebrate *, .celebrate *::after, .hero-halo { animation: none !important; }
  .celebrate .ring, .celebrate .burst, .celebrate .fall { display: none; }
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  .phone-sheet { display: none; }                      /* the hero phone simply shows Today */
  .postcard { opacity: 1; transform: rotate(-2.5deg); transition: none; }
  .chip, .chip *, .handed, .landed-row, .landed-row .row, .postcard * { transition: none !important; }
}
