/* ═══════════════════════════════════════════════════════════════════
   NashByte Solution — Scroll Animations & Visual Enhancements
   File: css/animations.css
   ═══════════════════════════════════════════════════════════════════ */

/* ── 1A. Scroll-triggered entrance animations ──────────────────────── */
.nash-fade-up {
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.nash-fade-left {
    opacity: 0;
    transform: translateX(-60px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.nash-fade-right {
    opacity: 0;
    transform: translateX(60px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.nash-scale-in {
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.nash-visible {
    opacity: 1 !important;
    transform: none !important;
}

/* Stagger delays */
.nash-stagger-1 { transition-delay: 0.1s; }
.nash-stagger-2 { transition-delay: 0.2s; }
.nash-stagger-3 { transition-delay: 0.3s; }
.nash-stagger-4 { transition-delay: 0.4s; }
.nash-stagger-5 { transition-delay: 0.5s; }
.nash-stagger-6 { transition-delay: 0.6s; }

/* ── 1B. 3D card hover effects ──────────────────────────────────────── */
.nash-3d-card {
    transform-style: preserve-3d;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: default;
    will-change: transform;
}
.nash-3d-card:hover {
    box-shadow: 0 25px 60px rgba(0, 229, 255, 0.15), 0 0 0 1px rgba(0, 229, 255, 0.1);
}
.nash-3d-inner {
    transform-style: preserve-3d;
    transition: transform 0.1s ease;
}

/* ── 1C. Float animations ───────────────────────────────────────────── */
@keyframes nash-float {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-12px); }
}
@keyframes nash-float-subtle {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-6px); }
}
.nash-float       { animation: nash-float 4s ease-in-out infinite; }
.nash-float-slow  { animation: nash-float 6s ease-in-out infinite; }
.nash-float-delay { animation: nash-float 4s ease-in-out 1s infinite; }

/* ── 1D. Glow pulse on cyan elements ───────────────────────────────── */
@keyframes nash-glow-pulse {
    0%, 100% { box-shadow: 0 0 10px rgba(0, 229, 255, 0.3); }
    50%       { box-shadow: 0 0 30px rgba(0, 229, 255, 0.7), 0 0 60px rgba(0, 229, 255, 0.3); }
}
.nash-glow { animation: nash-glow-pulse 2.5s ease-in-out infinite; }

/* ── 1E. Scroll indicator bounce ───────────────────────────────────── */
@keyframes nash-bounce {
    0%, 100% { transform: translateY(0); opacity: 1; }
    50%       { transform: translateY(8px); opacity: 0.5; }
}
.nash-scroll-indicator {
    animation: nash-bounce 1.5s ease-in-out infinite;
    display: inline-block;
}

/* ── 1F. Section heading underline draw ────────────────────────────── */
.nash-heading-line { position: relative; }
.nash-heading-line::after {
    content: '';
    display: block;
    height: 3px;
    background: linear-gradient(90deg, #00e5ff, rgba(0, 229, 255, 0.2));
    border-radius: 2px;
    width: 0;
    margin-top: 8px;
    transition: width 0.8s ease 0.3s;
}
.nash-heading-line.nash-visible::after {
    width: 60px;
}

/* ── 1G. Stat box hover ─────────────────────────────────────────────── */
.nash-stat-box {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.nash-stat-box:hover {
    transform: translateY(-6px) scale(1.03);
    box-shadow: 0 10px 40px rgba(0, 229, 255, 0.2);
}

/* ── 1H. Client logo hover ──────────────────────────────────────────── */
.nash-client-logo {
    transition: transform 0.3s ease, filter 0.3s ease;
    filter: grayscale(30%);
}
.nash-client-logo:hover {
    transform: scale(1.05);
    filter: grayscale(0%) drop-shadow(0 0 8px rgba(0, 229, 255, 0.4));
}

/* ── 1I. Testimonial card lift ──────────────────────────────────────── */
.nash-testimonial {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.nash-testimonial:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(0, 229, 255, 0.12);
}

/* ── 1J. Parallax hero grid overlay ────────────────────────────────── */
.nash-grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 229, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 229, 255, 0.04) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 1;
}

/* ── 1K. Plasma canvas ──────────────────────────────────────────────── */
#nash-plasma-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -1;
    opacity: 0.55;
    pointer-events: none;
}

/* ── 1L. Cursor glow ────────────────────────────────────────────────── */
#nash-cursor-glow {
    position: fixed;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 229, 255, 0.07) 0%, transparent 70%);
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease, opacity 0.3s ease;
    will-change: transform;
}
#nash-cursor-glow.nash-cursor-hover {
    width: 160px;
    height: 160px;
}

/* ── 1M. Navbar scroll enhancement ─────────────────────────────────── */
.nash-scrolled {
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    background: rgba(13, 17, 23, 0.92) !important;
    box-shadow: 0 1px 0 rgba(0, 229, 255, 0.12), 0 4px 20px rgba(0, 0, 0, 0.3) !important;
    transition: background 0.3s ease, box-shadow 0.3s ease !important;
}

/* Navbar link hover underline from left */
.nash-nav-link-wrap {
    position: relative;
    display: inline-block;
}
.nash-nav-link-wrap::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 0;
    width: 0; height: 2px;
    background: #00e5ff;
    border-radius: 1px;
    transition: width 0.3s ease;
}
.nash-nav-link-wrap:hover::after,
.nash-nav-link-wrap.active::after {
    width: 100%;
}

/* ── 1N. Page transition overlay ───────────────────────────────────── */
#nash-page-overlay {
    position: fixed;
    inset: 0;
    background: #0d1117;
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
#nash-page-overlay.nash-overlay-in {
    opacity: 1;
    pointer-events: all;
}

/* Body fade-in on load */
body.nash-page-enter {
    opacity: 0;
}
body {
    transition: opacity 0.4s ease;
}

/* ── 1O. Number counter ─────────────────────────────────────────────── */
.nash-counter { font-variant-numeric: tabular-nums; }

/* ── 1P. Service card shimmer border on hover ───────────────────────── */
.nb-service-card {
    position: relative;
    overflow: hidden;
}
.nb-service-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.0) 0%, rgba(0, 229, 255, 0.08) 50%, rgba(0, 229, 255, 0.0) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 0;
}
.nb-service-card:hover::before {
    opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════════
   PHASE 2 — Enhanced Effects
   ═══════════════════════════════════════════════════════════════════ */

/* ── E1. Tech Bubble float animation ───────────────────────────────── */
@keyframes nash-bubble-float {
    0%   { transform: translate(0, 0) rotate(-1deg); opacity: 0.18; }
    50%  { opacity: 0.32; }
    100% { transform: translate(var(--dx, 40px), var(--dy, 30px)) rotate(1deg); opacity: 0.18; }
}
.nash-tech-bubble {
    transition: color 0.3s ease, border-color 0.3s ease, opacity 0.3s ease;
}

/* ── E2. Click Ripple ───────────────────────────────────────────────── */
.nash-ripple {
    position: fixed;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid rgba(0, 229, 255, 0.8);
    transform: translate(-50%, -50%) scale(1);
    pointer-events: none;
    z-index: 99997;
    animation: nash-ripple-expand 0.65s ease-out forwards;
}
@keyframes nash-ripple-expand {
    0%   { transform: translate(-50%, -50%) scale(1);   opacity: 0.9; }
    100% { transform: translate(-50%, -50%) scale(30);  opacity: 0; }
}

/* ── E3. Mouse Trail Sparks ─────────────────────────────────────────── */
.nash-spark {
    position: fixed;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(0, 229, 255, 0.85);
    pointer-events: none;
    z-index: 99996;
    transform: translate(-50%, -50%);
    animation: nash-spark-fade 0.6s ease-out forwards;
}
@keyframes nash-spark-fade {
    0%   { transform: translate(-50%, -50%) scale(1);   opacity: 0.9; }
    40%  { transform: translate(-50%, -60%) scale(1.5); opacity: 0.6; }
    100% { transform: translate(-50%, -80%) scale(0);   opacity: 0; }
}

/* ── E4. Hero Glitch Effect ─────────────────────────────────────────── */
.nash-glitch-target {
    position: relative;
}
.nash-glitching {
    animation: nash-glitch 0.32s steps(2) forwards;
}
@keyframes nash-glitch {
    0%  {
        clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
        transform: translate(-3px, 0);
        color: #ff00aa;
    }
    20% {
        clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
        transform: translate(3px, 0);
        color: #00e5ff;
    }
    40% {
        clip-path: polygon(0 20%, 100% 20%, 100% 60%, 0 60%);
        transform: translate(-2px, 1px);
        filter: hue-rotate(90deg);
    }
    60% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
        transform: translate(1px, -1px);
        filter: none;
    }
    80% {
        transform: translate(-1px, 0);
        filter: brightness(1.4);
    }
    100% {
        transform: none;
        filter: none;
        color: inherit;
    }
}

/* ── E5. Typewriter cursor blink ────────────────────────────────────── */
@keyframes nash-tw-blink {
    0%, 100% { border-color: #00e5ff; }
    50%       { border-color: transparent; }
}

/* ── E6. Scan line overlay on hero ─────────────────────────────────── */
@keyframes nash-scanline {
    0%   { transform: translateY(-100%); }
    100% { transform: translateY(100vh); }
}
.nash-scanline {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, rgba(0,229,255,0.12) 50%, transparent 100%);
    pointer-events: none;
    z-index: 1;
    animation: nash-scanline 8s linear infinite;
}

/* ── E7. Section highlight border draw ─────────────────────────────── */
@keyframes nash-border-draw {
    0%   { clip-path: inset(0 100% 0 0); }
    100% { clip-path: inset(0 0% 0 0); }
}
.nash-border-draw {
    position: relative;
}
.nash-border-draw::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, #00e5ff, rgba(0,229,255,0.2));
    clip-path: inset(0 100% 0 0);
    transition: clip-path 1s ease 0.5s;
}
.nash-border-draw.nash-visible::after {
    clip-path: inset(0 0% 0 0);
}

/* ── Mobile: disable heavy transforms ──────────────────────────────── */
@media (max-width: 768px) {
    .nash-3d-card:hover { transform: none !important; }
    .nash-float, .nash-float-slow, .nash-float-delay { animation: none; }
    #nash-cursor-glow { display: none !important; }
    .nash-grid-overlay { opacity: 0.5; }
    #nash-plasma-canvas { opacity: 0.2; }
}

/* ── Accessibility: reduced motion ──────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .nash-fade-up,
    .nash-fade-left,
    .nash-fade-right,
    .nash-scale-in {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    .nash-float,
    .nash-float-slow,
    .nash-float-delay,
    .nash-glow,
    .nash-scroll-indicator {
        animation: none !important;
    }
    .nash-heading-line::after {
        width: 60px !important;
        transition: none !important;
    }
}
