/* Sitewide motion layer (assets/js/motion.js). Every rule that hides or moves
   content is scoped under html.motion, which JS adds only when the visitor has
   not asked for reduced motion, so no-JS and reduced-motion visitors get the
   fully visible static page. Only transform and opacity are animated. */

/* Smooth cross-fade between pages (supported browsers; ignored elsewhere). */
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
}

/* ------------------------------------------------------- ambient background */
.fx {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.fx-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.fx-blob {
  position: absolute;
  width: min(46vw, 640px);
  aspect-ratio: 1;
  border-radius: 50%;
  translate: 0 var(--py, 0);
  will-change: transform;
}
.fx-blob--a {
  top: -22%;
  left: -8%;
  animation: fx-float-a 22s ease-in-out infinite alternate;
}
.fx-blob--b {
  right: -10%;
  bottom: -30%;
  animation: fx-float-b 26s ease-in-out infinite alternate;
}
.fx--dark .fx-blob--a {
  background: radial-gradient(circle at 50% 50%, rgba(214, 149, 0, 0.22), transparent 66%);
}
.fx--dark .fx-blob--b {
  background: radial-gradient(circle at 50% 50%, rgba(120, 70, 220, 0.3), transparent 66%);
}
.fx--light .fx-blob--a {
  background: radial-gradient(circle at 50% 50%, rgba(214, 149, 0, 0.14), transparent 66%);
}
.fx--light .fx-blob--b {
  background: radial-gradient(circle at 50% 50%, rgba(110, 70, 200, 0.12), transparent 66%);
}
@keyframes fx-float-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(8%, 10%, 0) scale(1.12); }
}
@keyframes fx-float-b {
  from { transform: translate3d(0, 0, 0) scale(1.08); }
  to { transform: translate3d(-10%, -8%, 0) scale(0.95); }
}

/* ------------------------------------------------------------ word reveal */
html.motion .split .w {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding: 0 0.06em 0.16em 0;
  margin: 0 -0.06em -0.16em 0;
}
html.motion .split .wi {
  display: inline-block;
  transform: translateY(108%);
  transition: transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(var(--wi, 0) * 55ms);
}
html.motion .split.split-in .wi {
  transform: none;
}

/* --------------------------------------------- staggered scroll reveal */
html.motion [data-reveal].reveal-init {
  transform: translateY(28px);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
html.motion [data-reveal].reveal-init.is-visible {
  transform: none;
}
html.motion [data-reveal].reveal-init .card {
  opacity: 0;
  transform: translateY(26px) scale(0.985);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(var(--i, 0) * 90ms + 120ms);
}
html.motion [data-reveal].reveal-init.is-visible .card {
  opacity: 1;
  transform: none;
}

/* ------------------------------------------------------------- buttons */
.button--primary,
.button--accent {
  position: relative;
  overflow: hidden;
}
html.motion .button.is-magnetic {
  translate: var(--tx, 0) var(--ty, 0);
  transition: translate 0.3s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

/* ------------------------------------------------------ scroll progress */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 90;
  transform-origin: left center;
  transform: scaleX(0);
  background: var(--color-link);
  pointer-events: none;
}


@media (prefers-reduced-motion: reduce) {
  .fx-blob {
    animation: none;
  }
}
