/* ═══════════════════════════════════════════
   MUVIXO — ENHANCE.CSS  (Modern Animation Layer)
   Include AFTER style.css:
   <link rel="stylesheet" href="enhance.css">
═══════════════════════════════════════════ */

/* ── 0. Smooth everything ── */
html { scroll-behavior: smooth; }
::selection { background: rgba(37,99,235,0.25); }

/* ── 1. Custom cursor glow (desktop only) ── */
.cursor-glow {
  position: fixed; width: 420px; height: 420px; border-radius: 50%;
  pointer-events: none; z-index: 1;
  background: radial-gradient(circle, rgba(37,99,235,0.10) 0%, transparent 65%);
  transform: translate(-50%, -50%);
  transition: opacity 0.3s;
  mix-blend-mode: multiply;
}
@media (max-width: 900px), (hover: none) { .cursor-glow { display: none; } }

/* ── 2. Better reveal system (directional, no blur) ── */
.reveal { opacity: 0; transform: translateY(36px);
  transition: opacity 0.8s cubic-bezier(0.22,1,0.36,1),
              transform 0.8s cubic-bezier(0.22,1,0.36,1); }
.reveal.visible { opacity: 1; transform: translateY(0); }

.reveal-left  { opacity: 0; transform: translateX(-48px); transition: all 0.85s cubic-bezier(0.22,1,0.36,1); }
.reveal-right { opacity: 0; transform: translateX(48px);  transition: all 0.85s cubic-bezier(0.22,1,0.36,1); }
.reveal-zoom  { opacity: 0; transform: scale(0.9);        transition: all 0.8s cubic-bezier(0.22,1,0.36,1); }
.reveal-left.visible, .reveal-right.visible { opacity: 1; transform: translateX(0); }
.reveal-zoom.visible { opacity: 1; transform: scale(1); }

/* Stagger children of any .stagger container */
.stagger > * { opacity: 0; transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.22,1,0.36,1), transform 0.7s cubic-bezier(0.22,1,0.36,1); }
.stagger.visible > * { opacity: 1; transform: translateY(0); }
.stagger.visible > *:nth-child(1) { transition-delay: 0.05s; }
.stagger.visible > *:nth-child(2) { transition-delay: 0.13s; }
.stagger.visible > *:nth-child(3) { transition-delay: 0.21s; }
.stagger.visible > *:nth-child(4) { transition-delay: 0.29s; }
.stagger.visible > *:nth-child(5) { transition-delay: 0.37s; }
.stagger.visible > *:nth-child(6) { transition-delay: 0.45s; }
.stagger.visible > *:nth-child(7) { transition-delay: 0.53s; }
.stagger.visible > *:nth-child(8) { transition-delay: 0.61s; }
.stagger.visible > *:nth-child(9) { transition-delay: 0.69s; }
.stagger.visible > *:nth-child(10){ transition-delay: 0.77s; }

/* ── 3. Hero: cinematic entrance + typing headline ── */
.hero-title { perspective: 600px; }
.hero-title .word-split span {
  display: inline-block; opacity: 0;
  transform: translateY(40px) rotateX(-40deg);
  animation: heroWord 0.8s cubic-bezier(0.22,1,0.36,1) forwards;
}
@keyframes heroWord { to { opacity: 1; transform: translateY(0) rotateX(0); } }

/* Rotating word in hero (JS swaps text) */
.rotating-word {
  display: inline-block; position: relative;
  background: linear-gradient(100deg,#22d3ee,#3b82f6,#818cf8);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  animation: rotWordIn 0.5s cubic-bezier(0.22,1,0.36,1);
  min-width: 4ch;
}
@keyframes rotWordIn {
  from { opacity: 0; transform: translateY(18px) skewY(3deg); }
  to   { opacity: 1; transform: translateY(0) skewY(0); }
}

/* Hero image parallax tilt frame */
.hero-img-frame { transform-style: preserve-3d; transition: transform 0.15s ease-out; will-change: transform; }

/* Scroll-down indicator */
.scroll-indicator {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  z-index: 5; display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: rgba(255,255,255,0.55); font-size: 0.7rem; letter-spacing: 2px; text-transform: uppercase;
  animation: fadeDown 1s 1.2s both;
}
.scroll-indicator .mouse {
  width: 24px; height: 38px; border: 2px solid rgba(255,255,255,0.4); border-radius: 14px; position: relative;
}
.scroll-indicator .mouse::after {
  content: ''; position: absolute; top: 6px; left: 50%; width: 4px; height: 8px;
  background: #22d3ee; border-radius: 4px; transform: translateX(-50%);
  animation: scrollDot 1.6s ease-in-out infinite;
}
@keyframes scrollDot { 0% { opacity: 1; top: 6px; } 70% { opacity: 0; top: 20px; } 100% { opacity: 0; top: 6px; } }
@media (max-width: 900px) { .scroll-indicator { display: none; } }

/* ── 4. 3D tilt cards (JS driven) ── */
[data-tilt] { transform-style: preserve-3d; will-change: transform; transition: box-shadow 0.3s; }
[data-tilt] > * { transform: translateZ(24px); }

/* Card shine sweep on hover */
.shine { position: relative; overflow: hidden; }
.shine::before {
  content: ''; position: absolute; top: 0; left: -80%; width: 55%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,0.55), transparent);
  transform: skewX(-20deg); transition: left 0.6s ease; pointer-events: none; z-index: 3;
}
.shine:hover::before { left: 130%; }

/* ── 5. Magnetic buttons ── */
.magnetic { transition: transform 0.2s cubic-bezier(0.22,1,0.36,1); will-change: transform; }

/* Button ripple */
.btn-primary, .btn-gold, .btn-white, .submit-btn, .nav-cta-btn { position: relative; overflow: hidden; }
.ripple-ink {
  position: absolute; border-radius: 50%; background: rgba(255,255,255,0.45);
  transform: scale(0); animation: rippleAnim 0.65s ease-out forwards; pointer-events: none;
}
@keyframes rippleAnim { to { transform: scale(3.2); opacity: 0; } }

/* ── 6. Section headings: underline draw + gradient sweep ── */
.section-title { position: relative; }
.section-title.visible::after,
.reveal.visible .section-title::after { transform: scaleX(1); }

/* Animated gradient headline underline */
.title-underline { position: relative; display: inline-block; }
.title-underline::after {
  content: ''; position: absolute; left: 0; bottom: -6px; height: 4px; width: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg,#06b6d4,#2563eb,#6366f1);
  background-size: 200% auto; animation: gradientShift 4s linear infinite;
  transform: scaleX(0); transform-origin: left; transition: transform 0.9s 0.25s cubic-bezier(0.22,1,0.36,1);
}
.reveal.visible .title-underline::after, .title-underline.visible::after { transform: scaleX(1); }

/* ── 7. Scroll progress bar ── */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: linear-gradient(90deg,#06b6d4,#2563eb,#818cf8);
  z-index: 2001; box-shadow: 0 0 12px rgba(37,99,235,0.6);
  transition: width 0.08s linear;
}

/* ── 8. Number counters: pop when done ── */
.count-pop { animation: countPop 0.45s cubic-bezier(0.34,1.56,0.64,1); }
@keyframes countPop { 0% { transform: scale(1); } 50% { transform: scale(1.18); } 100% { transform: scale(1); } }

/* ── 9. Marquee: smoother + hover glow chips ── */
.tech-chip { animation: chipFloat 4s ease-in-out infinite; }
.tech-chip:nth-child(odd) { animation-delay: -2s; }
@keyframes chipFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

/* ── 10. Image hover: subtle zoom + gradient ring ── */
.about-img-wrap, .about-img-side, .cs-media { overflow: hidden; }
.about-img-wrap img, .about-img-side img, .cs-media img {
  transition: transform 0.7s cubic-bezier(0.22,1,0.36,1), filter 0.5s;
}
.about-img-wrap:hover img, .about-img-side:hover img, .cs-media:hover img {
  transform: scale(1.05); filter: saturate(1.12);
}

/* ── 11. Nav: link underline slide ── */
.nav-links a { position: relative; }
.nav-pill .nav-links a::after {
  content: ''; position: absolute; left: 1.1rem; right: 1.1rem; bottom: 6px; height: 2px;
  background: var(--accent); border-radius: 2px;
  transform: scaleX(0); transform-origin: center; transition: transform 0.25s;
}
.nav-pill .nav-links a:not(.active):hover::after { transform: scaleX(1); }

/* Nav logo entrance */
.logo-img { animation: fadeDown 0.7s ease both; }

/* ── 12. FAQ: smoother open + icon spin already exists; add left accent ── */
.faq-item { border-left: 3px solid transparent; transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s; }
.faq-item.open { border-left-color: var(--accent); transform: translateX(4px); }

/* ── 13. Testimonial cards: quote mark + lift ── */
.testi-card::before {
  content: '"'; position: absolute; top: 10px; right: 18px;
  font-family: 'Space Grotesk', sans-serif; font-size: 4.5rem; line-height: 1;
  color: rgba(37,99,235,0.08); font-weight: 800; pointer-events: none;
}

/* ── 14. Project cards: image ken-burns + meta slide ── */
.img-proj-thumb img { transition: transform 6s ease, filter 0.4s; }
.img-proj-card:hover .img-proj-thumb img { transform: scale(1.12); }
.proj-meta-bar { transition: background 0.3s; }
.img-proj-card:hover .proj-meta-bar { background: var(--bg2); }

/* Filter buttons: bounce on activate */
.proj-filter.active { animation: filterBounce 0.4s cubic-bezier(0.34,1.56,0.64,1); }
@keyframes filterBounce { 0% { transform: scale(0.92); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }

/* Cards filtering: fade/scale instead of jump */
[data-cat] { transition: opacity 0.4s, transform 0.4s; }
[data-cat].hidden { opacity: 0; transform: scale(0.9); pointer-events: none; position: absolute; visibility: hidden; }

/* ── 15. WhatsApp button: attention wiggle every few sec ── */
.whatsapp-float { animation: waPulse 2.4s ease-in-out infinite, waWiggle 6s ease-in-out infinite; }
@keyframes waWiggle {
  0%, 90%, 100% { transform: rotate(0); }
  92% { transform: rotate(-10deg); } 94% { transform: rotate(10deg); }
  96% { transform: rotate(-6deg); } 98% { transform: rotate(4deg); }
}

/* ── 16. Form: floating focus glow + shake on error ── */
input:focus, textarea:focus, select:focus {
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12), 0 6px 18px rgba(37,99,235,0.12);
  transform: translateY(-1px);
}
input, textarea, select { transition: border-color 0.2s, box-shadow 0.25s, transform 0.25s; }
.form-shake { animation: formShake 0.45s; }
@keyframes formShake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-8px); } 40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); } 80% { transform: translateX(5px); }
}
.form-success { animation: successPop 0.5s cubic-bezier(0.34,1.56,0.64,1); }
@keyframes successPop { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: scale(1); } }

/* ── 17. CTA banner: aurora sweep ── */
.cta-banner::after {
  content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,0.08) 45%, transparent 60%);
  background-size: 250% auto; animation: gradientShift 5s linear infinite;
}

/* ── 18. Footer: link arrow micro-interaction ── */
.footer-links a { display: inline-block; transition: color 0.2s, transform 0.2s; }
.footer-links a:hover { transform: translateX(4px); }

/* ── 19. Timeline: dots pulse in sequence when visible ── */
.timeline-row.visible .timeline-dot { animation: dotPulseIn 0.5s cubic-bezier(0.34,1.56,0.64,1) both; }
.timeline-row.visible .timeline-item:nth-child(1) .timeline-dot { animation-delay: 0.1s; }
.timeline-row.visible .timeline-item:nth-child(2) .timeline-dot { animation-delay: 0.3s; }
.timeline-row.visible .timeline-item:nth-child(3) .timeline-dot { animation-delay: 0.5s; }
.timeline-row.visible .timeline-item:nth-child(4) .timeline-dot { animation-delay: 0.7s; }
.timeline-row.visible .timeline-item:nth-child(5) .timeline-dot { animation-delay: 0.9s; }
@keyframes dotPulseIn { from { transform: scale(0); } to { transform: scale(1); } }

/* ── 20. Page transition fade ── */
.page.active { animation: pageIn 0.55s cubic-bezier(0.22,1,0.36,1); }
@keyframes pageIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

/* ── 21. Back-to-top button ── */
.back-to-top {
  position: fixed; bottom: 96px; right: 28px; width: 46px; height: 46px;
  border-radius: 50%; background: var(--gradient); color: #fff; border: none;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  box-shadow: 0 6px 20px rgba(37,99,235,0.4); z-index: 1999;
  opacity: 0; transform: translateY(16px) scale(0.8); pointer-events: none;
  transition: opacity 0.35s, transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
}
.back-to-top.show { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.back-to-top:hover { transform: translateY(-3px) scale(1.05); }
@media (max-width: 600px) { .back-to-top { bottom: 84px; right: 18px; width: 42px; height: 42px; } }

/* ── 22. Reduced motion respect ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal, .reveal-left, .reveal-right, .reveal-zoom, .stagger > * { opacity: 1; transform: none; filter: none; }
}

/* ── 23. Service detail modal ── */
.svc-modal-overlay {
  position: fixed; inset: 0; z-index: 3000;
  background: rgba(15,23,42,0.55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
}
.svc-modal-overlay.show { opacity: 1; visibility: visible; }

.svc-modal {
  position: relative;
  background: #fff;
  border-radius: 22px;
  max-width: 520px; width: 100%;
  max-height: 88vh; overflow-y: auto;
  padding: 2.5rem 2.25rem 2rem;
  box-shadow: 0 30px 80px rgba(15,23,42,0.35), 0 8px 24px rgba(0,0,0,0.12);
  transform: scale(0.88) translateY(24px);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s ease;
}
.svc-modal-overlay.show .svc-modal { transform: scale(1) translateY(0); opacity: 1; }
.svc-modal:focus { outline: none; }
.svc-modal::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 6px;
  border-radius: 22px 22px 0 0;
  background: var(--gradient-gold); background-size: 200% auto;
  animation: gradientShift 4s linear infinite;
}

.svc-modal-close {
  position: absolute; top: 18px; right: 18px;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg2); border: 1px solid var(--border);
  color: var(--text2); display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.25s ease;
}
.svc-modal-close:hover { background: var(--accent); color: #fff; transform: rotate(90deg); border-color: transparent; }

.svc-modal-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.1rem; padding-right: 2rem; }
.svc-modal-icon {
  flex-shrink: 0; width: 56px; height: 56px; border-radius: 16px;
  background: var(--gradient); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(37,99,235,0.3);
}
.svc-modal-icon svg { width: 26px; height: 26px; }
.svc-modal-head h3 {
  font-family: 'Space Grotesk', sans-serif; font-size: 1.35rem; font-weight: 800;
  color: var(--text); letter-spacing: -0.3px; line-height: 1.25;
}

.svc-modal-desc { color: var(--text2); font-size: 0.95rem; line-height: 1.7; margin-bottom: 1.5rem; }

.svc-modal-features h4 {
  font-size: 0.72rem; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--accent); font-weight: 700; margin-bottom: 0.8rem;
}
.svc-modal-features ul { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: 0.65rem; }
.svc-modal-features li { display: flex; align-items: flex-start; gap: 0.6rem; font-size: 0.88rem; color: var(--text2); line-height: 1.5; }
.svc-modal-features li svg {
  flex-shrink: 0; margin-top: 2px; color: #fff;
  background: var(--accent); border-radius: 50%; padding: 3px;
  width: 18px; height: 18px; box-sizing: border-box;
}

.svc-modal-tags { margin-bottom: 1.75rem; }

.svc-modal-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.svc-modal-actions .btn-primary { flex: 1; justify-content: center; }
.svc-modal-actions .btn-outline { flex-shrink: 0; }

@media (max-width: 560px) {
  .svc-modal { padding: 2rem 1.4rem 1.6rem; border-radius: 18px; }
  .svc-modal-actions { flex-direction: column; }
}

/* Clickable service card hint */
.svc-card-hint {
  display: inline-flex; align-items: center; gap: 0.35rem;
  margin-top: 1rem; font-size: 0.78rem; font-weight: 600; color: var(--accent);
  opacity: 0; transform: translateY(4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.svc-card-hint svg { transition: transform 0.25s ease; }
.float-card:hover .svc-card-hint,
.service-card:hover .svc-card-hint { opacity: 1; transform: translateY(0); }
.float-card:hover .svc-card-hint svg,
.service-card:hover .svc-card-hint svg { transform: translateX(3px); }

@media (prefers-reduced-motion: reduce) {
  .svc-modal-overlay, .svc-modal, .svc-modal-close { transition: none !important; animation: none !important; }
}
