/* Motion layered on top of the base design. Loaded after styles.css.
   The hidden starting states only apply when motion.js has added the "js"
   class to <html>, so the page is fully visible without JavaScript, and only
   when the visitor has not asked for reduced motion. */

@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0; transform: translateY(28px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
    transition-delay: calc(var(--i, 0) * 90ms);
  }
  .js .reveal.in { opacity: 1; transform: none; }

  .js .gallery .reveal { transform: translateY(20px) scale(0.96); }
  .js .gallery .reveal.in { transform: none; }

  .js .steps li.reveal::before { transition: scale 0.5s var(--ease); transition-delay: calc(var(--i, 0) * 90ms + 0.25s); }
  .js .steps li.reveal:not(.in)::before { scale: 0; }

  .js .chips li {
    opacity: 0; transform: translateY(12px);
    transition: opacity 0.45s var(--ease), transform 0.45s var(--ease), translate 0.2s var(--ease), background-color 0.2s;
    transition-delay: calc(var(--i, 0) * 60ms);
  }
  .js .chips.in li { opacity: 1; transform: none; transition-delay: calc(var(--i, 0) * 60ms), calc(var(--i, 0) * 60ms), 0s, 0s; }

  .js .badge { transition: scale 0.3s var(--ease), rotate 0.3s var(--ease); }
  .js .feature.reveal:not(.in) .badge { scale: 0.6; rotate: -20deg; }
}

/* Header shadow once the page has scrolled, and the current section in the nav */
.top { transition: box-shadow 0.3s var(--ease); }
.top.scrolled { box-shadow: 0 6px 20px rgba(22, 48, 42, 0.08); }
.top nav a[aria-current="true"] { color: var(--pink); background-size: 100% 2px; }

/* Back to top, once the hero has scrolled away */
.to-top {
  position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 6;
  width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--marigold); color: var(--ink); box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
  display: grid; place-items: center;
  opacity: 0; translate: 0 16px; pointer-events: none;
  transition: opacity 0.3s var(--ease), translate 0.3s var(--ease), background-color 0.2s;
}
.to-top.show { opacity: 1; translate: 0 0; pointer-events: auto; }
.to-top:hover { background: #ffc341; }
.to-top svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 860px) { .to-top { width: 44px; height: 44px; } }
