/* xGrowth motion refresh v1: services hub and four service pages (additive; loaded after services.css).
   1. Diagram refinements ride the existing one-shot lifecycle in services.js: every rule needs [data-mstate=play],
      which services.js sets on first real entry and removes when the sequence settles, is interrupted, the tab is
      hidden or reduced motion switches on. Nothing here can hold a diagram away from its resting design.
   2. Interaction polish: explicit transitioned properties, press feedback, fine-pointer hover only (no sticky hover
      on touch), keyboard focus states kept.
   3. Opportunity editor: brief interruptible highlight on a result value that actually changed. Values update
      immediately; no counting or interim numbers.
   The existing --ease token wins over skill defaults. Reduced motion: services.css already removes all transitions
   and animations; the diagram rules below are additionally gated to no-preference. */

/* ---------- 1. explanatory diagram sequences ---------- */
@media screen and (prefers-reduced-motion:no-preference){
@keyframes mr-pass{0%,100%{transform:none;box-shadow:0 0 0 0 transparent}40%{transform:scale(1.35);border-color:var(--acc);box-shadow:0 0 0 6px color-mix(in srgb,var(--acc) 26%,transparent)}}
@keyframes mr-lit{35%,65%{color:var(--ink)}}
@keyframes mr-stream{35%{border-color:var(--acc);box-shadow:0 0 0 6px color-mix(in srgb,var(--acc) 18%,transparent)}}
@keyframes mr-hold{30%,80%{color:var(--acc)}}
@keyframes mr-row{40%{border-color:var(--acc)}}
@keyframes mr-panel{from{opacity:0;transform:translateY(-6px)}}

/* Hub (HUB-03 decision loop): the signal is handed node to node. Each node it reaches answers with a brief pulse
   and its sublabel brightens, so the reading order Acquisition → Product experience → Monetization → Investment is
   shown, not just drawn. Investment keeps its existing pop; the return line still says "could sit anywhere". */
[data-motion=loop][data-mstate=play] .dg-node:nth-child(1)::after{animation:mr-pass .5s var(--ease) .1s both}
[data-motion=loop][data-mstate=play] .dg-node:nth-child(2)::after{animation:mr-pass .5s var(--ease) .5s both}
[data-motion=loop][data-mstate=play] .dg-node:nth-child(3)::after{animation:mr-pass .5s var(--ease) .88s both}
[data-motion=loop][data-mstate=play] .dg-node:nth-child(-n+3) span{animation:mr-lit .6s ease .12s both}
[data-motion=loop][data-mstate=play] .dg-node:nth-child(2) span{animation-delay:.52s}
[data-motion=loop][data-mstate=play] .dg-node:nth-child(3) span{animation-delay:.9s}
[data-motion=loop][data-mstate=play] .dg-node:nth-child(4) span{animation:mr-lit .6s ease 1.25s both}

/* Monetization (MON-05 mixed revenue): each stream is named in turn as it moves into the overlap, so three
   distinct sources visibly become one combined result. Keeps the existing gather and core emphasis. */
[data-motion=mix][data-mstate=play] .c{animation:dg-settle .9s var(--ease) both,mr-stream .62s ease both}
[data-motion=mix][data-mstate=play] .c2{animation-delay:.08s,.2s}
[data-motion=mix][data-mstate=play] .c3{animation-delay:.16s,.4s}

/* User acquisition (UA-04 campaign worth): the trace starts from the users a campaign attracts, so the three
   flagged constraints read as consequences of that starting point. Existing flags unchanged. */
[data-motion=chain][data-mstate=play] .dg-node:nth-child(1)::after{animation:mr-pass .5s var(--ease) .08s both}

/* Product (PRODUCT-02 value path): while the signal pauses at the friction step, its label holds the accent, so
   the pause reads as "something interrupts here" before the next step is revealed. */
[data-motion=path][data-mstate=play] .dg-node:nth-child(1)::after{animation:mr-pass .5s var(--ease) .08s both}
[data-motion=path][data-mstate=play] .dg-node.dash b{animation:mr-hold .62s ease .58s both}

/* ASO (ASO-02 discovery vs conversion): each side's heading takes the accent as that side is revealed, so the two
   problems are named one after the other. */
[data-motion=two][data-mstate=play] .side>b{animation:dg-settle .55s var(--ease) both,mr-hold .6s ease .08s both}
[data-motion=two][data-mstate=play] .side.r>b{animation-delay:.45s,.5s}

/* ASO (ASO-05 consistent promise): the row border joins the sweep, so each surface is visibly connected in turn. */
[data-motion=align][data-mstate=play] div{animation:mr-row .75s ease .15s both}
[data-motion=align][data-mstate=play] div:nth-child(2){animation-delay:.55s}
[data-motion=align][data-mstate=play] div:nth-child(3){animation-delay:.95s}

/* Opportunity editor: opening "Use your numbers" settles the panel in (state indication); closing is instant. */
.s-imp .imp-use[open] .imp-panel{animation:mr-panel .24s var(--ease) both}
}

/* ---------- 2. interaction polish (explicit properties, press, hover gating) ---------- */
.svc-page .btn{transition:transform .16s var(--ease),background-color .2s ease,color .2s ease}
.svc-page .btn:active{transform:scale(.97)}
.svc-page .s-row .ar,.svc-page .s-index a .ar{transition:transform .25s var(--ease),background-color .2s ease,color .2s ease,border-color .2s ease}
.svc-page .thm{transition:border-color .2s ease,transform .2s var(--ease)}
.svc-page .s-imp .imp-use>summary::before{transition:background-color .2s ease,color .2s ease,border-color .2s ease}
.svc-page .s-imp .imp-box{transition:border-color .16s ease}
@media (hover:none),(pointer:coarse){
  .svc-page .btn-ink:hover{transform:none;background:var(--ink)}
  [data-theme=dark] .svc-page .btn-ink:hover{background:var(--g)}
  .svc-page .thm:hover{transform:none;border-color:var(--line2)}
  .svc-page .s-row .go:not(:focus-visible):hover .ar,.svc-page .s-index a:not(:focus-visible):hover .ar,
  [data-theme=dark] .svc-page .s-row .go:not(:focus-visible):hover .ar,[data-theme=dark] .svc-page .s-index a:not(:focus-visible):hover .ar{background:transparent;color:inherit;border-color:var(--line2);transform:none}
  .svc-page .s-imp .imp-use>summary:hover::before{background:transparent;color:inherit;border-color:var(--line2)}
}

/* ---------- 3. opportunity editor: changed-value highlight ---------- */
.svc-page .s-imp [data-out]{border-radius:6px;transition:background-color .45s ease,box-shadow .45s ease}
.svc-page .s-imp [data-out].mr-changed{transition:none;background-color:color-mix(in srgb,var(--acc) 22%,transparent);box-shadow:0 0 0 4px color-mix(in srgb,var(--acc) 22%,transparent)}

@media (prefers-reduced-motion:reduce){
  .svc-page .btn:active{transform:none}
  .svc-page .s-imp [data-out].mr-changed{background-color:transparent;box-shadow:none}
}
