/* ============================================
   EXOS SYSTEMS — Scroll Animations & Effects
   ============================================ */

/* --- Scroll Reveal Base States --- */
[data-animate] {
    opacity: 0;
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease-out);
    will-change: opacity, transform;
}

[data-animate="fade-up"] {
    transform: translateY(32px);
}

[data-animate="fade-down"] {
    transform: translateY(-32px);
}

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

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

[data-animate="fade-in"] {
    transform: none;
}

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

/* --- Revealed State --- */
[data-animate].in-view {
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1);
}

/* --- Counter Animation --- */
.stats-bar__value span {
    display: inline-block;
    font-variant-numeric: tabular-nums;
}

/* --- Spotlight Diagram Rings --- */
.spotlight__diagram-ring {
    animation: ring-pulse 4s ease-in-out infinite;
}

.spotlight__diagram-ring:nth-child(1) {
    animation-delay: 0s;
}

.spotlight__diagram-ring:nth-child(2) {
    animation-delay: 0.5s;
}

.spotlight__diagram-ring:nth-child(3) {
    animation-delay: 1s;
}

@keyframes ring-pulse {
    0%, 100% {
        opacity: 0.5;
        border-color: rgba(0, 200, 255, 0.06);
    }
    50% {
        opacity: 1;
        border-color: rgba(0, 200, 255, 0.15);
    }
}

/* --- Pulse Dot (hero badge) --- */
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(0.7); }
}

/* --- Nav Link Underline Slide --- */
.nav__link::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 16px;
    height: 2px;
    background: var(--cyan);
    border-radius: 1px;
    transition: transform 0.25s var(--ease-out);
}

.nav__link:hover::after {
    transform: translateX(-50%) scaleX(1);
}

.nav__link--active::after {
    transform: translateX(-50%) scaleX(1);
}

/* --- Service Card Bottom Line --- */
.service-card::after {
    transform-origin: left;
}

/* --- Glass Card Shimmer on Hover --- */
.glass-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 40%,
        rgba(0, 200, 255, 0.02) 45%,
        rgba(0, 200, 255, 0.04) 50%,
        rgba(0, 200, 255, 0.02) 55%,
        transparent 60%
    );
    transform: translateX(-100%);
    transition: none;
    pointer-events: none;
}

.glass-card:hover::after {
    transform: translateX(100%);
    transition: transform 0.8s var(--ease);
}

/* --- Event Recap Top Bar Gradient Animation --- */
.event-recap::before {
    background-size: 200% 100%;
    animation: gradient-slide 3s linear infinite;
}

@keyframes gradient-slide {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

/* --- Button Hover Ripple --- */
.btn--primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: translateX(-100%);
    transition: none;
}

.btn--primary:hover::before {
    transform: translateX(100%);
    transition: transform 0.5s var(--ease);
}

/* --- Mobile Nav Toggle Animation --- */
.nav__toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav__toggle.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(10px);
}

.nav__toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Testimonial Card Hover --- */
.testimonial-card {
    transition: all 0.35s var(--ease);
}

.testimonial-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 200, 255, 0.05);
}

/* --- Cert Badge Hover Glow --- */
.cert-badge {
    transition: all 0.3s var(--ease);
}

.cert-badge:hover {
    box-shadow: 0 0 20px rgba(0, 200, 255, 0.06);
}

/* --- Form Input Focus Ring --- */
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    animation: focus-ring 0.3s var(--ease-out);
}

@keyframes focus-ring {
    0% { box-shadow: 0 0 0 0 rgba(0, 200, 255, 0.2); }
    100% { box-shadow: 0 0 0 3px rgba(0, 200, 255, 0.08); }
}

/* --- Loading Spinner (for form submit) --- */
.btn--loading {
    position: relative;
    pointer-events: none;
}

.btn--loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 0.5rem;
}

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

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

    [data-animate] {
        opacity: 1;
        transform: none;
    }
}