/*
  Icon motion. Each glyph acts out what it depicts when its control is hovered
  or focused: a coin drops into the piggy bank, the palm sways, the clock's hands
  sweep, the bell rings. ui.js adds .play for the duration in data-ms, so a motion
  always finishes even if the pointer leaves. Glyphs are Lucide (ISC).
*/

.icon svg {
  overflow: visible;
  stroke-width: var(--icon-stroke, 1.85)
}

.icon svg * {
  transform-box: fill-box;
  transform-origin: center
}

.icon .coin,
.icon .twinkle,
.icon .ink {
  opacity: 0
}

/* Parts that turn around a shared point of the 24 x 24 glyph */
.icon :is(.needle, .minute, .hour, .gear, .ray, .moon, .hands, .mark, .person, .frond, .tail, .pencil, .bell, .clapper, .flap, .pig, .front, .back) {
  transform-box: view-box
}

.icon :is(.needle, .minute, .hour, .gear, .ray, .moon, .hands, .mark) {
  transform-origin: 12px 12px
}

.icon .person { transform-origin: 12px 17px }
.icon .frond { transform-origin: 12.5px 8.5px }
.icon .tail { transform-origin: 5px 11px }
.icon .pencil { transform-origin: 3px 21px }
.icon :is(.bell, .clapper) { transform-origin: 12px 3px }
.icon .flap { transform-origin: 12px 7px }
.icon .pig { transform-origin: 12px 20px }
.icon .front { transform-origin: 15px 17px }
.icon .back { transform-origin: 9px 22px }
.icon[data-motion="gauge"] .needle { transform-origin: 12px 14px }

/* Shared keyframes */
@keyframes i-draw {
  from { stroke-dashoffset: 1 }
  to { stroke-dashoffset: 0 }
}

@keyframes i-grow {
  from { transform: scaleY(0) }
  to { transform: none }
}

@keyframes i-pop {
  0% { transform: scale(0); opacity: 0 }
  65% { transform: scale(1.35); opacity: 1 }
  100% { transform: none; opacity: 1 }
}

@keyframes i-swell {
  0%, 100% { transform: none }
  40% { transform: scale(1.09) }
  70% { transform: scale(.97) }
}

.icon.play .draw {
  stroke-dasharray: 1;
  animation: i-draw .42s var(--ease-out) both
}

/* Navigation */
[data-motion="home"].play svg { transform-origin: 50% 100%; animation: i-hop .7s var(--ease-out) }
[data-motion="home"].play .door { animation: i-lights .85s ease-out }
@keyframes i-hop {
  0%, 100% { transform: none }
  28% { transform: translateY(-1.6px) }
  55% { transform: translateY(.3px) scale(1.03, .96) }
  78% { transform: translateY(-.3px) }
}
@keyframes i-lights {
  0%, 100% { fill: transparent }
  30%, 70% { fill: var(--icon-glow) }
}

[data-motion="checklist"].play .c2 { animation-delay: .2s }
[data-motion="checklist"].play :is(.l1, .l3) { animation: i-shift .5s var(--ease-out) }
[data-motion="checklist"].play .l3 { animation-delay: .2s }
@keyframes i-shift {
  0%, 100% { transform: none }
  40% { transform: translateX(1.8px) }
}

[data-motion="team"].play .back { animation: i-gather .75s var(--ease-out) }
[data-motion="team"].play .head { animation: i-nod .6s .12s var(--ease-out) }
@keyframes i-gather {
  0%, 100% { transform: none }
  35% { transform: translateX(-2.4px) }
  70% { transform: translateX(.6px) }
}
@keyframes i-nod {
  0%, 100% { transform: none }
  40% { transform: translateY(-1.3px) }
  75% { transform: translateY(.3px) }
}

[data-motion="scan"].play .lens { animation: i-scan .85s var(--ease-in-out) }
@keyframes i-scan {
  0%, 100% { transform: none }
  25% { transform: translate(-2.2px, -1px) }
  55% { transform: translate(.8px, -2.2px) }
  80% { transform: translate(.4px, .4px) }
}

[data-motion="needle"].play .needle { animation: i-needle 1s var(--ease-out) }
@keyframes i-needle {
  0%, 100% { transform: none }
  18% { transform: rotate(-42deg) }
  42% { transform: rotate(30deg) }
  62% { transform: rotate(-13deg) }
  80% { transform: rotate(5deg) }
}

[data-motion="pay"].play :is(.coin-a, .coin-b) { animation: i-coin-in .5s var(--ease-out) both }
[data-motion="pay"].play .coin-b { animation-delay: .13s }
[data-motion="pay"].play .hand { animation: i-catch .45s .3s var(--ease-out) }
@keyframes i-coin-in {
  0% { transform: translateY(-6px); opacity: 0 }
  60% { transform: translateY(.7px); opacity: 1 }
  100% { transform: none; opacity: 1 }
}
@keyframes i-catch {
  0%, 100% { transform: none }
  40% { transform: translateY(.9px) }
}

[data-motion="clock"].play .minute { animation: i-turn .9s var(--ease-in-out) }
[data-motion="clock"].play .hour { animation: i-tick .9s var(--ease-in-out) }
@keyframes i-turn {
  to { transform: rotate(360deg) }
}
@keyframes i-tick {
  0%, 100% { transform: none }
  50% { transform: rotate(30deg) }
}

[data-motion="sway"].play .frond { animation: i-sway 1.15s ease-in-out }
[data-motion="sway"].play .trunk { transform-origin: 50% 100%; animation: i-bend 1.15s ease-in-out }
@keyframes i-sway {
  0%, 100% { transform: none }
  22% { transform: rotate(-10deg) }
  52% { transform: rotate(7deg) }
  78% { transform: rotate(-2.5deg) }
}
@keyframes i-bend {
  0%, 100% { transform: none }
  22% { transform: skewX(-5deg) }
  52% { transform: skewX(3deg) }
  78% { transform: skewX(-1deg) }
}

[data-motion="pillars"].play .col { transform-origin: 50% 100%; animation: i-grow .42s var(--ease-out) both }
[data-motion="pillars"].play .k2 { animation-delay: .06s }
[data-motion="pillars"].play .k3 { animation-delay: .12s }
[data-motion="pillars"].play .k4 { animation-delay: .18s }
[data-motion="pillars"].play .roof { animation: i-settle .75s var(--ease-out) }
@keyframes i-settle {
  0%, 100% { transform: none }
  25% { transform: translateY(-2.2px) }
  60% { transform: translateY(.4px) }
}

[data-motion="piggy"].play .coin { animation: i-coin-drop .8s cubic-bezier(.55, 0, .8, .4) both }
[data-motion="piggy"].play .pig { animation: i-dip .5s .55s var(--ease-out) }
[data-motion="piggy"].play .tail { animation: i-wag .55s .6s ease-in-out }
@keyframes i-coin-drop {
  0% { opacity: 0; transform: translateY(-3.5px) }
  18% { opacity: 1 }
  72% { opacity: 1; transform: translateY(3px) }
  88%, 100% { opacity: 0; transform: translateY(4.4px) }
}
@keyframes i-dip {
  0%, 100% { transform: none }
  35% { transform: translateY(.5px) scaleY(.95) }
  70% { transform: scaleY(1.02) }
}
@keyframes i-wag {
  0%, 100% { transform: none }
  30% { transform: rotate(-24deg) }
  65% { transform: rotate(14deg) }
}

[data-motion="shield"].play .shield { animation: i-swell .6s var(--ease-out) }
[data-motion="shield"].play .draw { animation-delay: .16s }

[data-motion="receipt"].play .paper { animation: i-print .7s var(--ease-out) }
[data-motion="receipt"].play .draw { animation-duration: .55s; animation-delay: .1s }
@keyframes i-print {
  0%, 100% { transform: none }
  35% { transform: translateY(-1.6px) }
  70% { transform: translateY(.3px) }
}

[data-motion="bars"].play .bar,
[data-motion="report"].play .bar { transform-origin: 50% 100%; animation: i-grow .42s var(--ease-spring) both }
:is([data-motion="bars"], [data-motion="report"]).play .k2 { animation-delay: .08s }
:is([data-motion="bars"], [data-motion="report"]).play .k3 { animation-delay: .16s }

[data-motion="fan"].play .front { animation: i-fan-front .7s var(--ease-out) }
[data-motion="fan"].play .back { animation: i-fan-back .7s var(--ease-out) }
@keyframes i-fan-front {
  0%, 100% { transform: none }
  40% { transform: rotate(8deg) translate(.8px, -.6px) }
}
@keyframes i-fan-back {
  0%, 100% { transform: none }
  40% { transform: rotate(-7deg) translateX(-.8px) }
}

[data-motion="hello"].play .person { animation: i-tilt .75s var(--ease-out) }
@keyframes i-tilt {
  0%, 100% { transform: none }
  30% { transform: rotate(-11deg) }
  65% { transform: rotate(6deg) }
}

[data-motion="gear"].play .gear { animation: i-gear .85s var(--ease-spring) }
@keyframes i-gear {
  to { transform: rotate(120deg) }
}

/* Objects and actions */
[data-motion="nod"].play .head { animation: i-nod .6s var(--ease-out) }

[data-motion="add-person"].play .add,
[data-motion="add-file"].play .add { transform-box: view-box; animation: i-spin-add .6s var(--ease-spring) }
[data-motion="add-person"].play .add { transform-origin: 19px 11px }
[data-motion="add-file"].play .add { transform-origin: 12px 15px }
@keyframes i-spin-add {
  from { transform: rotate(-90deg) scale(.4) }
  to { transform: none }
}

[data-motion="forward"].play .go { animation: i-forward .55s var(--ease-out) }
[data-motion="backward"].play .go { animation: i-backward .55s var(--ease-out) }
[data-motion="outward"].play .go { animation: i-outward .55s var(--ease-out) }
@keyframes i-forward {
  0% { transform: none; opacity: 1 }
  42% { transform: translateX(6px); opacity: 0 }
  43% { transform: translateX(-6px); opacity: 0 }
  100% { transform: none; opacity: 1 }
}
@keyframes i-backward {
  0% { transform: none; opacity: 1 }
  42% { transform: translateX(-6px); opacity: 0 }
  43% { transform: translateX(6px); opacity: 0 }
  100% { transform: none; opacity: 1 }
}
@keyframes i-outward {
  0% { transform: none; opacity: 1 }
  42% { transform: translate(5px, -5px); opacity: 0 }
  43% { transform: translate(-5px, 5px); opacity: 0 }
  100% { transform: none; opacity: 1 }
}

[data-motion="ring"].play .bell { animation: i-ring .9s ease-out }
[data-motion="ring"].play .clapper { animation: i-ring .9s .07s ease-out }
@keyframes i-ring {
  0%, 100% { transform: none }
  14% { transform: rotate(15deg) }
  30% { transform: rotate(-13deg) }
  46% { transform: rotate(9deg) }
  62% { transform: rotate(-5deg) }
  78% { transform: rotate(2deg) }
}

[data-motion="lift"].play svg { transform-origin: 50% 100%; animation: i-lift .7s var(--ease-out) }
@keyframes i-lift {
  0%, 100% { transform: none }
  35% { transform: translateY(-2px) rotate(-6deg) }
  70% { transform: translateY(.3px) rotate(1.5deg) }
}

[data-motion="days"].play .day { animation: i-pop .32s var(--ease-out) both }
[data-motion="days"].play .d2 { animation-delay: .05s }
[data-motion="days"].play .d3 { animation-delay: .1s }
[data-motion="days"].play .d4 { animation-delay: .15s }
[data-motion="days"].play .d5 { animation-delay: .2s }
[data-motion="days"].play .d6 { animation-delay: .25s }
[data-motion="days"].play :is(.ring-l, .ring-r) { animation: i-nod .5s var(--ease-out) }
[data-motion="days"].play .ring-r { animation-delay: .06s }

[data-motion="typing"].play .dot,
[data-motion="tasks"].play .dot { animation: i-hopdot .46s ease-in-out both }
[data-motion="typing"].play .t2 { animation-delay: .1s }
[data-motion="typing"].play .t3 { animation-delay: .2s }
[data-motion="tasks"].play .t2 { animation-delay: .18s }
[data-motion="tasks"].play .r2 { animation-delay: .18s }
@keyframes i-hopdot {
  0%, 100% { transform: none }
  45% { transform: translateY(-2.3px) }
}

[data-motion="double-check"].play .c2 { animation-delay: .18s }

[data-motion="check"].play .draw { animation-delay: .06s }
[data-motion="check"].play :is(.clip, .ring) { animation: i-swell .5s var(--ease-out) }

[data-motion="drop"].play svg { animation: i-drop .5s var(--ease-out) }
[data-motion="nudge"].play svg { animation: i-nudge .5s var(--ease-out) }
[data-motion="nudge-back"].play svg { animation: i-nudge-back .5s var(--ease-out) }
@keyframes i-drop {
  0%, 100% { transform: none }
  40% { transform: translateY(2.5px) }
}
@keyframes i-nudge {
  0%, 100% { transform: none }
  40% { transform: translateX(2.5px) }
}
@keyframes i-nudge-back {
  0%, 100% { transform: none }
  40% { transform: translateX(-2.5px) }
}

[data-motion="updown"].play .up { animation: i-up .55s var(--ease-out) }
[data-motion="updown"].play .down { animation: i-down .55s var(--ease-out) }
@keyframes i-up {
  0%, 100% { transform: none }
  40% { transform: translateY(-1.8px) }
}
@keyframes i-down {
  0%, 100% { transform: none }
  40% { transform: translateY(1.8px) }
}

[data-motion="clip"].play .clip { animation: i-settle .6s var(--ease-out) }

[data-motion="spin"].play svg { animation: i-spin .55s var(--ease-spring) }
@keyframes i-spin {
  from { transform: rotate(-90deg) }
  to { transform: none }
}

[data-motion="rise"].play .arrow,
[data-motion="upload"].play .arrow { animation: i-rise .7s var(--ease-out) }
@keyframes i-rise {
  0% { transform: none; opacity: 1 }
  38% { transform: translateY(-6px); opacity: 0 }
  39% { transform: translateY(5px); opacity: 0 }
  100% { transform: none; opacity: 1 }
}

[data-motion="download"].play .arrow { animation: i-fall .7s var(--ease-out) }
[data-motion="download"].play .tray,
[data-motion="upload"].play .tray { transform-origin: 50% 100%; animation: i-squash .7s var(--ease-out) }
@keyframes i-fall {
  0% { transform: none; opacity: 1 }
  38% { transform: translateY(6px); opacity: 0 }
  39% { transform: translateY(-6px); opacity: 0 }
  100% { transform: none; opacity: 1 }
}
@keyframes i-squash {
  0%, 100% { transform: none }
  42% { transform: scaleY(.78) }
  64% { transform: scaleY(1.06) }
}

[data-motion="write"].play .row { stroke-dasharray: 1; animation: i-draw .32s var(--ease-out) both }
[data-motion="write"].play .r2 { animation-delay: .14s }
[data-motion="write"].play .r3 { animation-delay: .28s }

[data-motion="scribble"].play .pencil { animation: i-scribble .8s ease-in-out }
[data-motion="scribble"].play .ink { stroke-dasharray: 1; animation: i-ink .8s var(--ease-out) both }
@keyframes i-scribble {
  0%, 100% { transform: none }
  20% { transform: rotate(-8deg) }
  40% { transform: rotate(4deg) translateX(1px) }
  60% { transform: rotate(-6deg) translateX(2px) }
  80% { transform: rotate(2deg) translateX(1px) }
}
@keyframes i-ink {
  0% { opacity: 1; stroke-dashoffset: 1 }
  70% { opacity: 1; stroke-dashoffset: 0 }
  100% { opacity: 0; stroke-dashoffset: 0 }
}

[data-motion="mail"].play .flap { animation: i-flap .75s var(--ease-out) }
@keyframes i-flap {
  0%, 100% { transform: none }
  35%, 62% { transform: scaleY(-.55) }
}

[data-motion="folder"].play svg { transform-origin: 50% 100%; animation: i-hop .6s var(--ease-out) }

[data-motion="nodes"].play .node { animation: i-swell .45s var(--ease-out) both }
[data-motion="nodes"].play .k2 { animation-delay: .1s }
[data-motion="nodes"].play .k3 { animation-delay: .18s }

[data-motion="gauge"].play .needle { animation: i-gauge .9s var(--ease-spring) }
@keyframes i-gauge {
  from { transform: rotate(-95deg) }
  to { transform: none }
}

[data-motion="tiles"].play .tile { animation: i-pop .36s var(--ease-out) both }
[data-motion="tiles"].play .k2 { animation-delay: .07s }
[data-motion="tiles"].play .k3 { animation-delay: .14s }
[data-motion="tiles"].play .k4 { animation-delay: .21s }

[data-motion="beat"].play svg,
[data-motion="ecg"].play .heart { animation: i-beat .75s ease-out }
[data-motion="ecg"].play .pulse { animation-duration: .6s; animation-delay: .1s }
@keyframes i-beat {
  0%, 100% { transform: none }
  15% { transform: scale(1.18) }
  30% { transform: scale(.96) }
  45% { transform: scale(1.1) }
  65% { transform: none }
}

[data-motion="glow"].play .bulb { animation: i-lights .95s ease-out }

[data-motion="link"].play .link-a { animation: i-part-a .6s var(--ease-out) }
[data-motion="link"].play .link-b { animation: i-part-b .6s var(--ease-out) }
@keyframes i-part-a {
  0%, 100% { transform: none }
  40% { transform: translate(1.6px, -1.6px) }
}
@keyframes i-part-b {
  0%, 100% { transform: none }
  40% { transform: translate(-1.6px, 1.6px) }
}

[data-motion="list"].play .row,
[data-motion="menu"].play .row { transform-origin: 0 50%; animation: i-row .45s var(--ease-out) both }
:is([data-motion="list"], [data-motion="menu"]).play .k2 { animation-delay: .07s }
:is([data-motion="list"], [data-motion="menu"]).play .k3 { animation-delay: .14s }
@keyframes i-row {
  0%, 100% { transform: none }
  45% { transform: scaleX(.55) }
}

[data-motion="exit"].play .arrow { animation: i-forward .7s var(--ease-out) }

[data-motion="pin"].play svg { animation: i-pin .7s var(--ease-out) }
@keyframes i-pin {
  0%, 100% { transform: none }
  30% { transform: translateY(-3.5px) }
  58% { transform: translateY(.5px) scale(1.04, .95) }
  80% { transform: translateY(-.6px) }
}

[data-motion="moon"].play .moon { animation: i-moon .9s var(--ease-out) }
[data-motion="moon"].play .twinkle { animation: i-twinkle .85s .12s var(--ease-out) both }
@keyframes i-moon {
  0%, 100% { transform: none }
  35% { transform: rotate(-20deg) }
  70% { transform: rotate(5deg) }
}
@keyframes i-twinkle {
  0% { opacity: 0; transform: scale(0) rotate(-45deg) }
  40% { opacity: 1; transform: scale(1.15) }
  100% { opacity: 0; transform: scale(.5) rotate(30deg) }
}

[data-motion="sun"].play .ray { animation: i-rays .8s var(--ease-out) }
[data-motion="sun"].play .core { animation: i-swell .6s var(--ease-out) }
@keyframes i-rays {
  from { transform: rotate(-45deg) scale(.55); opacity: .2 }
  to { transform: none; opacity: 1 }
}

[data-motion="wobble"].play .mark { animation: i-wobble .7s var(--ease-out) }
@keyframes i-wobble {
  0%, 100% { transform: none }
  25% { transform: rotate(-14deg) }
  55% { transform: rotate(10deg) }
  80% { transform: rotate(-4deg) }
}

[data-motion="look"].play .lens { animation: i-scan .8s var(--ease-in-out) }

[data-motion="twinkle"].play svg,
[data-motion="spark"].play svg { animation: i-star .7s var(--ease-spring) }
@keyframes i-star {
  from { transform: rotate(-72deg) scale(.6) }
  to { transform: none }
}

[data-motion="watch"].play .hands { animation: i-turn .85s var(--ease-in-out) }
[data-motion="watch"].play svg { animation: i-wobble .85s var(--ease-out) }

[data-motion="inbox"].play .tray { animation: i-drop .6s var(--ease-out) }

/* The agent panel */
[data-motion="clip-on"].play svg { animation: i-clip-on .65s var(--ease-out) }
@keyframes i-clip-on {
  0%, 100% { transform: none }
  35% { transform: rotate(-18deg) translateY(-.6px) }
  70% { transform: rotate(5deg) }
}

[data-motion="add-folder"].play .add,
[data-motion="new-chat"].play .add { transform-box: view-box; animation: i-spin-add .6s var(--ease-spring) }
[data-motion="add-folder"].play .add { transform-origin: 12px 13px }
[data-motion="new-chat"].play .add { transform-origin: 12px 11px }
[data-motion="add-folder"].play .fill { animation: i-settle .6s var(--ease-out) }

/* the plug pushes into its socket and settles back */
[data-motion="plug"].play :is(.prong, .plug-body) { animation: i-plug .75s var(--ease-out) }
@keyframes i-plug {
  0%, 100% { transform: none }
  35% { transform: translateY(-2.4px) }
  60% { transform: translateY(-1.8px) }
}

/* the piece turns and snaps into place */
[data-motion="snap"].play svg { animation: i-snap .7s var(--ease-spring) }
@keyframes i-snap {
  0% { transform: rotate(-14deg) scale(.82) }
  100% { transform: none }
}

[data-motion="slash"].play .fill { animation: i-swell .5s var(--ease-out) }

/* the capsule hops as if it caught a word */
[data-motion="mic"].play .capsule { animation: i-hop .7s var(--ease-out) }
[data-motion="mic"].play .cup { animation: i-swell .6s .08s var(--ease-out) }

/* each bar takes its own level */
[data-motion="levels"].play .bar { animation: i-level .45s ease-in-out 2 alternate }
[data-motion="levels"].play .k2 { animation-delay: .07s }
[data-motion="levels"].play .k3 { animation-delay: .14s }
[data-motion="levels"].play .k4 { animation-delay: .04s }
[data-motion="levels"].play .k5 { animation-delay: .11s }
[data-motion="levels"].play .k6 { animation-delay: .18s }
@keyframes i-level {
  0% { transform: none }
  45% { transform: scaleY(.3) }
  100% { transform: scaleY(1.2) }
}

/* the divider slides to the side the panel docks to */
[data-motion="dock-left"].play .divider { animation: i-dock-left .65s var(--ease-out) }
[data-motion="dock-right"].play .divider { animation: i-dock-right .65s var(--ease-out) }
@keyframes i-dock-left {
  0%, 100% { transform: none }
  40% { transform: translateX(-3px) }
}
@keyframes i-dock-right {
  0%, 100% { transform: none }
  40% { transform: translateX(3px) }
}

[data-motion="expand"].play .c1 { animation: i-corner-out .6s var(--ease-out) }
[data-motion="expand"].play .c2 { animation: i-corner-in .6s var(--ease-out) }
[data-motion="shrink"].play .c1 { animation: i-corner-in .6s var(--ease-out) }
[data-motion="shrink"].play .c2 { animation: i-corner-out .6s var(--ease-out) }
@keyframes i-corner-out {
  0%, 100% { transform: none }
  40% { transform: translate(1.8px, -1.8px) }
}
@keyframes i-corner-in {
  0%, 100% { transform: none }
  40% { transform: translate(-1.8px, 1.8px) }
}

[data-motion="stop"].play svg { animation: i-press .5s var(--ease-out) }
@keyframes i-press {
  0%, 100% { transform: none }
  35% { transform: scale(.78) }
}

/* the arrow leaves upward and comes back from below */
[data-motion="send"].play .go { animation: i-send .55s var(--ease-out) }
@keyframes i-send {
  0% { transform: none; opacity: 1 }
  42% { transform: translateY(-6px); opacity: 0 }
  43% { transform: translateY(6px); opacity: 0 }
  100% { transform: none; opacity: 1 }
}

/* the hands run backwards */
[data-motion="rewind"].play .hands { animation: i-turn .85s var(--ease-in-out) reverse }
[data-motion="rewind"].play svg { animation: i-tick .85s var(--ease-out) reverse }

[data-motion="duplicate"].play .sheet { animation: i-copy .6s var(--ease-out) }
@keyframes i-copy {
  0% { transform: translate(-3px, -3px); opacity: .2 }
  100% { transform: none; opacity: 1 }
}

[data-motion="retry"].play svg { animation: i-turn .7s var(--ease-in-out) reverse }

[data-motion="zap"].play svg { animation: i-zap .65s linear }
@keyframes i-zap {
  0%, 100% { transform: none; opacity: 1 }
  12% { transform: scale(1.14); opacity: .35 }
  24% { opacity: 1 }
  36% { opacity: .5 }
  52% { transform: scale(1.05); opacity: 1 }
}

/* a hand goes up to ask first */
[data-motion="raise"].play svg { transform-origin: 50% 100%; animation: i-raise .8s var(--ease-out) }
@keyframes i-raise {
  0%, 100% { transform: none }
  35% { transform: translateY(-2.2px) rotate(-7deg) }
  65% { transform: translateY(-1px) rotate(4deg) }
}

[data-motion="blink"].play .lid { animation: i-blink .5s .1s ease-in-out }
[data-motion="blink"].play .pupil { animation: i-look .75s var(--ease-out) }
@keyframes i-blink {
  0%, 100% { transform: none }
  45% { transform: scaleY(.1) }
}
@keyframes i-look {
  0%, 100% { transform: none }
  30% { transform: translateX(-1.8px) }
  70% { transform: translateX(1.2px) }
}

[data-motion="wrench"].play svg { animation: i-wrench .75s var(--ease-out) }
@keyframes i-wrench {
  0%, 100% { transform: none }
  35% { transform: rotate(-30deg) }
  70% { transform: rotate(6deg) }
}

/* the waves go out one after the other */
[data-motion="sound"].play .wave { animation: i-wave .42s ease-out both }
[data-motion="sound"].play .w2 { animation-delay: .16s }
@keyframes i-wave {
  0% { opacity: 0; transform: translateX(-2px) }
  100% { opacity: 1; transform: none }
}

[data-motion="hang-up"].play .handset { animation: i-hang .65s var(--ease-out) }
@keyframes i-hang {
  0%, 100% { transform: none }
  40% { transform: rotate(16deg) translateY(1px) }
}

/* Books */
.icon .leaf,
.icon .note {
  opacity: 0
}

.icon :is(.leaf, .card, .beam, .left, .right) {
  transform-box: view-box
}

.icon .leaf { transform-origin: 12px 12px }
.icon .card { transform-origin: 12px 12px }
.icon .beam { transform-origin: 12px 5px }

/* a page turns over the spine */
[data-motion="leaf"].play .leaf { animation: i-leaf .82s var(--ease-in-out) both }
@keyframes i-leaf {
  0% { opacity: 0; transform: none }
  12% { opacity: 1 }
  88% { opacity: 1 }
  100% { opacity: 0; transform: scaleX(-1) }
}

/* a note rises out of the wallet and tucks back in */
[data-motion="wallet"].play .note { animation: i-note .8s var(--ease-out) both }
[data-motion="wallet"].play .clasp { animation: i-settle .6s .1s var(--ease-out) }
@keyframes i-note {
  0% { opacity: 0; transform: translateY(3px) }
  35% { opacity: 1; transform: translateY(-1.4px) }
  70% { opacity: 1; transform: translateY(-.6px) }
  100% { opacity: 0; transform: translateY(3px) }
}

/* the card is swiped */
[data-motion="swipe"].play .card { animation: i-swipe .7s var(--ease-out) }
@keyframes i-swipe {
  0%, 100% { transform: none }
  35% { transform: translateX(2.4px) rotate(-5deg) }
  70% { transform: translateX(-.5px) rotate(1deg) }
}

/* the beam tips and comes to rest level */
[data-motion="balance"].play .beam { animation: i-balance 1s var(--ease-out) }
@keyframes i-balance {
  0%, 100% { transform: none }
  22% { transform: rotate(-10deg) }
  50% { transform: rotate(6deg) }
  76% { transform: rotate(-2deg) }
}

/* one slice lifts out of the pie */
[data-motion="slice"].play .slice { animation: i-slice .75s var(--ease-out) }
@keyframes i-slice {
  0%, 100% { transform: none }
  40% { transform: translate(1.6px, -1.6px) }
}

/* the arrows pass each other */
[data-motion="swap"].play .left { animation: i-left .6s var(--ease-out) }
[data-motion="swap"].play .right { animation: i-right .6s var(--ease-out) }
@keyframes i-left {
  0%, 100% { transform: none }
  45% { transform: translateX(-2.4px) }
}
@keyframes i-right {
  0%, 100% { transform: none }
  45% { transform: translateX(2.4px) }
}

/* the note slides as if counted and its coin turns */
[data-motion="count"].play .note-face { animation: i-count .7s var(--ease-out) }
[data-motion="count"].play .coin-face { animation: i-coin-turn .7s var(--ease-in-out) }
@keyframes i-count {
  0%, 100% { transform: none }
  40% { transform: translateX(1.6px) }
}
/* its own name: as a second "i-turn" this took the clock's, the watch's and the retry arrow's turn away */
@keyframes i-coin-turn {
  0%, 100% { transform: none }
  50% { transform: scaleX(.2) }
}

/* Compliance */
.icon :is(.idcard, .idholder, .mallet) { transform-box: view-box }
.icon :is(.idcard, .idholder) { transform-origin: 12px 19px }
.icon .mallet { transform-origin: 4px 20px }

/* the ID card is held up to be checked */
[data-motion="present"].play :is(.idcard, .idholder) { animation: i-present .75s var(--ease-out) }
[data-motion="present"].play .idholder { animation-delay: .04s }
@keyframes i-present {
  0%, 100% { transform: none }
  40% { transform: translateY(-1.6px) rotate(-6deg) }
  72% { transform: translateY(-.3px) rotate(1.5deg) }
}

/* the gavel strikes once */
[data-motion="strike"].play .mallet { animation: i-strike .8s var(--ease-out) }
@keyframes i-strike {
  0%, 100% { transform: none }
  32% { transform: rotate(-20deg) }
  52% { transform: rotate(5deg) }
  72% { transform: rotate(-1.5deg) }
}

/* Charts: a figure that fell sinks once; the performance line traces itself */
[data-motion="sink"].play .go { animation: i-sink .6s var(--ease-out) }
@keyframes i-sink {
  0% { transform: none; opacity: 1 }
  42% { transform: translateY(5px); opacity: 0 }
  43% { transform: translateY(-5px); opacity: 0 }
  100% { transform: none; opacity: 1 }
}
[data-motion="trace"] .trace { stroke-dasharray: 20; stroke-dashoffset: 0 }
[data-motion="trace"].play .trace { animation: i-trace .9s var(--ease-out) }
@keyframes i-trace {
  0% { stroke-dashoffset: 20 }
  100% { stroke-dashoffset: 0 }
}

/* Language: the two scripts lean toward each other */
[data-motion="translate"].play .src { animation: i-lang-src .75s var(--ease-out) }
[data-motion="translate"].play .dst { animation: i-lang-dst .75s var(--ease-out) }
@keyframes i-lang-src {
  0%, 100% { transform: none }
  40% { transform: translate(1.3px, 1.3px) }
}
@keyframes i-lang-dst {
  0%, 100% { transform: none }
  40% { transform: translate(-1.3px, -1.3px) }
}

/* Sophie: the figure turns on its ring, as a 3D model on a turntable */
[data-motion="turntable"].play .figure { animation: i-turntable .9s var(--ease-in-out) }
@keyframes i-turntable {
  0%, 100% { transform: none }
  50% { transform: scaleX(.45) }
}

/* The suite (v5 draws this family alone, so it grew a few glyphs: tools/suite_icons.py) */
[data-motion="hop"].play svg { transform-origin: 50% 100%; animation: i-hop .7s var(--ease-out) }
[data-motion="swell"].play svg { animation: i-swell .6s var(--ease-out) }
[data-motion="sliders"].play :is(.k1, .k2, .k3) { animation: i-shift .5s var(--ease-out) }
[data-motion="sliders"].play .k2 { animation-delay: .08s; animation-direction: reverse }
[data-motion="sliders"].play .k3 { animation-delay: .16s }
[data-motion="dots"].play .dot { animation: i-pop .45s var(--ease-out) both }
[data-motion="dots"].play .t2 { animation-delay: .08s }
[data-motion="dots"].play .t3 { animation-delay: .16s }
[data-motion="dots"].play .t4 { animation-delay: .24s }
/* the Moon blinks as the eye does: its two eyes are the eye's .lid */

@media (prefers-reduced-motion: reduce) {
  .icon.play svg,
  .icon.play svg * {
    animation: none !important
  }
}
