/* ============================================
   RayRay Beats — Animations (Purple Liquid Glass)
   ============================================ */

@import 'fonts.css';

/* ---- Loader ---- */
.loader { position: fixed; inset: 0; background: #0c0b10; z-index: 99999; display: flex; align-items: center; justify-content: center; transition: opacity 0.6s, visibility 0.6s; }
.loader.done { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-logo { font-family: 'Sora', sans-serif; font-size: 52px; font-weight: 800; letter-spacing: -2px; display: flex; gap: 1px; justify-content: center; }
.loader-letter { display: inline-block; opacity: 0; transform: translateY(24px); animation: letterIn 0.5s cubic-bezier(0.16,1,0.3,1) forwards; }
.loader-letter:nth-child(1) { animation-delay: .08s; }
.loader-letter:nth-child(2) { animation-delay: .12s; }
.loader-letter:nth-child(3) { animation-delay: .16s; }
.loader-letter:nth-child(4) { animation-delay: .24s; }
.loader-letter:nth-child(5) { animation-delay: .28s; }
.loader-letter:nth-child(6) { animation-delay: .32s; }
@keyframes letterIn { to { opacity: 1; transform: translateY(0); } }
.loader-bar { width: 160px; height: 2px; background: rgba(255,255,255,0.06); margin: 20px auto 0; overflow: hidden; border-radius: 2px; }
.loader-bar-fill { width: 0%; height: 100%; background: linear-gradient(90deg, #dc2626, #b91c1c); animation: loaderFill 0.6s 0.2s cubic-bezier(0.16,1,0.3,1) forwards; border-radius: 2px; }
@keyframes loaderFill { to { width: 100%; } }

/* ---- Cursor ---- */
.cursor { position: fixed; width: 7px; height: 7px; background: #dc2626; border-radius: 50%; pointer-events: none; z-index: 99998; transform: translate(-50%,-50%); }
.cursor.hovering { width: 32px; height: 32px; background: rgba(220,38,38,0.08); border: 1px solid rgba(220,38,38,0.35); }
.cursor-glow { position: fixed; width: 26px; height: 26px; border-radius: 50%; border: 1px solid rgba(220,38,38,0.1); pointer-events: none; z-index: 99997; transform: translate(-50%,-50%); transition: transform 0.35s cubic-bezier(0.16,1,0.3,1), width 0.3s, height 0.3s; }
.cursor-glow.hovering { width: 48px; height: 48px; border-color: rgba(220,38,38,0.18); }
@media (hover: none) { .cursor, .cursor-glow { display: none; } }

/* ---- Scroll Progress ---- */
.scroll-progress { position: fixed; top: 0; left: 0; height: 2px; background: linear-gradient(90deg, #dc2626, #b91c1c); z-index: 10001; width: 0%; }

/* ---- Particles ---- */
.particle-canvas { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

/* ---- Mouse Spotlight ---- */
.mouse-spotlight { position: fixed; width: 450px; height: 450px; border-radius: 50%; background: radial-gradient(circle, rgba(220,38,38,0.025) 0%, transparent 70%); pointer-events: none; z-index: 1; transform: translate(-50%,-50%); transition: left 0.4s ease, top 0.4s ease; }

/* ---- Equalizer ---- */
.equalizer { display: flex; align-items: flex-end; gap: 2.5px; height: 32px; }
.equalizer .bar { width: 3px; background: #dc2626; border-radius: 2px; animation: eq 1s ease-in-out infinite; }
.equalizer .bar:nth-child(1) { height: 60%; animation-delay: 0s; }
.equalizer .bar:nth-child(2) { height: 40%; animation-delay: .1s; }
.equalizer .bar:nth-child(3) { height: 80%; animation-delay: .2s; }
.equalizer .bar:nth-child(4) { height: 50%; animation-delay: .3s; }
.equalizer .bar:nth-child(5) { height: 70%; animation-delay: .15s; }
.equalizer .bar:nth-child(6) { height: 45%; animation-delay: .25s; }
.equalizer.paused .bar { animation-play-state: paused; height: 5px !important; transition: height 0.3s; }
@keyframes eq { 0%,100% { transform: scaleY(0.3); } 25% { transform: scaleY(1); } 50% { transform: scaleY(0.6); } 75% { transform: scaleY(0.9); } }

/* ---- Vinyl ---- */
.vinyl { width: 120px; height: 120px; border-radius: 50%; background: conic-gradient(from 0deg, #15142a 0deg, #1e1d38 30deg, #15142a 60deg, #1a1936 90deg, #1e1d38 120deg, #15142a 150deg, #1a1936 180deg, #1e1d38 210deg, #15142a 240deg, #1a1936 270deg, #1e1d38 300deg, #15142a 330deg, #1a1936 360deg); position: relative; animation: spin 3s linear infinite; animation-play-state: paused; box-shadow: 0 0 40px rgba(0,0,0,0.4); }
.vinyl::before { content: ''; position: absolute; top: 50%; left: 50%; width: 26px; height: 26px; background: #dc2626; border-radius: 50%; transform: translate(-50%,-50%); box-shadow: 0 0 14px rgba(220,38,38,0.4); }
.vinyl::after { content: ''; position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; border: 1px solid rgba(220,38,38,0.08); border-radius: 50%; transform: translate(-50%,-50%); }
.vinyl-grooves { position: absolute; inset: 15%; border-radius: 50%; border: 1px solid rgba(255,255,255,0.015); box-shadow: inset 0 0 0 8px rgba(255,255,255,0.008), inset 0 0 0 16px rgba(255,255,255,0.008), inset 0 0 0 24px rgba(255,255,255,0.008); }
.vinyl-glow { position: absolute; width: 280px; height: 280px; border-radius: 50%; background: radial-gradient(circle, rgba(220,38,38,0.06) 0%, transparent 70%); animation: vinylPulse 4s ease-in-out infinite; filter: blur(10px); }
@keyframes vinylPulse { 0%,100% { transform: scale(1); opacity: 0.5; } 50% { transform: scale(1.1); opacity: 1; } }
.vinyl-arm { position: absolute; width: 90px; height: 3px; background: linear-gradient(90deg, #333, #555); top: 50%; right: 10%; transform-origin: right center; transform: rotate(-25deg); transition: transform 0.8s cubic-bezier(0.16,1,0.3,1); border-radius: 2px; }
.vinyl-arm::before { content: ''; position: absolute; left: -3px; top: -3.5px; width: 10px; height: 10px; background: #444; border-radius: 50%; }
.vinyl-arm.active { transform: rotate(-15deg); }
.vinyl.spinning { animation-play-state: running; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ---- Music Notes ---- */
.music-notes-bg { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.music-note { position: absolute; font-size: 18px; color: rgba(220,38,38,0.03); animation: floatNote linear infinite; }
@keyframes floatNote { 0% { transform: translateY(100vh) rotate(0deg) scale(0.5); opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { transform: translateY(-80px) rotate(360deg) scale(1); opacity: 0; } }

/* ---- Glitch ---- */
.glitch { position: relative; display: inline-block; }
.glitch::before, .glitch::after { content: attr(data-text); position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.glitch::before { animation: g1 4s infinite linear alternate-reverse; clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%); opacity: 0.4; color: rgba(220,38,38,0.5); }
.glitch::after { animation: g2 3s infinite linear alternate-reverse; clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%); opacity: 0.4; color: rgba(185,28,28,0.5); }
@keyframes g1 { 0%,90% { transform: translate(0); } 91% { transform: translate(-3px, 1px); } 93% { transform: translate(3px, -1px); } 94%,100% { transform: translate(0); } }
@keyframes g2 { 0%,85% { transform: translate(0); } 86% { transform: translate(2px, -1px); } 88% { transform: translate(-2px, 1px); } 89%,100% { transform: translate(0); } }

/* ---- Soundwave BG ---- */
.soundwave-bg { position: absolute; bottom: 0; left: 0; width: 100%; height: 160px; overflow: hidden; opacity: 0.03; }
.soundwave-bg .wave { position: absolute; bottom: 0; width: 200%; height: 100%; background: repeating-linear-gradient(90deg, transparent, transparent 4px, rgba(220,38,38,0.5) 4px, rgba(220,38,38,0.5) 5px); animation: waveScroll 12s linear infinite; }
.soundwave-bg .wave:nth-child(2) { opacity: 0.5; animation-duration: 16s; animation-direction: reverse; }
@keyframes waveScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---- Noise ---- */
.noise-overlay { position: fixed; top: -50%; left: -50%; width: 200%; height: 200%; pointer-events: none; z-index: 9999; opacity: 0.012; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' 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"); animation: noiseShift 0.5s steps(5) infinite; }
@keyframes noiseShift { 0% { transform: translate(0); } 20% { transform: translate(-2%,-2%); } 40% { transform: translate(2%,2%); } 60% { transform: translate(-1%,1%); } 80% { transform: translate(1%,-1%); } }

/* ---- Reveal ---- */
.reveal { opacity: 0; transform: translateY(36px); transition: opacity 0.8s cubic-bezier(0.16,1,0.3,1), transform 0.8s cubic-bezier(0.16,1,0.3,1); }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ---- Fade In Up ---- */
.fade-in-up { opacity: 0; transform: translateY(24px); animation: fadeUp 0.6s cubic-bezier(0.16,1,0.3,1) forwards; }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }
.fade-in-up:nth-child(1) { animation-delay: .03s; }
.fade-in-up:nth-child(2) { animation-delay: .06s; }
.fade-in-up:nth-child(3) { animation-delay: .09s; }
.fade-in-up:nth-child(4) { animation-delay: .12s; }
.fade-in-up:nth-child(5) { animation-delay: .15s; }
.fade-in-up:nth-child(6) { animation-delay: .18s; }
.fade-in-up:nth-child(7) { animation-delay: .21s; }
.fade-in-up:nth-child(8) { animation-delay: .24s; }

/* ---- Split Text ---- */
.split-text .char { display: inline-block; opacity: 0; transform: translateY(80%); transition: transform 0.5s cubic-bezier(0.16,1,0.3,1), opacity 0.5s; }
.split-text.visible .char { opacity: 1; transform: translateY(0); }
.split-text .char-space { display: inline-block; width: 0.3em; }

/* ---- Filter button morph ---- */
.filter-btn { transition: all 0.4s cubic-bezier(0.16,1,0.3,1), transform 0.3s; }
.filter-btn:active { transform: scale(0.95); }

/* ---- Stat counter pop ---- */
.stat-item { transition: transform 0.5s cubic-bezier(0.16,1,0.3,1); }
.stat-item:hover { transform: scale(1.08); }
.stat-number { transition: color 0.3s; }
.stat-item:hover .stat-number { text-shadow: 0 0 20px rgba(220,38,38,0.3); }

/* ---- Section label slide-in ---- */
.section-label {
  opacity: 0; transform: translateX(-16px);
  transition: opacity 0.6s 0.1s, transform 0.6s 0.1s cubic-bezier(0.16,1,0.3,1);
}
.reveal.visible .section-label,
.visible .section-label { opacity: 0.7; transform: translateX(0); }

/* ---- About photo tilt on scroll ---- */
.about-photo { transition: transform 0.6s cubic-bezier(0.16,1,0.3,1), box-shadow 0.6s; }
.about-photo-wrapper:hover .about-photo { transform: scale(1.03) rotate(1deg); box-shadow: 0 0 60px rgba(220,38,38,0.15), 0 30px 80px rgba(0,0,0,0.4); }

/* ---- Marquee hover: only brighten items, no speed change to avoid jump ---- */

/* ---- CTA section breathing glow ---- */
.cta-section::before {
  content: ''; position: absolute; top: 0; left: 50%; width: 80%; height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(220,38,38,0.15), transparent);
}

/* ---- Nav link hover micro-animation ---- */
.nav-links a { transition: color 0.3s, transform 0.3s; }
.nav-links a:hover { transform: translateY(-1px); }

/* ---- Global player slide-in with bounce ---- */
.global-player { transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); }

/* ---- Beat tag hover ---- */
.beat-tag { transition: all 0.3s cubic-bezier(0.16,1,0.3,1); }
.beat-tag:hover { background: rgba(220,38,38,0.08); border-color: rgba(220,38,38,0.2); color: var(--accent-light); transform: translateY(-1px); }
