/* ============================================
   Prism Flow Animation - Updated for New Design
   ============================================ */
.prism-animation-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* --- 1. Input Light Beam --- */
.light-beam-anim {
    position: absolute;
    /* Hit left edge of triangle */
    top: 60px; 
    left: -80px;
    width: 100px;
    height: 2px;
    background: rgba(255, 255, 255, 0.9);
    transform-origin: right center;
    transform: rotate(0deg) scaleX(0);
    opacity: 0;
    z-index: 1;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
    pointer-events: none;
    border-radius: 1px;
}

/* --- 2. Internal Refraction Beam --- */
.internal-beam-anim {
    position: absolute;
    /* Inside triangle, fan shape */
    top: 50px;
    left: 25px;
    width: 60px;
    height: 25px;
    background: linear-gradient(90deg, rgba(255,255,255,0.7), rgba(255,255,255,0.5));
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.6);
    clip-path: polygon(0 48%, 0 52%, 100% 15%, 100% 85%);
    transform-origin: left center;
    transform: rotate(5deg) scaleX(0);
    opacity: 0;
    z-index: 1;
    pointer-events: none;
}

/* --- 3. Output Spectrum with Prism Colors --- */
.rainbow-spectrum-anim {
    position: absolute;
    top: 65px;
    left: 85px;
    width: 0;
    height: 0;
    z-index: 0;
    pointer-events: none;
    transform: rotate(5deg);
}

.band {
    position: absolute;
    left: 0;
    height: 2.5px;
    width: 0;
    transform-origin: left center;
    opacity: 0;
    clip-path: polygon(0 45%, 100% 0%, 100% 100%, 0 55%);
    will-change: width, opacity;
}

/* Updated with Prism Spectrum Colors */
.band.red    { background: #FF0055; top: -7.5px; box-shadow: 0 0 6px #FF0055; }
.band.orange { background: #FF9900; top: -5px; box-shadow: 0 0 6px #FF9900; }
.band.yellow { background: #FFD600; top: -2.5px; box-shadow: 0 0 6px #FFD600; }
.band.green  { background: #00E073; top: 0px;  box-shadow: 0 0 6px #00E073; }
.band.blue   { background: #00A3FF; top: 2.5px;  box-shadow: 0 0 6px #00A3FF; }
.band.violet { background: #8F00FF; top: 5px;  box-shadow: 0 0 6px #8F00FF; }

/* --- Animation Sequences --- */

/* 1. Beam enters */
.prism-animation-wrapper.animating .light-beam-anim {
    animation: beam-enter 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* 2. Internal refraction */
.prism-animation-wrapper.animating .internal-beam-anim {
    animation: internal-refract 0.3s cubic-bezier(0.22, 1, 0.36, 1) 0.3s forwards;
}

/* 3. Spectrum expands */
.prism-animation-wrapper.animating .band {
    animation: spectrum-expand 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.5s forwards;
}

/* Spectrum stays parallel to remain tightly adjacent */
.prism-animation-wrapper.animating .band { transform: none; }

/* Logo Transparency Transition */
.logo-svg {
    transition: all 0.5s ease;
    filter: drop-shadow(0 0 8px rgba(0, 163, 255, 0.3));
}

.prism-animation-wrapper.animating .logo-svg path {
    stroke: rgba(255, 255, 255, 0.5) !important;
    stroke-opacity: 0.9 !important;
    fill: rgba(255, 255, 255, 0.08);
    transition: all 0.5s ease;
}

.prism-animation-wrapper.animating .logo-svg rect {
    opacity: 0.3 !important;
    transition: all 0.5s ease;
}

/* Keyframes */
@keyframes beam-enter {
    0% {
        transform: rotate(0deg) scaleX(0);
        opacity: 0;
    }
    100% {
        transform: rotate(0deg) scaleX(1);
        opacity: 1;
    }
}

@keyframes internal-refract {
    0% {
        transform: rotate(5deg) scaleX(0);
        opacity: 0;
    }
    100% {
        transform: rotate(5deg) scaleX(1);
        opacity: 0.8;
    }
}

@keyframes spectrum-expand {
    0% {
        width: 0;
        opacity: 0;
    }
    100% {
        width: 120px;
        opacity: 0.9;
    }
}

