/* ==========================================================================
   R3 — motion tokens and assignments
   Work order §9, gate §13.4
   --------------------------------------------------------------------------
   Five curves account for the reference's entire motion vocabulary. Two matter
   for reveals, and R2 used `ease-out` for both of them, which is why the build
   felt inert where the reference feels springy.

     settle      cubic-bezier(0.165, 0.84, 0.44, 1)     54 uses
     overshoot   cubic-bezier(0.43, 1.71, 0.39, 0.92)   52 uses
     capsule     cubic-bezier(0.76, 0.09, 0.215, 1)      4 uses
     button-in   cubic-bezier(0.72, 0.01, 0, 1)          3 uses

   The split-pill's exact asymmetric pair is NOT touched here — it is verified
   by tests/split-pill-gate.mjs and stays on 0.25s / 0.6s.
   ========================================================================== */

:root {
  --ease-settle: cubic-bezier(0.165, 0.84, 0.44, 1);
  --ease-overshoot: cubic-bezier(0.43, 1.71, 0.39, 0.92);
  --ease-capsule: cubic-bezier(0.76, 0.09, 0.215, 1);
  --ease-button-in: cubic-bezier(0.72, 0.01, 0, 1);

  /*
   * Durations. §9.2 says the entrance durations were not supplied as Loom
   * measurements and must not be presented as such: these are the existing R2
   * durations, kept, and paired with the measured curves.
   */
  --dur-reveal: 700ms;
  --dur-card: 700ms;
}

/* --------------------------------------------------------------------------
   Major heading entrances -> overshoot
   --------------------------------------------------------------------------
   The word wrappers already exist and already animate opacity + translateY.
   Only the curve changes, and the distance is modest so the overshoot reads as
   spring rather than bounce (§9.3).
   -------------------------------------------------------------------------- */
.b-motion-ready .b-word-heading[data-b-state="shown"] .b-word__inner {
  transition:
    opacity var(--dur-reveal) var(--ease-overshoot),
    transform var(--dur-reveal) var(--ease-overshoot);
}

/* Section-level reveals that are editorial, not incidental -> overshoot. */
.b-motion-ready .b-reveal[data-b-state="shown"] {
  transition:
    opacity var(--dur-reveal) var(--ease-overshoot),
    transform var(--dur-reveal) var(--ease-overshoot);
}

/* Collage tiles enter on the same springy vocabulary. */
.b-motion-ready .b-art-layer[data-b-state="shown"] {
  transition:
    opacity 800ms var(--ease-overshoot),
    transform 800ms var(--ease-overshoot);
}

/* --------------------------------------------------------------------------
   Small secondary reveals -> settle
   --------------------------------------------------------------------------
   The process steps and the card bodies are supporting content: they arrive on
   the smooth curve so they do not compete with the headings.
   -------------------------------------------------------------------------- */
.b-motion-ready .b-principle[data-b-state="shown"],
.b-motion-ready .b-service-row[data-b-state="shown"],
.b-motion-ready .b-process__item[data-b-state="shown"],
.b-motion-ready .b-timeline__item[data-b-state="shown"] {
  transition:
    opacity 550ms var(--ease-settle),
    transform 550ms var(--ease-settle);
}

/* --------------------------------------------------------------------------
   Reduced motion — no entrance overshoot at all (§9.6).
   The existing global reduced-motion block already collapses durations; this
   makes the intent explicit for the entrance properties.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .b-motion-ready .b-word-heading[data-b-state="shown"] .b-word__inner,
  .b-motion-ready .b-reveal[data-b-state="shown"],
  .b-motion-ready .b-art-layer[data-b-state="shown"],
  .b-motion-ready .b-principle[data-b-state="shown"],
  .b-motion-ready .b-service-row[data-b-state="shown"],
  .b-motion-ready .b-process__item[data-b-state="shown"],
  .b-motion-ready .b-timeline__item[data-b-state="shown"] {
    transition: none;
    opacity: 1;
    transform: none;
  }
}
