/* Homepage scroll motion after the hero. Content stays visible unless JS opts in
   (html.hm-on) and the visitor allows motion; every reveal releases to the natural style. */
@media (prefers-reduced-motion: no-preference) {
  html.hm-on [data-hm]:not(.hm-in),
  html.hm-on [data-hm-group]:not(.hm-in) > [data-hm-item] { opacity: 0; }

  html.hm-on [data-hm="fade"].hm-in { animation: hm-fade .7s cubic-bezier(.16,1,.3,1) .12s backwards; }
  html.hm-on [data-hm="mask"].hm-in { animation: hm-mask .8s cubic-bezier(.16,1,.3,1) backwards; }
  html.hm-on [data-hm-group].hm-in > [data-hm-item] {
    animation: hm-rise .7s cubic-bezier(.16,1,.3,1) backwards;
    animation-delay: calc(var(--hm-i, 0) * 70ms);
  }

  /* Cases slide out like sheets from under the section edge. */
  html.hm-on .cases.hm-in > [data-hm-item] {
    animation: hm-sheet .9s cubic-bezier(.16,1,.3,1) backwards;
    animation-delay: calc(var(--hm-i, 0) * 120ms);
  }

  /* Focal moment: the process runs left to right — each rule draws, then its step lands. */
  html.hm-on .steps > .step { position: relative; border-top-color: transparent; }
  html.hm-on .steps > .step::before {
    content: ''; position: absolute; left: 0; right: 0; top: -2px; height: 2px;
    background: var(--blue, #3265f5); transform-origin: left center;
  }
  html.hm-on .steps:not(.hm-in) > .step::before { transform: scaleX(0); }
  html.hm-on .steps.hm-in > .step::before {
    animation: hm-rule .6s cubic-bezier(.65,0,.35,1) backwards;
    animation-delay: calc(var(--hm-i, 0) * 300ms);
  }
  html.hm-on .steps:not(.hm-in) > .step > * { opacity: 0; }
  html.hm-on .steps.hm-in > .step > * {
    animation: hm-rise .6s cubic-bezier(.16,1,.3,1) backwards;
    animation-delay: calc(var(--hm-i, 0) * 300ms + 260ms);
  }

  /* Research figures: the proportion bar fills while the number counts up. */
  html.hm-on .stats > .stat { position: relative; overflow: hidden; }
  html.hm-on .stats > .stat::after {
    content: ''; position: absolute; left: 0; bottom: 0; height: 3px;
    width: var(--hm-share, 0%); background: var(--blue, #3265f5); transform-origin: left center;
  }
  html.hm-on .stats:not(.hm-in) > .stat::after { transform: scaleX(0); }
  html.hm-on .stats.hm-in > .stat::after {
    animation: hm-rule 1.1s cubic-bezier(.16,1,.3,1) backwards;
    animation-delay: calc(var(--hm-i, 0) * 70ms + 150ms);
  }

  /* Native disclosure keeps its semantics; only the height change is eased. */
  #faq details, #cases .case-details { interpolate-size: allow-keywords; }
  #faq details::details-content,
  #cases .case-details::details-content {
    block-size: 0; overflow: clip;
    transition: block-size .38s cubic-bezier(.16,1,.3,1), content-visibility .38s allow-discrete;
  }
  #faq details[open]::details-content,
  #cases .case-details[open]::details-content { block-size: auto; }
}

@keyframes hm-fade { from { opacity: 0; transform: translateY(12px); } }
@keyframes hm-rise { from { opacity: 0; transform: translateY(22px); } }
@keyframes hm-mask { from { opacity: 0; clip-path: inset(0 0 100% 0); transform: translateY(.35em); } to { opacity: 1; clip-path: inset(0 0 -20% 0); transform: none; } }
@keyframes hm-sheet { from { opacity: 0; clip-path: inset(0 0 100% 0); transform: translateY(36px); } to { opacity: 1; clip-path: inset(-20px -20px -20px -20px); transform: none; } }
@keyframes hm-rule { from { transform: scaleX(0); } to { transform: scaleX(1); } }
