/* ============================================
   NEVILLE SION DIGITAL SECURITIES
   Advanced Blockchain Hexagon Network
   Interactive NS Formation
   ============================================ */

:root {
    --deep-magenta: #8B008B;
    --magenta: #9932CC;
    --purple: #9370DB;
    --cyan: #00CED1;
    --light-blue: #87CEEB;
}

/* Background subtle gradient */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 25% 35%, rgba(139, 0, 139, 0.04) 0%, transparent 60%),
        radial-gradient(circle at 75% 65%, rgba(135, 206, 235, 0.04) 0%, transparent 60%);
    animation: bgPulse 12s ease-in-out infinite;
    z-index: 0;
}

@keyframes bgPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.7; }
}

/* Blockchain hexagon network container */
#hexagon-network {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* SVG canvas for hexagons and lines */
#hexagon-svg {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

/* Hexagon styling */
.hexagon {
    fill: none;
    stroke: url(#hexagon-gradient);
    stroke-width: 1;
    opacity: 0.6;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.hexagon:hover {
    opacity: 1;
    stroke-width: 3;
}

/* Connection lines between hexagons */
.connection-line {
    stroke: url(#line-gradient);
    stroke-width: 0.9;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.connection-line.active {
    opacity: 0.5;
    stroke-width: 1;
}

/* Scanning line - bidirectional */
.scan-line-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

.scan-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(139, 0, 139, 0.3) 20%,
        rgba(135, 206, 235, 0.8) 50%,
        rgba(139, 0, 139, 0.3) 80%,
        transparent 100%
    );
    box-shadow: 0 0 15px rgba(135, 206, 235, 0.6);
    animation: scanBidirectional 30s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes scanBidirectional {
    0% {
        top: 0;
        opacity: 0;
    }
    5% {
        opacity: 1;
    }
    45% {
        top: 100%;
        opacity: 1;
    }
    65% {
        top: 100%;
        opacity: 0;
    }
    65% {
        top: 100%;
        opacity: 1;
    }
    95% {
        top: 0;
        opacity: 1;
    }
    100% {
        top: 0;
        opacity: 0;
    }
}

/* Tech grid background */
.tech-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(139, 0, 139, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(135, 206, 235, 0.015) 1px, transparent 1px);
    background-size: 80px 80px;
    opacity: 0.4;
    animation: gridDrift 30s linear infinite;
    z-index: 0;
}

@keyframes gridDrift {
    0% { transform: translate(0, 0); }
    100% { transform: translate(80px, 80px); }
}

/* Ambient glows */
.ambient-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.08;
    animation: glowPulse 12s ease-in-out infinite;
    pointer-events: none;
}

@keyframes glowPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.08;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.15;
    }
}

.ambient-glow.g1 {
    top: 10%;
    left: 15%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--deep-magenta), transparent);
    animation-delay: 0s;
}

.ambient-glow.g2 {
    top: 50%;
    right: 10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--cyan), transparent);
    animation-delay: 4s;
}

.ambient-glow.g3 {
    bottom: 15%;
    left: 30%;
    width: 550px;
    height: 550px;
    background: radial-gradient(circle, var(--purple), transparent);
    animation-delay: 2s;
}

/* Mobile optimizations */
@media (max-width: 968px) {
    .hexagon {
        stroke-width: 0.5 !important;
    }
    
    .connection-line {
        stroke-width: 0.3;
    }
    
    .tech-grid {
        opacity: 0.2;
        animation: none;
    }
    
    .ambient-glow {
        filter: blur(70px);
        opacity: 0.06;
    }
}


@media (max-width: 640px) {
    .hexagon {
        stroke-width: 1;
    }
    
    .connection-line {
        stroke-width: 0.2;
    }
    
    .ambient-glow.g3 {
        display: none;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .hexagon,
    .connection-line,
    .scan-line,
    .tech-grid,
    .ambient-glow,
    .hero::before {
        animation: none !important;
        transition: none !important;
    }
}
