/* ============================================
   STR ADVISORS - ADVANCED ANIMATIONS
   Enterprise-Level Motion Design
============================================ */

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

@keyframes loadingDots {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

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

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

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    33% {
        transform: translateY(-20px) rotate(5deg);
    }
    66% {
        transform: translateY(10px) rotate(-3deg);
    }
}

@keyframes floatSlow {
    0%, 100% {
        transform: translateY(0) rotate(0deg) scale(1);
    }
    25% {
        transform: translateY(-30px) rotate(10deg) scale(1.1);
    }
    50% {
        transform: translateY(0) rotate(0deg) scale(1);
    }
    75% {
        transform: translateY(20px) rotate(-10deg) scale(0.9);
    }
}

@keyframes scrollPulse {
    0%, 100% {
        opacity: 1;
        transform: translateY(0);
    }
    50% {
        opacity: 0.5;
        transform: translateY(10px);
    }
}

@keyframes parallaxFloat {
    0%, 100% {
        transform: translateY(0) translateX(0) scale(1);
    }
    25% {
        transform: translateY(-50px) translateX(30px) scale(1.1);
    }
    50% {
        transform: translateY(20px) translateX(-20px) scale(0.9);
    }
    75% {
        transform: translateY(30px) translateX(40px) scale(1.05);
    }
}

@keyframes orbit {
    0% {
        transform: rotate(0deg) translateX(170px) rotate(0deg);
    }
    100% {
        transform: rotate(360deg) translateX(170px) rotate(-360deg);
    }
}

@keyframes contactFloat {
    0%, 100% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0.1;
    }
    50% {
        transform: translateY(-30px) translateX(20px) scale(1.1);
        opacity: 0.2;
    }
}

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

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

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

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

@keyframes rotateIn {
    from {
        opacity: 0;
        transform: rotate(-10deg) scale(0.9);
    }
    to {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }
}

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

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

@keyframes morphBackground {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
}

@keyframes particleFloat {
    0%, 100% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 0.7;
    }
    25% {
        transform: translateY(-100px) translateX(50px) rotate(90deg);
        opacity: 1;
    }
    50% {
        transform: translateY(-50px) translateX(-30px) rotate(180deg);
        opacity: 0.8;
    }
    75% {
        transform: translateY(-150px) translateX(20px) rotate(270deg);
        opacity: 0.9;
    }
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3) translate3d(0, 0, 0);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.05);
    }
    80% {
        opacity: 1;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1) translate3d(0, 0, 0);
    }
}

@keyframes slideInFromBottom {
    0% {
        transform: translateY(100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

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

@keyframes zoomInRotate {
    0% {
        opacity: 0;
        transform: scale(0) rotate(-360deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* ============================================
   SCROLL-TRIGGERED ANIMATIONS
============================================ */

.scroll-animate {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scroll-animate.animate {
    opacity: 1;
    transform: translateY(0);
}

.scroll-animate-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scroll-animate-left.animate {
    opacity: 1;
    transform: translateX(0);
}

.scroll-animate-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scroll-animate-right.animate {
    opacity: 1;
    transform: translateX(0);
}

.scroll-animate-scale {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scroll-animate-scale.animate {
    opacity: 1;
    transform: scale(1);
}

/* ============================================
   PARALLAX EFFECTS
============================================ */

.parallax-container {
    overflow-x: hidden;
    overflow-y: auto;
    perspective: 1px;
}

.parallax-element {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

.parallax-back {
    transform: translateZ(-1px) scale(2);
}

.parallax-base {
    transform: translateZ(0);
}

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

.hover-lift {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.hover-scale {
    transition: transform 0.3s ease;
}

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

.hover-rotate {
    transition: transform 0.3s ease;
}

.hover-rotate:hover {
    transform: rotate(5deg);
}

.hover-glow {
    position: relative;
    transition: all 0.3s ease;
}

.hover-glow::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle, rgba(30, 64, 175, 0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
    z-index: -1;
}

.hover-glow:hover::before {
    opacity: 1;
}

/* ============================================
   TEXT ANIMATIONS
============================================ */

.text-reveal {
    overflow: hidden;
}

.text-reveal span {
    display: inline-block;
    opacity: 0;
    transform: translateY(100%);
    animation: slideInFromBottom 0.8s ease forwards;
}

.text-reveal span:nth-child(1) { animation-delay: 0.1s; }
.text-reveal span:nth-child(2) { animation-delay: 0.2s; }
.text-reveal span:nth-child(3) { animation-delay: 0.3s; }
.text-reveal span:nth-child(4) { animation-delay: 0.4s; }
.text-reveal span:nth-child(5) { animation-delay: 0.5s; }

.gradient-text {
    background: linear-gradient(45deg, #0d1a33, #1ca7a2, #114b5f);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
}

.typewriter-text {
    overflow: hidden;
    border-right: 3px solid #1ca7a2;
    white-space: nowrap;
    animation: typewriter 4s steps(40, end) 1s 1 normal both,
               blinkTextCursor 500ms steps(40, end) infinite normal;
}

@keyframes blinkTextCursor {
    from { border-right-color: #1ca7a2; }
    to { border-right-color: transparent; }
}

/* ============================================
   LOADING ANIMATIONS
============================================ */

.skeleton-loader {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

.pulse-loader {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.bounce-loader {
    animation: bounceIn 1s ease-in-out;
}

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

.btn-magnetic {
    position: relative;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.320, 1);
}

.btn-magnetic::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: inherit;
    border-radius: inherit;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.320, 1);
    transform: scale(0.8);
}

.btn-magnetic:hover::before {
    opacity: 0.3;
    transform: scale(1.1);
}

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

.btn-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-ripple:hover::after {
    width: 300px;
    height: 300px;
}

/* ============================================
   GEOMETRIC ANIMATIONS
============================================ */

.geometric-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.geometric-shape {
    position: absolute;
    opacity: 0.1;
    animation: morphBackground 8s ease-in-out infinite;
}

.triangle-float {
    width: 0;
    height: 0;
    border-left: 25px solid transparent;
    border-right: 25px solid transparent;
    border-bottom: 43px solid rgba(28, 167, 162, 0.1);
    animation: particleFloat 12s ease-in-out infinite;
}

.circle-pulse {
    width: 50px;
    height: 50px;
    background: rgba(28, 167, 162, 0.1);
    border-radius: 50%;
    animation: pulse 4s ease-in-out infinite;
}

.square-rotate {
    width: 40px;
    height: 40px;
    background: rgba(17, 75, 95, 0.1);
    animation: zoomInRotate 6s ease-in-out infinite;
}

/* ============================================
   PARTICLE EFFECTS
============================================ */

.particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(28, 167, 162, 0.7);
    border-radius: 50%;
    animation: particleFloat 20s linear infinite;
}

.particle:nth-child(1) {
    left: 10%;
    animation-delay: 0s;
    animation-duration: 15s;
}

.particle:nth-child(2) {
    left: 20%;
    animation-delay: 2s;
    animation-duration: 18s;
}

.particle:nth-child(3) {
    left: 30%;
    animation-delay: 4s;
    animation-duration: 12s;
}

.particle:nth-child(4) {
    left: 40%;
    animation-delay: 6s;
    animation-duration: 22s;
}

.particle:nth-child(5) {
    left: 50%;
    animation-delay: 8s;
    animation-duration: 16s;
}

.particle:nth-child(6) {
    left: 60%;
    animation-delay: 10s;
    animation-duration: 20s;
}

.particle:nth-child(7) {
    left: 70%;
    animation-delay: 12s;
    animation-duration: 14s;
}

.particle:nth-child(8) {
    left: 80%;
    animation-delay: 14s;
    animation-duration: 18s;
}

.particle:nth-child(9) {
    left: 90%;
    animation-delay: 16s;
    animation-duration: 24s;
}

/* ============================================
   ADVANCED TRANSFORMATIONS
============================================ */

.perspective-card {
    perspective: 1000px;
}

.perspective-card .card-inner {
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.perspective-card:hover .card-inner {
    transform: rotateY(10deg) rotateX(5deg);
}

.tilt-effect {
    transition: all 0.3s ease;
}

.tilt-effect:hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(5deg) scale3d(1.05, 1.05, 1.05);
}

/* ============================================
   STAGGERED ANIMATIONS
============================================ */

.stagger-container .stagger-item {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease forwards;
}

.stagger-container .stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-container .stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-container .stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-container .stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-container .stagger-item:nth-child(5) { animation-delay: 0.5s; }
.stagger-container .stagger-item:nth-child(6) { animation-delay: 0.6s; }
.stagger-container .stagger-item:nth-child(7) { animation-delay: 0.7s; }

/* ============================================
   PERFORMANCE OPTIMIZATIONS
============================================ */

.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000;
}

.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

/* ============================================
   REDUCED MOTION PREFERENCES
============================================ */

@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;
    }
    
    .parallax-element {
        transform: none !important;
    }
    
    .floating-elements,
    .animated-shapes,
    .mckinsey-grid,
    .orbit-elements {
        display: none;
    }
}

/* ============================================
   McKINSEY/BCG-STYLE PROFESSIONAL ANIMATIONS
   Sophisticated, Understated Motion Design
============================================ */

/* Subtle Gradient Animation */
@keyframes sophisticatedGradient {
    0%, 100% {
        background-position: 0% 50%;
        opacity: 0.15;
    }
    50% {
        background-position: 100% 50%;
        opacity: 0.2;
    }
}

/* Data Flow Animation */
@keyframes dataFlow {
    0% {
        opacity: 0;
        transform: translateX(-100%) translateY(0) scale(0.5);
    }
    20% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.15;
        transform: translateX(50%) translateY(-20px) scale(1);
    }
    80% {
        opacity: 0.1;
    }
    100% {
        opacity: 0;
        transform: translateX(200%) translateY(-40px) scale(0.8);
    }
}

/* Hero Fade-in Animation */
@keyframes heroFadeIn {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Word Rotation Animation */
@keyframes wordRotationFade {
    0%, 30% {
        opacity: 1;
        transform: translateY(0);
    }
    35%, 65% {
        opacity: 0;
        transform: translateY(-10px);
    }
    70%, 100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Subtle Professional Pulse */
@keyframes professionalPulse {
    0%, 100% {
        opacity: 0.05;
        transform: scale(1);
    }
    50% {
        opacity: 0.12;
        transform: scale(1.05);
    }
}

/* Section Reveal Animation */
@keyframes sectionReveal {
    0% {
        opacity: 0;
        transform: translateY(50px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Sophisticated Background Movement */
@keyframes sophisticatedMove {
    0%, 100% {
        transform: translateX(-50%) translateY(-50%) rotate(0deg) scale(1);
    }
    33% {
        transform: translateX(-45%) translateY(-55%) rotate(120deg) scale(1.1);
    }
    66% {
        transform: translateX(-55%) translateY(-45%) rotate(240deg) scale(0.9);
    }
}

/* Professional Element Classes */
.animate-fade-in {
    animation: heroFadeIn 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.animate-fade-in:nth-child(1) {
    animation-delay: 0.2s;
}

.animate-fade-in:nth-child(2) {
    animation-delay: 0.4s;
}

.animate-fade-in:nth-child(3) {
    animation-delay: 0.6s;
}

/* Scroll-triggered Section Animations */
.section-animate {
    opacity: 0;
    transform: translateY(50px);
    transition: all 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.section-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered Section Elements */
.stagger-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.stagger-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

.stagger-animate:nth-child(1) { transition-delay: 0s; }
.stagger-animate:nth-child(2) { transition-delay: 0.1s; }
.stagger-animate:nth-child(3) { transition-delay: 0.2s; }
.stagger-animate:nth-child(4) { transition-delay: 0.3s; }
.stagger-animate:nth-child(5) { transition-delay: 0.4s; }
.stagger-animate:nth-child(6) { transition-delay: 0.5s; }