/* ============================================
   MADSINMUSICK - Animations & Effects
   ============================================ */

/* ---- Scroll Reveal Animations ---- */
.animate-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.animate-in:nth-child(1) { transition-delay: 0s; }
.animate-in:nth-child(2) { transition-delay: 0.1s; }
.animate-in:nth-child(3) { transition-delay: 0.2s; }
.animate-in:nth-child(4) { transition-delay: 0.3s; }
.animate-in:nth-child(5) { transition-delay: 0.4s; }
.animate-in:nth-child(6) { transition-delay: 0.5s; }
.animate-in:nth-child(7) { transition-delay: 0.6s; }

/* ---- Section Reveal ---- */
.section-header,
.about-grid,
.music-featured,
.music-grid,
.visuals-grid,
.contact-grid,
.marquee-wrapper {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.section-header.revealed,
.about-grid.revealed,
.music-featured.revealed,
.music-grid.revealed,
.visuals-grid.revealed,
.contact-grid.revealed,
.marquee-wrapper.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Card Hover Glow Effect ---- */
.track-card::before,
.visual-card::before,
.contact-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: var(--gradient-primary);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
}

.track-card:hover::before,
.visual-card:hover::before,
.contact-card:hover::before {
    opacity: 1;
}

/* ---- Staggered Grid Animations ---- */
.track-card,
.visual-card,
.contact-card,
.detail-item {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease, border-color 0.3s, box-shadow 0.3s;
}

.track-card.revealed,
.visual-card.revealed,
.contact-card.revealed,
.detail-item.revealed {
    opacity: 1;
    transform: translateY(0);
}

.track-card:nth-child(1) { transition-delay: 0.1s; }
.track-card:nth-child(2) { transition-delay: 0.2s; }
.track-card:nth-child(3) { transition-delay: 0.3s; }

.visual-card:nth-child(1) { transition-delay: 0.05s; }
.visual-card:nth-child(2) { transition-delay: 0.1s; }
.visual-card:nth-child(3) { transition-delay: 0.15s; }
.visual-card:nth-child(4) { transition-delay: 0.2s; }
.visual-card:nth-child(5) { transition-delay: 0.25s; }

.detail-item:nth-child(1) { transition-delay: 0.1s; }
.detail-item:nth-child(2) { transition-delay: 0.2s; }
.detail-item:nth-child(3) { transition-delay: 0.3s; }
.detail-item:nth-child(4) { transition-delay: 0.4s; }

/* ---- Glitch Effect for Title ---- */
.hero-title:hover .title-line:first-child {
    animation: glitch 0.4s ease forwards;
}

@keyframes glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-3px, 2px); }
    40% { transform: translate(3px, -2px); }
    60% { transform: translate(-1px, 1px); }
    80% { transform: translate(2px, -1px); }
    100% { transform: translate(0); }
}

/* ---- Magnetic Button Hover ---- */
.btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:active {
    transform: scale(0.97);
}

/* ---- Shimmer Effect ---- */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.hero-badge {
    background: linear-gradient(
        90deg,
        rgba(168, 85, 247, 0.1),
        rgba(168, 85, 247, 0.2),
        rgba(168, 85, 247, 0.1)
    );
    background-size: 200% 100%;
    animation: shimmer 3s infinite;
}

/* ---- Floating Particles in Sections ---- */
.section::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.05), transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: drift 15s ease-in-out infinite;
}

.section::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.05), transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: drift 12s ease-in-out infinite reverse;
}

@keyframes drift {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(30px, -20px); }
    50% { transform: translate(-10px, 30px); }
    75% { transform: translate(20px, 10px); }
}

/* ---- Text Gradient Shift ---- */
.gradient-text {
    background-size: 200% 200%;
    animation: gradientShift 4s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ---- Nav Link Underline ---- */
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transform: translateX(-50%);
    transition: width 0.3s ease;
    border-radius: 1px;
}

.nav-link:hover::after {
    width: 60%;
}

.nav-link.active::after {
    display: none;
}

/* ---- Smooth Image Hover ---- */
.about-image:hover .placeholder-icon svg {
    transform: translateY(-10px) scale(1.05);
    transition: transform 0.6s ease;
}

/* ---- Form Focus Ring ---- */
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-bottom-color: transparent;
}

/* ---- Loading Skeleton ---- */
@keyframes skeleton {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

/* ---- Social Icon Bounce ---- */
.footer-socials a:hover {
    animation: iconBounce 0.4s ease;
}

@keyframes iconBounce {
    0% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
    100% { transform: translateY(-3px); }
}

/* ---- Parallax Background Text ---- */
.section-bg-text {
    transition: transform 0.1s linear;
}

/* ---- Noise Texture Overlay (subtle) ---- */
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: 9998;
    opacity: 0.4;
}
