/* ============================================
   ITENOMIC DYNAMICS - FUTURISTIC ANIMATIONS
   2050 AI/Neural Network Theme
   ============================================ */

/* ============================================
   GLITCH TEXT EFFECT
   ============================================ */
.glitch-text {
    position: relative;
    display: inline-block;
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
}

.glitch-text::before {
    left: 2px;
    text-shadow: -2px 0 #ea72e3;
    clip-path: inset(0 0 0 0);
    animation: glitch-anim-1 2s infinite linear alternate-reverse;
}

.glitch-text::after {
    left: -2px;
    text-shadow: 2px 0 #8B5CF6;
    clip-path: inset(0 0 0 0);
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
    0% { clip-path: inset(40% 0 61% 0); }
    10% { clip-path: inset(92% 0 1% 0); }
    20% { clip-path: inset(43% 0 1% 0); }
    30% { clip-path: inset(25% 0 58% 0); }
    40% { clip-path: inset(54% 0 7% 0); }
    50% { clip-path: inset(58% 0 43% 0); }
    60% { clip-path: inset(45% 0 47% 0); }
    70% { clip-path: inset(14% 0 62% 0); }
    80% { clip-path: inset(78% 0 2% 0); }
    90% { clip-path: inset(1% 0 72% 0); }
    100% { clip-path: inset(37% 0 53% 0); }
}

@keyframes glitch-anim-2 {
    0% { clip-path: inset(25% 0 58% 0); }
    10% { clip-path: inset(54% 0 7% 0); }
    20% { clip-path: inset(58% 0 43% 0); }
    30% { clip-path: inset(40% 0 61% 0); }
    40% { clip-path: inset(92% 0 1% 0); }
    50% { clip-path: inset(43% 0 1% 0); }
    60% { clip-path: inset(14% 0 62% 0); }
    70% { clip-path: inset(78% 0 2% 0); }
    80% { clip-path: inset(1% 0 72% 0); }
    90% { clip-path: inset(45% 0 47% 0); }
    100% { clip-path: inset(37% 0 53% 0); }
}

/* Gradient text shimmer */
.shimmer-text {
    background: linear-gradient(
        90deg,
        var(--accent-primary) 0%,
        var(--accent-secondary) 25%,
        #fff 50%,
        var(--accent-secondary) 75%,
        var(--accent-primary) 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    to { background-position: 200% center; }
}

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */
[data-animation] {
    opacity: 0;
    will-change: transform, opacity, filter;
}

[data-animation="fade-up"] {
    transform: translateY(80px);
}

[data-animation="fade-down"] {
    transform: translateY(-80px);
}

[data-animation="fade-left"] {
    transform: translateX(-100px);
}

[data-animation="fade-right"] {
    transform: translateX(100px);
}

[data-animation="fade-scale"] {
    transform: scale(0.8);
}

[data-animation="reveal-blur"] {
    filter: blur(20px);
    transform: translateY(40px);
}

[data-animation="rotate-in"] {
    transform: rotate(-10deg) scale(0.9);
}

/* Revealed state */
[data-animation].revealed {
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1) rotate(0);
    filter: blur(0);
    transition:
        opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.8s cubic-bezier(0.16, 1, 0.3, 1),
        filter 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Stagger delays for grids */
[data-delay="100"] { transition-delay: 100ms; }
[data-delay="200"] { transition-delay: 200ms; }
[data-delay="300"] { transition-delay: 300ms; }
[data-delay="400"] { transition-delay: 400ms; }
[data-delay="500"] { transition-delay: 500ms; }
[data-delay="600"] { transition-delay: 600ms; }

/* ============================================
   ENERGY PULSE / RIPPLE EFFECT
   ============================================ */
.energy-pulse {
    position: relative;
    overflow: visible;
}

.energy-pulse::before,
.energy-pulse::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: inherit;
    border: 2px solid transparent;
    opacity: 0;
    pointer-events: none;
}

.energy-pulse:hover::before {
    border-color: var(--accent-primary);
    opacity: 1;
    animation: energy-ripple 1.5s ease-out infinite;
}

.energy-pulse:hover::after {
    border-color: var(--accent-secondary);
    opacity: 1;
    animation: energy-ripple 1.5s ease-out infinite;
    animation-delay: 0.3s;
}

@keyframes energy-ripple {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.08);
        opacity: 0;
    }
}

/* ============================================
   HOLOGRAPHIC EFFECTS
   ============================================ */
.holographic {
    position: relative;
    overflow: hidden;
}

.holographic::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 20%,
        rgba(139, 92, 246, 0.1) 40%,
        rgba(234, 114, 227, 0.2) 50%,
        rgba(139, 92, 246, 0.1) 60%,
        transparent 80%
    );
    transform: rotate(45deg) translateY(-100%);
    transition: transform 0.6s ease;
    pointer-events: none;
}

.holographic:hover::before {
    transform: rotate(45deg) translateY(100%);
}

/* Holographic ring for images */
.holographic-ring {
    transition: all 0.5s ease;
}

.holographic-ring:hover {
    box-shadow:
        0 0 0 3px var(--accent-primary),
        0 0 20px var(--accent-glow),
        0 0 40px rgba(234, 114, 227, 0.4),
        0 0 60px rgba(139, 92, 246, 0.2);
    animation: ring-pulse 2s ease-in-out infinite;
}

@keyframes ring-pulse {
    0%, 100% {
        box-shadow:
            0 0 0 3px var(--accent-primary),
            0 0 20px var(--accent-glow),
            0 0 40px rgba(234, 114, 227, 0.3);
    }
    50% {
        box-shadow:
            0 0 0 5px var(--accent-secondary),
            0 0 30px var(--accent-glow),
            0 0 60px rgba(234, 114, 227, 0.5);
    }
}

/* Scanlines overlay */
.scanlines::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(139, 92, 246, 0.03) 2px,
        rgba(139, 92, 246, 0.03) 4px
    );
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.scanlines:hover::after {
    opacity: 1;
    animation: scanline-move 0.1s linear infinite;
}

@keyframes scanline-move {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

/* ============================================
   CIRCUIT / DATA PATTERN
   ============================================ */
.circuit-pattern {
    position: relative;
    overflow: hidden;
}

.circuit-pattern::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(139, 92, 246, 0.1) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(139, 92, 246, 0.1) 1px, transparent 1px);
    background-size: 25px 25px;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
}

.circuit-pattern:hover::after {
    opacity: 1;
    animation: circuit-glow 2s ease-in-out infinite;
}

@keyframes circuit-glow {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

/* Data flow line */
.data-flow-line {
    position: absolute;
    height: 2px;
    width: 100%;
    top: 50%;
    left: 0;
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
}

.data-flow-line::before {
    content: '';
    position: absolute;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        var(--accent-primary),
        var(--accent-secondary),
        transparent
    );
    animation: data-flow 2s linear infinite;
}

@keyframes data-flow {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(300%); }
}

.circuit-pattern:hover .data-flow-line {
    opacity: 1;
}

/* ============================================
   FLOATING ANIMATIONS
   ============================================ */
.float-slow {
    animation: float-slow 8s ease-in-out infinite;
}

.float-medium {
    animation: float-medium 6s ease-in-out infinite;
}

.float-fast {
    animation: float-fast 4s ease-in-out infinite;
}

@keyframes float-slow {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-15px) rotate(2deg); }
    50% { transform: translateY(-5px) rotate(-1deg); }
    75% { transform: translateY(-20px) rotate(1deg); }
}

@keyframes float-medium {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-25px) rotate(3deg); }
}

@keyframes float-fast {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

/* ============================================
   ICON PULSE
   ============================================ */
.icon-pulse {
    animation: icon-pulse 2s ease-in-out infinite;
}

@keyframes icon-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 var(--accent-glow);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 20px 5px var(--accent-glow);
    }
}

/* ============================================
   COUNTER ANIMATION EFFECTS
   ============================================ */
.counter-glow {
    transition: text-shadow 0.3s ease;
}

.counter-glow.counting {
    text-shadow: 0 0 20px var(--accent-primary);
}

.counter-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--accent-primary);
    border-radius: 50%;
    pointer-events: none;
    animation: particle-burst 0.8s ease-out forwards;
}

@keyframes particle-burst {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(
            calc(cos(var(--angle)) * 50px),
            calc(sin(var(--angle)) * 50px)
        ) scale(0);
        opacity: 0;
    }
}

/* ============================================
   TILT CARD EFFECTS
   ============================================ */
.tilt-card {
    transform-style: preserve-3d;
    transition: transform 0.1s ease;
}

.tilt-glare-wrapper {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: inherit;
    pointer-events: none;
}

.tilt-glare {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    background: radial-gradient(
        circle at 50% 50%,
        rgba(255, 255, 255, 0.2) 0%,
        transparent 60%
    );
}

.tilt-card:hover .tilt-glare {
    opacity: 1;
}

/* ============================================
   CURSOR EFFECTS
   ============================================ */
.cursor-glow {
    position: fixed;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(139, 92, 246, 0.4) 0%,
        rgba(234, 114, 227, 0.2) 40%,
        transparent 70%
    );
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    mix-blend-mode: screen;
    transition: transform 0.1s ease;
}

.cursor-glow.hovering {
    transform: translate(-50%, -50%) scale(1.5);
}

.cursor-trail {
    position: fixed;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.4);
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
}

/* ============================================
   BACKGROUND EFFECTS
   ============================================ */
.animated-gradient-bg {
    position: relative;
}

.animated-gradient-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        45deg,
        rgba(139, 92, 246, 0.05) 0%,
        transparent 25%,
        rgba(234, 114, 227, 0.05) 50%,
        transparent 75%,
        rgba(139, 92, 246, 0.05) 100%
    );
    background-size: 400% 400%;
    animation: gradient-shift 20s ease infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    25% { background-position: 100% 50%; }
    50% { background-position: 100% 100%; }
    75% { background-position: 0% 100%; }
}

/* Noise texture overlay */
.noise-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.03;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ============================================
   NEURAL NETWORK CANVAS
   ============================================ */
.neural-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* ============================================
   PREMIUM 3D HERO ELEMENTS
   ============================================ */

/* Hero Badge */
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 50px;
    font-size: 0.9rem;
    color: var(--accent-primary);
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
}

.badge-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

/* New Hero Title - Clean 3D */
.hero-title-new {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-bottom: 1.5rem;
}

.title-line {
    display: block;
    overflow: hidden;
}

.text-3d {
    display: inline-block;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: -0.02em;
    line-height: 1.1;
    position: relative;
    text-shadow:
        0 1px 0 rgba(255,255,255,0.1),
        0 -1px 0 rgba(0,0,0,0.3),
        0 4px 8px rgba(0,0,0,0.3);
    transition: transform 0.3s ease;
}

.text-3d.highlight {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 4px 8px rgba(139, 92, 246, 0.3));
}

.title-line.small {
    margin-top: 0.5rem;
}

.text-subtle {
    font-size: clamp(1rem, 2vw, 1.3rem);
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Hero Description - Clean */
.hero-description-new {
    font-size: clamp(1rem, 1.5vw, 1.15rem);
    color: var(--text-secondary);
    max-width: 600px;
    line-height: 1.7;
    margin: 0 auto 2rem;
}

/* Hero Stats Bar */
.hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(139, 92, 246, 0.2);
}

.hero-stat {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    text-align: center;
}

.hero-stat .stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
}

.hero-stat .stat-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hero-stat-divider {
    width: 1px;
    height: 40px;
    background: rgba(139, 92, 246, 0.3);
}

/* 3D AI Sphere Element */
.hero-3d-element {
    position: absolute;
    right: 8%;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    pointer-events: none;
}

.ai-sphere {
    width: 280px;
    height: 280px;
    position: relative;
    transform-style: preserve-3d;
    animation: sphere-rotate 20s linear infinite;
}

.sphere-ring {
    position: absolute;
    inset: 0;
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 50%;
}

.sphere-ring.ring-1 {
    transform: rotateX(60deg);
    animation: ring-pulse 3s ease-in-out infinite;
}

.sphere-ring.ring-2 {
    transform: rotateY(60deg);
    animation: ring-pulse 3s ease-in-out infinite;
    animation-delay: -1s;
    border-color: rgba(234, 114, 227, 0.3);
}

.sphere-ring.ring-3 {
    transform: rotateX(60deg) rotateY(60deg);
    animation: ring-pulse 3s ease-in-out infinite;
    animation-delay: -2s;
}

.sphere-core {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 70px;
    height: 70px;
    transform: translate(-50%, -50%);
    background: radial-gradient(
        circle,
        rgba(139, 92, 246, 0.8) 0%,
        rgba(234, 114, 227, 0.4) 50%,
        transparent 70%
    );
    border-radius: 50%;
    filter: blur(10px);
    animation: core-glow 3s ease-in-out infinite;
}

@keyframes sphere-rotate {
    0% { transform: translateY(-50%) rotateY(0deg) rotateX(15deg); }
    100% { transform: translateY(-50%) rotateY(360deg) rotateX(15deg); }
}

@keyframes ring-pulse {
    0%, 100% { opacity: 0.3; transform: rotateX(60deg) scale(1); }
    50% { opacity: 0.8; transform: rotateX(60deg) scale(1.05); }
}

@keyframes core-glow {
    0%, 100% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

/* Text reveal animation */
.title-line .text-3d,
.title-line .text-subtle {
    animation: text-reveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: calc(var(--index, 0) * 0.1s);
}

.title-line:nth-child(1) { --index: 0; }
.title-line:nth-child(2) { --index: 1; }
.title-line:nth-child(3) { --index: 2; }

@keyframes text-reveal {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   ACCESSIBILITY - REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .cursor-glow,
    .cursor-trail {
        display: none !important;
    }

    [data-animation] {
        opacity: 1;
        transform: none;
        filter: none;
    }
}

/* ============================================
   MOBILE OPTIMIZATIONS
   ============================================ */
@media (max-width: 1024px) {
    .hero-3d-element {
        display: none;
    }

    .hero-stats {
        flex-wrap: wrap;
        gap: 1.5rem;
    }

    .hero-stat-divider {
        display: none;
    }
}

@media (max-width: 768px) {
    .cursor-glow,
    .cursor-trail {
        display: none;
    }

    .hero-floating-element,
    .geometric-shape {
        display: none;
    }

    .glitch-text::before,
    .glitch-text::after {
        display: none;
    }

    .hero-stats {
        justify-content: center;
        text-align: center;
    }

    .text-3d {
        font-size: clamp(2rem, 8vw, 3rem);
    }
}

/* ============================================
   SECTION BACKGROUNDS
   ============================================ */
section.about,
section.contact {
    background: var(--bg-secondary);
}

section.hero,
section.services,
section.team {
    background: var(--bg-primary);
}
