/*
 * CSS chuyển động: aurora, particle, hover và hỗ trợ reduced motion.
 */
.button {
    display: inline-block;
    border: 2px solid transparent;
    border-radius: 4px;
    padding: 0.85rem 1.35rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: none;
}

.button--primary {
    color: var(--color-navy);
    background: var(--cloud-green);
}

.button--primary:hover {
    color: var(--color-navy);
    background: var(--color-green-hover);
}

.button--secondary,
.button--outline {
    color: var(--cloud-orange-soft);
    border-color: var(--cloud-orange);
    background: transparent;
}

.button--secondary:hover,
.button--outline:hover {
    color: var(--color-surface);
    background: transparent;
}

.particles-wrapper {
    position: absolute;
    z-index: 1;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    top: var(--y);
    left: var(--x);
    display: block;
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    opacity: 0.5;
    background: var(--color-surface);
}

.particle:nth-child(3n + 2) {
    background: var(--color-orange-particle);
}

.particle:nth-child(3n) {
    background: var(--color-teal-particle);
}

.particle:nth-child(4n) {
    border-radius: 0;
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.feature-item,
.pricing-card {
    transition: none;
}

@media (prefers-reduced-motion: no-preference) {
    .hero-section.landing-hero::before {
        animation: aurora-drift 18s ease-in-out infinite alternate;
    }

    .hero-section.landing-hero::after {
        animation: aurora-orbit 20s ease-in-out infinite alternate;
    }

    .particle {
        animation: float var(--duration) ease-in-out var(--delay) infinite alternate;
        will-change: transform, opacity;
    }

    .button,
    .feature-item,
    .pricing-card {
        transition: transform 250ms ease, opacity 250ms ease, box-shadow 250ms ease, border-color 250ms ease, background-color 250ms ease;
    }

    .button--primary:hover {
        transform: scale(1.05);
        box-shadow: 0 0 20px var(--color-green-glow);
    }

    .button--secondary:hover,
    .button--outline:hover {
        transform: translateY(-2px);
        border-color: var(--cloud-orange);
        background: var(--color-orange-hover);
    }

    .feature-item:hover,
    .pricing-card:hover {
        transform: translateY(-6px);
        border-color: var(--color-orange-border);
        box-shadow: 0 16px 38px var(--color-shadow-hover);
    }
}

@keyframes aurora-drift {
    0% {
        transform: translate3d(-2%, -1%, 0) scale(1);
    }

    100% {
        transform: translate3d(3%, 2%, 0) scale(1.08);
    }
}

@keyframes aurora-orbit {
    0% {
        transform: translate3d(2%, 1%, 0) rotate(0deg) scale(1);
    }

    100% {
        transform: translate3d(-3%, -2%, 0) rotate(8deg) scale(1.06);
    }
}

@keyframes float {
    0% {
        opacity: 0.2;
        transform: translate3d(0, 0, 0);
    }

    50% {
        opacity: 0.8;
    }

    100% {
        opacity: 0.2;
        transform: translate3d(var(--drift-x), var(--drift-y), 0);
    }
}

@media (max-width: 768px) {
    .feature-grid,
    .pricing-grid {
        grid-template-columns: 1fr;
        grid-template-rows: none;
    }

    .feature-item,
    .feature-item--primary,
    .feature-item--bandwidth,
    .feature-item--security,
    .feature-item--support {
        grid-column: auto;
        grid-row: auto;
        min-height: 180px;
    }

    .particle:nth-child(n + 16) {
        display: none;
    }
}

@media (max-width: 640px) {
    .pricing-card--featured {
        order: -1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .button,
    .feature-item,
    .pricing-card {
        transition: none;
    }
}
