:root {
    --logo-scale: 1;
    --logo-width: 140px;
    --logo-height: 70px;
}

@media (max-width: 768px) {
    :root {
        --logo-scale: 0.7;
        --logo-width: 100px;
        --logo-height: 50px;
    }
}

@media (max-width: 480px) {
    :root {
        --logo-scale: 0.55;
        --logo-width: 80px;
        --logo-height: 40px;
    }
}

/* Animated Aperture Dynamics Logo */
.logo-animated {
    display: flex;
    align-items: center;
    gap: calc(1rem * var(--logo-scale));
    text-decoration: none;
}

.logo-graphic {
    position: relative;
    width: var(--logo-width);
    height: var(--logo-height);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

/* Central glowing aperture - invisible at start, blooms when waves converge */
.aperture-center {
    position: absolute;
    width: calc(12px * var(--logo-scale));
    height: calc(12px * var(--logo-scale));
    background: radial-gradient(circle, #ffffff 0%, #3b82f6 30%, #06b6d4 60%, transparent 100%);
    border-radius: 50%;
    box-shadow: 
        0 0 calc(15px * var(--logo-scale)) #3b82f6,
        0 0 calc(30px * var(--logo-scale)) #3b82f6,
        0 0 calc(60px * var(--logo-scale)) #06b6d4;
    animation: apertureBloom 3s ease-out infinite;
    z-index: 10;
}

@keyframes apertureBloom {
    0%, 40% { 
        transform: scale(0);
        opacity: 0;
        box-shadow: none;
        filter: brightness(0.5);
    }
    45% {
        transform: scale(0.3);
        opacity: 0.5;
        box-shadow: 0 0 calc(10px * var(--logo-scale)) #3b82f6;
    }
    50% { 
        transform: scale(1.2);
        opacity: 1;
        box-shadow: 0 0 calc(30px * var(--logo-scale)) #ffffff, 0 0 calc(60px * var(--logo-scale)) #3b82f6, 0 0 calc(90px * var(--logo-scale)) #06b6d4;
        filter: brightness(2);
    }
    60% {
        transform: scale(1);
        opacity: 0.9;
        box-shadow: 0 0 calc(20px * var(--logo-scale)) #3b82f6, 0 0 calc(40px * var(--logo-scale)) #06b6d4;
        filter: brightness(1.5);
    }
    80%, 100% { 
        transform: scale(0);
        opacity: 0;
        box-shadow: none;
    }
}

/* PSF Container - separate from the pulsing center */
.psf-container {
    position: absolute;
    width: calc(60px * var(--logo-scale));
    height: calc(60px * var(--logo-scale));
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9;
    animation: psfSidelobes 3s ease-in-out infinite;
}

/* PSF cross with elegant tapered glow - horizontal and vertical only */
.psf-star {
    position: absolute;
    top: 50%;
    left: 50%;
    width: calc(90px * var(--logo-scale));
    height: calc(90px * var(--logo-scale));
    transform: translate(-50%, -50%);
    animation: psfSidelobes 3s ease-in-out infinite;
}

.psf-star-arm {
    position: absolute;
    top: 50%;
    left: 50%;
    width: calc(90px * var(--logo-scale));
    height: calc(4px * var(--logo-scale));
    transform-origin: center;
    background: linear-gradient(90deg, 
        transparent 0%,
        rgba(59, 130, 246, 0.1) 10%,
        rgba(59, 130, 246, 0.5) 25%,
        rgba(255, 255, 255, 0.95) 50%,
        rgba(59, 130, 246, 0.5) 75%,
        rgba(59, 130, 246, 0.1) 90%,
        transparent 100%
    );
    filter: blur(calc(0.3px * var(--logo-scale)));
}

.psf-star-arm:nth-child(1) { transform: translate(-50%, -50%) rotate(0deg); }
.psf-star-arm:nth-child(2) { transform: translate(-50%, -50%) rotate(90deg); }

@keyframes psfSidelobes {
    0%, 100% {
        opacity: 0.4;
        transform: translate(-50%, -50%) scale(0.6);
    }
    20%, 80% {
        opacity: 0.7;
        transform: translate(-50%, -50%) scale(0.8);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
        filter: brightness(1.3);
    }
}

/* Incoming waves from left and right - arc wavefronts */
.wave-left, .wave-right {
    position: absolute;
    width: calc(30px * var(--logo-scale));
    height: calc(50px * var(--logo-scale));
    top: 50%;
    margin-top: calc(-25px * var(--logo-scale));
    opacity: 0;
    z-index: 5;
}

.wave-left {
    left: 0;
    border-radius: 0 50% 50% 0;
    border: calc(3px * var(--logo-scale)) solid transparent;
    border-right-color: rgba(59, 130, 246, 0.9);
    box-shadow: inset calc(-5px * var(--logo-scale)) 0 calc(10px * var(--logo-scale)) rgba(59, 130, 246, 0.3);
    animation: waveFromLeft 3s ease-out infinite;
}

.wave-right {
    right: 0;
    border-radius: 50% 0 0 50%;
    border: calc(3px * var(--logo-scale)) solid transparent;
    border-left-color: rgba(6, 182, 212, 0.9);
    box-shadow: inset calc(5px * var(--logo-scale)) 0 calc(10px * var(--logo-scale)) rgba(6, 182, 212, 0.3);
    animation: waveFromRight 3s ease-out infinite;
}

/* Wave delay classes */
.wave-delay-1 { animation-delay: 0.6s !important; }
.wave-delay-2 { animation-delay: 1.2s !important; }

/* Inner wave arc for depth */
.wave-left::before, .wave-right::before {
    content: '';
    position: absolute;
    width: calc(20px * var(--logo-scale));
    height: calc(35px * var(--logo-scale));
    top: 50%;
    transform: translateY(-50%);
    border-radius: 0 50% 50% 0;
    border: calc(2px * var(--logo-scale)) solid transparent;
    border-right-color: rgba(59, 130, 246, 0.5);
    opacity: 0.6;
}

.wave-right::before {
    right: 0;
    border-radius: 50% 0 0 50%;
    border-right-color: transparent;
    border-left-color: rgba(6, 182, 212, 0.5);
}

@keyframes waveFromLeft {
    0% {
        transform: translateX(0);
        opacity: 0;
    }
    5% {
        opacity: 1;
    }
    45% {
        transform: translateX(calc(50px * var(--logo-scale)));
        opacity: 1;
    }
    50% {
        transform: translateX(calc(55px * var(--logo-scale)));
        opacity: 0.5;
    }
    55%, 100% {
        transform: translateX(calc(55px * var(--logo-scale)));
        opacity: 0;
    }
}

@keyframes waveFromRight {
    0% {
        transform: translateX(0);
        opacity: 0;
    }
    5% {
        opacity: 1;
    }
    45% {
        transform: translateX(calc(-50px * var(--logo-scale)));
        opacity: 1;
    }
    50% {
        transform: translateX(calc(-55px * var(--logo-scale)));
        opacity: 0.5;
    }
    55%, 100% {
        transform: translateX(calc(-55px * var(--logo-scale)));
        opacity: 0;
    }
}

/* Energy burst when waves converge - more gradual */
.energy-burst {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.6) 0%, rgba(59, 130, 246, 0.3) 40%, transparent 70%);
    animation: burst 3s ease-out infinite;
    opacity: 0;
    z-index: 8;
}

@keyframes burst {
    0%, 42% {
        transform: scale(0);
        opacity: 0;
    }
    45% {
        transform: scale(0.3);
        opacity: 0.3;
    }
    50% {
        transform: scale(0.8);
        opacity: 0.6;
    }
    55% {
        transform: scale(1.2);
        opacity: 0.3;
    }
    60%, 100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Horizontal scan line */
.scan-beam {
    position: absolute;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.6), transparent);
    animation: scanSweep 3s ease-in-out infinite;
    z-index: 9;
}

@keyframes scanSweep {
    0%, 100% { 
        opacity: 0.3;
        transform: scaleX(0.5);
    }
    50% { 
        opacity: 1;
        transform: scaleX(1);
    }
}

/* Text styling */
.logo-text-container {
    display: flex;
    flex-direction: column;
    gap: calc(0.2rem * var(--logo-scale));
}

.logo-text-main {
    font-size: calc(1.6rem * var(--logo-scale));
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    background: linear-gradient(135deg, #ffffff 0%, #94a3b8 50%, #ffffff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 calc(30px * var(--logo-scale)) rgba(59, 130, 246, 0.5);
    animation: textShimmer 3s ease-in-out infinite;
    background-size: 200% 100%;
}

@keyframes textShimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.logo-text-sub {
    font-size: calc(0.65rem * var(--logo-scale));
    font-weight: 500;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: #60a5fa;
    opacity: 0.9;
}

/* Hover effect */
.logo-animated:hover .aperture-center {
    animation-duration: 0.8s;
}

.logo-animated:hover .wave-left,
.logo-animated:hover .wave-right {
    animation-duration: 1.5s;
}
