/* ============================================
   AEGIS CONSULTING
   Animations & Micro-interactions
   ============================================ */

/* ============================================
   KEYFRAME ANIMATIONS
   ============================================ */

@keyframes cardFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-12px) rotate(0.3deg);
    }
}

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

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

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

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

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

@keyframes underlineExpand {
    from {
        transform: scaleX(0);
        transform-origin: left;
    }
    to {
        transform: scaleX(1);
        transform-origin: left;
    }
}

/* ============================================
   PAGE LOAD ANIMATIONS
   ============================================ */

.page-load-animate > * {
    animation: fadeInUp 600ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.page-load-animate > *:nth-child(1) { animation-delay: 50ms; }
.page-load-animate > *:nth-child(2) { animation-delay: 120ms; }
.page-load-animate > *:nth-child(3) { animation-delay: 190ms; }
.page-load-animate > *:nth-child(4) { animation-delay: 260ms; }
.page-load-animate > *:nth-child(5) { animation-delay: 330ms; }
.page-load-animate > *:nth-child(6) { animation-delay: 400ms; }
.page-load-animate > *:nth-child(7) { animation-delay: 470ms; }
.page-load-animate > *:nth-child(8) { animation-delay: 540ms; }

/* Hero elements staggered reveal */
.hero-animate .hero-eyebrow {
    animation: fadeInUp 600ms cubic-bezier(0.16, 1, 0.3, 1) 100ms both;
}

.hero-animate .hero-heading {
    animation: fadeInUp 700ms cubic-bezier(0.16, 1, 0.3, 1) 200ms both;
}

.hero-animate .hero-desc {
    animation: fadeInUp 600ms cubic-bezier(0.16, 1, 0.3, 1) 400ms both;
}

.hero-animate .hero-buttons {
    animation: fadeInUp 600ms cubic-bezier(0.16, 1, 0.3, 1) 500ms both;
}

.hero-animate .hero-credentials {
    animation: fadeInUp 600ms cubic-bezier(0.16, 1, 0.3, 1) 650ms both;
}

.hero-animate .evidence-card-wrap {
    animation: fadeInUp 800ms cubic-bezier(0.16, 1, 0.3, 1) 350ms both;
}

/* ============================================
   BUTTON ANIMATIONS
   ============================================ */

.btn {
    will-change: transform;
}

.btn:active {
    transform: scale(0.97);
}

/* ============================================
   CRITERIA CHECKBOX ANIMATIONS
   ============================================ */

.criterion-checkbox {
    transition:
        background-color 250ms cubic-bezier(0.4, 0, 0.2, 1),
        border-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.criterion-checkbox svg {
    transition:
        opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 50ms,
        transform 250ms cubic-bezier(0.34, 1.56, 0.64, 1) 50ms;
}

/* Counter number update animation */
.selfcheck-current.updating {
    animation: counterPulse 350ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

/* Progress segment fill animation */
.progress-segment {
    transition:
        background-color 400ms cubic-bezier(0.4, 0, 0.2, 1),
        transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: left;
}

.progress-segment.filled {
    transform: scaleX(1);
}

.progress-segment:not(.filled) {
    transform: scaleX(1);
}

.progress-segment.filled:nth-child(1) { transition-delay: 0ms; }
.progress-segment.filled:nth-child(2) { transition-delay: 30ms; }
.progress-segment.filled:nth-child(3) { transition-delay: 60ms; }
.progress-segment.filled:nth-child(4) { transition-delay: 90ms; }
.progress-segment.filled:nth-child(5) { transition-delay: 120ms; }
.progress-segment.filled:nth-child(6) { transition-delay: 150ms; }
.progress-segment.filled:nth-child(7) { transition-delay: 180ms; }
.progress-segment.filled:nth-child(8) { transition-delay: 210ms; }
.progress-segment.filled:nth-child(9) { transition-delay: 240ms; }
.progress-segment.filled:nth-child(10) { transition-delay: 270ms; }

/* ============================================
   FAQ ACCORDION ANIMATIONS
   ============================================ */

.faq-answer {
    transition:
        max-height 450ms cubic-bezier(0.4, 0, 0.2, 1),
        padding 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-toggle {
    transition:
        background-color 300ms cubic-bezier(0.4, 0, 0.2, 1),
        border-color 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-toggle span {
    transition:
        transform 350ms cubic-bezier(0.4, 0, 0.2, 1),
        opacity 250ms cubic-bezier(0.4, 0, 0.2, 1),
        background-color 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-item.active .faq-question-text {
    color: var(--dark-green);
}

/* ============================================
   NAVIGATION ANIMATIONS
   ============================================ */

.main-nav a {
    transition:
        color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.main-nav a::after {
    transition:
        width 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

.site-header {
    transition:
        background-color 350ms cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

.header-inner {
    transition:
        height 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mobile nav */
.hamburger span {
    transition:
        transform 350ms cubic-bezier(0.4, 0, 0.2, 1),
        opacity 200ms ease;
}

.mobile-nav {
    transition: right 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-nav.active ul li {
    animation: fadeInUp 400ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.mobile-nav.active ul li:nth-child(1) { animation-delay: 150ms; }
.mobile-nav.active ul li:nth-child(2) { animation-delay: 200ms; }
.mobile-nav.active ul li:nth-child(3) { animation-delay: 250ms; }
.mobile-nav.active ul li:nth-child(4) { animation-delay: 300ms; }
.mobile-nav.active ul li:nth-child(5) { animation-delay: 350ms; }

.mobile-nav-cta {
    animation: fadeInUp 500ms cubic-bezier(0.16, 1, 0.3, 1) 500ms both;
}

/* ============================================
   CARD HOVER ANIMATIONS
   ============================================ */

.service-card,
.standard-card,
.criterion-item {
    will-change: transform, box-shadow;
}

/* ============================================
   TIMELINE ANIMATIONS
   ============================================ */

.timeline-item::before {
    transition:
        background-color 400ms cubic-bezier(0.4, 0, 0.2, 1),
        border-color 400ms cubic-bezier(0.4, 0, 0.2, 1),
        transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.timeline-number {
    transition: color 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   EVIDENCE CARD ROW ANIMATIONS
   ============================================ */

.evidence-row {
    transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.evidence-status {
    transition:
        background-color 250ms cubic-bezier(0.4, 0, 0.2, 1),
        color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   FORM INPUT ANIMATIONS
   ============================================ */

.form-input,
.form-textarea,
.form-select {
    transition:
        border-color 250ms cubic-bezier(0.4, 0, 0.2, 1),
        background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.form-input::placeholder,
.form-textarea::placeholder {
    transition:
        opacity 200ms cubic-bezier(0.4, 0, 0.2, 1),
        transform 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.form-input:focus::placeholder,
.form-textarea:focus::placeholder {
    opacity: 0.4;
    transform: translateX(4px);
}

/* Custom checkbox */
.form-checkbox {
    transition:
        background-color 250ms cubic-bezier(0.4, 0, 0.2, 1),
        border-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.form-checkbox svg {
    transition:
        opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 50ms;
}

/* ============================================
   SCROLL REVEAL VARIANTS
   ============================================ */

.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition:
        opacity 700ms cubic-bezier(0.16, 1, 0.3, 1),
        transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition:
        opacity 700ms cubic-bezier(0.16, 1, 0.3, 1),
        transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.95);
    transition:
        opacity 700ms cubic-bezier(0.16, 1, 0.3, 1),
        transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-scale.visible {
    opacity: 1;
    transform: scale(1);
}

/* ============================================
   REDUCED MOTION SUPPORT
   ============================================ */

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

    .reveal,
    .reveal-left,
    .reveal-right,
    .reveal-scale {
        opacity: 1;
        transform: none;
    }

    .evidence-card {
        animation: none !important;
    }

    .page-load-animate > *,
    .hero-animate .hero-eyebrow,
    .hero-animate .hero-heading,
    .hero-animate .hero-desc,
    .hero-animate .hero-buttons,
    .hero-animate .hero-credentials,
    .hero-animate .evidence-card-wrap {
        animation: none !important;
        opacity: 1;
        transform: none;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .site-header,
    .site-footer,
    .mobile-nav,
    .mobile-nav-overlay,
    .hamburger,
    .hero-buttons,
    .contact-form-wrap {
        display: none !important;
    }

    .hero,
    .section {
        padding: 24px 0 !important;
    }

    body {
        background: white;
        color: black;
    }

    .standard-card,
    .service-card,
    .criterion-item,
    .selfcheck,
    .attorney-side,
    .evidence-card,
    .contact-info-block {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
        background: white !important;
        break-inside: avoid;
    }
}
