/* ProjectAI - Custom Styles */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* ── Gradient text utility ── */
.gradient-text {
    background: linear-gradient(135deg, #1e59f1 0%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Hero background ── */
.gradient-bg {
    background: linear-gradient(135deg, #0a0f1a 0%, #111827 40%, #0d1424 100%);
    position: relative;
    overflow: hidden;
}

/* Noise texture overlay */
.gradient-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    background-repeat: repeat;
    pointer-events: none;
    z-index: 1;
}

/* ── Card hover ── */
.service-card {
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
}
.service-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, transparent 0%, transparent 40%, rgba(30, 89, 241, 0) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    transition: background 0.4s ease;
    pointer-events: none;
}
.service-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 24px 48px rgba(30, 89, 241, 0.08), 0 0 0 1px rgba(30, 89, 241, 0.06);
}
.service-card:hover::before {
    background: linear-gradient(135deg, rgba(30, 89, 241, 0.3) 0%, rgba(16, 185, 129, 0.2) 100%);
}

/* ── Entrance animations ── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in-up {
    animation: fadeInUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Staggered children */
.stagger-children > *:nth-child(1) { animation-delay: 0s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.3s; }

/* Start invisible for observe-fade elements */
.observe-fade {
    opacity: 0;
    transform: translateY(30px);
}

/* ── Pulse glow for CTA ── */
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(30, 89, 241, 0.5); }
    50% { box-shadow: 0 0 24px 6px rgba(30, 89, 241, 0.15); }
}
.pulse-glow {
    animation: pulse-glow 3s ease-in-out infinite;
}

/* ── Circuit line animation ── */
@keyframes circuit-flow {
    0% { stroke-dashoffset: 1000; }
    100% { stroke-dashoffset: 0; }
}
.circuit-line {
    stroke-dasharray: 8 12;
    stroke-dashoffset: 1000;
    animation: circuit-flow 30s linear infinite;
}

/* ── Floating orb ── */
@keyframes float-orb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -20px) scale(1.05); }
    66% { transform: translate(-20px, 15px) scale(0.95); }
}
.float-orb {
    animation: float-orb 8s ease-in-out infinite;
}
.float-orb-delayed {
    animation: float-orb 10s ease-in-out infinite;
    animation-delay: -3s;
}

/* ── Diagonal section divider ── */
.diagonal-top {
    clip-path: polygon(0 8%, 100% 0, 100% 100%, 0 100%);
    margin-top: -4%;
}

/* ── Nav transparency → solid on scroll ── */
.nav-transparent {
    background: transparent;
    transition: background 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
}
.nav-solid {
    background: rgba(10, 15, 26, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ── Icon container glow ── */
.icon-glow {
    position: relative;
}
.icon-glow::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(30, 89, 241, 0.15), rgba(16, 185, 129, 0.1));
    filter: blur(8px);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
}
.service-card:hover .icon-glow::after {
    opacity: 1;
}

/* ── Stats counter ── */
@keyframes count-in {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}
.stat-number {
    animation: count-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
