/* Shared motion tokens. All content and controls work without animation. */
:root {
    --motion-quick: 140ms;
    --motion-settle: 240ms;
    --motion-expand: 350ms;
    --motion-ease: cubic-bezier(.2, .8, .2, 1);
    --motion-spring: cubic-bezier(.2, .9, .3, 1.3);
}
.button, .nav-primary {
    transition: transform var(--motion-settle) var(--motion-spring),
        background-color var(--motion-quick) ease, box-shadow var(--motion-quick) ease;
}
.button:active:not(:disabled):not([aria-disabled="true"]), .nav-primary:active {
    transform: scale(.95);
    transition-duration: 80ms;
}
details[open] > .motion-details-content {
    animation: motion-expand var(--motion-expand) var(--motion-ease) both;
}
@keyframes motion-expand {
    from { opacity: .25; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
.motion-success { display: flex; align-items: flex-start; gap: 10px; }
.motion-success-icon { width: 24px; height: 24px; flex: 0 0 24px; color: #166534; }
.motion-success-icon circle, .motion-success-icon path {
    fill: none; stroke: currentColor; stroke-width: 2.2;
    stroke-linecap: round; stroke-linejoin: round;
    stroke-dasharray: 1; stroke-dashoffset: 0;
}
.motion-success-icon circle { animation: motion-draw 230ms ease-out both; }
.motion-success-icon path { animation: motion-draw 240ms 230ms ease-out both; }
@keyframes motion-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.motion-number { position: relative; display: inline-block; font-variant-numeric: tabular-nums; }
.motion-number-source {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.motion-number-visual { display: inline-flex; white-space: pre; overflow: hidden; vertical-align: bottom; }
.motion-number-digit { display: inline-block; animation: motion-digit 350ms var(--motion-ease) both; animation-delay: var(--digit-delay, 0ms); }
@keyframes motion-digit { from { transform: translateY(100%); } to { transform: translateY(0); } }
.motion-refresh-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 16px 0; }
.motion-refresh-tools p { margin: 0; color: var(--muted); font-size: .9rem; }
[data-refresh-handle] { touch-action: none; }
[data-refresh-panel] { transition: transform var(--motion-settle) var(--motion-ease); }
[data-refresh-panel].is-pulling { transition: none; }
.builder-question.is-dragging, .builder-page-section.is-dragging {
    position: relative; z-index: 2; transform: scale(1.05);
    box-shadow: 0 12px 30px #083b6624; opacity: .8;
}
@media (prefers-reduced-motion: reduce) {
    .button:active, .nav-primary:active, [data-refresh-panel],
    .builder-question.is-dragging, .builder-page-section.is-dragging {
        transform: none !important;
    }
    .motion-number-digit, .motion-success-icon circle, .motion-success-icon path,
    details[open] > .motion-details-content { animation: none !important; }
}
@media print {
    .motion-number-source { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip-path: none; }
    .motion-number-visual, .motion-refresh-tools, .motion-success-icon { display: none; }
}
