/* ============================================================
   FX LAYER — Aurora background, film grain, neon glow,
   custom cursor, spotlight/tilt cards, magnetic buttons,
   tech marquee. Loaded last so it wins the cascade.
   ============================================================ */

/* ---------- Animated aurora background ---------- */
.fx-aurora {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
    pointer-events: none;
    background: #05070f;
}
.fx-aurora .blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.55;
    mix-blend-mode: screen;
    will-change: transform;
}
.fx-aurora .blob-1 { width: 46vw; height: 46vw; background: #8b5cf6; top: -8%;  left: -6%;  animation: drift1 26s ease-in-out infinite; }
.fx-aurora .blob-2 { width: 42vw; height: 42vw; background: #22d3ee; top: 10%;  right: -8%; animation: drift2 32s ease-in-out infinite; }
.fx-aurora .blob-3 { width: 40vw; height: 40vw; background: #6366f1; bottom: -10%; left: 20%; animation: drift3 30s ease-in-out infinite; }
.fx-aurora .blob-4 { width: 34vw; height: 34vw; background: #f472b6; top: 35%;  left: 45%;  animation: drift4 36s ease-in-out infinite; opacity: 0.4; }

@keyframes drift1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(12vw, 8vh) scale(1.15); } }
@keyframes drift2 { 0%,100% { transform: translate(0,0) scale(1.1); } 50% { transform: translate(-10vw, 12vh) scale(0.9); } }
@keyframes drift3 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(8vw, -10vh) scale(1.2); } }
@keyframes drift4 { 0%,100% { transform: translate(0,0) scale(0.9); } 50% { transform: translate(-12vw, -6vh) scale(1.1); } }

/* ---------- Film grain ---------- */
.fx-grain {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.06;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Let the aurora show through: translucent sections over it */
body::before { background: none !important; opacity: 0 !important; }
.hero { background: transparent !important; }
.about, .skills, .projects, .contact {
    background: rgba(7, 10, 20, 0.62) !important;
}
.navbar {
    background: linear-gradient(180deg, rgba(7, 10, 20, 0.88) 0%, rgba(7, 10, 20, 0.62) 100%) !important;
}
.footer {
    background: linear-gradient(180deg, rgba(7, 10, 20, 0.6) 0%, rgba(7, 10, 20, 0.85) 100%) !important;
}

/* ---------- Neon hero typography ---------- */
.hero-title {
    background: var(--gradient-neon) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-size: 280% 280% !important;
    animation: gradientShift 9s ease infinite !important;
    text-shadow: 0 6px 50px rgba(139, 92, 246, 0.35) !important;
}
.highlight {
    background: linear-gradient(120deg, var(--neon-cyan) 0%, var(--neon-pink) 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}
.hero-subtitle {
    background: linear-gradient(90deg, var(--neon-violet-light), var(--neon-cyan-light));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 600;
    letter-spacing: 0.01em;
}

/* Neon profile ring + orbiting nodes */
.hero-image .profile-image {
    border-color: rgba(139, 92, 246, 0.5) !important;
    box-shadow: 0 0 36px rgba(139, 92, 246, 0.35), 0 0 80px rgba(34, 211, 238, 0.18) !important;
}
.orbiting-element {
    color: var(--neon-cyan-light) !important;
    border-color: rgba(139, 92, 246, 0.35) !important;
    box-shadow: var(--glass-shadow), 0 0 22px rgba(139, 92, 246, 0.3) !important;
}

/* ---------- Custom cursor ---------- */
@media (hover: hover) and (pointer: fine) {
    body.fx-cursor, body.fx-cursor * { cursor: none !important; }
}
.fx-cursor-dot, .fx-cursor-ring {
    position: fixed;
    top: 0; left: 0;
    border-radius: 50%;
    pointer-events: none;
    z-index: 100000;
    transform: translate3d(-50%, -50%, 0);
    mix-blend-mode: screen;
}
.fx-cursor-dot {
    width: 7px; height: 7px;
    background: var(--neon-cyan);
    box-shadow: 0 0 12px var(--neon-cyan);
}
.fx-cursor-ring {
    width: 34px; height: 34px;
    border: 1.5px solid rgba(167, 139, 250, 0.75);
    transition: width 0.2s ease, height 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.fx-cursor-ring.is-hover {
    width: 56px; height: 56px;
    border-color: var(--neon-cyan);
    background: rgba(34, 211, 238, 0.1);
}
.fx-cursor-ring.is-down { width: 24px; height: 24px; border-color: var(--neon-pink); }

/* ---------- Spotlight + tilt cards ---------- */
.skills-grid, .projects-carousel-track { perspective: 1400px; }
.project-card, .skill-category {
    transform-style: preserve-3d;
    will-change: transform;
}
.card-glow {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    z-index: -1; /* above card bg, below content */
    opacity: 0;
    transition: opacity 0.35s ease;
    background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%),
        rgba(34, 211, 238, 0.22), rgba(139, 92, 246, 0.12) 35%, transparent 65%);
}
.project-card:hover .card-glow,
.skill-category:hover .card-glow { opacity: 1; }

/* Neon edge on hover */
.project-card:hover, .skill-category:hover {
    border-color: var(--neon-cyan) !important;
}

/* ---------- Magnetic transitions ---------- */
.btn, .projects-carousel-btn, .social-link {
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1),
                box-shadow 0.3s ease, background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
.btn-primary {
    box-shadow: 0 6px 28px rgba(139, 92, 246, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
}

/* ---------- Tech marquee ---------- */
.fx-marquee {
    position: relative;
    overflow: hidden;
    padding: 0.9rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: rgba(7, 10, 20, 0.5);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.fx-marquee-track {
    display: inline-flex;
    align-items: center;
    gap: 2.5rem;
    white-space: nowrap;
    animation: marqueeScroll 38s linear infinite;
    will-change: transform;
}
.fx-marquee:hover .fx-marquee-track { animation-play-state: paused; }
.fx-marquee-item {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
    color: var(--text-secondary);
    text-transform: uppercase;
}
.fx-marquee-item i { color: var(--neon-cyan); font-size: 1.1rem; }
.fx-marquee-item .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--neon-violet); }
@keyframes marqueeScroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* Marquee pinned to bottom of skills section */
.fx-marquee--skills-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    border-top: 1px solid var(--border);
    border-bottom: none;
}

/* ---------- Reduced motion / mobile fallbacks ---------- */
@media (prefers-reduced-motion: reduce) {
    .fx-aurora .blob { animation: none !important; }
    .fx-marquee-track { animation: none !important; }
    .hero-title { animation: none !important; }
}
@media (max-width: 768px) {
    .fx-cursor-dot, .fx-cursor-ring { display: none !important; }
    .fx-aurora .blob { filter: blur(70px); opacity: 0.45; }
    .fx-grain { opacity: 0.05; }
}

/* ============================================================
   FULL-PAGE SECTION LOCKING (desktop / tablet landscape)
   Each section snaps to fill the viewport. Content clears the
   fixed navbar; anything taller than one screen scrolls inside
   its own locked panel rather than spilling past it.
   ============================================================ */
@media (min-width: 769px) {
    html {
        scroll-snap-type: y mandatory;
        scroll-padding-top: 0;
    }
    .hero, .about, .skills, .projects, .contact {
        scroll-snap-align: start;
        scroll-snap-stop: always;
    }
    /* Clear the fixed navbar so section tops aren't hidden behind it */
    .about, .skills, .projects, .contact {
        padding-top: calc(var(--navbar-height, 64px) + 0.75rem) !important;
        padding-bottom: 1rem !important;
    }
    /* Tall content scrolls within its locked panel instead of overflowing */
    .about .container,
    .skills .container,
    .contact .container {
        overflow-y: auto;
        overflow-x: hidden;
        max-height: 100%;
        scrollbar-width: thin;
        scrollbar-color: rgba(139, 92, 246, 0.5) transparent;
    }
    .about .container::-webkit-scrollbar,
    .skills .container::-webkit-scrollbar,
    .contact .container::-webkit-scrollbar { width: 6px; }
    .about .container::-webkit-scrollbar-thumb,
    .skills .container::-webkit-scrollbar-thumb,
    .contact .container::-webkit-scrollbar-thumb {
        background: rgba(139, 92, 246, 0.5);
        border-radius: 3px;
    }
}
