#gesture-hint {
    --duration: 2.5s;
    position: absolute;
    width: 0;
    height: 0;
    pointer-events: none;
    z-index: 35;
}
#gesture-hint[data-gesture^="swipe"] { --duration: 2.56s; }
#gesture-hint[data-gesture="tap"] { --duration: 1.65s; }
#gesture-hint[data-gesture="scroll-down"] { --duration: 2.56s; --distance: 30px; }
.gesture-hand-anchor {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
}
.gesture-hand {
    position: absolute;
    display: block;
    width: clamp(74px, 24vw, 107px);
    max-width: none;
    height: auto;
    --fingertip: translate(-37.234%, -11.111%);
    transform: var(--fingertip);
    transform-origin: 0 0;
    filter: drop-shadow(0 0 7px rgba(157, 146, 255, .42));
}
.gesture-contact {
    position: absolute;
    inset: -11px auto auto -11px;
    width: 22px;
    height: 22px;
    border: 1px solid rgba(223, 220, 255, .8);
    border-radius: 50%;
    box-shadow: 0 0 16px #9185ff, inset 0 0 7px rgba(216, 207, 255, .52);
    opacity: 0;
}
.gesture-spark {
    position: absolute;
    top: -17px;
    left: -16px;
    color: #ded8ff;
    font: 13px/1 Georgia, serif;
    text-shadow: 0 0 8px #a496ff;
}
.gesture-trail {
    position: absolute;
    left: calc(-1 * var(--distance));
    top: 0;
    width: calc(2 * var(--distance));
    height: 1px;
    background: linear-gradient(90deg, #e4dfff, #c6bcff 25%, #8c83db55 73%, transparent);
    opacity: 0;
    filter: drop-shadow(0 0 5px #afa3ff);
}
.gesture-trail::after {
    content: '';
    position: absolute;
    width: 7px;
    height: 7px;
    top: -3px;
    left: 1px;
    border-left: 1px solid #f0ebff;
    border-bottom: 1px solid #f0ebff;
    transform: rotate(45deg);
}
[data-gesture="hold"] .gesture-hand-anchor {
    animation: demonstrate-hold var(--duration) ease-in-out;
}
[data-gesture="hold"] .gesture-hand {
    transform: rotate(-32deg) var(--fingertip);
}
[data-gesture="hold"] .gesture-contact {
    animation: show-contact var(--duration) ease-out;
}
[data-gesture^="swipe"] .gesture-hand-anchor {
    animation: demonstrate-swipe var(--duration) ease-in-out;
}
:is([data-gesture^="swipe"], [data-gesture="scroll-down"]) .gesture-contact {
    width: 8px;
    height: 8px;
    left: -4px;
    top: -4px;
    background: #eae4ff;
    box-shadow: 0 0 10px 2px #9c91ff;
    opacity: .8;
}
:is([data-gesture^="swipe"], [data-gesture="scroll-down"]) .gesture-spark { display: none; }
:is([data-gesture^="swipe"], [data-gesture="scroll-down"]) .gesture-trail {
    animation: show-trail var(--duration) ease-out;
}
[data-gesture="swipe-left"] {
    --start-x: var(--distance);
    --end-x: calc(-1 * var(--distance));
}
[data-gesture="swipe-right"] {
    --start-x: calc(-1 * var(--distance));
    --end-x: var(--distance);
}
[data-gesture="swipe-right"] .gesture-trail {
    transform: scaleX(-1);
}
[data-gesture="tap"] .gesture-hand-anchor {
    animation: demonstrate-tap var(--duration) ease-in-out;
}
[data-gesture="tap"] .gesture-hand {
    transform: scale(var(--tap-side, 1), var(--tap-vertical, 1)) rotate(-32deg) var(--fingertip);
}
[data-gesture="tap"] .gesture-contact {
    animation: flash-contact var(--duration) ease-out;
}
[data-gesture="scroll-down"] .gesture-hand-anchor {
    animation: demonstrate-scroll var(--duration) ease-in-out;
}
[data-gesture="scroll-down"] .gesture-hand {
    width: 64px;
}
[data-gesture="scroll-down"] .gesture-trail {
    transform: rotate(90deg);
}
.gesture-caption {
    display: none;
    position: absolute;
    top: 72px;
    right: 28px;
    padding: 4px 12px;
    border: 1px solid rgba(200, 190, 255, .35);
    border-radius: 20px;
    background: #0a0e1c;
    color: #f0ebff;
    font: .9rem/1.4 'Spectral', Georgia, serif;
    white-space: nowrap;
}
[data-gesture="scroll-down"] .gesture-caption { display: block; }
@keyframes demonstrate-tap {
    0% { transform: translate(calc(17px * var(--tap-side, 1)), calc(17px * var(--tap-vertical, 1))); opacity: 0; }
    35%, 55% { transform: translate(0, 0); opacity: 1; }
    100% { transform: translate(calc(16px * var(--tap-side, 1)), calc(17px * var(--tap-vertical, 1))); opacity: 0; }
}
@keyframes flash-contact {
    0%, 29% { opacity: 0; transform: scale(.55); }
    40% { opacity: .95; transform: scale(.82); }
    84%, 100% { opacity: 0; transform: scale(1.6); }
}
@keyframes demonstrate-hold {
    0% { transform: translate(25px, 25px) scale(.94); opacity: 0; }
    26%, 73% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(13px, 21px) scale(.96); opacity: 0; }
}
@keyframes show-contact {
    0%, 24% { opacity: 0; transform: scale(.6); }
    35% { opacity: .9; transform: scale(1); }
    73% { opacity: .35; transform: scale(1.75); }
    92%, 100% { opacity: 0; transform: scale(2); }
}
@keyframes demonstrate-swipe {
    0% { transform: translate(var(--start-x), 12px); opacity: 0; }
    22% { transform: translate(var(--start-x), 0); opacity: 1; }
    65%, 79% { transform: translate(var(--end-x), 0); opacity: 1; }
    100% { transform: translate(var(--end-x), 14px); opacity: 0; }
}
@keyframes demonstrate-scroll {
    0% { transform: translateY(var(--distance)); opacity: 0; }
    22% { transform: translateY(var(--distance)); opacity: 1; }
    65%, 79% { transform: translateY(calc(-1 * var(--distance))); opacity: 1; }
    100% { transform: translateY(calc(-1 * var(--distance))); opacity: 0; }
}
@keyframes show-trail {
    0%, 27% { opacity: 0; }
    62%, 79% { opacity: .85; }
    100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
    #gesture-hint .gesture-hand-anchor,
    #gesture-hint .gesture-contact,
    #gesture-hint .gesture-trail { animation: none; }
    #gesture-hint .gesture-hand-anchor,
    #gesture-hint[data-gesture="hold"] .gesture-contact,
    #gesture-hint[data-gesture="tap"] .gesture-contact { opacity: 1; }
    #gesture-hint[data-gesture^="swipe"] .gesture-hand-anchor { transform: translateX(var(--start-x)); }
    #gesture-hint:is([data-gesture^="swipe"], [data-gesture="scroll-down"]) .gesture-trail { opacity: .85; }
}
