/* ===== Scroll choreography — las lineas se trazan como en un plano tecnico ===== */
/* Solo activa cuando main.js marca html.js-anim (JS + IntersectionObserver + sin reduced-motion) */

:root {
    --ease-plot: cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes plot-line {
    to { transform: scaleX(1); }
}

@keyframes settle-in {
    to { opacity: 1; transform: none; }
}

@keyframes fade-in {
    to { opacity: 1; }
}

/* ===== Titulos de seccion: la hairline se traza, el titulo se asienta ===== */
.js-anim .section-head {
    position: relative;
    border-bottom-color: transparent;
}

.js-anim .section-head::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 1px;
    background: var(--color-border);
    transform: scaleX(0);
    transform-origin: left;
}

.js-anim .section-head.in::after {
    animation: plot-line 0.7s var(--ease-plot) forwards;
}

.js-anim .section-head__title {
    opacity: 0;
    transform: translateY(10px);
}

.js-anim .section-head.in .section-head__title {
    animation: settle-in 0.55s var(--ease-plot) 0.15s forwards;
}

/* ===== Ofertas y planes: stagger de lista ===== */
.js-anim .offer,
.js-anim .price-card {
    opacity: 0;
    transform: translateY(14px);
}

.js-anim .offer.in,
.js-anim .price-card.in {
    animation: settle-in 0.55s var(--ease-plot) calc(var(--i, 0) * 70ms) forwards;
}

/* ===== Proceso: la regla de tinta de cada paso se traza en secuencia ===== */
.js-anim .step {
    position: relative;
    border-top-color: transparent;
}

.js-anim .step::before {
    content: "";
    position: absolute;
    left: 0;
    top: -2px;
    width: 100%;
    height: 2px;
    background: var(--color-text);
    transform: scaleX(0);
    transform-origin: left;
}

.js-anim .step.in::before {
    animation: plot-line 0.6s var(--ease-plot) calc(var(--i, 0) * 90ms) forwards;
}

.js-anim .step__number,
.js-anim .step__title,
.js-anim .step__tag,
.js-anim .step__text {
    opacity: 0;
}

.js-anim .step.in .step__number,
.js-anim .step.in .step__title,
.js-anim .step.in .step__tag,
.js-anim .step.in .step__text {
    animation: fade-in 0.5s ease-out calc(var(--i, 0) * 90ms + 180ms) forwards;
}

/* ===== Nosotros: hairlines que se trazan ===== */
.js-anim .about__item {
    position: relative;
    border-top-color: transparent;
}

.js-anim .about__item::before {
    content: "";
    position: absolute;
    left: 0;
    top: -1px;
    width: 100%;
    height: 1px;
    background: var(--color-border);
    transform: scaleX(0);
    transform-origin: left;
}

.js-anim .about__item.in::before {
    animation: plot-line 0.6s var(--ease-plot) calc(var(--i, 0) * 90ms) forwards;
}

.js-anim .about__label,
.js-anim .about__text {
    opacity: 0;
}

.js-anim .about__item.in .about__label,
.js-anim .about__item.in .about__text {
    animation: fade-in 0.5s ease-out calc(var(--i, 0) * 90ms + 160ms) forwards;
}

/* ===== Micro-feedback ===== */
.btn:active {
    transform: translateY(0);
}

.process__cta span {
    transition: transform 0.18s var(--ease-plot);
}

.process__cta:hover span,
.process__cta:focus-visible span {
    transform: translateX(4px);
}

/* ===== Reduced motion: todo visible, nada se mueve ===== */
@media (prefers-reduced-motion: reduce) {
    .js-anim .section-head { border-bottom-color: var(--color-border); }
    .js-anim .step { border-top-color: var(--color-text); }
    .js-anim .about__item { border-top-color: var(--color-border); }

    .js-anim .section-head::after,
    .js-anim .step::before,
    .js-anim .about__item::before {
        transform: scaleX(1);
        animation: none;
    }

    .js-anim .section-head__title,
    .js-anim .offer,
    .js-anim .price-card,
    .js-anim .step__number,
    .js-anim .step__title,
    .js-anim .step__tag,
    .js-anim .step__text,
    .js-anim .about__label,
    .js-anim .about__text {
        opacity: 1;
        transform: none;
        animation: none;
    }

    .process__cta span { transition: none; }
}
