/* ═══════════════════════════════════════════════════════════════════
   PORTFOLIO — ANIMATION.CSS  (REFACTORED)
   Salahedin Said
   ═══════════════════════════════════════════════════════════════════ */


/* Preloader animations */
#preloader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #0A0A14;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.2rem;
}

#preloader.hide {
    pointer-events: none;
}

.loader-svg-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
}

.preloader-name {
    display: flex;
    gap: 0.04em;
    font-family: 'Poppins', sans-serif;
    font-size: 3.8rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #6C63FF 0%, #FF6584 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.preloader-char {
    display: inline-block;
    opacity: 0;
    transform: translateY(30px);
    will-change: opacity, transform;
}

.preloader-tagline {
    font-family: 'Poppins', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.45em;
    text-transform: uppercase;
    color: rgba(139, 146, 164, 0.55);
    opacity: 0;
}

.preloader-logo {
    font-family: 'Poppins', sans-serif;
    font-size: 2.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #6C63FF 0%, #FF6584 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.preloader-bar-track {
    width: 200px;
    height: 2px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    overflow: hidden;
}

.preloader-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #6C63FF, #FF6584);
    border-radius: 999px;
    will-change: width;
}

.preloader-label {
    font-family: 'Poppins', sans-serif;
    font-size: 0.62rem;
    letter-spacing: 0.5em;
    text-transform: uppercase;
    color: rgba(139, 146, 164, 0.4);
}


/* Transition curtain animations */
#screen-transition {
    position: fixed;
    inset: 0;
    z-index: 99990;
    pointer-events: none;
    visibility: hidden;
    opacity: 1;
}

.transition-curtain {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #0d1020 0%, #0A0A14 100%);
    will-change: transform;
}

.transition-curtain::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg,
        transparent,
        #6C63FF 30%,
        #FF6584 70%,
        transparent
    );
    opacity: 0.8;
}


/* Custom cursor animations */
.cursor {
    width: 36px;
    height: 36px;
    border: 1.5px solid rgba(108, 99, 255, 0.75);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 99998;
    top: 0;
    left: 0;
    transition:
        width 0.22s ease,
        height 0.22s ease,
        border-color 0.22s ease,
        background 0.22s ease,
        box-shadow 0.25s ease;
}

.cursor.is-hovering {
    width: 60px;
    height: 60px;
    background: rgba(108, 99, 255, 0.06);
    border-color: #FF6584;
}

.cursor.is-clicking {
    width: 28px;
    height: 28px;
    background: rgba(255, 101, 132, 0.18);
    border-color: #FF6584;
}

.cursor.cursor-glow {
    box-shadow: 0 0 14px 3px rgba(108, 99, 255, 0.4);
}

.cursor-follower {
    width: 6px;
    height: 6px;
    background: #FF6584;
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 99999;
    top: 0;
    left: 0;
    will-change: transform;
    transition: background 0.3s ease;
}

.cursor-follower.cursor-glow {
    box-shadow: 0 0 8px 2px rgba(255, 101, 132, 0.6);
}

.cursor-trail {
    position: fixed;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 99985;
    will-change: transform, opacity;
}


/* Navbar animations */
.navbar {
    opacity: 0;
}


/* Hero section animations */
.hero-text .greeting,
.hero-text .name,
.hero-text .title,
.hero-text .subtitle,
.hero-text .cta-buttons,
.hero-img-box {
    opacity: 0;
}

.hero-terminal {
    opacity: 0;
}

.hero-text .name .char {
    display: inline-block;
    background: linear-gradient(135deg, #6C63FF 0%, #FF6584 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 1 !important;
    transform: none !important;
}

.char {
    display: inline-block;
    opacity: 0;
}

.hero::after {
    content: '';
    position: absolute;
    top: -30%;
    right: -20%;
    width: 700px;
    height: 700px;
    background: radial-gradient(
        circle,
        rgba(108, 99, 255, 0.06) 0%,
        transparent 65%
    );
    border-radius: 50%;
    pointer-events: none;
    animation: auroraMove 14s ease-in-out infinite alternate;
    z-index: 0;
}

@keyframes auroraMove {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(-70px, 55px) scale(1.12); }
}

.scroll-indicator {
    opacity: 0;
}


/* Skills section animations */
.skill-card {
    opacity: 0;
    transform: translateY(32px);
}

@keyframes floatIdle {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-7px); }
}

.skill-card.floating {
    animation: floatIdle 7s ease-in-out infinite;
}

.contact-card.floating {
    animation: floatIdle 8s ease-in-out infinite;
}


/* Project level system */
.project-row {
    opacity: 0;
    transform: translateY(50px);
}


/* Contact cards — start hidden */
.contact-card {
    opacity: 0;
    transform: translateY(32px) scale(0.97);
}


/* Noise grain overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 9998;
    pointer-events: none;
    opacity: 0.022;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 140px;
}


/* Fade-up utility (IntersectionObserver fallback) */
.fade-up {
    opacity: 0;
    transform: translateY(32px);
    transition:
        opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

.fade-up.active {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 { transition-delay: 0.18s; }
.delay-2 { transition-delay: 0.36s; }


/* Terminal reveal lines — start hidden, GSAP animates in */
.t-reveal-line {
    opacity: 0;
    will-change: opacity;
}


/* Scan line effect — premium CRT feel on hero */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 3px,
        rgba(0, 0, 0, 0.015) 3px,
        rgba(0, 0, 0, 0.015) 4px
    );
}


/* Mobile adjustments */
@media (max-width: 768px) {
    .cursor,
    .cursor-follower,
    .cursor-trail {
        display: none !important;
    }

    .skill-card,
    .project-image-wrapper {
        transform-style: flat !important;
    }

    .skill-card.floating,
    .contact-card.floating {
        animation: none;
    }

    /* #progress-text and xp-toast removed */
}
/* ─────────────────────────────────────────────────────────────────
   SCROLL PROGRESS GAME BAR & XP TOAST
   ───────────────────────────────────────────────────────────────── */
#progress-container {
    position: fixed; top: 0; left: 0; width: 100%; height: 3px;
    background: rgba(255, 255, 255, 0.04); z-index: 10001; pointer-events: none;
}

#progress-bar {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, #6C63FF 0%, #9f7aea 40%, #FF6584 80%, rgba(255, 101, 132, 0.25) 100%);
    box-shadow: 2px 0 12px 2px rgba(255, 101, 132, 0.5);
    transition: width 0.1s ease-out;
}

#progress-text {
    position: fixed; top: 10px; right: 1.5%;
    font-family: 'Poppins', sans-serif; font-size: 0.68rem; font-weight: 700;
    letter-spacing: 0.12em; text-transform: uppercase; color: #FF6584;
    opacity: 0; pointer-events: none; z-index: 10001;
    text-shadow: 0 0 10px rgba(255, 101, 132, 0.45);
    transition: opacity 0.5s ease;
}

.xp-toast {
    position: fixed; bottom: 40px; right: 40px; z-index: 9990;
    background: rgba(10, 10, 20, 0.92); border: 1px solid rgba(108, 99, 255, 0.5);
    border-radius: 12px; padding: 14px 22px; display: flex; align-items: center; gap: 12px;
    backdrop-filter: blur(12px); pointer-events: none;
    box-shadow: 0 0 25px rgba(108, 99, 255, 0.2);
    transform: translateX(150%); /* Start buiten beeld */
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.xp-toast.show {
    transform: translateX(0); /* Schuif in beeld */
}

.xp-toast-icon { font-size: 1.4rem; }
.xp-toast-text { font-family: 'Poppins', sans-serif; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #fff; }
.xp-toast-points { font-family: 'Poppins', sans-serif; font-size: 0.68rem; font-weight: 600; color: #a78bfa; letter-spacing: 0.08em; }

/* Mobiele fix voor de bar & toast */
@media (max-width: 768px) {
    #progress-text { font-size: 0.58rem; right: 3%; top: 15px; }
    .xp-toast { bottom: 20px; right: 15px; left: 15px; justify-content: center; }
}
/* ─────────────────────────────────────────────────────────────────
   SCROLL PROGRESS GAME BAR & XP TOAST (GSAP GEOPTIMALISEERD)
   ───────────────────────────────────────────────────────────────── */
#progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.04);
    z-index: 10001;
    pointer-events: none;
}

#progress-bar {
    height: 100%;
    width: 0%; /* GSAP neemt dit over */
    background: linear-gradient(90deg, #6C63FF 0%, #9f7aea 40%, #FF6584 80%, rgba(255, 101, 132, 0.25) 100%);
    box-shadow: 2px 0 12px 2px rgba(255, 101, 132, 0.5);
    /* Let op: Geen CSS transition op width meer! GSAP (scrub) doet het werk */
}

#progress-text {
    position: fixed;
    top: 10px;
    right: 1.5%;
    font-family: 'Poppins', sans-serif;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #FF6584;
    opacity: 0; /* GSAP fade dit in */
    pointer-events: none;
    z-index: 10001;
    text-shadow: 0 0 10px rgba(255, 101, 132, 0.45);
}

.xp-toast {
    position: fixed;
    bottom: 40px;
    right: 40px;
    z-index: 9990;
    background: rgba(10, 10, 20, 0.92);
    border: 1px solid rgba(108, 99, 255, 0.5);
    border-radius: 12px;
    padding: 14px 22px;
    display: flex;
    align-items: center;
    gap: 12px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    pointer-events: none;
    box-shadow: 0 0 25px rgba(108, 99, 255, 0.2);
    transform: translateX(150%); /* Start buiten beeld, wachtend op GSAP */
    will-change: transform;
    /* Let op: GEEN CSS transitions hier! GSAP regelt de beweging */
}

.xp-toast-icon {
    font-size: 1.4rem;
}

.xp-toast-text {
    font-family: 'Poppins', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #fff;
}

.xp-toast-points {
    font-family: 'Poppins', sans-serif;
    font-size: 0.68rem;
    font-weight: 600;
    color: #a78bfa;
    letter-spacing: 0.08em;
}

/* Mobiele fix voor de bar & toast */
@media (max-width: 768px) {
    #progress-text { font-size: 0.58rem; right: 3%; top: 15px; }
    .xp-toast { bottom: 20px; right: 15px; left: 15px; justify-content: center; }
}