/* 
AIFormul8r Website Animations
*/

/* Removed glitch effect for cleaner hero; replaced by gradient title in styles.css */

/* ===== Particle Animation ===== */
.particle-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.particle {
    position: absolute;
    display: block;
    background-color: var(--teal);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    animation: particles 15s linear infinite;
    opacity: 0;
}

@keyframes particles {
    0% {
        opacity: 0;
        transform: translateY(0) rotate(0deg);
    }
    10% {
        opacity: 0.5;
    }
    90% {
        opacity: 0.5;
    }
    100% {
        opacity: 0;
        transform: translateY(-1000px) rotate(720deg);
    }
}

/* ===== Beaker Animation ===== */
.formula-animation {
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.beaker {
    position: relative;
    width: 80px;
    height: 240px;
    background: transparent;
    border: 6px solid #e6e7ea; /* light gray like logo */
    border-radius: 14px 14px 46px 46px; /* straight sides, rounded bottom */
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.6);
}

/* Tube rim (outer lip) */
.beaker::before {
    content: '';
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    width: 112px;
    height: 30px;
    background: #f4f5f7;
    border: 6px solid #e6e7ea;
    border-bottom: none;
    border-radius: 999px 999px 0 0;
}

/* Inner rim highlight */
.beaker::after {
    content: '';
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 92px;
    height: 12px;
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.65) 65%, rgba(255,255,255,0) 70%);
    border-radius: 999px;
    pointer-events: none;
}

.liquid {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 58%;
    background: linear-gradient(180deg, rgba(43,167,160,0.5) 0%, rgba(43,167,160,0.95) 100%);
    border-radius: 0 0 40px 40px;
    animation: liquid 5s ease-in-out infinite;
}

/* Meniscus removed per design */
.liquid::before { content: none !important; display: none !important; }

@keyframes liquid {
    0%, 100% {
        height: 70%;
    }
    50% {
        height: 75%;
    }
}

.bubbles {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70%;
    overflow: hidden;
}

.bubbles span {
    position: absolute;
    bottom: -20px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: bubble 5s linear infinite;
}

.bubbles span:nth-child(1) {
    width: 10px;
    height: 10px;
    left: 20%;
    animation-delay: 0s;
}

.bubbles span:nth-child(2) {
    width: 15px;
    height: 15px;
    left: 40%;
    animation-delay: 1s;
}

.bubbles span:nth-child(3) {
    width: 8px;
    height: 8px;
    left: 60%;
    animation-delay: 2s;
}

.bubbles span:nth-child(4) {
    width: 12px;
    height: 12px;
    left: 80%;
    animation-delay: 3s;
}

.bubbles span:nth-child(5) {
    width: 6px;
    height: 6px;
    left: 30%;
    animation-delay: 4s;
}

@keyframes bubble {
    0% {
        bottom: -20px;
        transform: translateX(0);
    }
    50% {
        transform: translateX(10px);
    }
    100% {
        bottom: 180px;
        transform: translateX(-10px);
        opacity: 0;
    }
}

.formula-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 600;
}

.formula-text span {
    display: inline-block;
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

.formula-text span:nth-child(1) {
    animation-delay: 0.2s;
    color: var(--teal);
}

.formula-text span:nth-child(2) {
    animation-delay: 0.4s;
}

.formula-text span:nth-child(3) {
    animation-delay: 0.6s;
    color: var(--charcoal);
}

.formula-text span:nth-child(4) {
    animation-delay: 0.8s;
}

.formula-text span:nth-child(5) {
    animation-delay: 1s;
    color: var(--teal);
}

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

/* ===== Floating Elements Animation ===== */
.floating {
    animation: floating 3s ease-in-out infinite;
}

@keyframes floating {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-15px);
    }
}

/* ===== Mouse Wheel Animation ===== */
.wheel {
    animation: wheel 1.5s ease-in-out infinite;
}

@keyframes wheel {
    0%, 100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    50% {
        opacity: 0.5;
        transform: translateX(-50%) translateY(8px);
    }
}

.scroll-arrow {
    animation: arrow 1.5s ease-in-out infinite;
}

@keyframes arrow {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

/* ===== Code Typing Animation ===== */
.code-animation {
    display: block;
    white-space: pre-wrap;
    overflow: hidden;
    padding-right: 6px;
    height: 100%;
}

/* blinking caret */
.code-animation::after {
    content: '';
    display: inline-block;
    width: 2px;
    height: 1em;
    background: var(--teal);
    margin-left: 2px;
    animation: blink 0.8s step-end infinite;
    vertical-align: -0.2em;
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

/* Connection lines disabled */
.connection-lines, .connection-lines::before, .connection-lines::after, .connection-line { display: none !important; }

/* ===== Custom Cursor Animation ===== */
/* Custom cursor animations removed */

/* ===== Scroll Reveal Animations ===== */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.active {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-left.active {
    opacity: 1;
    transform: translateX(0);
}

.fade-in-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-right.active {
    opacity: 1;
    transform: translateX(0);
}

.zoom-in {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.zoom-in.active {
    opacity: 1;
    transform: scale(1);
}

/* ===== Icon Animations ===== */
/* AI Icon */
.icon-ai {
    position: relative;
    display: inline-block;
    width: 30px;
    height: 30px;
}

.icon-ai::before,
.icon-ai::after {
    content: '';
    position: absolute;
    background-color: var(--teal);
}

.icon-ai::before {
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    transform: translateX(-50%);
}

.icon-ai::after {
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    transform: translateY(-50%);
}

.icon-ai::before {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Formula Icon */
.icon-formula {
    position: relative;
    display: inline-block;
    width: 30px;
    height: 30px;
}

.icon-formula::before {
    content: 'f(x)';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    font-weight: bold;
    color: var(--teal);
}

/* Time Icon */
.icon-time {
    position: relative;
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 2px solid var(--teal);
    border-radius: 50%;
}

.icon-time::before,
.icon-time::after {
    content: '';
    position: absolute;
    background-color: var(--teal);
}

.icon-time::before {
    top: 50%;
    left: 50%;
    width: 10px;
    height: 2px;
    transform: translate(-50%, -50%) rotate(45deg);
    transform-origin: left center;
    animation: clock-hour 10s linear infinite;
}

.icon-time::after {
    top: 50%;
    left: 50%;
    width: 8px;
    height: 2px;
    transform: translate(-50%, -50%) rotate(90deg);
    transform-origin: left center;
    animation: clock-minute 2s linear infinite;
}

@keyframes clock-hour {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes clock-minute {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Service Icons */
.icon-formulation,
.icon-analysis,
.icon-testing,
.icon-consulting {
    position: relative;
    display: inline-block;
    width: 30px;
    height: 30px;
}

.icon-formulation::before {
    content: '⚗️';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
}

.icon-analysis::before {
    content: '📊';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
}

.icon-testing::before {
    content: '🧪';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
}

.icon-consulting::before {
    content: '💬';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
}

/* Contact Icons */
.icon-email,
.icon-phone,
.icon-location {
    position: relative;
    display: inline-block;
    width: 30px;
    height: 30px;
}

.icon-email::before {
    content: '✉️';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
}

.icon-phone::before {
    content: '📱';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
}

.icon-location::before {
    content: '📍';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
}

/* Social Icons */
.icon-linkedin,
.icon-twitter,
.icon-instagram {
    position: relative;
    display: inline-block;
    width: 20px;
    height: 20px;
}

.icon-linkedin::before {
    content: 'in';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: bold;
    color: var(--white);
}

.icon-twitter::before {
    content: '𝕏';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: bold;
    color: var(--white);
}

.icon-instagram::before {
    content: '📷';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    color: var(--white);
}