/* ═══════════════════════════════════════
   home-animations.css
   Drop-in animation layer for ExploitEye
   ═══════════════════════════════════════ */

/* ── Animation Variables ── */
:root {
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
    --a-fast: 0.3s;
    --a-normal: 0.6s;
    --a-slow: 0.9s;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ═══════════════════════════════════════
   FLOATING BACKGROUND SHAPES
   ═══════════════════════════════════════ */

.hero__floating-shapes {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.fl-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(2px);
    will-change: transform;
}

.fl-shape--1 {
    width: 320px;
    height: 320px;
    top: 5%;
    right: 10%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.1), transparent 70%);
    animation: fl1 22s ease-in-out infinite;
}

.fl-shape--2 {
    width: 220px;
    height: 220px;
    bottom: 15%;
    left: 5%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.08), transparent 70%);
    animation: fl2 28s ease-in-out infinite;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
}

.fl-shape--3 {
    width: 180px;
    height: 180px;
    top: 40%;
    left: 40%;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.08), transparent 70%);
    animation: fl3 19s ease-in-out infinite;
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
}

@keyframes fl1 {
    0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
    33% { transform: translate(-40px, 50px) rotate(120deg) scale(1.08); }
    66% { transform: translate(30px, -30px) rotate(240deg) scale(0.94); }
}

@keyframes fl2 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(50px, -40px) rotate(180deg); }
}

@keyframes fl3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-35px, 45px) scale(1.12) rotate(90deg); }
}

/* ═══════════════════════════════════════
   GLOW ORB (behind terminal)
   ═══════════════════════════════════════ */

.hero__glow-orb {
    position: absolute;
    width: 350px;
    height: 350px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.15), transparent 70%);
    filter: blur(50px);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    animation: orbGlow 5s ease-in-out infinite;
    z-index: 0;
}

@keyframes orbGlow {
    0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
}

/* ═══════════════════════════════════════
   TERMINAL ENHANCEMENTS
   ═══════════════════════════════════════ */

/* Typing cursor */
.terminal__cursor {
    display: inline-block;
    width: 8px;
    height: 16px;
    background: #79c0ff;
    margin-left: 4px;
    vertical-align: middle;
    animation: cursorBlink 1s step-end infinite;
}

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

/* Terminal scan line */
.terminal__scanline {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.15), transparent);
    animation: scanMove 4s linear infinite;
    pointer-events: none;
    z-index: 2;
}

@keyframes scanMove {
    0% { top: 0; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

/* ═══════════════════════════════════════
   SCROLL-TRIGGERED ANIMATIONS
   These use data attributes set by JS
   ═══════════════════════════════════════ */

/* Fade up */
[data-animate="fade-up"] {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity var(--a-slow) var(--ease-out-expo),
                transform var(--a-slow) var(--ease-out-expo);
}

[data-animate="fade-up"].is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Fade left */
[data-animate="fade-left"] {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity var(--a-slow) var(--ease-out-expo),
                transform var(--a-slow) var(--ease-out-expo);
}

[data-animate="fade-left"].is-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Fade right */
[data-animate="fade-right"] {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity var(--a-slow) var(--ease-out-expo),
                transform var(--a-slow) var(--ease-out-expo);
}

[data-animate="fade-right"].is-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Scale up */
[data-animate="scale-up"] {
    opacity: 0;
    transform: scale(0.88);
    transition: opacity var(--a-slow) var(--ease-out-expo),
                transform var(--a-slow) var(--ease-out-expo);
}

[data-animate="scale-up"].is-visible {
    opacity: 1;
    transform: scale(1);
}

/* Stagger children */
[data-animate-stagger] > * {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s var(--ease-out-expo),
                transform 0.5s var(--ease-out-expo);
}

[data-animate-stagger].is-visible > * {
    opacity: 1;
    transform: translateY(0);
}

/* ═══════════════════════════════════════
   BUTTON RIPPLE
   ═══════════════════════════════════════ */

.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    transform: scale(0);
    animation: rippleGrow 0.6s ease-out forwards;
    pointer-events: none;
    z-index: 10;
}

@keyframes rippleGrow {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ═══════════════════════════════════════
   3D TILT ACTIVE STATE
   ═══════════════════════════════════════ */

.tilt-3d {
    transition: transform 0.15s ease-out, box-shadow 0.3s ease;
}

.tilt-3d.tilt-reset {
    transition: transform 0.6s var(--ease-out-expo), box-shadow 0.6s ease;
}

/* ═══════════════════════════════════════
   SERVICE CARD HOVER GLOW
   ═══════════════════════════════════════ */

.svc-card {
    position: relative;
}

.svc-card__glow {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 0;
}

.svc-card:hover .svc-card__glow {
    opacity: 1;
}

.svc-card:nth-child(1) .svc-card__glow {
    background: radial-gradient(circle at var(--glow-x, 50%) var(--glow-y, 50%), rgba(37, 99, 235, 0.06), transparent 60%);
}

.svc-card:nth-child(2) .svc-card__glow {
    background: radial-gradient(circle at var(--glow-x, 50%) var(--glow-y, 50%), rgba(6, 182, 212, 0.06), transparent 60%);
}

.svc-card:nth-child(3) .svc-card__glow {
    background: radial-gradient(circle at var(--glow-x, 50%) var(--glow-y, 50%), rgba(139, 92, 246, 0.06), transparent 60%);
}

.svc-card:nth-child(4) .svc-card__glow {
    background: radial-gradient(circle at var(--glow-x, 50%) var(--glow-y, 50%), rgba(245, 158, 11, 0.06), transparent 60%);
}

/* ═══════════════════════════════════════
   WHY PILL HOVER LINE
   ═══════════════════════════════════════ */

.why-pill {
    position: relative;
    overflow: hidden;
}

.why-pill::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--gradient-primary);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.4s var(--ease-out-expo);
    border-radius: 0 2px 2px 0;
}

.why-pill:hover::before {
    transform: scaleY(1);
}

/* ═══════════════════════════════════════
   PORTFOLIO IMAGE OVERLAY
   ═══════════════════════════════════════ */

.pf-card__img-wrap {
    position: relative;
}

.pf-card__img-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(37, 99, 235, 0.12) 100%);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 1;
}

.pf-card:hover .pf-card__img-wrap::after {
    opacity: 1;
}

/* ═══════════════════════════════════════
   CURSOR GLOW TRAIL (Desktop)
   ═══════════════════════════════════════ */

.cursor-glow {
    position: fixed;
    width: 350px;
    height: 350px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.045), transparent 70%);
    pointer-events: none;
    z-index: 0;
    transform: translate(-50%, -50%);
    transition: opacity 0.4s;
    opacity: 0;
    will-change: left, top;
}

body[data-theme="dark"] .cursor-glow {
    background: radial-gradient(circle, rgba(37, 99, 235, 0.07), transparent 70%);
}

/* ═══════════════════════════════════════
   CTA STRIP ANIMATED BG
   ═══════════════════════════════════════ */

.cta-strip__inner {
    background-size: 200% 200%;
    animation: ctaShift 10s ease infinite;
}

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

/* Sparkle dots inside CTA */
.cta-sparkle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    pointer-events: none;
    animation: sparkleFloat 6s ease-in-out infinite;
}

.cta-sparkle:nth-child(1) { top: 15%; left: 10%; animation-delay: 0s; }
.cta-sparkle:nth-child(2) { top: 60%; left: 25%; animation-delay: 1.5s; }
.cta-sparkle:nth-child(3) { top: 30%; right: 20%; animation-delay: 3s; }
.cta-sparkle:nth-child(4) { bottom: 20%; right: 10%; animation-delay: 4.5s; }
.cta-sparkle:nth-child(5) { top: 50%; left: 60%; animation-delay: 2s; }

@keyframes sparkleFloat {
    0%, 100% { opacity: 0; transform: translateY(0) scale(1); }
    25% { opacity: 1; transform: translateY(-15px) scale(1.5); }
    75% { opacity: 0.5; transform: translateY(-30px) scale(0.8); }
}

/* ═══════════════════════════════════════
   WHATSAPP FLOAT ANIMATION
   ═══════════════════════════════════════ */

.whatsapp-float {
    animation: whatsappPulse 3s ease-in-out infinite;
}

@keyframes whatsappPulse {
    0%, 100% { transform: translateY(0) scale(1); box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3); }
    50% { transform: translateY(-6px) scale(1.05); box-shadow: 0 8px 25px rgba(37, 211, 102, 0.5); }
}

.whatsapp-float:hover {
    animation-play-state: paused;
    transform: scale(1.15) !important;
}

/* ═══════════════════════════════════════
   BACK TO TOP ANIMATION
   ═══════════════════════════════════════ */

.back-to-top {
    transition: transform 0.3s var(--ease-out-back), opacity 0.3s, background 0.3s;
}

.back-to-top:hover {
    transform: translateY(-5px) scale(1.1);
}

/* ═══════════════════════════════════════
   FOOTER LINK UNDERLINES
   ═══════════════════════════════════════ */

.footer-links a {
    position: relative;
    display: inline-block;
}

.footer-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: var(--color-primary);
    transition: width 0.4s var(--ease-out-expo);
}

.footer-links a:hover::after {
    width: 100%;
}

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */

@media (max-width: 768px) {
    .fl-shape--1 { width: 180px; height: 180px; }
    .fl-shape--2 { width: 130px; height: 130px; }
    .fl-shape--3 { width: 100px; height: 100px; }
    .hero__glow-orb { width: 220px; height: 220px; }
    .cursor-glow { display: none; }

    /* Disable heavy transforms on touch devices */
    .tilt-3d {
        transform: none !important;
        transition: box-shadow 0.3s ease !important;
    }

    /* Disable why-pill translateX on mobile (causes layout shift) */
    .why-pill:hover {
        transform: none;
    }

    /* Simplify CTA sparkle on mobile */
    .cta-sparkle {
        display: none;
    }
}

@media (max-width: 480px) {
    .fl-shape { opacity: 0.4; }
    .fl-shape--3 { display: none; }
    .hero__glow-orb { width: 140px; height: 140px; filter: blur(40px); }
    .terminal__scanline { display: none; }
}

/* Disable all motion-heavy effects on hover-less (touch) devices */
@media (hover: none) {
    .tilt-3d { transform: none !important; }
    .whatsapp-float { animation: none; }
    .fl-shape { animation-duration: 40s; }
    .hero__glow-orb { animation: none; opacity: 0.5; }
}