/* Recharge4Me — motion
 *
 * Everything here is opacity and transform only. Those two properties are
 * the ones a browser can animate on the compositor without re-laying out
 * the page, which is why this stays smooth on a mid-range Android phone.
 *
 * Nothing is hidden by CSS alone. The reveal classes are attached by
 * motion.js, so if the script fails to load the page renders normally
 * rather than staying blank. */

.r4m-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.7s cubic-bezier(0.22, 0.68, 0.3, 1) var(--r4m-d, 0ms),
    transform 0.7s cubic-bezier(0.22, 0.68, 0.3, 1) var(--r4m-d, 0ms);
  will-change: opacity, transform;
}

.r4m-in {
  opacity: 1;
  transform: none;
}

/* Once a section has arrived it never animates again, so leave the
   compositor alone. */
.r4m-done {
  will-change: auto;
}

/* The header starts flat against the hero and gains a surface once the
   page moves under it. */
.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  transition:
    background-color 0.32s ease,
    backdrop-filter 0.32s ease,
    border-color 0.32s ease,
    box-shadow 0.32s ease;
  border-bottom: 1px solid transparent;
}

.site-head.r4m-stuck {
  background-color: rgba(14, 17, 22, 0.72);
  backdrop-filter: saturate(1.5) blur(14px);
  -webkit-backdrop-filter: saturate(1.5) blur(14px);
  border-bottom-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 30px -22px rgba(0, 0, 0, 0.9);
}

/* The hero card drifts a little slower than the page. Small on purpose —
   anything more and it reads as a gimmick rather than depth. */
.card-stage {
  will-change: transform;
}

/* Buttons and cards get a little life on hover, on devices that have a
   real pointer. Touch devices skip it, where hover states stick. */
@media (hover: hover) and (pointer: fine) {
  .btn {
    transition: transform 0.18s ease, box-shadow 0.18s ease;
  }
  .btn:hover {
    transform: translateY(-2px);
  }
  .btn:active {
    transform: translateY(0);
  }

  .netcard,
  .step,
  .net {
    transition: transform 0.28s cubic-bezier(0.22, 0.68, 0.3, 1);
  }
  .netcard:hover,
  .step:hover,
  .net:hover {
    transform: translateY(-4px);
  }
}

/* Anyone who has asked their system for less movement gets none of it.
   This is not decoration — vestibular disorders make parallax genuinely
   unpleasant, and the setting exists to be honoured. */
@media (prefers-reduced-motion: reduce) {
  .r4m-reveal,
  .r4m-in {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .card-stage {
    transform: none !important;
  }
  .btn:hover,
  .netcard:hover,
  .step:hover,
  .net:hover {
    transform: none !important;
  }
}
