/* Motion for the leads page. Pure CSS.
   - Hero: plays once on load.
   - Everything else: CSS scroll-driven animations (animation-timeline: view()), so each element
     animates as it enters the screen. Browsers without support simply show the static page.
   - Nothing moves for visitors who ask for reduced motion. Only opacity and transform animate (GPU-friendly). */

@keyframes m-rise    { from { opacity: 0; transform: translateY(36px); } to { opacity: 1; transform: none; } }
@keyframes m-rise-sm { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes m-from-r  { from { opacity: 0; transform: translateX(48px); } to { opacity: 1; transform: none; } }
@keyframes m-from-l  { from { opacity: 0; transform: translateX(-48px); } to { opacity: 1; transform: none; } }
@keyframes m-pop     { from { opacity: 0; transform: scale(.82); } 70% { opacity: 1; transform: scale(1.04); } to { opacity: 1; transform: none; } }
@keyframes m-unveil  { from { transform: scale(.92); } to { transform: none; } }
@keyframes m-drift   { from { transform: translateY(-7%) scale(1.14); } to { transform: translateY(7%) scale(1.14); } }
@keyframes m-draw-x  { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes m-draw-y  { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes m-tick    { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes m-glow    { to { box-shadow: 0 12px 30px -12px rgba(0,0,0,.7); border-bottom-color: var(--kit-rule-2); } }

@media (prefers-reduced-motion: no-preference) {

  /* ---------- Hero: on load ---------- */
  .hero > div:first-child > * { animation: m-rise .9s cubic-bezier(.2,.7,.2,1) both; }
  .hero > div:first-child > :nth-child(1) { animation-delay: .05s; }
  .hero > div:first-child > :nth-child(2) { animation-delay: .15s; }
  .hero > div:first-child > :nth-child(3) { animation-delay: .28s; }
  .hero > div:first-child > :nth-child(4),
  .hero > div:first-child > :nth-child(5) { animation-delay: .4s; }
  .hero > div:first-child > :nth-child(n+6) { animation-delay: .52s; }
  .hero .form-panel { animation: m-from-r 1s .3s cubic-bezier(.2,.7,.2,1) both; }
  .hero .next .steps li { animation: m-rise-sm .7s cubic-bezier(.2,.7,.2,1) both; }
  .hero .next .steps li:nth-child(1) { animation-delay: .7s; }
  .hero .next .steps li:nth-child(2) { animation-delay: .82s; }
  .hero .next .steps li:nth-child(3) { animation-delay: .94s; }

  /* ---------- Micro-interactions (work everywhere) ---------- */
  .btn { transition: background var(--kit-transition), transform .25s cubic-bezier(.2,.7,.2,1), box-shadow .25s; }
  .btn:hover { transform: translateY(-2px); }
  .btn-primary:hover { box-shadow: 0 10px 24px -10px rgba(232,0,13,.65); }
  .panel, .who li, .stat { transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s, border-color .35s; }
  .stat:hover, .light .panel:hover { transform: translateY(-4px); }
  .light .panel:hover { box-shadow: 0 18px 40px -18px rgba(13,17,23,.25); }
  .who-photo { transition: box-shadow .35s; }
  .who li:hover .who-photo { box-shadow: 0 26px 44px -22px rgba(13,17,23,.55); }
  .icon-list li .ico { transition: transform .3s cubic-bezier(.2,.7,.2,1); }
  .icon-list li:hover .ico { transform: scale(1.1) rotate(-4deg); }
  .photo img { transition: transform .8s cubic-bezier(.2,.7,.2,1); }

  /* ---------- Scroll-driven ---------- */
  @supports (animation-timeline: view()) {

    /* Header deepens its shadow once you start scrolling */
    .site-header { animation: m-glow linear both; animation-timeline: scroll(root); animation-range: 0 140px; }

    /* Shared defaults for anything that reveals on scroll */
    .kit-head > *, .faq-head > *, .problem-body > :not(.pains),
    .flowline li, .pains li, .who li, .who-legend, .fit-col, .fit-col li,
    .stats .stat, #included .split > div > *:not(.team-photo), .scope, .icon-list li,
    .timeline li, .cta-text > *, .faq details, .site-footer .footer-inner > * {
      animation: m-rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 85%;
    }

    /* Section labels: the little tick draws itself */
    .kit-label::before { animation: m-tick linear both; animation-timeline: view(); animation-range: entry 10% entry 70%; transform-origin: bottom; }
    .hero .kit-label::before { animation: m-tick .6s .2s ease-out both; animation-timeline: auto; }

    /* Stagger items that sit side by side: later ones start a little later */
    .flowline li:nth-child(2), .who li:nth-child(2), .stats .stat:nth-child(2), .timeline li:nth-child(2) { animation-range: entry 10% entry 95%; }
    .flowline li:nth-child(3), .who li:nth-child(3), .stats .stat:nth-child(3), .timeline li:nth-child(3) { animation-range: entry 20% cover 25%; }
    .flowline li:nth-child(4), .who li:nth-child(4) { animation-range: entry 30% cover 30%; }
    .flowline li:nth-child(5), .who li:nth-child(5) { animation-range: entry 40% cover 35%; }

    /* Fit columns slide in from opposite sides */
    .fit-col:first-child { animation-name: m-from-l; }
    .fit-col:last-child  { animation-name: m-from-r; }

    /* Problem list and price card come in from the side */
    .pains li { animation-name: m-from-r; }
    .scope { animation-name: m-from-r; animation-range: entry 0% cover 30%; }

    /* Photos: the frame unveils, and the picture drifts slowly inside it (parallax) */
    .photo { animation: m-unveil linear both; animation-timeline: view(); animation-range: entry 0% cover 35%; }
    .photo img { animation: m-drift linear both; animation-timeline: view(); animation-range: cover 0% cover 100%; }

    /* The "How it works" line and the timeline line draw across as you arrive */
    .flowline::before { animation: m-draw-x linear both; animation-timeline: view(); animation-range: entry 20% cover 40%; transform-origin: left; }
    .timeline::before { animation: m-draw-x linear both; animation-timeline: view(); animation-range: entry 20% cover 40%; transform-origin: left; }

    /* The big ₹45,000 scales up a touch */
    .price { animation: m-pop linear both; animation-timeline: view(); animation-range: entry 30% cover 35%; transform-origin: left center; }
  }
}

/* Phones: the timeline is vertical, so its line draws downwards */
@media (prefers-reduced-motion: no-preference) and (max-width: 900px) {
  @supports (animation-timeline: view()) {
    .timeline::before { animation-name: m-draw-y; transform-origin: top; }
    .fit-col:first-child, .fit-col:last-child, .pains li, .scope { animation-name: m-rise; }
  }
}
