/*--------------------------------------------------
 # HERO SECTION
--------------------------------------------------*/

/* Main hero container */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: 0;
    margin-top: 0;
    background: #fff;
}

/* Diagonal gradient background */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #bd28ba 0%, #4527a0 100%);
    clip-path: polygon(0 0, 100% 0, 100% 22%, 0 79%);
    z-index: 0;
}

/* SVG animations container - clips to diagonal shape */
.svg-animations-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    clip-path: polygon(0 0, 100% 0, 100% 22%, 0 85%);
    z-index: 1;
    pointer-events: none;
}

/* SVG base styles - performance optimized */
.svg-item {
    position: absolute;
    transform: scale(1.1) translateZ(0); /* Force GPU acceleration */
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0));
    will-change: transform, opacity, filter;
    contain: paint; /* Limit repaint area to SVG itself */
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); /* Smoother easing */
}

.svg-animation {
    width: 100%;
    height: 100%;
}

/* Animation keyframes for SVG elements */
@keyframes svgGlow {
    0%, 100% {
        opacity: 0.85;
        filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.7)) brightness(1.2);
        transform: scale(0.98);
    }
    50% {
        opacity: 1;
        filter: drop-shadow(0 0 30px rgba(255, 255, 255, 0.9)) brightness(1.5);
        transform: scale(1.02);
    }
}

@keyframes pulseAnimation {
    0%, 100% { transform: scale(0.92); }
    50% { transform: scale(1.08); }
}

@keyframes floatAnimation {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes rotateAnimation {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* SVG positioning and animations */

/* Top row SVGs - ordered from right to left */
.svg-item:nth-child(1) {
    top: 5%; right: 13%;
    width: 100px; height: 100px;
    animation: svgGlow 8s ease-in-out infinite, pulseAnimation 12s ease-in-out infinite;
    animation-delay: 0s, 0.2s;
}

.svg-item:nth-child(2) {
    top: 5%; right: 28%;
    width: 120px; height: 120px;
    animation: svgGlow 10s ease-in-out infinite, pulseAnimation 10s ease-in-out infinite;
    animation-delay: 0.3s, 0.1s;
}

.svg-item:nth-child(3) {
    top: 5%; right: 45%;
    width: 130px; height: 130px;
    animation: svgGlow 9s ease-in-out infinite, pulseAnimation 15s ease-in-out infinite;
    animation-delay: 0.5s, 0.2s;
}

.svg-item:nth-child(4) {
    top: 5%; right: 61%;
    width: 120px; height: 120px;
    animation: svgGlow 12s ease-in-out infinite, pulseAnimation 12s ease-in-out infinite alternate;
    animation-delay: 0.2s, 0.3s;
}

.svg-item:nth-child(5) {
    top: 10%; right: 20%;
    width: 160px; height: 160px;
    animation: svgGlow 10s ease-in-out infinite, pulseAnimation 12s ease-in-out infinite;
    animation-delay: 0.4s, 0s;
}

.svg-item:nth-child(6) {
    top: 3%; right: 74%;
    width: 170px; height: 170px;
    animation: svgGlow 9s ease-in-out infinite, floatAnimation 18s ease-in-out infinite;
    animation-delay: 0.6s, 0.5s;
}

/* Middle/Bottom positioned SVGs */
.svg-item:nth-child(7) {
    top: 4%; right: 88%;
    width: 155px; height: 155px;
    z-index: 5;
    animation: svgGlow 11s ease-in-out infinite, pulseAnimation 15s ease-in-out infinite;
    animation-delay: 0.7s, 0.15s;
}

.svg-item:nth-child(8) {
    bottom: 45%; right: 69%;
    width: 120px; height: 120px;
    z-index: 5;
    animation: svgGlow 11s ease-in-out infinite, floatAnimation 20s ease-in-out infinite;
    animation-delay: 0.8s, 0.25s;
}

.svg-item:nth-child(9) {
    bottom: 15%; right: 25%;
    width: 180px; height: 180px;
    z-index: 5;
    animation: svgGlow 12s ease-in-out infinite, rotateAnimation 55s linear infinite;
    animation-delay: 0.9s, 0.35s;
}

/* Special SVG elements styling */

/* Interactive SVG hover effects */
.svg-item[data-svg="puzzle-modules"]:hover,
.svg-item[data-svg="workflow-pattern"]:hover {
    transform: scale(1.05);
}

/* Specific SVG animations */
.svg-item[data-svg="workflow-pattern"] {
    animation: svgGlow 10s ease-in-out infinite, floatAnimation 45s ease-in-out infinite !important;
    transition: transform 0.8s ease;
    position: absolute;
    bottom: 30%;
    left: 8%;
    width: 160px;
    height: 160px;
    z-index: 5;
    opacity: 0.8;
}

.svg-item[data-svg="puzzle-modules"] {
    animation: svgGlow 9s ease-in-out infinite, pulseAnimation 12s ease-in-out infinite !important;
    transition: transform 0.8s ease;
}

.svg-item[data-svg="security-shield"] {
    position: absolute;
    bottom: 18%;
    left: 20%;
    width: 170px;
    height: 170px;
    z-index: 5;
    animation: svgGlow 10s ease-in-out infinite, floatAnimation 17s ease-in-out infinite;
    animation-delay: 1.3s, 0.55s;
    opacity: 0.8;
}

/* Bottom left SVG positioning class */
.bottom-left-svg {
    position: absolute;
    top: auto;
    right: auto;
}

/* SVG color styles */
.svg-item[data-svg="gears"] .svg-animation {
    color: #a98aff; /* Light purple color */
    filter: drop-shadow(0 0 5px rgba(169, 138, 255, 0.7));
}

/* Background light effects */
.modern-light-effects {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    clip-path: polygon(0 0, 100% 0, 100% 22%, 0 79%);
    background: linear-gradient(to left, #bd28ba 10%, rgba(181, 51, 191, 0.95) 25%, 
                               rgba(153, 63, 196, 0.9) 50%, rgba(122, 72, 199, 0.95) 75%, #404cba 100%);
    z-index: 0;
    pointer-events: none;
}

/* Hero content layout */
.hero-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-direction: row;
    width: 100%;
    height: 100vh;
    position: relative;
    z-index: 2;
}

/* Hero text area */
.hero-text {
    flex: 1;
    color: #ffffff;
    margin-top: 133px;
    margin-left: -68px;
    position: relative;
    z-index: 2;
    max-width: 40%;
}

.hero-text h1 {
    font-size: 2.2rem;
    margin-bottom: 0.2rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    font-weight: 700;
}

.hero-text h2 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    font-weight: 400;
}

.hero-text h2 .highlight {
    color: #ffc107;
    font-weight: 700;
}

/* Call to action buttons */
.cta-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

/* Hero SVG elements */

/* Mobile SVG container */
.hero-image {
    position: relative;
    z-index: 5;
    pointer-events: none;
    overflow: visible;
}

/* SVG overlay systems */
#hero-overlay-container {
    position: relative;
}

.hero-svg-overlay {
    position: absolute;
    right: 23vw;
    top: calc(19vh - 100vh);
    width: 20vw;
    height: 85vh;
    transform: scale(3.2);
    object-fit: contain;
    object-position: center right;
    pointer-events: none;
    overflow: visible;
}

.hero-svg-main {
    position: absolute;
    right: 0;
    top: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center right;
    transform: scale(3.2);
}

.hero-svg-wrapper {
    position: relative;
    width: 100%;
    max-width: 650px;
    margin-left: 30%;
    margin-bottom: 10%;
    height: auto;
    transition: transform 0.5s ease;
}

/* Animated welcome text with handwriting effect */
.welcome-text {
    position: absolute;
    bottom: 50px;
    left: 266px;
    transform: rotate(-8deg);
    z-index: 10;
    width: auto;
    max-width: 350px;
}

.welcome-text .animated-writing {
    font-family: 'Caveat', cursive;
    font-size: 0; /* Hide text before animation */
    font-weight: 600;
    line-height: 1.3;
    position: relative;
}

.welcome-text .text-container { display: block; }
.welcome-text .arrow-container {
    position: relative;
    display: block;
    margin-top: 10px;
}

/* Text line styling */
.welcome-text .line {
    font-size: 1.8rem;
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    width: 0;
    margin-right: 5px;
    color: #4527a0;
}

/* Animation timing for each line */
.welcome-text .line:nth-of-type(1) { animation: typing 1s steps(20) 0.3s forwards; }
.welcome-text .line:nth-of-type(2) { animation: typing 0.7s steps(10) 1.3s forwards; }

/* Special line styles */
.welcome-text .line.signature {
    font-size: 2rem;
    opacity: 0;
    width: auto;
    margin-top: 5px;
    animation: fadeIn 0.8s 2s forwards;
}

.welcome-text .line.arrow {
    opacity: 0;
    width: auto;
    margin-left: 112px;
    text-align: center;
    margin-top: 15px;
    animation: fadeInBounce 0.8s 1.5s forwards;
}

.welcome-text .arrow-img {
    width: 40px;
    height: auto;
}

/* Text animation keyframes */
@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes fadeInBounce {
    0% { opacity: 0; transform: translateY(-10px); }
    50% { opacity: 1; transform: translateY(5px); }
    100% { 
        opacity: 1;
        transform: translateY(0);
        animation: bounce 2s 4.5s infinite;
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Main SVG elements */
.hero-main-svg {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.2));
    animation: floatMainSvg 6s ease-in-out infinite;
    z-index: 5;
}

.hero-svg-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: radial-gradient(circle at center, 
                rgba(189, 40, 186, 0.3) 0%, 
                rgba(69, 39, 160, 0.2) 30%, 
                rgba(0, 0, 0, 0) 70%);
    filter: blur(30px);
    opacity: 0;
    animation: glowPulse 4s ease-in-out infinite;
    z-index: 4;
    pointer-events: none;
}

@keyframes floatMainSvg {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.4; transform: scale(0.95); }
    50% { opacity: 0.7; transform: scale(1.05); }
}

/* Responsive styles */
@media (max-width: 1200px) {
    /* Stack hero content vertically on smaller screens */
    .hero-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .hero-text {
        margin: 100px auto 0;
        max-width: 80%;
    }
    
    /* Adjust diagonal clip path for medium screens */
    .hero::before {
        clip-path: polygon(0 0, 100% 0, 100% 30%, 0 85%);
    }
    
    .hero-image {
        margin-top: 50px;
    }
}

@media (max-width: 768px) {
    /* Further adjust diagonal clip for mobile */
    .hero::before {
        clip-path: polygon(0 0, 100% 0, 100% 40%, 0 85%);
    }
    
    /* Reduce SVG size on mobile */
    .svg-item {
        transform: scale(0.8);
    }
}
