/* Animaciones para las cajas del hero - Versión corregida */
.hero-animation {
    position: absolute;
    top: 40%;
    left: 60%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}
@keyframes rotate-left {
    0% {
        transform: rotate(var(--start-angle, 0deg));
    }
    100% {
        transform: rotate(calc(var(--start-angle, 0deg) - 360deg));
    }
}

.animated-box {
    position: absolute;
    border-radius: 25px;
    opacity: 0.6;
    filter: blur(1px);
    box-shadow: 
        0 0 30px rgba(108, 99, 255, 0.3),
        inset 0 0 20px rgba(255, 255, 255, 0.1);
    transform-origin: center center;
}

/* Todos los recuadros comparten el mismo centro */
.box-1 {
    width: 240;
    height: 240px;
    background: linear-gradient(45deg, #005C7A, #CE2A5B);
    --start-angle: 45deg;
    animation: rotate-left 170s linear infinite;
    z-index: 7; /* El más pequeño está adelante */
}

.box-2 {
    width: 340px;
    height: 340px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    --start-angle: 60deg;
    animation: rotate-left 170s linear infinite;
    z-index: 6;
}

.box-3 {
    width: 460px;
    height: 460px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    --start-angle: 75deg;
    animation: rotate-left 170s linear infinite;
    z-index: 5;
}

.box-4 {
    width: 600px;
    height: 600px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    --start-angle: 90deg;
    animation: rotate-left 170s linear infinite;
    z-index: 4;
}

.box-5 {
    width: 780px;
    height: 780px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    --start-angle: 105deg;
    animation: rotate-left 170s linear infinite;
    z-index: 3;
}

.box-6 {
    width: 980px;
    height: 980px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    --start-angle: 120deg;;
    animation: rotate-left 170s linear infinite;
    z-index: 2;
}

.box-7 {
    width: 1200px;
    height: 1200px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    --start-angle: 135deg;;
    animation: rotate-left 170s linear infinite;
    z-index: 1; /* El más grande está atrás */
}
.box-8 {
    width: 1460px;
    height: 1460px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    --start-angle: 150deg;;
    animation: rotate-left 170s linear infinite;
    z-index: 1; /* El más grande está atrás */
}


/* Efectos 3D para imágenes */
.section-image:hover .image-3d {
    transform: rotateY(10deg) rotateX(5deg);
}

/* Animaciones de entrada para secciones */
section {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Animación para botones */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

/* Animación de carga para imágenes */
.image-3d {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.image-3d.loaded {
    opacity: 1;
    transform: scale(1);
}

/* Animación de partículas */
@keyframes float-particle {
    0% {
        transform: translateY(0px) translateX(0px);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(calc(var(--random-x) * 1px));
        opacity: 0;
    }
}

/* Efecto de respiración para el contenido del hero */
.hero-content {
    animation: breathe 6s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}