/* ============================================================
   Futuristic Visual Enhancements
   Particle Network · 3D Transitions · Parallax · Glow Effects
============================================================ */

/* ---- Scroll Progress Bar ---- */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0%;
    background: linear-gradient(90deg, #2563eb, #06b6d4, #818cf8);
    z-index: 9999;
    box-shadow: 0 0 10px rgba(37,99,235,0.7), 0 0 25px rgba(6,182,212,0.45);
    transition: width 0.1s linear;
}

/* ---- Mouse Glow Cursor ---- */
.mouse-glow {
    position: fixed;
    width: 380px;
    height: 380px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37,99,235,0.09) 0%, transparent 70%);
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    filter: blur(22px);
    will-change: left, top;
}

/* ============================================================
   HERO SECTION — Particle Canvas
============================================================ */
.hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ---- Animated Perspective Grid ---- */
.hero-grid {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(37,99,235,0.09) 1px, transparent 1px),
        linear-gradient(90deg, rgba(37,99,235,0.09) 1px, transparent 1px);
    background-size: 80px 80px;
    -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 25%, transparent 78%);
    mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 25%, transparent 78%);
    animation: gridDrift 30s linear infinite;
}

@keyframes gridDrift {
    from { background-position: 0 0; }
    to   { background-position: 80px 80px; }
}

/* ---- Glow Orbs ---- */
.hero-orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    filter: blur(55px);
}

.hero-orb-1 {
    width: 700px;
    height: 700px;
    top: -250px;
    right: -200px;
    background: radial-gradient(circle at 35% 35%, rgba(37,99,235,0.38) 0%, rgba(37,99,235,0.08) 45%, transparent 70%);
    animation: orbDrift1 14s ease-in-out infinite;
}

.hero-orb-2 {
    width: 460px;
    height: 460px;
    bottom: -130px;
    left: -80px;
    background: radial-gradient(circle at 65% 65%, rgba(6,182,212,0.3) 0%, rgba(6,182,212,0.06) 50%, transparent 70%);
    animation: orbDrift2 11s ease-in-out infinite;
}

.hero-orb-3 {
    width: 280px;
    height: 280px;
    top: 42%;
    left: 14%;
    background: radial-gradient(circle, rgba(129,140,248,0.22) 0%, transparent 70%);
    filter: blur(38px);
    animation: orbDrift1 18s ease-in-out infinite reverse;
    animation-delay: -6s;
}

@keyframes orbDrift1 {
    0%,100% { transform: translate(0,0) scale(1); }
    33%     { transform: translate(25px,-35px) scale(1.06); }
    66%     { transform: translate(-18px,18px) scale(0.96); }
}

@keyframes orbDrift2 {
    0%,100% { transform: translate(0,0) scale(1); }
    50%     { transform: translate(-25px,-22px) scale(1.08); }
}

/* ---- Floating 3D Geometric Shapes ---- */
.hero-shape {
    position: absolute;
    pointer-events: none;
    z-index: 1;
    will-change: transform;
    transition: transform 0.6s cubic-bezier(0.25,0.46,0.45,0.94);
}

.hero-shape-1 {
    top: 10%;
    right: 6%;
    width: 170px;
    height: 170px;
    opacity: 0.42;
    animation: floatA 14s ease-in-out infinite;
}

.hero-shape-2 {
    bottom: 16%;
    right: 10%;
    width: 100px;
    height: 100px;
    opacity: 0.35;
    animation: floatB 10s ease-in-out infinite;
    animation-delay: -5s;
}

.hero-shape-3 {
    top: 52%;
    left: 3%;
    width: 80px;
    height: 80px;
    opacity: 0.28;
    animation: floatA 20s ease-in-out infinite reverse;
    animation-delay: -8s;
}

.hero-shape-4 {
    top: 24%;
    left: 7%;
    width: 55px;
    height: 55px;
    opacity: 0.22;
    animation: floatB 9s ease-in-out infinite;
    animation-delay: -3s;
}

@keyframes floatA {
    0%   { transform: translateY(0)     rotate(0deg); }
    25%  { transform: translateY(-28px) rotate(8deg); }
    50%  { transform: translateY(-12px) rotate(0deg); }
    75%  { transform: translateY(-38px) rotate(-6deg); }
    100% { transform: translateY(0)     rotate(0deg); }
}

@keyframes floatB {
    0%   { transform: translateY(0)     rotate(0deg)   scale(1); }
    50%  { transform: translateY(-22px) rotate(180deg) scale(1.06); }
    100% { transform: translateY(0)     rotate(360deg) scale(1); }
}

/* ---- Data Nodes ---- */
.data-node {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(37,99,235,0.45);
    pointer-events: none;
    z-index: 1;
    animation: nodeFloat 7s ease-in-out infinite;
}

.data-node::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #60a5fa;
    box-shadow: 0 0 14px rgba(37,99,235,0.9), 0 0 35px rgba(37,99,235,0.4);
}

@keyframes nodeFloat {
    0%,100% { transform: translate(0,0); }
    25%     { transform: translate(14px,-20px); }
    50%     { transform: translate(-8px,-32px); }
    75%     { transform: translate(-16px,-12px); }
}

/* ---- Shimmer Lines ---- */
.hero-shimmer {
    position: absolute;
    width: 100%;
    height: 1px;
    left: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.hero-shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -30%;
    width: 30%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(6,182,212,0.6), transparent);
    animation: shimmerSlide 7s ease-in-out infinite;
}

@keyframes shimmerSlide {
    0%   { left: -30%; opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { left: 100%; opacity: 0; }
}

/* ---- Hero Name Shimmer ---- */
.hero-name {
    color: #fff;
    background: linear-gradient(100deg, #ffffff 20%, #93c5fd 48%, #e0f2fe 56%, #ffffff 80%);
    background-size: 220% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: textShine 5s linear infinite;
}

@keyframes textShine {
    to { background-position: 220% center; }
}

.hero-title {
    text-shadow: 0 0 30px rgba(6,182,212,0.35);
}

/* ============================================================
   3D SCROLL REVEALS
============================================================ */
.reveal-3d {
    opacity: 0;
    transform: perspective(1200px) rotateX(18deg) translateY(55px);
    transition:
        opacity  0.9s cubic-bezier(0.16,1,0.3,1),
        transform 0.9s cubic-bezier(0.16,1,0.3,1);
}

.reveal-3d.revealed {
    opacity: 1;
    transform: perspective(1200px) rotateX(0deg) translateY(0px);
}

.reveal-3d.delay-1 { transition-delay: 0.1s; }
.reveal-3d.delay-2 { transition-delay: 0.2s; }
.reveal-3d.delay-3 { transition-delay: 0.32s; }
.reveal-3d.delay-4 { transition-delay: 0.44s; }

/* ============================================================
   3D CARD TILT + SHINE
============================================================ */
.service-card,
.stat-item {
    will-change: transform;
    transform-style: preserve-3d;
}

.card-shine {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(
        circle at var(--shine-x, 50%) var(--shine-y, 50%),
        rgba(255,255,255,0.18) 0%,
        transparent 65%
    );
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: 10;
}

.service-card:hover .card-shine,
.stat-item:hover .card-shine {
    opacity: 1;
}

/* ============================================================
   SECTION DECORATIVE ELEMENTS
============================================================ */

/* --- About --- */
.about-section { overflow: hidden; }

.about-deco {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.about-deco-1 {
    width: 650px;
    height: 650px;
    top: -180px;
    right: -220px;
    background: radial-gradient(circle, rgba(37,99,235,0.055) 0%, transparent 70%);
    filter: blur(65px);
}

.about-deco-2 {
    width: 350px;
    height: 350px;
    bottom: -100px;
    left: -80px;
    background: radial-gradient(circle, rgba(6,182,212,0.065) 0%, transparent 70%);
    filter: blur(48px);
}

/* --- Services --- */
.services-section { overflow: hidden; }

.services-deco {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.services-deco-1 {
    width: 520px;
    height: 520px;
    top: -130px;
    left: -130px;
    background: radial-gradient(circle, rgba(37,99,235,0.05) 0%, transparent 70%);
    filter: blur(58px);
}

.services-deco-2 {
    width: 420px;
    height: 420px;
    bottom: -100px;
    right: -110px;
    background: radial-gradient(circle, rgba(6,182,212,0.05) 0%, transparent 70%);
    filter: blur(52px);
}

/* --- Testimonials --- */
.testimonials-section { overflow: hidden; }

.testimonials-deco {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.testimonials-deco-1 {
    width: 450px;
    height: 450px;
    top: -80px;
    left: -120px;
    background: radial-gradient(circle, rgba(6,182,212,0.13) 0%, transparent 70%);
    filter: blur(56px);
    animation: orbDrift2 12s ease-in-out infinite;
}

.testimonials-deco-2 {
    width: 380px;
    height: 380px;
    bottom: -60px;
    right: -100px;
    background: radial-gradient(circle, rgba(37,99,235,0.13) 0%, transparent 70%);
    filter: blur(52px);
    animation: orbDrift1 10s ease-in-out infinite reverse;
}

/* Rotating ring decoration */
.deco-ring-svg {
    position: absolute;
    pointer-events: none;
    z-index: 0;
    opacity: 0.07;
    animation: ringSpin 45s linear infinite;
}

@keyframes ringSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* --- Contact --- */
.contact-section { overflow: hidden; }

.contact-deco {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.contact-deco-1 {
    width: 600px;
    height: 600px;
    top: -150px;
    right: -200px;
    background: radial-gradient(circle, rgba(37,99,235,0.065) 0%, transparent 70%);
    filter: blur(68px);
}

/* --- Events --- */
.events-section { overflow: hidden; }

.events-deco {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.events-deco-1 {
    width: 580px;
    height: 580px;
    top: -140px;
    right: -160px;
    background: radial-gradient(circle, rgba(129,140,248,0.07) 0%, transparent 70%);
    filter: blur(60px);
    animation: orbDrift1 15s ease-in-out infinite;
}

/* ============================================================
   MISC GLOW ENHANCEMENTS
============================================================ */
.skill-progress {
    box-shadow: 0 0 10px rgba(37,99,235,0.45);
}

.section-tag {
    text-shadow: 0 0 20px rgba(37,99,235,0.38);
}

.portfolio-item { will-change: transform; }

.btn-primary {
    box-shadow: 0 4px 15px -3px rgba(37,99,235,0.4), 0 0 30px rgba(37,99,235,0.1);
}

.btn-primary:hover {
    box-shadow: 0 10px 30px -5px rgba(37,99,235,0.5), 0 0 50px rgba(37,99,235,0.18);
}

/* ============================================================
   REDUCED MOTION
============================================================ */
@media (prefers-reduced-motion: reduce) {
    .hero-orb, .hero-shape, .data-node,
    .hero-shimmer::after, .hero-grid,
    .deco-ring-svg, .testimonials-deco-1,
    .testimonials-deco-2 { animation: none; }

    .hero-name {
        -webkit-text-fill-color: #fff;
        background: none;
        animation: none;
    }

    .reveal-3d { opacity: 1; transform: none; transition: none; }
}

/* ============================================================
   MOBILE OPTIMISATIONS
============================================================ */
@media (max-width: 768px) {
    .hero-shape  { display: none; }
    .data-node   { display: none; }
    .hero-shimmer{ display: none; }
    .mouse-glow  { display: none; }
    .hero-orb-1  { width: 360px; height: 360px; }
    .hero-orb-2  { width: 260px; height: 260px; }
    .hero-orb-3  { display: none; }
}
