/* Animations for Scroll Reveal */

/* Base State for Animated Elements */
.reveal-text,
.reveal-card,
.reveal-image {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
    will-change: opacity, transform;
}

/* Visible State */
.reveal-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger Delays */
.delay-100 {
    transition-delay: 0.1s;
}

.delay-200 {
    transition-delay: 0.2s;
}

.delay-300 {
    transition-delay: 0.3s;
}

.delay-400 {
    transition-delay: 0.4s;
}

.delay-500 {
    transition-delay: 0.5s;
}

/* 3D Float Animation for Hero Assets */
@keyframes float-3d {
    0% {
        transform: translateY(0px) rotateX(0deg);
    }

    50% {
        transform: translateY(-15px) rotateX(2deg);
    }

    100% {
        transform: translateY(0px) rotateX(0deg);
    }
}

.float-anim {
    animation: float-3d 6s ease-in-out infinite;
}

/* Glow Pulse */
@keyframes glow-pulse {
    0% {
        box-shadow: 0 0 5px var(--accent-blue, #4080ff);
    }

    50% {
        box-shadow: 0 0 20px var(--accent-blue, #4080ff), 0 0 10px var(--accent-cyan, #00c8ff);
    }

    100% {
        box-shadow: 0 0 5px var(--accent-blue, #4080ff);
    }
}

.glow-effect {
    animation: glow-pulse 3s infinite;
}

/* Cyber Glitch Effect (Simple CSS only version) */
@keyframes glitch-skew {
    0% {
        transform: skew(0deg);
    }

    20% {
        transform: skew(-2deg);
    }

    40% {
        transform: skew(2deg);
    }

    60% {
        transform: skew(-1deg);
    }

    80% {
        transform: skew(1deg);
    }

    100% {
        transform: skew(0deg);
    }
}

.glitch-hover:hover {
    animation: glitch-skew 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
    color: var(--accent-cyan, #4080ff);
}

/* Blink Animation for Terminal Cursor/Text */
@keyframes blink-anim {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.blink-text {
    animation: blink-anim 1s step-end infinite;
}

/* CRT Scanline Effect */
.scanline-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(to bottom,
            rgba(255, 255, 255, 0),
            rgba(255, 255, 255, 0) 50%,
            rgba(0, 0, 0, 0.2) 50%,
            rgba(0, 0, 0, 0.2));
    background-size: 100% 4px;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.05;
    /* Much more subtle */
    mix-blend-mode: overlay;
    animation: scanline-move 10s linear infinite;
}

@keyframes scanline-move {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 0 100%;
    }
}

/* Advanced Glitch Text - Simplified to prevent clipping/collapse issues */
.hero-glitch {
    position: relative;
    color: white;
    font-size: 4rem;
    font-weight: bold;
    text-transform: uppercase;
    text-shadow: 2px 2px var(--accent-magenta), -2px -2px var(--accent-cyan);
    /* Removed aggressive clip-path animation that might hide text */
    animation: glitch-color 2s infinite;
}

@keyframes glitch-color {
    0% {
        text-shadow: 2px 2px var(--accent-magenta), -2px -2px var(--accent-cyan);
    }

    50% {
        text-shadow: -2px -2px var(--accent-magenta), 2px 2px var(--accent-cyan);
    }

    100% {
        text-shadow: 2px 2px var(--accent-magenta), -2px -2px var(--accent-cyan);
    }
}

/* 3D Tilt Card Effect Class */
.tilt-card {
    transition: transform 0.1s;
    transform-style: preserve-3d;
}

.tilt-card:hover {
    transform: perspective(1000px) rotateX(var(--rotateX)) rotateY(var(--rotateY)) scale(1.05);
}

/* Timeline Animations & Structure - Precision Layout */
.solution-timeline {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 0;
}

/* Center Vertical Line */
.solution-timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    background: var(--accent-cyan);
    box-shadow: 0 0 15px var(--accent-cyan);
    z-index: 0;
}

.timeline-step {
    position: relative;
    margin-bottom: 80px;
    width: 50%;
    display: block;
    clear: both;
    box-sizing: border-box;
}

/* Clear any rogue pseudo-elements from previous styles */
.timeline-step::before {
    content: none;
}

/* Odd Steps: Left Side */
.timeline-step:nth-child(odd) {
    float: left;
    padding-right: 120px;
    /* Increased gap for connector */
    text-align: right;
    left: 0;
}

/* Even Steps: Right Side */
.timeline-step:nth-child(even) {
    float: right;
    padding-left: 120px;
    /* Increased gap */
    text-align: left;
    left: 0;
    margin-top: 80px;
}

/* Clear fix */
.solution-timeline::after {
    content: "";
    display: table;
    clear: both;
}

/* This class applies the starting state for animation IF JS is running and adds it */
.timeline-step.anim-hidden {
    opacity: 0;
    transform: translateY(30px);
}

.timeline-step.visible {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Marker - Removed as requested to leave clean lines */
.step-marker {
    display: none;
}

/* Inner Dot */
.step-marker::after {
    display: none;
}

/* Outer Ring (Pulse) */
.step-marker::before {
    display: none;
}

/* Marker Positioning */
.timeline-step:nth-child(odd) .step-marker {
    right: -12px;
    /* Center on line */
    left: auto;
}

.timeline-step:nth-child(even) .step-marker {
    left: -12px;
    /* Center on line */
    right: auto;
}

/* Connector Line - Horizontal Beam using Step Pseudo-element */
.timeline-step::after {
    content: '';
    position: absolute;
    top: 36px;
    height: 2px;
    background: var(--accent-cyan);
    /* box-shadow removed to prevent double-line illusion */
    z-index: 1;
    width: 120px;
}

/* Ensure no ghost elements from content box */
.step-content::before,
.step-content::after {
    content: none;
    display: none;
}

/* Connector Positioning */
.timeline-step:nth-child(odd)::after {
    right: 0;
    /* Start from center line */
    left: auto;
}

.timeline-step:nth-child(even)::after {
    left: 0;
    /* Start from center line */
    right: auto;
}

@keyframes marker-pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

.step-content {
    background: rgba(10, 10, 15, 0.95);
    border: 1px solid rgba(64, 128, 255, 0.2);
    padding: 30px;
    border-radius: 12px;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    display: block;
    width: 100%;
    box-sizing: border-box;
    z-index: 5;
    /* Above connector line */
}

.step-content:hover {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 30px rgba(64, 128, 255, 0.15);
}

/* Hover Transforms */
.timeline-step:nth-child(odd) .step-content:hover {
    transform: translateX(-5px);
}

.timeline-step:nth-child(even) .step-content:hover {
    transform: translateX(5px);
}

/* Responsive Fixes */
@media screen and (max-width: 768px) {
    .solution-timeline::before {
        left: 30px;
    }

    .timeline-step {
        width: 100%;
        padding-left: 80px;
        padding-right: 0;
        float: none;
        text-align: left;
        margin-bottom: 40px;
    }

    .timeline-step:nth-child(odd),
    .timeline-step:nth-child(even) {
        float: none;
        padding-left: 80px;
        padding-right: 0;
        text-align: left;
        left: 0;
        margin-top: 0;
    }

    .timeline-step:nth-child(odd) .step-marker,
    .timeline-step:nth-child(even) .step-marker {
        left: 18px;
        right: auto;
    }

    /* Disable beam on mobile or adjust */
    .timeline-step::after {
        width: 50px;
        left: 30px !important;
        right: auto !important;
    }
}

/* --- LOGO MARQUEE ANIMATION --- */
.logo-marquee {
    overflow: hidden;
    position: relative;
    width: 100%;
    padding: 60px 0;
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.marquee-track {
    display: flex;
    gap: 80px;
    /* Space between logos */
    align-items: center;
    width: max-content;
    animation: scroll-left 40s linear infinite;
    padding-left: 80px;
}

.tech-logo-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 100px;
    transition: all 0.3s ease;
    filter: grayscale(0%);
    /* Force color */
    position: relative;
}

.tech-logo-item:hover {
    transform: scale(1.2) translateY(-10px);
    z-index: 10;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.4));
}

.tech-logo-item img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.tech-logo-item span {
    margin-top: 15px;
    font-size: 0.85rem;
    color: #fff;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s;
    text-shadow: 0 0 5px black;
    font-weight: 600;
    position: absolute;
    bottom: -30px;
    width: 200px;
    text-align: center;
}

.tech-logo-item:hover span {
    opacity: 1;
    transform: translateY(0);
}

@keyframes scroll-left {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

.marquee-track:hover {
    animation-play-state: paused;
}

/* Vertical Scan Animation */
@keyframes scanVertical {
    0% {
        top: 0%;
        opacity: 0;
    }

    5% {
        opacity: 1;
    }

    50% {
        top: 95%;
        opacity: 1;
    }

    55% {
        opacity: 0;
    }

    100% {
        top: 0%;
        opacity: 0;
    }
}