/* ============================================================
   SOLACE WEBSITE — ANIMATIONS.CSS
   Reveal animations, transitions, and micro-interactions
   ============================================================ */

/* ---------- Reveal Animation System ---------- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delays for child elements */
.reveal[data-delay="0"] { transition-delay: 0ms; }
.reveal[data-delay="1"] { transition-delay: 150ms; }
.reveal[data-delay="2"] { transition-delay: 300ms; }
.reveal[data-delay="3"] { transition-delay: 450ms; }

/* Hero-specific stagger */
.section-hero .reveal:nth-child(1) { transition-delay: 200ms; }
.section-hero .reveal:nth-child(2) { transition-delay: 400ms; }
.section-hero .reveal:nth-child(3) { transition-delay: 600ms; }
.section-hero .reveal:nth-child(4) { transition-delay: 800ms; }
.section-hero .hero-headline { transition-delay: 0ms; }
.section-hero .hero-sub { transition-delay: 200ms; }
.section-hero .hero-ctas { transition-delay: 400ms; }
.section-hero .scroll-indicator { transition-delay: 800ms; }

/* ---------- Transition Section Word Reveals ---------- */
.transition-word {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.transition-word.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.transition-word[data-delay="0"] { transition-delay: 0ms; }
.transition-word[data-delay="1"] { transition-delay: 300ms; }
.transition-word[data-delay="2"] { transition-delay: 600ms; }

/* ---------- Mockup Slide-In ---------- */
.app-mockup {
    opacity: 0;
    transform: translateY(50px) scale(0.95);
    transition: opacity 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.app-mockup.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ---------- Wallpaper Showcase Slide-In ---------- */
.macbook-light {
    opacity: 0;
    transform: translateX(-60px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.macbook-dark {
    opacity: 0;
    transform: translateX(60px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    transition-delay: 150ms;
}

.wallpaper-showcase.visible .macbook-light,
.wallpaper-showcase.visible .macbook-dark {
    opacity: 1;
    transform: translateX(0);
}

/* ---------- Shooting Star ---------- */
@keyframes shooting-star {
    0% {
        opacity: 0;
        transform: translate(0, 0) rotate(-35deg);
    }
    10% {
        opacity: 1;
    }
    70% {
        opacity: 0.8;
    }
    100% {
        opacity: 0;
        transform: translate(350px, 200px) rotate(-35deg);
    }
}

/* ---------- Mockup Mode Switch ---------- */
.m2-header-card {
    transition: background 0.5s ease;
}
.m2-mode-icon {
    transition: background 0.5s ease;
}
.m2-mode-title {
    transition: color 0.3s ease;
}
.mockup-sun-svg, .mockup-moon-svg {
    transition: opacity 0.3s ease;
}

/* ---------- Pricing Card Scale ---------- */
.pricing-card {
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

/* ---------- Trust Badge Pulse ---------- */
.trust-icon svg {
    transition: transform 0.3s ease;
}

.trust-badge:hover .trust-icon svg {
    transform: scale(1.1);
}

/* ---------- Full-Viewport Rain Animation ---------- */
@keyframes rain-fall {
    0% { transform: translateY(-60px) rotate(-5deg); }
    100% { transform: translateY(110vh) rotate(-5deg); }
}

/* ---------- Weather Mockup Card Entrance ---------- */
.weather-before {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.weather-after {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
    transition-delay: 200ms;
}
.weather-mockup-pair.visible .weather-before,
.weather-mockup-pair.visible .weather-after {
    opacity: 1;
    transform: translateX(0);
}

/* ---------- Sun Arc Animation ---------- */
.arc-sun {
    transition: cx 0.1s ease-out, cy 0.1s ease-out;
}

/* ---------- Step Number Count-Up ---------- */
@keyframes count-up {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 0.15; transform: translateY(0); }
}

.step-card.visible .step-number {
    animation: count-up 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* ---------- Kelvin Thumb Glow ---------- */
.kelvin-thumb {
    transition: left 0.15s ease-out, box-shadow 0.3s;
}

.kelvin-thumb:hover,
.kelvin-visual:hover .kelvin-thumb {
    box-shadow: 0 0 0 4px rgba(255, 159, 10, 0.2), 0 2px 8px rgba(0,0,0,0.2);
}

/* ---------- Button Press Effect ---------- */
.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s;
    background: radial-gradient(circle at center, rgba(255,255,255,0.2) 0%, transparent 70%);
}

.btn:active::after {
    opacity: 1;
}

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

/* ---------- Smooth Theme Transition ---------- */
body,
.section-headline,
.section-body,
.hero-headline,
.hero-sub,
.transition-intro,
.transition-word,
.transition-follow,
.transition-body {
    transition: color 0.6s ease;
}

.glass,
.pricing-card.glass,
.step-card.glass,
.trust-badge.glass {
    transition: background 0.6s ease, border-color 0.6s ease;
}

/* ---------- Reduce Motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .transition-word {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .app-mockup,
    .macbook-light,
    .macbook-dark,
    .pricing-card {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .mockup-popover {
        animation: none;
    }

    #shooting-star {
        display: none;
    }

    .final-nebula {
        animation: none;
    }

    .scroll-indicator svg {
        animation: none;
    }

    .pricing-card-glow {
        animation: none;
    }

    .status-dot.active {
        animation: none;
    }

    .btn-hero {
        animation: none;
    }

    .cloud {
        animation: none;
    }

    .rain-drop {
        animation: none;
    }

    .weather-before,
    .weather-after {
        opacity: 1;
        transform: none;
        transition: none;
    }

    #rain-overlay {
        display: none;
    }

    #lightning-flash {
        display: none;
    }
}
