/* Steelyard site: motion layer.
   Decoration only. Without JavaScript, or with "reduce motion" switched on, the page is complete and static.
   Hidden-until-revealed states exist only under html.motion, which motion.js sets, and only for
   elements that start below the fold, so nothing visible on load ever disappears. */

:root {
  --sy-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --sy-ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
  --sy-stagger: 70ms;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  /* ---------- hero: CSS-only entrance, runs from the first paint ---------- */
  .js .hero__text > * { animation: sy-rise 0.9s var(--sy-ease) both; }
  .js .hero__text > :nth-child(1) { animation-delay: 0.04s; }
  .js .hero__text > :nth-child(2) { animation-delay: 0.12s; }
  .js .hero__text > :nth-child(3) { animation-delay: 0.18s; }
  .js .hero__text > :nth-child(4) { animation-delay: 0.24s; }
  .js .hero__text > :nth-child(5) { animation-delay: 0.30s; }
  .js .hero__text > :nth-child(6) { animation-delay: 0.36s; }
  .js .hero__shot { animation: sy-panel-in 1.1s var(--sy-ease) 0.2s both; }
  .js .hero__shot .crop img {
    transform-origin: 82% 46%;
    animation: sy-settle 2.2s var(--sy-ease) 0.2s both;
  }
  .js .hero__amount { display: inline-block; animation: sy-pop 0.7s var(--sy-ease-pop) 0.5s both; }

  /* hero screenshot drifts a little while the page scrolls (motion.js sets --sy-drift) */
  .motion .hero__shot .crop { transform: translate3d(0, var(--sy-drift, 0px), 0); will-change: transform; }

  /* ---------- scroll reveal ---------- */
  .motion .sy-r {
    transition: opacity 0.85s var(--sy-ease), transform 0.85s var(--sy-ease);
    transition-delay: calc(var(--sy-i, 0) * var(--sy-stagger));
  }
  .motion .sy-r.is-pending { opacity: 0; transform: translate3d(0, 28px, 0); }
  .motion h2.sy-r.is-pending { transform: translate3d(0, 18px, 0); }

  /* screenshots inside a revealed panel open like a shutter, one after another */
  .motion .sy-r .crop {
    transition: clip-path 1.1s var(--sy-ease), opacity 0.6s var(--sy-ease);
    transition-delay: calc(0.12s + var(--sy-ci, 0) * 120ms);
    clip-path: inset(0 0 0 0 round var(--r-md));
  }
  .motion .sy-r.is-pending .crop { clip-path: inset(10% 6% 10% 6% round var(--r-md)); opacity: 0.2; }

  /* lists revealed as a group: children follow each other */
  .motion .sy-group > * {
    transition: opacity 0.7s var(--sy-ease), transform 0.7s var(--sy-ease);
    transition-delay: calc(0.08s + var(--sy-i, 0) * var(--sy-stagger));
  }
  .motion .sy-group.is-pending > * { opacity: 0; transform: translate3d(0, 20px, 0); }
  .motion .sy-group.is-pending { opacity: 1; transform: none; }

  /* preset dots pop in after their card */
  .motion .presets .dot { transition: transform 0.6s var(--sy-ease-pop); transition-delay: calc(0.3s + var(--sy-i, 0) * var(--sy-stagger)); }
  .motion .presets.is-pending .dot { transform: scale(0); }

  /* comparison table: rows rise, then the Steelyard column lights up once */
  .motion .compare tbody tr {
    transition: opacity 0.6s var(--sy-ease), transform 0.6s var(--sy-ease);
    transition-delay: calc(0.1s + var(--sy-i, 0) * 50ms);
  }
  .motion .sy-r.is-pending .compare tbody tr { opacity: 0; transform: translate3d(0, 12px, 0); }
  .motion .compare.is-lit td.is-ours { animation: sy-col-light 1.4s var(--sy-ease) both; animation-delay: calc(0.2s + var(--sy-i, 0) * 60ms); }

  /* dark panel: the measured numbers count up (motion.js), the list follows the heading */
  .motion .dark-panel.is-pending h2 { opacity: 0; transform: translate3d(0, 16px, 0); }
  .motion .dark-panel h2 { transition: opacity 0.8s var(--sy-ease) 0.15s, transform 0.8s var(--sy-ease) 0.15s; }
  .motion .dark-panel .dark-list > li { transition: opacity 0.7s var(--sy-ease), transform 0.7s var(--sy-ease); transition-delay: calc(0.3s + var(--sy-i, 0) * 90ms); }
  .motion .dark-panel.is-pending .dark-list > li { opacity: 0; transform: translate3d(0, 14px, 0); }
  .num-anim { font-variant-numeric: tabular-nums; }

  /* ---------- small interactions ---------- */
  .btn, .link-arrow, .preset__link { transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.2s var(--sy-ease); }
  .btn svg, .link-arrow svg, .docs-nav__link svg, .preset__link svg { transition: transform 0.25s var(--sy-ease); }
  .btn:hover svg, .link-arrow:hover svg, .preset__link:hover svg { transform: translateX(3px); }
  .btn:active { transform: scale(0.97); }
  a.preset__link:hover { transform: translateY(-1px); }

  .site-header { transition: box-shadow 0.3s var(--sy-ease), background-color 0.3s; }
  .site-header.is-scrolled { box-shadow: 0 1px 0 var(--line), 0 8px 24px -16px rgba(16, 18, 20, 0.25); }

  .site-search__results:not([hidden]) { animation: sy-drop 0.18s var(--sy-ease) both; transform-origin: top center; }
  .js .site-nav.is-open, .js .site-search.is-open, .js .docs-nav.is-open { animation: sy-drop 0.22s var(--sy-ease) both; transform-origin: top center; }

  .faq__x { transition: transform 0.35s var(--sy-ease-pop), background-color 0.2s; }
  .faq__item summary:hover .faq__x { background-color: var(--line); }

  input, select, textarea { transition: border-color 0.2s, box-shadow 0.2s; }

  /* ---------- documentation pages ---------- */
  .docs-main { animation: sy-rise 0.6s var(--sy-ease) both; }
  .docs-toc a, .docs-nav__sub a, .docs-nav__link { transition: background-color 0.2s, color 0.2s; }
  .sy-progress {
    position: fixed; left: 0; top: 0; z-index: 40; height: 3px; width: 100%;
    background: var(--accent); transform-origin: 0 50%; transform: scaleX(var(--sy-p, 0));
    pointer-events: none;
  }

  /* ---------- support ---------- */
  .success { animation: sy-rise 0.7s var(--sy-ease) both; }
  .success__ticket { animation: sy-stamp 0.6s var(--sy-ease-pop) 0.25s both; }
  .error-summary { animation: sy-shake 0.45s var(--sy-ease) both; }
}

@keyframes sy-rise { from { opacity: 0; transform: translate3d(0, 24px, 0); } to { opacity: 1; transform: none; } }
@keyframes sy-panel-in { from { opacity: 0; transform: translate3d(0, 40px, 0) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes sy-settle { from { transform: scale(1.08); } to { transform: scale(1); } }
@keyframes sy-pop { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: none; } }
@keyframes sy-drop { from { opacity: 0; transform: translate3d(0, -6px, 0) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes sy-fade-in { from { opacity: 0; transform: translate3d(0, -4px, 0); } to { opacity: 1; transform: none; } }
@keyframes sy-stamp { from { opacity: 0; transform: scale(1.25); } to { opacity: 1; transform: none; } }
@keyframes sy-shake {
  0%, 100% { transform: none; }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}
@keyframes sy-col-light {
  0% { box-shadow: inset 0 0 0 100vmax rgba(15, 43, 255, 0); }
  35% { box-shadow: inset 0 0 0 100vmax rgba(15, 43, 255, 0.1); }
  100% { box-shadow: inset 0 0 0 100vmax rgba(15, 43, 255, 0); }
}

@media print {
  .motion .is-pending, .motion .is-pending > *, .motion .is-pending .crop, .motion .is-pending tr, .motion .is-pending li, .motion .is-pending h2 {
    opacity: 1 !important; transform: none !important; clip-path: none !important;
  }
  .sy-progress { display: none; }
}
