/* ===============================================
   PARALLAX & SCROLL EFFECTS
   Add-on layer — inspired by kaysonfakhar.com
   Keeps existing design; adds depth + motion.
   =============================================== */

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

/* ---------- Neural network canvas in hero ---------- */
.hero {
    /* allow canvas to sit behind content */
    isolation: isolate;
}

.hero-neural-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.55;
    will-change: transform;
}

/* Keep hero text/visual above the canvas + overlay */
.hero .container {
    z-index: 2;
}

.hero-overlay {
    z-index: 1;
    /* soften so the network is subtly visible through it */
    background: rgba(255, 255, 255, 0.42);
}

/* ---------- Generic parallax elements ---------- */
[data-parallax] {
    will-change: transform;
}

/* Floating decorative blobs used for section depth */
.parallax-decor {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    filter: blur(2px);
    opacity: 0.5;
    will-change: transform;
}

.parallax-decor.decor-gold {
    background: radial-gradient(closest-side, rgba(212, 175, 55, 0.18), transparent 70%);
}

.parallax-decor.decor-slate {
    background: radial-gradient(closest-side, rgba(44, 44, 44, 0.07), transparent 70%);
}

/* Sections need positioning context + clipping for decor */
.section {
    position: relative;
    overflow: hidden;
}

.section .container {
    position: relative;
    z-index: 1;
}

/* ---------- Scroll reveal animations ---------- */
.reveal {
    opacity: 0;
    transform: translateY(32px);
    transition:
        opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

.reveal.reveal-left  { transform: translateX(-40px); }
.reveal.reveal-right { transform: translateX(40px); }
.reveal.reveal-scale { transform: scale(0.94); }

.reveal.is-visible {
    opacity: 1;
    transform: translate(0, 0) scale(1);
}

/* Stagger children (grids, lists, timelines) */
.stagger > * {
    opacity: 0;
    transform: translateY(28px);
    transition:
        opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

.stagger.is-visible > * {
    opacity: 1;
    transform: translateY(0);
}

/* Delay increments applied via nth-child so it works without JS per-item */
.stagger.is-visible > *:nth-child(1) { transition-delay: 0.00s; }
.stagger.is-visible > *:nth-child(2) { transition-delay: 0.08s; }
.stagger.is-visible > *:nth-child(3) { transition-delay: 0.16s; }
.stagger.is-visible > *:nth-child(4) { transition-delay: 0.24s; }
.stagger.is-visible > *:nth-child(5) { transition-delay: 0.32s; }
.stagger.is-visible > *:nth-child(6) { transition-delay: 0.40s; }
.stagger.is-visible > *:nth-child(7) { transition-delay: 0.48s; }
.stagger.is-visible > *:nth-child(8) { transition-delay: 0.56s; }

/* Section titles get a subtle underline sweep on reveal */
.section-title {
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -0.4rem;
    height: 2px;
    width: 0;
    background: linear-gradient(90deg, var(--color-highlight), transparent);
    transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.2s;
}

.reveal.is-visible .section-title::after,
.section-title.is-visible::after {
    width: 64px;
}

/* Cards lift a touch as they settle in + on hover */
.project-card,
.highlight-item,
.timeline-vertical .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),
        opacity 0.6s ease;
}

.project-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.10);
}

/* Parallax tilt of the hero liquid circle handled in JS via transform */
.liquid-circle-stage {
    will-change: transform;
    transition: transform 0.15s ease-out;
}

/* ---------- Scroll progress bar ---------- */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    background: linear-gradient(90deg, var(--color-highlight), #b8933a);
    z-index: 1000;
    transition: width 0.1s linear;
    pointer-events: none;
}

/* ---------- Reduced motion: disable everything ---------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    .hero-neural-canvas,
    .parallax-decor { display: none; }

    [data-parallax] { transform: none !important; }

    .reveal,
    .stagger > * {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    .section-title::after { width: 64px; transition: none; }

    .scroll-progress { display: none; }
}
