/* Cut & Layer motion. Transform and opacity only. No new dependencies.
   Inspired by 21st.dev editorial collage heroes, scroll reveals and
   animated pricing comparisons. Original implementation; no paid code. */

@media (prefers-reduced-motion: no-preference) {
  .zh-btn,
  .fdx-form-button {
    transition: transform .18s cubic-bezier(.2, .8, .2, 1), background-color .18s ease, color .18s ease;
  }
  .zh-btn:hover,
  .fdx-form-button:hover { transform: translateY(-2px); }
  .zh-btn:active,
  .fdx-form-button:active { transform: translateY(0); }

  /* Charge and About: the collage pieces travel in and settle on their cuts. */
  .zh-page .collage__disc {
    animation: zh-disc 1.05s cubic-bezier(.16, 1, .3, 1) both;
  }
  .zh-page .collage__horizon {
    animation: zh-ground 1.05s cubic-bezier(.16, 1, .3, 1) .05s both;
  }
  .zh-page .collage__cut {
    animation: zh-assemble 1.05s cubic-bezier(.16, 1, .3, 1) both;
  }
  .zh-page .collage__cut--photo,
  .zh-page .collage__cut--sheet { animation-delay: .08s; }
  .zh-page .collage__cut--chip { animation-delay: .24s; }
  .zh-page .collage__cut--cursor { animation-delay: .4s; }

  /* Homepage reporting art opens like a sheet of paper as it enters. */
  body.zh-home:not(.zh-page) .report__art .z-circle {
    animation: zh-unveil linear both;
    animation-timeline: view();
    animation-range: entry 5% entry 40%;
  }
  body.zh-home:not(.zh-page) .benefit__bar {
    transform-origin: 100% 50%;
    animation: zh-bar linear both;
    animation-timeline: view();
    animation-range: entry 20% entry 55%;
  }

  /* Charge: fee marks grow to their real widths. Currency swaps are scripted. */
  .zh-page--charge .pk-card {
    animation: zh-deal linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 35%;
  }
  .zh-page--charge .pk-card__bar {
    transform-origin: right center;
    animation: zh-bar linear both;
    animation-timeline: view();
    animation-range: entry 15% entry 50%;
  }

  /* About: the story arrives as a full paper rule and two rising paragraphs. */
  .zh-page--about-us .story__title {
    box-shadow: inset 0 -4px 0 #770011;
  }
  .zh-page--about-us .story__text p {
    animation: zh-rise linear both;
    animation-timeline: view();
    animation-range: entry 5% entry 40%;
  }
  .zh-page--about-us .story__text p + p { animation-range: entry 15% entry 50%; }
  .zh-page--about-us .svc__grid > li {
    animation: zh-rise linear both;
    animation-timeline: view();
    animation-range: entry 8% entry 42%;
  }
}

@keyframes zh-assemble {
  from { opacity: 0; transform: translateY(86px) rotate(calc(var(--r) - 12deg)) scale(.84); }
}
@keyframes zh-disc {
  from { opacity: 0; transform: scale(.5) translateY(40px); }
}
@keyframes zh-ground {
  from { opacity: 0; transform: translateY(52px); }
}
@keyframes zh-unveil {
  from { opacity: 0; clip-path: inset(18% 10% 70% 10% round 24px); transform: rotate(-6deg) scale(.9); }
  to { opacity: 1; clip-path: inset(0 round 0); transform: none; }
}
@keyframes zh-bar {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
@keyframes zh-deal {
  from { opacity: 0; transform: translateY(56px) rotate(-1.5deg); }
  to { opacity: 1; transform: none; }
}
@keyframes zh-rise {
  from { opacity: 0; transform: translateY(48px); }
  to { opacity: 1; transform: none; }
}
@keyframes zh-rule {
  to { background-size: 100% 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .zh-btn:hover,
  .fdx-form-button:hover { transform: none; }
}
