/**
 * styles-premium.css — Mejoras estéticas de alto nivel
 * Añade efectos de brillo, cuadrículas de fondo y animaciones sutiles.
 */

:root {
    --brand-glow: rgba(139, 92, 246, 0.5);
    --grid-color: rgba(255, 255, 255, 0.03);
}

/* Global mobile overflow safeguard */
/* NOTE: 'clip' is used instead of 'hidden' — 'hidden' creates a scroll container
   which breaks position:sticky on children (like the sidebar). 'clip' only clips
   visually without affecting scroll behavior. */
html, body {
    overflow-x: clip;
    max-width: 100%;
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* Fondo de cuadrícula global (estilo Dashboard) */
.bg-grid {
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* Efecto de flotación suave */
@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-15px);
    }

    100% {
        transform: translateY(0px);
    }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

/* Tarjeta estilo Bento con borde luminoso al hover */
.bento-card {
    position: relative;
    background: rgba(9, 9, 11, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.bento-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}

.bento-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(800px circle at var(--mouse-x) var(--mouse-y), rgba(255, 255, 255, 0.06), transparent 40%);
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
}

.bento-card:hover::before {
    opacity: 1;
}

/* Brillo perimetral para elementos destacados */
.glow-border {
    position: relative;
}

.glow-border::after {
    content: '';
    position: absolute;
    inset: -1px;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    border-radius: inherit;
    z-index: -1;
    pointer-events: none;
}

/* Texto gradiente dinámico */
.text-gradient {
    background: linear-gradient(to right, #fff, #a1a1aa, #fff);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 8s linear infinite;
}

/* Carrusel infinito (Marquee) */
@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.marquee-container {
    display: flex;
    overflow: hidden;
    user-select: none;
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.marquee-content {
    display: flex;
    gap: 40px;
    animation: marquee 30s linear infinite;
    width: max-content;
}

.marquee-content:hover {
    animation-play-state: paused;
}

/* Animaciones de Texto Premium */
@keyframes text-reveal {
    0% {
        transform: translateY(100%);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.text-reveal {
    display: inline-block;
    overflow: hidden;
    vertical-align: bottom;
}

.text-reveal>span {
    display: inline-block;
    animation: text-reveal 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* Brillo en texto */
.text-shine {
    background: linear-gradient(to right,
            #444 0%,
            #fff 10%,
            #444 20%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: text-shine 3s linear infinite;
}

@keyframes text-shine {
    to {
        background-position: 200% center;
    }
}

/* Ciclo de palabras — texto animado en el hero */
.hero-cycle-word {
    display: inline-block;
    background: linear-gradient(to right, #d4d4d8, #ffffff, #71717a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: wordFadeIn 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes wordFadeIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes wordFadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-16px);
    }
}

.hero-cycle-word.leaving {
    animation: wordFadeOut 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* Premium Speed Widget Styles */
.speed-widget {
    filter: drop-shadow(0 4px 20px rgba(239, 68, 68, 0.15));
    transition: transform 0.3s ease;
}

.speed-widget:hover {
    transform: scale(1.05);
}

@keyframes blink {
    0%, 90%, 100% {
        transform: scaleY(1);
    }
    93%, 97% {
        transform: scaleY(0.1);
    }
}

.animate-blink {
    animation: blink 4s linear infinite;
    transform-origin: center;
}

@keyframes dash {
    to {
        stroke-dashoffset: -72;
    }
}

.animate-dash {
    animation: dash 1s linear infinite;
}

/* Make the dash move faster on parent bento hover */
.bento-card:hover .animate-dash {
    animation-duration: 0.4s;
}

/* Vercel-style Graphic Animations */

/* Flow Line Animation (Moving dashes along paths) */
@keyframes flowLine {
    to {
        stroke-dashoffset: -30;
    }
}
.animate-flow-line {
    stroke-dasharray: 6 9;
    animation: flowLine 2s linear infinite;
}

/* Faster flow for DOM interaction */
@keyframes flowLineFast {
    to {
        stroke-dashoffset: -30;
    }
}
.animate-flow-line-fast {
    stroke-dasharray: 4 6;
    animation: flowLineFast 1s linear infinite;
}

/* Pulsing slow for nodes */
@keyframes pulseSlow {
    0%, 100% {
        opacity: 0.4;
        transform: scale(0.96);
    }
    50% {
        opacity: 0.95;
        transform: scale(1.04);
    }
}
.animate-pulse-slow {
    animation: pulseSlow 3s ease-in-out infinite;
}

/* Wave Path Dot Movement */
@keyframes waveMove {
    0% {
        motion-offset: 0%;
        offset-distance: 0%;
    }
    100% {
        motion-offset: 100%;
        offset-distance: 100%;
    }
}
.animate-wave-move {
    /* offset-path is set inline inside the SVG */
    animation: waveMove 4s linear infinite;
}

/* Shield rotation */
@keyframes shieldRotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}
.animate-shield-rotate {
    animation: shieldRotate 12s linear infinite;
    transform-origin: center;
}

/* Float slower */
@keyframes floatSlower {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-8px);
    }
}
.animate-float-slower {
    animation: floatSlower 5s ease-in-out infinite;
}

/* Secure Widget Scanner Animation */
@keyframes scanner {
    0%, 100% {
        transform: translateY(-20px);
        opacity: 0.2;
    }
    50% {
        transform: translateY(20px);
        opacity: 0.9;
        filter: drop-shadow(0 0 4px #10b981);
    }
}

.animate-scanner {
    animation: scanner 3s ease-in-out infinite;
    transform-origin: center;
}

/* Make scanner sweep faster on hover */
.bento-card:hover .animate-scanner {
    animation-duration: 1.5s;
}