/* ============================================
   EFFECTS — Animations, cursor, glare, etc.
   ============================================ */

/* --- REVEAL ANIMATIONS --- */
@keyframes smooth-reveal {
  0% { opacity: 0; transform: translateY(40px); filter: blur(12px) }
  100% { opacity: 1; transform: translateY(0); filter: blur(0) }
}
.reveal { opacity: 0; transform: translateY(40px); filter: blur(12px); transition: opacity .7s cubic-bezier(.16, 1, .3, 1), transform .7s cubic-bezier(.16, 1, .3, 1), filter .7s cubic-bezier(.16, 1, .3, 1) }
.reveal.visible { opacity: 1; transform: none; filter: blur(0) }
.reveal-d1 { transition-delay: .1s } .reveal-d2 { transition-delay: .2s }
.reveal-d3 { transition-delay: .32s } .reveal-d4 { transition-delay: .44s }

/* --- SMOOTH PAGE TRANSITION --- */
@keyframes page-enter { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.page.active { animation: page-enter .5s cubic-bezier(.23,1,.32,1) both; }

/* --- CUSTOM CURSOR --- */
.custom-cursor { position: fixed; top: 0; left: 0; width: 18px; height: 18px; border: 1.5px solid var(--accent-2); border-radius: 50%; pointer-events: none; z-index: 9999; transform: translate(-50%, -50%); transition: width .15s cubic-bezier(.23, 1, .32, 1), height .15s cubic-bezier(.23, 1, .32, 1), background .15s, border-color .15s, opacity .15s; mix-blend-mode: difference; opacity: 0; will-change: transform; }
.custom-cursor.visible { opacity: 1 }
.custom-cursor.active { width: 48px; height: 48px; background: rgba(94, 92, 255, 0.12); border-color: rgba(94, 92, 255, 0.6) }
.custom-cursor.clicking { width: 14px; height: 14px; background: var(--accent-2) }
@media(hover:none), (pointer:coarse) { .custom-cursor { display: none !important } }

/* --- MAGNETIC --- */
.magnetic { will-change: auto }

/* --- GLASS GLARE --- */
.feature-card::after, .dev-feat::after { content: ''; position: absolute; inset: 0; opacity: 0; pointer-events: none; z-index: 1; border-radius: inherit; background: radial-gradient(320px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(94, 92, 255, 0.10), transparent 60%); transition: opacity .35s; }
.feature-card:hover::after, .dev-feat:hover::after { opacity: 1 }
.arch-item::after { content: ''; position: absolute; inset: 0; opacity: 0; pointer-events: none; border-radius: inherit; background: radial-gradient(280px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(94, 92, 255, 0.08), transparent 60%); transition: opacity .35s; }
.arch-item:hover::after { opacity: 1 }
.comp-card .glass-glare { position: absolute; inset: 0; opacity: 0; pointer-events: none; border-radius: inherit; background: radial-gradient(300px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(94, 92, 255, 0.09), transparent 60%); transition: opacity .35s; z-index: 0; }
.comp-card:hover .glass-glare { opacity: 1 }

/* --- RIPPLE FLASH --- */
.ripple-flash { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, 0.35); transform: scale(0); animation: ripple-expand .5s ease-out forwards; pointer-events: none; z-index: 10; }
@keyframes ripple-expand { to { transform: scale(4); opacity: 0 } }

/* --- LIGHT SWEEP BUTTON --- */
.btn-primary::after { content: ''; position: absolute; top: 0; left: -150%; width: 50%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent); transform: skewX(-20deg); transition: left .6s cubic-bezier(.4, 0, .2, 1); }
.btn-primary:hover::after { left: 150% }

/* --- FILM GRAIN OVERLAY --- */
body::before { content: ''; position: fixed; inset: 0; z-index: 9990; pointer-events: none; opacity: 0.028; 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.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); background-repeat: repeat; background-size: 180px; mix-blend-mode: overlay; }
[data-theme="light"] body::before { opacity: 0.04; mix-blend-mode: multiply; }

/* --- GRADIENT MESH --- */
.gradient-mesh { position: fixed; inset: 0; z-index: -2; pointer-events: none; overflow: hidden; }
.mesh-blob { position: absolute; border-radius: 50%; filter: blur(150px); opacity: 0.10; will-change: transform; animation: blob-drift 40s ease-in-out infinite alternate; }
.mesh-blob:nth-child(1) { width: 600px; height: 600px; background: rgba(61,58,255,0.5); top: -20%; left: -10%; }
.mesh-blob:nth-child(2) { width: 500px; height: 500px; background: rgba(107,105,255,0.3); bottom: -10%; right: -10%; animation-delay: -18s; }
.mesh-blob:nth-child(3), .mesh-blob:nth-child(4) { display: none; }
[data-theme="light"] .mesh-blob { opacity: 0.05; }
@keyframes blob-drift { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(40px, -30px) scale(1.1); } 100% { transform: translate(-20px, 20px) scale(0.95); } }

/* --- HERO NEBULA GLOW --- */
.hero-glow { position: absolute; top: -200px; left: 50%; transform: translateX(-50%); width: 1000px; height: 600px; background: radial-gradient(ellipse at center, rgba(61,58,255,0.15) 0%, rgba(61,58,255,0.05) 30%, transparent 65%); pointer-events: none; z-index: -1; animation: nebula-pulse 8s ease-in-out infinite alternate; }
[data-theme="light"] .hero-glow { background: radial-gradient(ellipse at center, rgba(42,40,232,0.06) 0%, rgba(42,40,232,0.02) 30%, transparent 65%); }
@keyframes nebula-pulse { 0% { opacity: 0.6; transform: translateX(-50%) scale(1); } 100% { opacity: 1; transform: translateX(-50%) scale(1.1); } }

/* --- ANIMATED NAV LINK UNDERLINES --- */
.nav-links a { position: relative; overflow: hidden; }
.nav-links a::after { content: ''; position: absolute; bottom: 2px; left: 12px; right: 12px; height: 1.5px; background: var(--accent-2); transform: scaleX(0); transform-origin: left; transition: transform .35s cubic-bezier(.4, 0, .2, 1); }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }

/* --- 3D TILT PERSPECTIVE --- */
.feature-card, .comp-card, .arch-item, .dev-feat, .mock-card { transform-style: preserve-3d; transition: transform .4s cubic-bezier(.23, 1, .32, 1), background .25s, border-color .25s, box-shadow .4s; }
.feature-card:hover, .comp-card:hover { box-shadow: var(--glass-shadow-hover); }

/* --- GLOWING BORDER GRADIENT --- */
.feature-card::before { content: ''; position: absolute; inset: -1px; border-radius: inherit; background: conic-gradient(from var(--card-angle, 0deg) at 50% 50%, transparent 0deg, var(--accent) 60deg, transparent 120deg); opacity: 0; transition: opacity .5s; z-index: -1; mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); mask-composite: exclude; -webkit-mask-composite: xor; padding: 1px; }
.feature-card:hover::before { opacity: 0.5; }

/* --- STAT COUNTER BOUNCE --- */
@keyframes stat-pop { 0% { transform: scale(1); } 50% { transform: scale(1.08); } 100% { transform: scale(1); } }
.stat-val.counted { animation: stat-pop .4s cubic-bezier(.23,1,.32,1); }

/* --- WAVE DIVIDER --- */
.wave-divider { width: 100%; height: 60px; overflow: hidden; position: relative; }
.wave-divider svg { width: 100%; height: 100%; display: block; }

/* --- HERO TYPING CURSOR --- */
.typing-cursor { display: inline-block; width: 3px; height: 0.85em; background: var(--accent-2); margin-left: 4px; vertical-align: baseline; animation: cursor-blink 1s steps(1) infinite; border-radius: 2px; }
@keyframes cursor-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* --- HERO WORD STAGGER --- */
.hero-word { display: inline-block; opacity: 0; transform: translateY(18px) rotateX(-12deg); animation: word-rise .6s cubic-bezier(.23,1,.32,1) forwards; }
@keyframes word-rise { to { opacity: 1; transform: translateY(0) rotateX(0); } }

/* --- RESPONSIVE (effects) --- */
@media(max-width:960px) {
  .mesh-blob { filter: blur(60px); }
  .mesh-blob:nth-child(1) { width: 300px; height: 300px; }
  .mesh-blob:nth-child(2) { width: 250px; height: 250px; }
  .mesh-blob:nth-child(3) { width: 200px; height: 200px; }
}
@media(max-width:640px) {
  #cvs, .gradient-mesh, .hero-glow { display: none !important; }
}
