/* ============================================
   STYLE MARKING — Animations & Effects
   ============================================ */

/* ---------- Scroll Animations ---------- */
[data-animate] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

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

[data-animate="fade-left"] {
    opacity: 0;
    transform: translateX(50px);
}

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

[data-animate="fade-right"] {
    opacity: 0;
    transform: translateX(-50px);
}

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

/* ---------- Particle Canvas ---------- */
#particleCanvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* ---------- Typing Effect ---------- */
.typing-cursor {
    display: inline-block;
    width: 3px;
    height: 1em;
    background: var(--accent);
    margin-left: 4px;
    animation: blink 1s step-end infinite;
    vertical-align: text-bottom;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* ---------- Glow Borders ---------- */
.glow-border {
    position: relative;
}

.glow-border::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: var(--gradient-primary);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s;
}

.glow-border:hover::after {
    opacity: 0.3;
}

/* ---------- Staggered Entrance ---------- */
.stagger-in > * {
    opacity: 0;
    transform: translateY(20px);
}

.stagger-in.visible > *:nth-child(1) { animation: staggerItem 0.5s 0.0s forwards; }
.stagger-in.visible > *:nth-child(2) { animation: staggerItem 0.5s 0.1s forwards; }
.stagger-in.visible > *:nth-child(3) { animation: staggerItem 0.5s 0.2s forwards; }
.stagger-in.visible > *:nth-child(4) { animation: staggerItem 0.5s 0.3s forwards; }
.stagger-in.visible > *:nth-child(5) { animation: staggerItem 0.5s 0.4s forwards; }
.stagger-in.visible > *:nth-child(6) { animation: staggerItem 0.5s 0.5s forwards; }

@keyframes staggerItem {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- Gradient Border Animation ---------- */
@keyframes gradientBorder {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ---------- Counter Animation ---------- */
.count-up {
    font-variant-numeric: tabular-nums;
}

/* ---------- Smooth Section Transitions ---------- */
.section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-subtle), transparent);
}

/* ---------- Hover lift effect ---------- */
.hover-lift {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* ---------- Text Reveal ---------- */
@keyframes textReveal {
    from {
        clip-path: inset(0 100% 0 0);
    }
    to {
        clip-path: inset(0 0 0 0);
    }
}

.text-reveal {
    animation: textReveal 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ---------- Noise Texture Overlay ---------- */
body::after {
    content: '';
    position: fixed;
    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");
    pointer-events: none;
    z-index: 9999;
    opacity: 0.4;
}

/* ---------- Page Transitions ---------- */
.page-enter {
    animation: pageEnter 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes pageEnter {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
