/* ==========================================================================
   Biting Consulting — ilustraciones SVG animadas (inicio y servicios)
   Las ilustraciones son SVG dentro del HTML. Cada una recibe del script de la
   página su avance, --lp (0 → 1), y aquí se reparte entre sus piezas: cada
   pieza tiene su retraso (--d) y su velocidad (--s), y de ahí sale su propio
   avance --k. Sin JavaScript, --lp vale 1 y se ve el dibujo terminado.
   ========================================================================== */

.ill { display: block; width: 100%; height: auto; overflow: visible; --lp: 1; }
.ill g, .ill rect, .ill path, .ill circle { transform-box: fill-box; transform-origin: center; }
.ill [class] { --k: clamp(0, calc((var(--lp) - var(--d, 0)) * var(--s, 4)), 1); }

.c-white { fill: #fff; }
.c-navy { fill: var(--navy); }
.c-blue { fill: var(--blue); }
.c-sky { fill: var(--sky); }
.c-tint { fill: var(--tint); }
.c-tint2 { fill: var(--tint-2); }
.s-navy { stroke: var(--navy); stroke-width: 3; }
.s-blue { stroke: var(--blue); stroke-width: 4; }
.s-sky { stroke: var(--sky); stroke-width: 4; }
.s-white { stroke: #fff; stroke-width: 4; }
.ill path.s-navy, .ill path.s-blue, .ill path.s-sky, .ill path.s-white { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.o6 { opacity: .6; }
.o3 { opacity: .3; }
.ill text { font-family: var(--font); font-weight: 800; text-anchor: middle; }
.t-eur { fill: #fff; font-size: 14px; }
.t-badge { fill: #fff; font-size: 20px; }
.t-ask { fill: var(--navy); font-size: 30px; }
.t-ask--light { fill: #fff; }
.t-ask--sm { font-size: 22px; }

/* «Pagamos módulos que nadie abre»: los que no se usan se apagan, pero se pagan */
.ill-modules .tile { --s: 5; }
.ill-modules .d1 { --d: .05; } .ill-modules .d2 { --d: .14; } .ill-modules .d3 { --d: .23; }
.ill-modules .d4 { --d: .32; } .ill-modules .d5 { --d: .41; } .ill-modules .d6 { --d: .5; } .ill-modules .d7 { --d: .59; }
.ill-modules .shade { fill: var(--bg); opacity: calc(var(--k) * .8); }
.ill-modules .eur { opacity: var(--k); transform: scale(calc(.4 + var(--k) * .6)); }

/* «La contabilidad se teclea dos veces»: la misma factura, escrita dos veces */
.ill-twice .typed { --s: 14; transform-origin: 0 50%; transform: scaleX(var(--k)); }
.ill-twice .l1 { --d: .04; } .ill-twice .l2 { --d: .1; } .ill-twice .l3 { --d: .16; } .ill-twice .l4 { --d: .22; } .ill-twice .l5 { --d: .3; }
.ill-twice .l6 { --d: .5; } .ill-twice .l7 { --d: .56; } .ill-twice .l8 { --d: .62; } .ill-twice .l9 { --d: .68; } .ill-twice .l10 { --d: .76; }
.ill-twice .dash { stroke-dasharray: 5 6; }
.ill-twice .twice-badge { --d: .84; --s: 8; opacity: var(--k); transform: scale(calc(.5 + var(--k) * .5)); }

/* «Nadie nos explica qué implica Verifactu»: un papel y muchas dudas */
.ill-doubt .scribble { stroke-width: 3; stroke-dasharray: 900; stroke-dashoffset: calc((1 - var(--lp)) * 900px); }
.ill-doubt .ask { --s: 5; opacity: var(--k); transform: translateY(calc((1 - var(--k)) * 26px)) scale(calc(.6 + var(--k) * .4)); }
.ill-doubt .a1 { --d: .1; } .ill-doubt .a2 { --d: .35; } .ill-doubt .a3 { --d: .6; }

/* «El soporte responde a los cuatro días»: el teléfono suena y se tachan días */
.ill-wait .cross { --s: 8; stroke-width: 4; stroke-dasharray: 70; stroke-dashoffset: calc((1 - var(--k)) * 70px); }
.ill-wait .x1 { --d: .1; } .ill-wait .x2 { --d: .3; } .ill-wait .x3 { --d: .5; } .ill-wait .x4 { --d: .7; }
.motion .ill-wait .phone { animation: home-ring 2.4s ease-in-out infinite; transform-origin: 50% 90%; }
.motion .ill-wait .ring { animation: home-pulse 1.2s ease-in-out infinite; }
.motion .ill-wait .r2 { animation-delay: .2s; }

/* «Solo tienes los módulos que has pedido»: los que sobran se van, los tuyos encajan */
.ill-fit .spare { --d: .05; --s: 3; opacity: calc(1 - var(--k)); transform: scale(calc(1 - var(--k) * .4)); }
.ill-fit .pick { --d: .2; --s: 1.6; transform: translate(calc(var(--k) * var(--tx)), calc(var(--k) * var(--ty))); }
.ill-fit .pick--a { --tx: 8px; --ty: 74px; }
.ill-fit .pick--b { --tx: 0px; --ty: -8px; }
.ill-fit .pick--c { --tx: -8px; --ty: -90px; }
.ill-fit .fit-frame { --d: .5; --s: 3; opacity: var(--k); transform: scale(calc(.94 + var(--k) * .06)); }

/* «Conectamos Verifactu»: factura → registros encadenados → Hacienda */
.ill-chain .link { --s: 8; stroke-dasharray: 40; stroke-dashoffset: calc((1 - var(--k)) * 40px); }
.ill-chain .k1 { --d: .05; } .ill-chain .k2 { --d: .3; } .ill-chain .k3 { --d: .5; } .ill-chain .k4 { --d: .7; }
.ill-chain .block { --s: 6; opacity: var(--k); transform: scale(calc(.5 + var(--k) * .5)); }
.ill-chain .b1 { --d: .12; } .ill-chain .b2 { --d: .36; } .ill-chain .b3 { --d: .56; }
.ill-chain .ok { --d: .82; --s: 6; opacity: var(--k); transform: scale(calc(.4 + var(--k) * .6)); }

/* «La parte repetitiva la hace un robot»: entran papeles, salen revisados */
.ill-robot .doc-in { --s: 3; opacity: calc(1 - var(--k)); transform: translateX(calc(var(--k) * 70px)); }
.ill-robot .i3 { --d: .1; } .ill-robot .i2 { --d: .35; } .ill-robot .i1 { --d: .6; }
.ill-robot .doc-out { --s: 3; opacity: var(--k); transform: translateX(calc((var(--k) - 1) * 24px)); }
.ill-robot .o1 { --d: .2; } .ill-robot .o2 { --d: .45; } .ill-robot .o3 { --d: .7; }
.motion .ill-robot .arm { animation: home-stamp 1.3s ease-in-out infinite; }
.motion .ill-robot .eye { animation: home-blink 4s ease-in-out infinite; }

/* «Llamas y te coge quien lo ha desarrollado»: respuesta al momento, bajo un escudo */
.ill-call .shield { --s: 2.5; opacity: calc(.4 + var(--k) * .6); transform: scale(calc(.8 + var(--k) * .2)); }
.ill-call .shield-line { stroke-width: 3; stroke-dasharray: 800; stroke-dashoffset: calc((1 - var(--lp)) * 800px); }
.ill-call .reply { --d: .45; --s: 4; opacity: var(--k); transform-origin: 0 100%; transform: translate(calc((1 - var(--k)) * -20px), calc((1 - var(--k)) * 10px)) scale(calc(.7 + var(--k) * .3)); }
.motion .ill-call .wave { animation: home-pulse 1.4s ease-in-out infinite; }
.motion .ill-call .w2 { animation-delay: .25s; }

@keyframes home-ring {
  0%, 60%, 100% { transform: rotate(0); }
  64%, 72%, 80% { transform: rotate(-4deg); }
  68%, 76% { transform: rotate(4deg); }
}
@keyframes home-pulse { 50% { opacity: .2; } }
@keyframes home-stamp { 50% { transform: translateY(14px); } }
@keyframes home-blink { 0%, 92%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }


/* «Módulo de contabilidad»: de la factura al libro, y de ahí a los libros oficiales */
.ill-ledger .lk { --s: 6; stroke-dasharray: 40; stroke-dashoffset: calc((1 - var(--k)) * 40px); }
.ill-ledger .typed { --s: 12; transform-origin: 0 50%; transform: scaleX(var(--k)); }
.ill-ledger .e1 { --d: .12; } .ill-ledger .e2 { --d: .18; } .ill-ledger .e3 { --d: .24; } .ill-ledger .e4 { --d: .3; }
.ill-ledger .e5 { --d: .36; } .ill-ledger .e6 { --d: .42; } .ill-ledger .e7 { --d: .48; } .ill-ledger .e8 { --d: .54; }
.ill-ledger .e9 { --d: .6; } .ill-ledger .e10 { --d: .66; }
.ill-ledger .book { --s: 8; opacity: var(--k); transform: translateY(calc((1 - var(--k)) * -18px)); }
.ill-ledger .bk1 { --d: .7; } .ill-ledger .bk2 { --d: .78; } .ill-ledger .bk3 { --d: .86; }

/* «Ciberseguridad»: capas que se cierran alrededor de un candado */
.ill-secure .layer { --s: 3; stroke-width: 3; stroke-dasharray: 1000; stroke-dashoffset: calc((1 - var(--k)) * 1000px); }
.ill-secure .ly1 { --d: 0; } .ill-secure .ly2 { --d: .15; } .ill-secure .ly3 { --d: .3; }
.ill-secure .lock { --d: .35; --s: 5; opacity: var(--k); transform: scale(calc(.6 + var(--k) * .4)); }
.ill-secure .shackle { --d: .62; --s: 6; stroke-width: 8; transform: translateY(calc((1 - var(--k)) * -16px)); }
.ill-secure .copy { --s: 7; opacity: var(--k); transform: translateY(calc((1 - var(--k)) * 14px)); }
.ill-secure .cp1 { --d: .74; } .ill-secure .cp2 { --d: .84; }

/* «Webs, soporte y mantenimiento»: la web se monta y el pulso de la monitorización sigue */
.ill-web .blk { --s: 6; opacity: var(--k); transform: scale(calc(.8 + var(--k) * .2)); }
.ill-web .bw1 { --d: .05; } .ill-web .bw2 { --d: .22; } .ill-web .bw3 { --d: .32; } .ill-web .bw4 { --d: .42; }
.ill-web .beat { stroke-dasharray: 520; stroke-dashoffset: calc((1 - var(--k)) * 520px); --d: .45; --s: 1.9; }
.motion .ill-web .spin { animation: ill-spin 3s linear infinite; }
@keyframes ill-spin { to { transform: rotate(360deg); } }
