/* Portada del dominio (views/home.html). Identidad propia: la pagina agrupa
 * herramientas que cada una tiene su aspecto (armas: oscuro y ambar; rosco:
 * papel y naranja), asi que la portada no puede parecer de ninguna de las dos.
 *
 * Tema "vivo": manchas de color que derivan por el fondo, titular con degradado
 * en movimiento, tarjetas de cristal con borde degradado giratorio al pasar el
 * raton e iconos flotando. Jugueton pero medido: animaciones lentas y
 * tipografia sobria. Todo se apaga con prefers-reduced-motion.
 */
:root {
    --tinta: #f2f1fa;
    --suave: #a6a2c4;
    --acento: #8f88f8;
    --fondo: #050508;
    --vidrio: rgba(22, 20, 40, .55);
    --borde: rgba(255, 255, 255, .14);
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    background: var(--fondo);
    color: var(--tinta);
    font-size: 16px;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Manchas de color que derivan despacio por detras de todo. Son degradados
 * radiales (sin filtro de desenfoque: no cuesta nada repintarlos). Enormes,
 * con caida continua del color pleno en el centro hasta opacidad 0 en la
 * circunferencia exterior: el closest-side es clave, porque el tamano por
 * defecto (farthest-corner) lleva el 0 a la esquina del cuadrado y el
 * border-radius recorta un borde a ~29% de opacidad, marcando el circulo. */
.fondo { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.mancha { position: absolute; border-radius: 50%; }
.mancha-1 { width: 64rem; height: 64rem; left: -20rem; top: -22rem; background: radial-gradient(circle closest-side, rgba(124, 108, 240, 1), rgba(124, 108, 240, 0)); animation: derivar-1 22s ease-in-out infinite alternate; }
.mancha-2 { width: 56rem; height: 56rem; right: -16rem; top: 8rem; background: radial-gradient(circle closest-side, rgba(232, 121, 249, 1), rgba(232, 121, 249, 0)); animation: derivar-2 26s ease-in-out infinite alternate; }
.mancha-3 { width: 50rem; height: 50rem; left: 6%; bottom: -18rem; background: radial-gradient(circle closest-side, rgba(34, 211, 238, 1), rgba(34, 211, 238, 0)); animation: derivar-3 24s ease-in-out infinite alternate; }
.mancha-4 { width: 42rem; height: 42rem; right: 10%; bottom: 2rem; background: radial-gradient(circle closest-side, rgba(251, 191, 36, 1), rgba(251, 191, 36, 0)); animation: derivar-4 20s ease-in-out infinite alternate; }
@keyframes derivar-1 { to { transform: translate(9rem, 7rem) scale(1.15); } }
@keyframes derivar-2 { to { transform: translate(-8rem, 9rem) scale(.9); } }
@keyframes derivar-3 { to { transform: translate(7rem, -6rem) scale(1.1); } }
@keyframes derivar-4 { to { transform: translate(-6rem, -8rem) scale(1.2); } }

.wrap { max-width: 860px; margin: 0 auto; width: 100%; padding: 56px 20px 72px; }

a { color: var(--acento); }
a:focus-visible, .servicio:focus-visible {
    outline: 3px solid rgba(79, 70, 229, .45);
    outline-offset: 2px;
}

/* Cristal esmerilado comun a chip, tarjetas y pie. */
header { position: relative; padding: 10px 4px 4px; }
header .sub { margin: 0; color: var(--suave); font-size: 17px; }

/* Firma de la portada: un rosco de letras (A-Z y N) que gira despacio como
 * fondo del card del rosco, asomando por la derecha. La pieza que diferencia
 * la pagina de cualquier plantilla. */
.rueda {
    position: absolute; right: -60px; top: 50%; z-index: 0;
    width: 250px; height: 250px; margin-top: -125px;
    border-radius: 50%;
    pointer-events: none; opacity: .4;
    animation: girar-rueda 100s linear infinite;
}
.rueda::before {
    content: ""; position: absolute; inset: 7%;
    border: 1.5px dashed rgba(45, 212, 191, .28); border-radius: 50%;
}
.rueda .letra {
    position: absolute; left: 50%; top: 50%;
    width: 28px; height: 28px; margin: -14px 0 0 -14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 800; line-height: 1;
    color: rgba(45, 212, 191, .55);
    transform: rotate(calc(var(--i) * 13.3333deg)) translateY(-113px);
}
@keyframes girar-rueda { to { transform: rotate(360deg); } }

/* Pistola automatica de fondo en el card de armas. Misma animacion que en
 * tipos-de-armas (gatillo + balas en bucle), recoloreada para el tema oscuro:
 * arma clara, gatillo indigo y balas violetas. */
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.wpn {
    position: absolute; right: -50px; bottom: -18px; z-index: 0;
    width: 330px; max-width: 72%;
    pointer-events: none; opacity: .25;
    --cycle: 4s;
    --gun: #c9cee7;
    --acc: #8f88f8;
    --acc2: #c084fc;
    --magc: rgba(255, 255, 255, .16);
}
.wpn svg { display: block; width: 100%; height: auto; }
.gun { fill: var(--gun); }
.guard { fill: none; stroke: var(--gun); stroke-width: 4; }
.mag { fill: var(--magc); }
.accent { fill: var(--acc); }
.accent2 { fill: var(--acc2); }
.trg { transform-box: view-box; transform-origin: 126px 78px; stroke: var(--acc); }
.trg path { fill: none; stroke-width: 4; stroke-linecap: round; }
.bullet, .press-ring { transform-box: view-box; }
.bullet { opacity: 0; }
.loaded { animation: none; }   /* cartucho quieto en la recamara */
.press-ring { opacity: 0; transform-origin: 127px 88px; }
.press-ring circle { fill: none; stroke: var(--acc2); stroke-width: 2.5; }
.trg, .bullet, .press-ring {
    animation-duration: var(--cycle);
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}
.bullet, .press-ring { animation-delay: var(--d, 0s); }
.press-ring { animation-timing-function: ease-out; }
.trg { animation-name: trg-auto; }
.bullet { animation-name: fly-pull; }
.wpn--auto .press-ring { animation-name: ring-auto; }

/* Automatica: una pulsacion y sigue disparando sola hasta que se suelta */
@keyframes trg-auto {
    0%   { transform: rotate(0deg);   stroke: var(--acc); }
    12.5% { transform: rotate(32deg);  stroke: var(--acc2); }
    85%  { transform: rotate(32deg);  stroke: var(--acc2); }
    93%  { transform: rotate(0deg);   stroke: var(--acc); }
    100% { transform: rotate(0deg);   stroke: var(--acc); }
}
/* La bala sale desde la recamara, de la misma posicion que el cartucho fijo */
@keyframes fly-pull {
    0%   { transform: translate(0, 0); opacity: 1; }
    8%   { transform: translate(200px, 0); opacity: 1; }
    11%  { transform: translate(200px, 0); opacity: 0; }
    100% { transform: translate(200px, 0); opacity: 0; }
}
/* Onda en el gatillo: se nota el momento exacto de la pulsacion */
@keyframes ring-auto {
    0%   { opacity: 0; transform: scale(.45); }
    12.5% { opacity: 1; transform: scale(1); }
    32%, 100% { opacity: 0; transform: scale(2.1); }
}

header .sub { position: relative; z-index: 1; }

/* Tinte por herramienta: indigo (armas), verde agua (rosco), rosa (chino). */
.servicio { --tinte-a: #6366f1; --tinte-b: #a855f7; }
.servicio-rosco { --tinte-a: #14b8a6; --tinte-b: #06b6d4; }
.servicio-chino { --tinte-a: #f43f5e; --tinte-b: #f97316; }

.servicios { display: grid; gap: 18px; margin-top: 24px; }
.servicio {
    position: relative; overflow: hidden;
    display: flex; flex-direction: column; align-items: flex-start;
    background: var(--vidrio);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--borde);
    border-radius: 20px; padding: 26px; text-decoration: none; color: var(--tinta);
    box-shadow: 0 2px 16px rgba(0, 0, 0, .45);
    transition: transform .2s ease, box-shadow .2s ease;
    animation: entrar .5s ease backwards;
}
/* El contenido queda por encima de la rueda que hace de fondo del rosco. */
.servicio .icono, .servicio h2, .servicio p, .servicio .estado { position: relative; z-index: 1; }
.servicio:nth-child(2) { animation-delay: .08s; }
.servicio:nth-child(3) { animation-delay: .16s; }

/* Borde degradado giratorio, solo al pasar el raton. */
@property --giro {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}
.servicio::before {
    content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px;
    background: conic-gradient(from var(--giro), #6366f1, #e879f9, #22d3ee, #fbbf24, #6366f1);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0; transition: opacity .25s ease;
    animation: girar 4s linear infinite;
    pointer-events: none;
}
@keyframes girar { to { --giro: 360deg; } }
.servicio:hover::before { opacity: 1; }

.servicio:hover {
    transform: translateY(-5px) rotate(-.4deg);
    box-shadow: 0 20px 44px -20px var(--tinte-a);
}
.servicio-rosco:hover { transform: translateY(-5px) rotate(.4deg); }

.servicio .icono {
    display: flex; align-items: center; justify-content: center;
    width: 52px; height: 52px; border-radius: 16px;
    font-size: 26px; line-height: 1;
    background: linear-gradient(135deg, var(--tinte-a), var(--tinte-b));
    box-shadow: 0 10px 22px -10px var(--tinte-a);
    animation: flotar 3.4s ease-in-out infinite;
}
.servicio:nth-child(2) .icono { animation-delay: .6s; }
.servicio:nth-child(3) .icono { animation-delay: 1.2s; }
@keyframes flotar { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

.servicio h2 { margin: 16px 0 8px; font-size: 20px; font-weight: 700; color: var(--tinta); }
.servicio p { margin: 0; font-size: 15px; line-height: 1.65; color: var(--suave); }
.servicio .estado {
    display: inline-flex; align-items: center;
    margin-top: 18px; padding: 10px 20px; border-radius: 999px;
    font-size: 14px; font-weight: 700; color: #fff;
    background: linear-gradient(90deg, var(--tinte-a), var(--tinte-b));
    background-size: 180% 100%;
    box-shadow: 0 8px 18px -8px var(--tinte-a);
    transition: background-position .35s ease, transform .2s ease;
}
.servicio:hover .estado { background-position: 100% 0; transform: translateX(3px); }

/* "Proximamente": muda, sin tinte vivo, que no invita a pulsar. */
.servicio.proximo { border-style: dashed; box-shadow: none; }
.servicio.proximo::before { display: none; }
.servicio.proximo:hover { transform: none; box-shadow: none; }
.servicio.proximo .icono { filter: saturate(.3) opacity(.85); box-shadow: none; }
.servicio.proximo h2 { color: var(--suave); }
.servicio.proximo .estado {
    color: var(--suave); background: var(--vidrio);
    border: 1px solid var(--borde); box-shadow: none; font-weight: 600;
}
.servicio.proximo:hover .estado { background-position: 0 0; transform: none; }

footer.site { margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--borde); color: var(--suave); font-size: 14px; text-align: center; }
footer.site nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; }
footer.site a { text-decoration: none; }
footer.site a:hover { text-decoration: underline; }
footer.site p { margin: 12px 0 0; }

/* Aviso de "no oficial" con las fuentes, justo antes del footer. Mismo
 * bloque que en el resto de paginas: un solo sitio para leerlo. */
.aviso-fuentes { margin-top: 26px; padding: 14px 16px; background: rgba(255,183,3,.07); border: 1px solid rgba(255,183,3,.3); border-radius: 14px; }
.aviso-fuentes p { margin: 0; color: var(--suave); font-size: 13px; line-height: 1.55; }
.aviso-fuentes p + p { margin-top: 8px; }
.aviso-fuentes b { color: #ffb703; }

@keyframes entrar {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

@media (max-width: 720px) {
    .rueda { width: 200px; height: 200px; right: -55px; top: -60px; margin-top: 0; opacity: .25; }
    .rueda .letra { transform: rotate(calc(var(--i) * 13.3333deg)) translateY(-88px); }
    .wpn { width: 250px; right: -40px; bottom: -14px; opacity: .15; }
}

@media (max-width: 560px) {
    .wrap { padding: 36px 18px 56px; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}
