/* ============================================
   Continental Chemicals - Modern Animations
   Premium 2026 Effects
   ============================================ */

/* --- Initial States for GSAP ---
   Only hide when JS/GSAP is confirmed loaded.
   body gets 'gsap-ready' class when GSAP initializes.
   ============================================ */
body.gsap-ready [data-animate] {
    opacity: 0;
}

body.gsap-ready [data-animate="fade-up"] {
    transform: translateY(40px);
}

body.gsap-ready [data-animate="fade-down"] {
    transform: translateY(-40px);
}

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

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

body.gsap-ready [data-animate="scale-up"] {
    transform: scale(0.9);
}

body.gsap-ready [data-animate="zoom-in"] {
    transform: scale(0.8);
}

/* Stagger items hidden only with GSAP */
body.gsap-ready .stagger-item {
    opacity: 0;
    transform: translateY(30px);
}

.stagger-item.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

/* --- Float Animation --- */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
}

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

.float-delay-1 { animation-delay: 0.5s; }
.float-delay-2 { animation-delay: 1s; }
.float-delay-3 { animation-delay: 1.5s; }

/* --- Glow Pulse --- */
@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(60, 58, 143, 0.2); }
    50% { box-shadow: 0 0 40px rgba(60, 58, 143, 0.4); }
}

.glow-pulse {
    animation: glowPulse 3s ease-in-out infinite;
}

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

.gradient-animate {
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
}

/* --- Shimmer Effect --- */
@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

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

.shimmer::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.15) 50%, transparent 100%);
    animation: shimmer 2.5s ease-in-out infinite;
}

/* --- Rotate Animation --- */
@keyframes slowRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.rotate-animation {
    animation: slowRotate 30s linear infinite;
}

/* --- Blob Morph --- */
@keyframes blobMorph {
    0%, 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
    25% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
    50% { border-radius: 50% 60% 30% 60% / 30% 60% 70% 40%; }
    75% { border-radius: 60% 30% 60% 40% / 70% 40% 50% 60%; }
}

.blob {
    animation: blobMorph 8s ease-in-out infinite;
}

/* --- Pulse Ring --- */
@keyframes pulseRing {
    0% { transform: scale(0.5); opacity: 0.8; }
    100% { transform: scale(2); opacity: 0; }
}

.pulse-ring {
    position: relative;
}

.pulse-ring::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid currentColor;
    animation: pulseRing 2s ease-out infinite;
}

/* --- Counter Number --- */
.counter-number {
    display: inline-block;
    font-variant-numeric: tabular-nums;
}

/* --- Parallax Layer --- */
.parallax-layer {
    will-change: transform;
    transition: none;
}

/* --- Magnetic Button --- */
[data-magnetic] {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Section Divider --- */
.section-divider {
    width: 50px;
    height: 3px;
    background: linear-gradient(135deg, #3C3A8F, #C02C7A);
    border-radius: 3px;
    margin: 0 auto 1.25rem;
}

/* --- Spinner --- */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(60, 58, 143, 0.15);
    border-top-color: var(--accent-indigo);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* --- Blink Cursor --- */
@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* --- Gradient Border Animation --- */
@keyframes borderGlow {
    0%, 100% {
        border-color: rgba(60, 58, 143, 0.2);
        box-shadow: 0 0 15px rgba(60, 58, 143, 0.05);
    }
    50% {
        border-color: rgba(192, 44, 122, 0.2);
        box-shadow: 0 0 15px rgba(192, 44, 122, 0.05);
    }
}

.border-glow {
    animation: borderGlow 4s ease-in-out infinite;
}

/* --- Decorative Background Shapes --- */
.bg-shape {
    position: absolute;
    pointer-events: none;
    z-index: 0;
}

.bg-shape-circle {
    border-radius: 50%;
    opacity: 0.03;
}

.bg-shape-dots {
    background-image: radial-gradient(circle, rgba(60, 58, 143, 0.3) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.05;
}

/* --- Image Reveal --- */
.img-reveal {
    position: relative;
    overflow: hidden;
}

.img-reveal::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-secondary);
    transform-origin: right;
    transition: transform 1s cubic-bezier(0.77, 0, 0.18, 1);
}

.img-reveal.revealed::after {
    transform: scaleX(0);
}

/* --- Split Text --- */
.split-text .char {
    display: inline-block;
}

body.gsap-ready .split-text .char {
    opacity: 0;
    transform: translateY(50px) rotateX(-90deg);
    transform-origin: bottom;
}

.split-text .word {
    display: inline-block;
    overflow: hidden;
}

/* --- Reveal Container --- */
.reveal-container {
    overflow: hidden;
    position: relative;
}

.reveal-mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    transform-origin: left;
    z-index: 2;
}

/* --- Color Swatch Stagger --- */
body.gsap-ready .color-swatch-stagger {
    opacity: 0;
    transform: scale(0);
}

.color-swatch-stagger.visible {
    opacity: 1;
    transform: scale(1);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- Subtle Entrance --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Orbit Animation for Preloader --- */
.hero-circle-1 {
    animation: float 8s ease-in-out infinite;
}

.hero-circle-2 {
    animation: float 6s ease-in-out infinite reverse;
}

.hero-circle-3 {
    animation: float 10s ease-in-out infinite;
}
