/* block-motion.css — анимация блоков, same-origin, без CDN */
:root {
  --bm-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --bm-accent: var(--brass, #c4a35a);
  --bm-ink: var(--ink, #0b1c2c);
}

/* scroll progress */
.bm-scroll-progress,
.sf-scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 9999;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--bm-accent), color-mix(in srgb, var(--bm-accent) 40%, #38bdf8));
  pointer-events: none;
}

/* reveal + stagger */
.bm-reveal,
.sf-reveal,
.reveal,
[data-bm-reveal] {
  opacity: 1;
  transform: none;
  transition: opacity 0.5s var(--bm-ease), transform 0.55s var(--bm-ease);
}
.bm-reveal.bm-pending,
.sf-reveal.sf-fx-pending,
.reveal:not(.is-in) {
  opacity: 0;
  transform: translateY(1rem);
}
.bm-reveal.bm-in,
.sf-reveal.sf-visible,
.reveal.is-in,
[data-bm-reveal].bm-in {
  opacity: 1;
  transform: none;
}
.bm-stagger > *.bm-pending {
  opacity: 0;
  transform: translateY(0.75rem);
  transition: opacity 0.45s var(--bm-ease), transform 0.5s var(--bm-ease);
  transition-delay: calc(var(--i, 0) * 60ms);
}

/* kinetic */
.bm-kinetic,
.sf-kinetic {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.02em 0.08em;
}
.bm-kinetic__word,
.sf-kinetic__word {
  display: inline-block;
  will-change: transform, opacity;
}

/* tilt / magnetic */
.bm-tilt,
.sf-tilt-card,
.bm-magnetic,
.sf-magnetic,
[data-bm-tilt],
[data-bm-magnetic] {
  transition: transform 0.15s var(--bm-ease);
  will-change: transform;
}
.bm-tilt-active,
.sf-tilt-active,
.bm-mag-active,
.sf-mag-active {
  transition: none;
}

/* coverflow */
.bm-coverflow,
[data-bm-coverflow],
[data-sf-coverflow] {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 12rem;
  perspective: 900px;
}
.bm-coverflow__item,
.sf-coverflow__item {
  grid-area: 1 / 1;
  width: min(100%, 18rem);
  transform: translateX(calc(var(--d, 0) * 42%)) scale(calc(1 - (var(--d, 0) * var(--d, 0)) * 0.04))
    rotateY(calc(var(--d, 0) * -18deg));
  opacity: 0.45;
  transition: transform 0.45s var(--bm-ease), opacity 0.35s ease;
  pointer-events: none;
}
.bm-coverflow__item--active,
.sf-coverflow__item--active {
  pointer-events: auto;
  opacity: 1;
  transform: translateX(0) scale(1) rotateY(0);
}

/* morph submit */
.bm-morph-submit,
.sf-morph-submit {
  position: relative;
  overflow: hidden;
}
.bm-morph-submit.is-loading .bm-morph-submit__label,
.sf-morph-submit.is-loading .sf-morph-submit__label {
  opacity: 0.35;
}
.bm-morph-submit__spin,
.sf-morph-submit__spin {
  position: absolute;
  inset: auto 0.85rem auto auto;
  width: 1rem;
  height: 1rem;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  opacity: 0;
}
.bm-morph-submit.is-loading .bm-morph-submit__spin,
.sf-morph-submit.is-loading .sf-morph-submit__spin {
  opacity: 1;
  animation: bm-spin 0.7s linear infinite;
}
@keyframes bm-spin {
  to {
    transform: rotate(360deg);
  }
}

/* accordion */
[data-bm-acc-item] [data-bm-acc-panel] {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s var(--bm-ease);
}
[data-bm-acc-item].is-open [data-bm-acc-panel] {
  grid-template-rows: 1fr;
}
[data-bm-acc-panel] > * {
  overflow: hidden;
}

/* hero parallax layers (CSS-only drift) */
.bm-parallax,
.sf-hero-parallax {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.bm-parallax__bg,
.sf-hero-parallax__bg {
  position: absolute;
  inset: -8%;
  z-index: -1;
  background-size: cover;
  background-position: center;
  animation: bm-drift 18s ease-in-out infinite alternate;
}
@keyframes bm-drift {
  to {
    transform: translate3d(2%, -1.5%, 0) scale(1.03);
  }
}

@media (prefers-reduced-motion: reduce) {
  .bm-scroll-progress,
  .sf-scroll-progress,
  .bm-parallax__bg,
  .sf-hero-parallax__bg,
  .bm-morph-submit__spin,
  .sf-morph-submit__spin {
    animation: none !important;
    display: none;
  }
  .bm-reveal,
  .sf-reveal,
  .reveal,
  .bm-coverflow__item,
  .sf-coverflow__item,
  .bm-tilt,
  .sf-tilt-card,
  .bm-magnetic,
  .sf-magnetic {
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}
