/* ================================================================
   ACCURACY LASER & FABRICATION — ANIMATIONS & EFFECTS
   accuracy-animations.css
   
   Companion to accuracy-animations.js
   Load this AFTER accuracy-theme.css
   
   Contains: reveal animation states, counter styling,
   shimmer effects, spark particles, parallax helpers.
   ================================================================ */


/* ================================================================
   SCROLL REVEAL — BASE STATES
   Elements start hidden, JS adds .revealed to trigger animation.
   Uses data-reveal attribute for direction variants.
   ================================================================ */

[data-reveal] {
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

/* Default: fade up */
[data-reveal="up"],
[data-reveal] {
    transform: translateY(40px);
}

[data-reveal="left"] {
    transform: translateX(-40px);
}

[data-reveal="right"] {
    transform: translateX(40px);
}

[data-reveal="scale"] {
    transform: scale(0.92);
}

[data-reveal="none"] {
    transform: none;
}

/* Revealed state */
[data-reveal].revealed {
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1);
}

/* Stagger children — adds delay per item in a grid */
[data-stagger] > [data-reveal]:nth-child(1)  { transition-delay: 0ms; }
[data-stagger] > [data-reveal]:nth-child(2)  { transition-delay: 100ms; }
[data-stagger] > [data-reveal]:nth-child(3)  { transition-delay: 200ms; }
[data-stagger] > [data-reveal]:nth-child(4)  { transition-delay: 300ms; }
[data-stagger] > [data-reveal]:nth-child(5)  { transition-delay: 400ms; }
[data-stagger] > [data-reveal]:nth-child(6)  { transition-delay: 500ms; }
[data-stagger] > [data-reveal]:nth-child(7)  { transition-delay: 600ms; }
[data-stagger] > [data-reveal]:nth-child(8)  { transition-delay: 700ms; }


/* ================================================================
   HERO TEXT ENTRANCE
   Staggered reveal for hero elements on page load.
   ================================================================ */

.hero-entrance {
    opacity: 0;
    transform: translateY(30px);
    animation: heroEntrance 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-entrance:nth-child(1) { animation-delay: 0.1s; }
.hero-entrance:nth-child(2) { animation-delay: 0.25s; }
.hero-entrance:nth-child(3) { animation-delay: 0.4s; }
.hero-entrance:nth-child(4) { animation-delay: 0.55s; }
.hero-entrance:nth-child(5) { animation-delay: 0.7s; }

@keyframes heroEntrance {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hero visual side — slide in from right */
.hero-visual-entrance {
    opacity: 0;
    transform: translateX(50px);
    animation: heroVisualEntrance 1s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
}

@keyframes heroVisualEntrance {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}


/* ================================================================
   COUNTER ANIMATION
   Numbers that count up when scrolled into view.
   ================================================================ */

[data-counter] {
    display: inline-block;
    font-variant-numeric: tabular-nums;
}


/* ================================================================
   BUTTON SHIMMER EFFECT
   A light sweep across CTA buttons.
   ================================================================ */

.btn-shimmer {
    position: relative;
    overflow: hidden;
}

.btn-shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.15) 50%,
        transparent 100%
    );
    transition: none;
    animation: shimmer 4s ease-in-out infinite;
    animation-delay: 2s;
    pointer-events: none;
}

@keyframes shimmer {
    0%   { left: -100%; }
    30%  { left: 120%; }
    100% { left: 120%; }
}

/* Disable shimmer on hover — feels cleaner */
.btn-shimmer:hover::after {
    animation: none;
    opacity: 0;
}


/* ================================================================
   SPARK / EMBER PARTICLES
   Floating orange particles for hero sections.
   Container positioned absolute within hero.
   ================================================================ */

.spark-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.spark {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--orange, #f97316);
    border-radius: 50%;
    opacity: 0;
    animation: sparkFloat linear infinite;
    box-shadow: 0 0 6px 1px rgba(249, 115, 22, 0.4);
}

/* Larger spark variant */
.spark.lg {
    width: 4px;
    height: 4px;
    box-shadow: 0 0 8px 2px rgba(249, 115, 22, 0.5);
}

/* Tiny spark variant */
.spark.sm {
    width: 2px;
    height: 2px;
    box-shadow: 0 0 4px 1px rgba(249, 115, 22, 0.3);
}

@keyframes sparkFloat {
    0% {
        opacity: 0;
        transform: translateY(0) translateX(0) scale(1);
    }
    10% {
        opacity: 0.8;
    }
    70% {
        opacity: 0.6;
    }
    100% {
        opacity: 0;
        transform: translateY(-350px) translateX(var(--drift, 30px)) scale(0.3);
    }
}


/* ================================================================
   PARALLAX HELPER
   Applied via JS. Translate is controlled inline by JS.
   ================================================================ */

[data-parallax] {
    will-change: transform;
    transition: none; /* JS controls this directly */
}


/* ================================================================
   IMAGE HOVER LIFT
   Adds an extra dimension to image cards on hover.
   ================================================================ */

.hover-lift {
    transition: transform var(--transition-slow, 0.4s ease),
                box-shadow var(--transition-slow, 0.4s ease);
}

.hover-lift:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}


/* ================================================================
   ICON PULSE ON HOVER
   Subtle pulse on icon boxes when parent card is hovered.
   ================================================================ */

.card:hover .icon-box,
.card-subtle:hover .icon-box,
.why-feature:hover .why-feature-icon,
.equipment-card:hover .equipment-icon {
    animation: iconPulse 0.4s ease;
}

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


/* ================================================================
   NAV SCROLL REVEAL
   Slim transition for nav background on scroll.
   ================================================================ */

.nav {
    transition: background 0.4s ease, padding 0.4s ease, border-color 0.4s ease;
}


/* ================================================================
   ORANGE LINE GROW
   Horizontal orange line that grows when scrolled into view.
   Used as section dividers.
   ================================================================ */

.line-grow {
    height: 3px;
    background: var(--orange, #f97316);
    width: 0;
    transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 2px;
}

.line-grow.revealed {
    width: 80px;
}


/* ================================================================
   REDUCE MOTION
   Respects user's prefers-reduced-motion setting.
   ================================================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    [data-reveal] {
        opacity: 1 !important;
        transform: none !important;
    }

    .spark-container {
        display: none !important;
    }

    .btn-shimmer::after {
        display: none !important;
    }
}
