/* ============================================
   SKYLANCH — Animation Stylesheet
   ============================================ */

/* --- Initial states for scroll-triggered animations --- */
[data-animate="slide-up"],
[data-animate="fade-up"],
[data-animate="stagger"] {
    opacity: 0;
    transform: translateY(40px);
}

[data-animate="slide-down"] {
    opacity: 0;
    transform: translateY(-40px);
}

[data-animate="perspective"] {
    opacity: 0;
    transform: perspective(1000px) rotateY(15deg) translateX(40px);
}

[data-animate="lines"] .line-inner {
    display: inline-block;
    transform: translateY(100%);
}

[data-animate="lines"] .line {
    display: block;
    overflow: hidden;
}

[data-animate="timeline"] {
    opacity: 0;
    transform: translateY(30px);
}

[data-animate="roadmap"] {
    opacity: 0;
    transform: translateX(-20px);
}

[data-animate="pie"] {
    opacity: 0;
    transform: scale(0.8);
}

/* --- Animated state (after scroll trigger) --- */
.is-visible[data-animate="slide-up"],
.is-visible[data-animate="fade-up"],
.is-visible[data-animate="stagger"],
.is-visible[data-animate="timeline"],
.is-visible[data-animate="slide-down"] {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.is-visible[data-animate="perspective"] {
    opacity: 1;
    transform: perspective(1000px) rotateY(0) translateX(0);
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1),
                transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.is-visible[data-animate="roadmap"] {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.is-visible[data-animate="pie"] {
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Pie chart animation --- */
.pie-segment-provider {
    stroke-dasharray: 502.65;
    stroke-dashoffset: 502.65;
    transform: rotate(-90deg);
    transform-origin: center;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.pie-animated .pie-segment-provider {
    stroke-dashoffset: 75.40;
}

/* --- Comparison bars --- */
.comparison-bar {
    width: 0;
    transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.comparison-bar.animated {
    width: var(--bar-width);
}

/* --- Roadmap line fill --- */
.roadmap-line-fill {
    position: absolute;
    left: 20px;
    top: 0;
    width: 2px;
    height: 0;
    background: var(--color-primary);
    z-index: 1;
    transition: height 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Phase marker activation --- */
.phase-marker.phase-lit {
    border-color: var(--color-primary);
    background: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

/* --- Card hover shadow animation --- */
.problema-card,
.beneficio-card,
.tarifa-card {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Prefers reduced motion --- */
@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 !important;
        transform: none !important;
    }

    .pie-segment-provider {
        transition-duration: 0.01ms !important;
    }

    .scroll-line {
        animation: none;
    }
}
