/* ============================================================
   Emil Kowalski-style Animations — DJ Galactiko
   ============================================================ */

/* ── Page Transition Overlay ─────────────────────────────── */
#page-transition {
    position: fixed;
    inset: 0;
    background: var(--purple-900);
    z-index: 9999;
    pointer-events: none;
    transform-origin: top;
    animation: pageReveal 0.55s cubic-bezier(0.76, 0, 0.24, 1) forwards;
}
@keyframes pageReveal {
    from { transform: scaleY(1); }
    to   { transform: scaleY(0); }
}

/* ── Scroll-triggered fade-up ────────────────────────────── */
.will-animate {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}
.will-animate.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger por posición en grid */
.will-animate:nth-child(1) { transition-delay:  0ms; }
.will-animate:nth-child(2) { transition-delay: 70ms; }
.will-animate:nth-child(3) { transition-delay:140ms; }
.will-animate:nth-child(4) { transition-delay:210ms; }
.will-animate:nth-child(5) { transition-delay:280ms; }
.will-animate:nth-child(6) { transition-delay:350ms; }

/* ── Hero entrance ───────────────────────────────────────── */
.hero h1,
.hero p,
.hero-buttons {
    opacity: 0;
    animation: heroIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.hero h1      { animation-delay: 0.25s; }
.hero p       { animation-delay: 0.42s; }
.hero-buttons { animation-delay: 0.58s; }

@keyframes heroIn {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Spring hover en cards ───────────────────────────────── */
.card {
    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.45s ease !important;
    will-change: transform;
    transform-style: preserve-3d;
}
.card:hover {
    box-shadow: 0 24px 48px rgba(147, 51, 234, 0.35) !important;
}

/* ── Glow pulsante en botones destacados ─────────────────── */
.btn-pink,
.btn-nav-highlight {
    animation: pinkGlow 3s ease-in-out infinite;
}
@keyframes pinkGlow {
    0%,100% { box-shadow: 0 0 8px rgba(219,39,119,0.25); }
    50%      { box-shadow: 0 0 22px rgba(219,39,119,0.65); }
}

/* ── Magnetic buttons — spring reset ────────────────────── */
.btn {
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
                background 0.2s ease,
                box-shadow 0.3s ease !important;
}
.btn:hover {
    box-shadow: 0 8px 28px rgba(147, 51, 234, 0.38);
}

/* ── Nav link underline slide ────────────────────────────── */
.main-nav a:not(.btn-nav-highlight):not(.carrito-icon) {
    position: relative;
}
.main-nav a:not(.btn-nav-highlight):not(.carrito-icon)::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--purple-400);
    border-radius: 2px;
    transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.main-nav a:not(.btn-nav-highlight):not(.carrito-icon):hover::after {
    width: 100%;
}

/* ── Section headings fade ───────────────────────────────── */
.section h2 {
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Respect prefers-reduced-motion ──────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    .will-animate { opacity: 1 !important; transform: none !important; }
    #page-transition { display: none !important; }
}
