/* ===== Performance & Polish enhancements ===== */

/* Scroll progress bar */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  z-index: 999; transition: width .1s ease; box-shadow: 0 0 10px rgba(25,143,217,0.5);
}

/* Custom cursor glow */
.cursor-glow {
  position: fixed; width: 24px; height: 24px; border-radius: 50%;
  background: radial-gradient(circle, rgba(25,143,217,0.5), transparent 70%);
  pointer-events: none; z-index: 998; transform: translate(-50%,-50%);
  transition: width .2s, height .2s, opacity .2s; opacity: 0;
  mix-blend-mode: screen;
}
:root[data-theme="light"] .cursor-glow { mix-blend-mode: multiply; background: radial-gradient(circle, rgba(25,143,217,0.25), transparent 70%); }
.cursor-glow.active { opacity: 1; }
.cursor-glow.hover { width: 56px; height: 56px; }

/* Grain overlay for texture */
.grain {
  position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' /%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' /%3E%3C/svg%3E");
}

/* Magnetic buttons */
.btn-magnetic { transition: transform .15s ease-out; }

/* Scroll-to-top */
.scroll-top {
  position: fixed; bottom: 30px; left: 30px; z-index: 200;
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
  opacity: 0; transform: translateY(20px); transition: all .3s; backdrop-filter: blur(10px);
}
.scroll-top.show { opacity: 1; transform: translateY(0); }
.scroll-top:hover { background: var(--primary); border-color: var(--primary); color: white; transform: translateY(-2px); }

/* Text reveal (word-by-word) */
.reveal-text { overflow: hidden; }
.reveal-text .word { display: inline-block; transform: translateY(110%); transition: transform .6s cubic-bezier(.16,1,.3,1); }
.reveal-text.visible .word { transform: translateY(0); }
.reveal-text.visible .word:nth-child(1) { transition-delay: .05s; }
.reveal-text.visible .word:nth-child(2) { transition-delay: .1s; }
.reveal-text.visible .word:nth-child(3) { transition-delay: .15s; }
.reveal-text.visible .word:nth-child(4) { transition-delay: .2s; }
.reveal-text.visible .word:nth-child(5) { transition-delay: .25s; }
.reveal-text.visible .word:nth-child(6) { transition-delay: .3s; }

/* Parallax */
.parallax { will-change: transform; transition: transform .1s linear; }

/* Glow card on hover (services/products) */
.glow-card { position: relative; }
.glow-card::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; opacity: 0;
  background: radial-gradient(600px circle at var(--mx,50%) var(--my,50%), rgba(25,143,217,0.1), transparent 40%);
  transition: opacity .3s; pointer-events: none; z-index: 0;
}
.glow-card:hover::before { opacity: 1; }

/* Shimmer loading skeleton */
.shimmer { background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Testimonial card */
.testimonial-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  padding: 32px; transition: all .3s; position: relative;
}
.testimonial-card:hover { border-color: rgba(25,143,217,0.3); transform: translateY(-3px); }
.testimonial-quote { font-size: 48px; color: var(--primary); opacity: 0.2; line-height: 1; position: absolute; top: 20px; left: 24px; }
.testimonial-text { font-size: 15px; color: var(--text-dim); line-height: 1.7; margin-bottom: 20px; position: relative; z-index: 1; }
.testimonial-author { display: flex; align-items: center; gap: 12px; }
.testimonial-avatar { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--accent)); display: flex; align-items: center; justify-content: center; font-weight: 700; color: white; }
.testimonial-author .name { font-size: 14px; font-weight: 600; }
.testimonial-author .role { font-size: 12px; color: var(--text-muted); }
.testimonial-stars { color: var(--accent); font-size: 14px; margin-bottom: 12px; letter-spacing: 2px; }

/* FAQ accordion */
.faq-item { border-bottom: 1px solid var(--border); }
.faq-q { padding: 22px 0; display: flex; justify-content: space-between; align-items: center; cursor: pointer; font-size: 16px; font-weight: 600; gap: 16px; transition: color .2s; }
.faq-q:hover { color: var(--primary); }
.faq-q .faq-icon { font-size: 22px; color: var(--primary); transition: transform .35s cubic-bezier(.16,1,.3,1); flex-shrink: 0; }
.faq-a-wrap { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s cubic-bezier(.16,1,.3,1); }
.faq-item.open .faq-a-wrap { grid-template-rows: 1fr; }
.faq-a { overflow: hidden; color: var(--text-dim); font-size: 14px; line-height: 1.7; }
.faq-a-inner { padding-bottom: 22px; }
.faq-item.open .faq-icon { transform: rotate(45deg); }

/* Glow CTA */
.glow-cta { position: relative; overflow: hidden; }
.glow-cta::after {
  content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
  background: conic-gradient(from 0deg, transparent, rgba(25,143,217,0.15), transparent 30%);
  animation: rotateGlow 4s linear infinite; opacity: 0; transition: opacity .3s;
}
.glow-cta:hover::after { opacity: 1; }
@keyframes rotateGlow { from { transform: rotate(0); } to { transform: rotate(360deg); } }

/* Marquee logos */
.logo-marquee { overflow: hidden; padding: 30px 0; }
.logo-marquee-track { display: flex; gap: 50px; align-items: center; animation: scrollX 25s linear infinite; }
.logo-marquee-track .client-logo {
  font-size: 22px; font-weight: 700; color: var(--text-muted); opacity: 0.5; white-space: nowrap;
  transition: opacity .2s;
}
.logo-marquee-track .client-logo:hover { opacity: 1; color: var(--text); }

/* Testimonials grid (responsive) */
.testimonials-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 980px) { .testimonials-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 680px) { .testimonials-grid { grid-template-columns: 1fr; } }

@media (max-width: 680px) {
  .cursor-glow { display: none; }
  .scroll-top { bottom: 20px; left: 20px; }
  .testimonial-card { padding: 24px; }
  .faq-q { font-size: 15px; }
  .testimonial-quote { font-size: 40px; }
}