/* Liftline demo motion. Everything that moves lives here and in motion.js.
   Nothing in this file applies unless motion.js has run (html.motion) and the
   visitor has not asked for reduced motion. Every end state equals the static design. */

@media (prefers-reduced-motion:no-preference){

  /* Quiet feedback on controls */
  .btn{transition:background-color .15s,border-color .15s,color .15s}
  .opt{transition:background-color .12s,border-color .12s,color .12s}

  /* ---- Accent line (only if a page adds one) draws down the page as you scroll ---- */
  .motion .riser{clip-path:inset(-2px -10px calc(100% - var(--len,100%)) -10px)}

  /* ---- Call pill: the "Live dispatch" dot breathes. Opacity only, no rings ---- */
  .pill-live i{animation:breathe 3s ease-in-out infinite}
  @keyframes breathe{50%{opacity:.35}}

  /* ---- Trust strip: the rating counts up once (motion.js) ---- */
  [data-count]{font-variant-numeric:lining-nums tabular-nums}
  .motion [data-motion=count]:not(.is-in){opacity:0}   /* the real number is never shown wrong, only late */

  /* ---- Work order: the slip is written in, row by row ---- */
  .motion [data-motion=write] dd,
  .motion [data-motion=write] .slip-status{opacity:0;transition:opacity .35s ease-out;transition-delay:calc(var(--i,0)*140ms)}
  .motion [data-motion=write].is-in dd,
  .motion [data-motion=write].is-in .slip-status{opacity:1}
  [data-motion=write] .slip-rows > div:nth-child(2){--i:1}
  [data-motion=write] .slip-rows > div:nth-child(3){--i:2}
  [data-motion=write] .slip-rows > div:nth-child(4){--i:3}
  [data-motion=write] .slip-rows > div:nth-child(5){--i:4}
  [data-motion=write] .slip-rows > div:nth-child(6){--i:5}
  [data-motion=write] .slip-status{--i:6}

  /* ---- Services: the two names settle into their spacing ---- */
  .motion [data-motion=settle] .service-name{letter-spacing:.035em;opacity:.5;transition:letter-spacing .9s cubic-bezier(.2,.7,.2,1),opacity .9s ease-out}
  .motion [data-motion=settle] .service + .service .service-name{transition-delay:.25s}
  .motion [data-motion=settle].is-in .service-name{letter-spacing:-.02em;opacity:1}

  /* ---- Promises: each hairline wipes in from the left ---- */
  .motion [data-motion=wipe] > :is(div,article){border-top-color:transparent;background:linear-gradient(var(--rule),var(--rule)) left top/0 1px no-repeat;transition:background-size .6s cubic-bezier(.3,0,.2,1)}
  .motion [data-motion=wipe] > :is(div,article):nth-child(2){transition-delay:.15s}
  .motion [data-motion=wipe] > :is(div,article):nth-child(3){transition-delay:.3s}
  .motion [data-motion=wipe] > :is(div,article):nth-child(4){transition-delay:.45s}
  .motion [data-motion=wipe] > :is(div,article):nth-child(5){transition-delay:.6s}
  .motion [data-motion=wipe] > :is(div,article):nth-child(6){transition-delay:.75s}
  .motion [data-motion=wipe] > :is(div,article):nth-child(7){transition-delay:.9s}
  .motion [data-motion=wipe] > :is(div,article):nth-child(8){transition-delay:1.05s}
  .motion [data-motion=wipe].is-in > div{background-size:100% 1px}

  /* ---- Areas: the three linked towns are underlined in turn ---- */
  .motion [data-motion=underline] a{text-decoration-color:transparent;background:linear-gradient(var(--accent),var(--accent)) left 96%/0 1.5px no-repeat;transition:background-size .5s cubic-bezier(.3,0,.2,1),color .15s}
  .motion [data-motion=underline] li:nth-child(2) a{transition-delay:.22s,0s}
  .motion [data-motion=underline] li:nth-child(3) a{transition-delay:.44s,0s}
  .motion [data-motion=underline].is-in a{background-size:100% 1.5px}

  /* ---- Club: each price rolls up into place ---- */
  .motion [data-motion=roll] .price{clip-path:inset(0 0 100% 0);transform:translateY(.4em);transition:clip-path .55s cubic-bezier(.2,.7,.2,1),transform .55s cubic-bezier(.2,.7,.2,1)}
  .motion [data-motion=roll] > div:nth-child(2) .price{transition-delay:.18s}
  .motion [data-motion=roll] > div:nth-child(3) .price{transition-delay:.36s}
  .motion [data-motion=roll].is-in .price{clip-path:inset(0 0 -10% 0);transform:none}

  /* ---- Reviews: each quote comes into focus, one after another ---- */
  .motion [data-motion=focus] blockquote p{color:#9CA5A2;transition:color .6s ease-out}
  .motion [data-motion=focus] blockquote:nth-child(2) p{transition-delay:.45s}
  .motion [data-motion=focus] blockquote:nth-child(3) p{transition-delay:.9s}
  .motion [data-motion=focus].is-in blockquote p{color:var(--ink)}

  /* ---- FAQ: answers open and close smoothly, the plus folds to a minus ---- */
  :root{interpolate-size:allow-keywords}
  details::details-content{block-size:0;overflow:clip;transition:block-size .3s cubic-bezier(.3,0,.2,1),content-visibility .3s allow-discrete}
  details[open]::details-content{block-size:auto}
  summary::after{transition:background-size .25s}
  details[open] summary::after{background:linear-gradient(var(--accent),var(--accent)) center/100% 1.5px no-repeat,linear-gradient(var(--accent),var(--accent)) center/1.5px 0 no-repeat}
}
