/* ============================================================================
   Vehicly Animation System
   ----------------------------------------------------------------------------
   Reusable keyframes, utility classes, scroll reveals, micro-interactions,
   page transitions, stagger effects, modal/toast animations, skeleton loading,
   and decorative effects.
   Include AFTER ux-consistency.css on every page.
   ============================================================================ */


/* ============================================================================
   A. REUSABLE KEYFRAMES
   ============================================================================ */

/* -- Fade Variants --------------------------------------------------------- */

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-24px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-24px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(24px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* -- Slide Variants (no opacity, pure positional) -------------------------- */

@keyframes slideUp {
    from { transform: translateY(24px); }
    to   { transform: translateY(0); }
}

@keyframes slideDown {
    from { transform: translateY(-24px); }
    to   { transform: translateY(0); }
}

/* -- Scale & Slide-In Variants -------------------------------------------- */

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.8); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(100%); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-100%); }
    to   { opacity: 1; transform: translateX(0); }
}

/* -- Attention & Feedback -------------------------------------------------- */

@keyframes bounceIn {
    0%   { opacity: 0; transform: scale(0.3); }
    50%  { opacity: 1; transform: scale(1.08); }
    70%  { opacity: 1; transform: scale(0.92); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.06); }
}

@keyframes shimmer {
    from { background-position: -200% 0; }
    to   { background-position: 200% 0; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    15%      { transform: translateX(-4px); }
    30%      { transform: translateX(4px); }
    45%      { transform: translateX(-4px); }
    60%      { transform: translateX(4px); }
    75%      { transform: translateX(-2px); }
    90%      { transform: translateX(2px); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-10px); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 4px rgba(var(--vh-primary-rgb), 0.2); }
    50%      { box-shadow: 0 0 20px rgba(var(--vh-primary-rgb), 0.5); }
}

/* -- Typewriter & Drawing -------------------------------------------------- */

@keyframes typewriter {
    from { width: 0; }
    to   { width: 100%; }
}

@keyframes typewriterBlink {
    0%, 100% { border-color: transparent; }
    50%      { border-color: currentColor; }
}

@keyframes drawLine {
    from { stroke-dashoffset: 1; }
    to   { stroke-dashoffset: 0; }
}

/* -- Ripple & Count -------------------------------------------------------- */

@keyframes ripple {
    from { transform: scale(0); opacity: 0.6; }
    to   { transform: scale(4); opacity: 0; }
}

@keyframes countUp {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* -- Fade-out (exit complement to fadeIn) ---------------------------------- */

@keyframes fadeOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}


/* ============================================================================
   B. REUSABLE UTILITY CLASSES
   ============================================================================ */

/* -- Animation trigger classes --------------------------------------------- */

.animate-fadeIn {
    animation: vh-fadeIn 0.4s ease both;
}

.animate-fadeInUp {
    animation: vh-fadeUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.animate-fadeInDown {
    animation: fadeInDown 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.animate-fadeInLeft {
    animation: fadeInLeft 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.animate-fadeInRight {
    animation: fadeInRight 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.animate-slideUp {
    animation: slideUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.animate-slideDown {
    animation: slideDown 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.animate-scaleIn {
    animation: scaleIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.animate-slideInRight {
    animation: slideInRight 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.animate-slideInLeft {
    animation: slideInLeft 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.animate-bounceIn {
    animation: bounceIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-shimmer {
    animation: shimmer 1.8s ease-in-out infinite;
}

.animate-shake {
    animation: shake 0.5s ease both;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-glow {
    animation: glow 2s ease-in-out infinite;
}

.animate-typewriter {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid currentColor;
    animation: typewriter 2s steps(40) both,
               typewriterBlink 0.75s step-end infinite;
}

.animate-drawLine {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: drawLine 1.5s ease forwards;
}

.animate-ripple {
    animation: ripple 0.6s ease-out both;
}

.animate-countUp {
    animation: countUp 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.animate-fadeOut {
    animation: fadeOut 0.3s ease both;
}

/* -- Animation modifier helpers ------------------------------------------- */

.animate-fill-both     { animation-fill-mode: both !important; }
.animate-fill-forwards { animation-fill-mode: forwards !important; }
.animate-infinite      { animation-iteration-count: infinite !important; }

/* -- Stagger delay helpers ------------------------------------------------- */
/* Uses animation-fill-mode: both to prevent flash before delay completes */

.animate-delay-100 { animation-delay: 100ms; }
.animate-delay-200 { animation-delay: 200ms; }
.animate-delay-300 { animation-delay: 300ms; }
.animate-delay-400 { animation-delay: 400ms; }
.animate-delay-500 { animation-delay: 500ms; }
.animate-delay-600 { animation-delay: 600ms; }
.animate-delay-700 { animation-delay: 700ms; }
.animate-delay-800 { animation-delay: 800ms; }

/* -- Duration modifiers ---------------------------------------------------- */

.animate-duration-fast   { animation-duration: 0.2s !important; }
.animate-duration-normal { animation-duration: 0.4s !important; }
.animate-duration-slow   { animation-duration: 0.8s !important; }

/* -- Scroll-triggered animation -------------------------------------------- */
/* Usage: add .animate-on-scroll to element, then add .is-visible via
   IntersectionObserver in JS when it enters the viewport. */

.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
    will-change: auto;
}

/* -- Hover utility classes ------------------------------------------------- */
/* GPU-accelerated: use transform/opacity only, will-change on hover */

.hover-lift {
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    will-change: transform;
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(var(--vh-primary-rgb), 0.4),
                0 0 40px rgba(var(--vh-primary-rgb), 0.15);
}

.hover-scale {
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.hover-scale:hover {
    transform: scale(1.05);
    will-change: transform;
}

.hover-float {
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.hover-float:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12),
                0 4px 10px rgba(0, 0, 0, 0.06);
    will-change: transform;
}

/* -- General-purpose transitions ------------------------------------------ */

.transition-base {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.transition-colors {
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

/* -- Skeleton loading ------------------------------------------------------ */

.skeleton-loading {
    position: relative;
    overflow: hidden;
    background: var(--vh-skeleton-base, rgba(128, 128, 128, 0.12));
    border-radius: var(--radius-xs);
    color: transparent;
}

.skeleton-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--vh-skeleton-highlight, rgba(255, 255, 255, 0.25)) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.8s ease-in-out infinite;
    will-change: background-position;
}

.skeleton-loading * {
    visibility: hidden;
}


/* ============================================================================
   C. VEHICLY-SPECIFIC ANIMATIONS (original system)
   ============================================================================ */


/* -- 1. Page Load Animations ------------------------------------------------ */

@keyframes vh-pageIn {
    from { opacity: 0.01; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes vh-pageOut {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(-6px); }
}

.vh-page-enter {
    opacity: 1;
    animation: vh-pageIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.vh-page-exit {
    animation: vh-pageOut 0.25s cubic-bezier(0.55, 0, 1, 0.45) both;
}


/* -- 1b. Generic Entry Keyframes -------------------------------------------- */

@keyframes vh-fadeIn {
    from { opacity: 0.01; }
    to   { opacity: 1; }
}

@keyframes vh-fadeUp {
    from { opacity: 0.01; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}


/* -- 2. Scroll Reveal System ------------------------------------------------ */
/* Content is VISIBLE by default. Animations only apply when JS is active
   and the user has no motion preference. This prevents invisible content. */

[data-vh-reveal] {
    opacity: 1;
    transform: none;
    filter: none;
    transition:
        opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.6s cubic-bezier(0.22, 1, 0.36, 1),
        filter 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Only hide elements for reveal animation when JS has initialized the system
   (indicated by .vh-reveal-ready on <html> or <body>) AND user allows motion */
@media (prefers-reduced-motion: no-preference) {
    .vh-reveal-ready [data-vh-reveal] {
        opacity: 0;
        will-change: opacity, transform;
    }

    .vh-reveal-ready [data-vh-reveal].vh-visible {
        opacity: 1;
        will-change: auto;
    }

    /* Reveal variants */
    .vh-reveal-ready [data-vh-reveal="up"]              { transform: translateY(36px); }
    .vh-reveal-ready [data-vh-reveal="up"].vh-visible   { transform: translateY(0); }

    .vh-reveal-ready [data-vh-reveal="down"]            { transform: translateY(-36px); }
    .vh-reveal-ready [data-vh-reveal="down"].vh-visible { transform: translateY(0); }

    .vh-reveal-ready [data-vh-reveal="left"]            { transform: translateX(-36px); }
    .vh-reveal-ready [data-vh-reveal="left"].vh-visible { transform: translateX(0); }

    .vh-reveal-ready [data-vh-reveal="right"]            { transform: translateX(36px); }
    .vh-reveal-ready [data-vh-reveal="right"].vh-visible { transform: translateX(0); }

    .vh-reveal-ready [data-vh-reveal="scale"]            { transform: scale(0.93); }
    .vh-reveal-ready [data-vh-reveal="scale"].vh-visible { transform: scale(1); }

    .vh-reveal-ready [data-vh-reveal="fade"] {
        /* Opacity-only transition, no transform */
    }

    .vh-reveal-ready [data-vh-reveal="rotate"]            { transform: translateY(24px) rotate(-1.5deg); }
    .vh-reveal-ready [data-vh-reveal="rotate"].vh-visible { transform: translateY(0) rotate(0); }

    .vh-reveal-ready [data-vh-reveal="zoom"]            { transform: scale(0.88); filter: blur(3px); }
    .vh-reveal-ready [data-vh-reveal="zoom"].vh-visible { transform: scale(1); filter: blur(0); }
}

/* Without .vh-reveal-ready, all reveal elements stay fully visible */
[data-vh-reveal].vh-visible {
    opacity: 1;
    transform: none;
    filter: none;
}

/* Stagger delay utilities (consistent 60ms increments) */
[data-vh-delay="1"] { transition-delay: 0.06s; }
[data-vh-delay="2"] { transition-delay: 0.12s; }
[data-vh-delay="3"] { transition-delay: 0.18s; }
[data-vh-delay="4"] { transition-delay: 0.24s; }
[data-vh-delay="5"] { transition-delay: 0.30s; }
[data-vh-delay="6"] { transition-delay: 0.36s; }
[data-vh-delay="7"] { transition-delay: 0.42s; }
[data-vh-delay="8"] { transition-delay: 0.48s; }

/* Speed modifiers */
[data-vh-speed="fast"]   { transition-duration: 0.35s !important; }
[data-vh-speed="normal"] { transition-duration: 0.6s  !important; }
[data-vh-speed="slow"]   { transition-duration: 0.9s  !important; }


/* -- 3. Micro-Interactions -------------------------------------------------- */

/* Button press effect */
.vh-press {
    transition:
        transform 0.12s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.12s cubic-bezier(0.22, 1, 0.36, 1);
}

.vh-press:active {
    transform: scale(0.97);
}

/* Button hover lift */
.vh-lift {
    transition:
        transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.vh-lift:hover {
    transform: translateY(-2px);
}

/* Card hover with subtle 3D tilt */
.vh-tilt {
    transition:
        transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    transform-style: preserve-3d;
    perspective: 1000px;
}

/* Glow effect on hover */
.vh-glow {
    position: relative;
}

.vh-glow::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(var(--vh-primary-rgb), .12), rgba(var(--vh-primary-rgb), 0));
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: -1;
}

.vh-glow:hover::after {
    opacity: 1;
}

/* Ripple container */
.vh-ripple {
    position: relative;
    overflow: hidden;
}

.vh-ripple-wave {
    position: absolute;
    border-radius: 50%;
    background: rgba(var(--vh-primary-rgb), .18);
    transform: scale(0);
    animation: vh-rippleExpand 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    pointer-events: none;
}

@keyframes vh-rippleExpand {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Magnetic hover */
.vh-magnetic {
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}


/* -- 4. Input & Form Animations --------------------------------------------- */

/* Input focus glow */
.vh-input-glow {
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
}

.vh-input-glow:focus,
.vh-input-glow:focus-within {
    border-color: var(--vh-primary);
    box-shadow: 0 0 0 3px rgba(var(--vh-primary-rgb), .12),
                0 2px 6px rgba(var(--vh-primary-rgb), .08);
}

/* Label float animation */
.vh-float-label {
    position: relative;
}

.vh-float-label label {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--vh-text-tertiary);
    font-size: 0.9rem;
    pointer-events: none;
    transition:
        top 0.2s cubic-bezier(0.22, 1, 0.36, 1),
        font-size 0.2s cubic-bezier(0.22, 1, 0.36, 1),
        color 0.2s cubic-bezier(0.22, 1, 0.36, 1),
        font-weight 0.2s cubic-bezier(0.22, 1, 0.36, 1);
    background: var(--vh-surface, #fff);
    padding: 0 0.25rem;
}

.vh-float-label input:focus ~ label,
.vh-float-label input:not(:placeholder-shown) ~ label {
    top: 0;
    font-size: 0.72rem;
    color: var(--vh-primary);
    font-weight: 600;
}

/* Checkbox/toggle animation */
.vh-toggle-anim {
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.vh-toggle-anim:checked {
    animation: vh-checkPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes vh-checkPop {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.18); }
    100% { transform: scale(1); }
}

/* Form group staggered entrance - visible by default */
.vh-form-stagger > * {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: no-preference) {
    .vh-form-stagger > * {
        opacity: 0;
        transform: translateY(12px);
        animation: vh-formItemIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
    }
}

.vh-form-stagger > *:nth-child(1) { animation-delay: 0.04s; }
.vh-form-stagger > *:nth-child(2) { animation-delay: 0.08s; }
.vh-form-stagger > *:nth-child(3) { animation-delay: 0.12s; }
.vh-form-stagger > *:nth-child(4) { animation-delay: 0.16s; }
.vh-form-stagger > *:nth-child(5) { animation-delay: 0.20s; }
.vh-form-stagger > *:nth-child(6) { animation-delay: 0.24s; }
.vh-form-stagger > *:nth-child(7) { animation-delay: 0.28s; }
.vh-form-stagger > *:nth-child(8) { animation-delay: 0.32s; }

@keyframes vh-formItemIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* -- 5. Card Animations ----------------------------------------------------- */

/* Card entrance stagger - visible by default, animated only with .vh-reveal-ready */
.vh-card-stagger > * {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: no-preference) {
    .vh-reveal-ready .vh-card-stagger > * {
        opacity: 0;
        transform: translateY(24px);
    }

    .vh-reveal-ready .vh-card-stagger > *.vh-visible {
        opacity: 1;
        transform: translateY(0);
        transition:
            opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
            transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    }

    .vh-reveal-ready .vh-card-stagger > *:nth-child(1).vh-visible { transition-delay: 0s; }
    .vh-reveal-ready .vh-card-stagger > *:nth-child(2).vh-visible { transition-delay: 0.08s; }
    .vh-reveal-ready .vh-card-stagger > *:nth-child(3).vh-visible { transition-delay: 0.16s; }
    .vh-reveal-ready .vh-card-stagger > *:nth-child(4).vh-visible { transition-delay: 0.24s; }
    .vh-reveal-ready .vh-card-stagger > *:nth-child(5).vh-visible { transition-delay: 0.32s; }
    .vh-reveal-ready .vh-card-stagger > *:nth-child(6).vh-visible { transition-delay: 0.40s; }
}

.vh-card-stagger > *.vh-visible {
    opacity: 1;
    transform: none;
}

/* Card content reveal (lazy-loaded content) - visible by default */
.vh-content-reveal {
    opacity: 1;
    transform: none;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.vh-content-reveal.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* Card border sweep -- hover only */
.vh-border-sweep {
    position: relative;
    overflow: hidden;
}

.vh-border-sweep::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--vh-primary), var(--vh-primary-hover));
    border-radius: 3px 3px 0 0;
    transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.vh-border-sweep:hover::before {
    width: 100%;
}


/* -- 6. Navigation Animations ----------------------------------------------- */

/* Active link indicator slide */
.vh-nav-indicator {
    position: absolute;
    bottom: 0;
    height: 2px;
    background: var(--vh-primary);
    border-radius: var(--radius-xs);
    transition:
        left 0.3s cubic-bezier(0.22, 1, 0.36, 1),
        width 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Hamburger morph animation */
.vh-hamburger-animated span {
    transition:
        transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.15s ease;
}

.vh-hamburger-animated.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.vh-hamburger-animated.open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.vh-hamburger-animated.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}


/* -- 7. Notification & Toast Animations ------------------------------------- */

@keyframes vh-toastIn {
    from {
        opacity: 0.01;
        transform: translateX(-50%) translateY(12px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

@keyframes vh-toastOut {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(12px) scale(0.96);
    }
}

/* Badge bounce */
@keyframes vh-badgeBounce {
    0%, 100% { transform: scale(1); }
    25%      { transform: scale(1.2); }
    50%      { transform: scale(0.95); }
    75%      { transform: scale(1.08); }
}

.vh-badge-bounce {
    animation: vh-badgeBounce 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

/* -- 8. Skeleton Loading ---------------------------------------------------- */

.vh-skeleton {
    position: relative;
    overflow: hidden;
}

.vh-skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(var(--vh-primary-rgb), .03),
        transparent
    );
    animation: vh-skeletonPulse 1.6s ease-in-out infinite;
    will-change: transform;
}

@keyframes vh-skeletonPulse {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}


/* -- 9. Counter / Number Animation ------------------------------------------ */

@keyframes vh-numberPop {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.12); }
    100% { transform: scale(1); }
}

.vh-number-pop {
    display: inline-block;
    animation: vh-numberPop 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}


/* -- 10. Progress & Status Animations --------------------------------------- */

@keyframes vh-progressFill {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
}

.vh-progress-fill {
    transform-origin: left center;
    animation: vh-progressFill 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Pulse dot (status indicators) */
@keyframes vh-pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.5; transform: scale(0.85); }
}

.vh-pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--vh-success);
    animation: vh-pulseDot 2s ease-in-out infinite;
}

.vh-pulse-dot.warning { background: var(--vh-warning); }
.vh-pulse-dot.error   { background: var(--vh-error); }


/* -- 11. Scroll-to-Top Button ----------------------------------------------- */

.vh-scroll-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--vh-primary, #F2C94C);
    color: var(--vh-on-primary, #1a1a1a);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-scroll-top, 9999);
    opacity: 0;
    transform: translateY(12px) scale(0.85);
    transition: opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 4px 16px rgba(var(--vh-primary-rgb), .25);
    pointer-events: none;
}

.vh-scroll-top.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.vh-scroll-top:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 24px rgba(var(--vh-primary-rgb), .3);
}

.vh-scroll-top:active {
    transform: scale(0.95);
}

.vh-scroll-top svg {
    width: 18px;
    height: 18px;
    transition: transform 0.2s ease;
}

.vh-scroll-top:hover svg {
    transform: translateY(-2px);
}


/* -- 12. Modal & Dialog Animations ------------------------------------------ */

@keyframes vh-overlayIn {
    from { opacity: 0.01; }
    to   { opacity: 1; }
}

@keyframes vh-overlayOut {
    from { opacity: 1; }
    to   { opacity: 0.01; }
}

@keyframes vh-modalIn {
    from {
        opacity: 0.01;
        transform: scale(0.94) translateY(16px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes vh-modalOut {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0.01;
        transform: scale(0.96) translateY(8px);
    }
}

.vh-modal-overlay {
    animation: vh-overlayIn 0.2s ease both;
}

.vh-modal-overlay.closing {
    animation: vh-overlayOut 0.18s ease both;
}

.vh-modal-content {
    animation: vh-modalIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.vh-modal-overlay.closing .vh-modal-content {
    animation: vh-modalOut 0.18s ease both;
}


/* -- 13. Decorative Animations ---------------------------------------------- */

/* Gradient shift */
@keyframes vh-gradientShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.vh-gradient-animated {
    background-size: 200% 200%;
    animation: vh-gradientShift 6s ease infinite;
}

/* Text gradient animation */
.vh-text-gradient {
    background: linear-gradient(
        135deg,
        var(--vh-text) 0%,
        var(--vh-primary) 50%,
        var(--vh-text) 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: vh-gradientShift 4s ease infinite;
}

/* -- 14. Smooth Scrollbar --------------------------------------------------- */

.vh-smooth-scroll {
    scroll-behavior: smooth;
}

.vh-smooth-scroll::-webkit-scrollbar {
    width: 6px;
}

.vh-smooth-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.vh-smooth-scroll::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, .1);
    border-radius: var(--radius-xs);
}

.vh-smooth-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(15, 23, 42, .18);
}


/* -- 15. Responsive Animation Adjustments ----------------------------------- */
/* Wrapped inside no-preference so reduced-motion users never get these */

@media (prefers-reduced-motion: no-preference) and (max-width: 768px) {
    .vh-reveal-ready [data-vh-reveal="up"]    { transform: translateY(18px); }
    .vh-reveal-ready [data-vh-reveal="down"]  { transform: translateY(-18px); }
    .vh-reveal-ready [data-vh-reveal="left"]  { transform: translateX(-18px); }
    .vh-reveal-ready [data-vh-reveal="right"] { transform: translateX(18px); }
    .vh-reveal-ready [data-vh-reveal="rotate"] { transform: translateY(12px) rotate(-0.8deg); }

    .vh-tilt {
        transform: none !important;
    }
}

@media (max-width: 768px) {
    .vh-scroll-top {
        bottom: 1.25rem;
        right: 1.25rem;
        width: 40px;
        height: 40px;
    }
}

@media (prefers-reduced-motion: no-preference) and (max-width: 480px) {
    .vh-reveal-ready [data-vh-reveal="up"]   { transform: translateY(10px); }
    .vh-reveal-ready [data-vh-reveal="down"] { transform: translateY(-10px); }
}


/* ============================================================================
   D. ACCESSIBILITY: prefers-reduced-motion
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
    /* Kill all animations and transitions globally */
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    /* Ensure reveal elements are always visible */
    [data-vh-reveal] {
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
        transition: none !important;
    }

    .vh-card-stagger > * {
        opacity: 1 !important;
        transform: none !important;
    }

    .vh-form-stagger > * {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
    }

    .vh-scroll-top {
        transition: opacity 0.01ms !important;
    }

    .vh-page-enter,
    .vh-page-exit {
        animation: none !important;
        opacity: 1 !important;
    }

    /* Ensure utility-class animated elements are visible */
    .animate-on-scroll {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    .animate-fadeIn,
    .animate-fadeInUp,
    .animate-fadeInDown,
    .animate-fadeInLeft,
    .animate-fadeInRight,
    .animate-slideUp,
    .animate-slideDown,
    .animate-scaleIn,
    .animate-slideInRight,
    .animate-slideInLeft,
    .animate-bounceIn,
    .animate-countUp,
    .animate-fadeOut {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }

    .animate-pulse,
    .animate-shimmer,
    .animate-spin,
    .animate-float,
    .animate-glow {
        animation: none !important;
    }

    .animate-typewriter {
        animation: none !important;
        width: auto !important;
        border-right: none !important;
        overflow: visible !important;
        white-space: normal !important;
    }

    .animate-drawLine {
        animation: none !important;
        stroke-dashoffset: 0 !important;
    }

    .animate-ripple {
        animation: none !important;
    }

    .skeleton-loading,
    .skeleton-loading::after,
    .vh-skeleton,
    .vh-skeleton::after {
        animation: none !important;
    }

    /* Disable hover transforms for motion-sensitive users */
    .hover-lift:hover,
    .hover-scale:hover,
    .hover-float:hover {
        transform: none !important;
    }

    .hover-glow:hover {
        box-shadow: none !important;
    }

    /* Ensure decorative animations are killed */
    .vh-gradient-animated,
    .vh-text-gradient,
    .vh-badge-bounce,
    .vh-number-pop,
    .vh-pulse-dot,
    .vh-progress-fill {
        animation: none !important;
    }

    .vh-progress-fill {
        transform: scaleX(1) !important;
    }

    /* Smooth scroll override */
    .vh-smooth-scroll {
        scroll-behavior: auto !important;
    }
}


/* ============================================================================
   E. FORCED-COLORS (Windows High Contrast) FALLBACKS
   ============================================================================ */

@media (forced-colors: active) {
    /* Skeleton shimmer is invisible in forced-colors; use a border instead */
    .skeleton-loading {
        border: 1px solid CanvasText;
        background: Canvas !important;
    }

    .skeleton-loading::after,
    .vh-skeleton::after {
        display: none;
    }

    /* Glow & shadow effects are invisible; rely on border outlines */
    .hover-glow:hover,
    .vh-glow:hover::after {
        box-shadow: none !important;
        outline: 2px solid Highlight;
    }

    .hover-lift:hover,
    .hover-float:hover {
        box-shadow: none !important;
    }

    /* Scroll-top button needs visible border */
    .vh-scroll-top {
        border: 2px solid ButtonText !important;
        box-shadow: none !important;
    }

    /* Pulse dot uses border instead of background color */
    .vh-pulse-dot {
        border: 2px solid Highlight;
    }

    /* Border sweep -- use outline for visibility */
    .vh-border-sweep::before {
        background: Highlight !important;
    }

    /* Nav indicator */
    .vh-nav-indicator {
        background: Highlight !important;
    }

    /* Input focus glow replaced with standard outline */
    .vh-input-glow:focus,
    .vh-input-glow:focus-within {
        box-shadow: none !important;
        outline: 2px solid Highlight !important;
    }

    /* Text gradient animation is invisible; restore normal text */
    .vh-text-gradient {
        background: none !important;
        -webkit-background-clip: initial !important;
        -webkit-text-fill-color: CanvasText !important;
        background-clip: initial !important;
        animation: none !important;
    }

    /* Ripple effect invisible */
    .vh-ripple-wave {
        display: none;
    }

    /* Modal overlay */
    .vh-modal-overlay {
        background: Canvas !important;
        border: 2px solid CanvasText;
    }
}
