/* ============================================================
   INTERACTIVE ENHANCEMENTS — Blake Burnett Portfolio
   Custom cursor · Hero blobs · Typewriter · Tilt · Magnetic
   Scroll progress · Section reveals · Counter glow · Sweep
   ============================================================ */

/* ── Custom Cursor ───────────────────────────────────────────── */
@media (pointer: fine) {
  *, *::before, *::after { cursor: none !important; }
}

.cursor-dot {
  position: fixed;
  top: 0; left: 0;
  width: 10px; height: 10px;
  background: #22D3EE;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  will-change: transform;
  opacity: 0;
  transition: width 0.15s ease, height 0.15s ease,
              box-shadow 0.15s ease, background 0.15s ease,
              opacity 0.15s ease;
  box-shadow:
    0 0 0 2px rgba(34, 211, 238, 0.25),
    0 0 14px rgba(34, 211, 238, 0.9),
    0 0 28px rgba(34, 211, 238, 0.4);
}

.cursor-ring {
  position: fixed;
  top: 0; left: 0;
  width: 38px; height: 38px;
  border: 2px solid rgba(34, 211, 238, 0.7);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  will-change: transform;
  opacity: 0;
  transition: width 0.22s ease, height 0.22s ease,
              border-color 0.22s ease, background 0.22s ease,
              box-shadow 0.22s ease, opacity 0.15s ease;
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.3),
              inset 0 0 8px rgba(34, 211, 238, 0.06);
}

.cursor-dot.cursor-hover {
  width: 14px; height: 14px;
  background: #22D3EE;
  box-shadow:
    0 0 0 3px rgba(34, 211, 238, 0.3),
    0 0 22px rgba(34, 211, 238, 1),
    0 0 44px rgba(34, 211, 238, 0.5);
}

.cursor-ring.cursor-hover {
  width: 58px; height: 58px;
  border-color: rgba(34, 211, 238, 0.85);
  background: rgba(34, 211, 238, 0.04);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.45),
              inset 0 0 12px rgba(34, 211, 238, 0.08);
}

/* ── Hero Interactive Grid ───────────────────────────────────── */
#hero-grid {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 1;
}

/* ── Animated Hero Blobs ─────────────────────────────────────── */
.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  opacity: 1;
  will-change: transform;
}

.blob-1 {
  width: 640px; height: 520px;
  background: radial-gradient(ellipse, rgba(139, 92, 246, 0.22) 0%, transparent 68%);
  top: -8%; right: -4%;
  animation: blobDrift1 14s ease-in-out infinite;
}

.blob-2 {
  width: 420px; height: 480px;
  background: radial-gradient(ellipse, rgba(34, 211, 238, 0.11) 0%, transparent 68%);
  bottom: 5%; left: 5%;
  animation: blobDrift2 17s ease-in-out infinite;
}

.blob-3 {
  width: 380px; height: 360px;
  background: radial-gradient(ellipse, rgba(167, 139, 250, 0.13) 0%, transparent 68%);
  top: 28%; left: 38%;
  animation: blobDrift3 20s ease-in-out infinite;
}

@keyframes blobDrift1 {
  0%, 100% { transform: translate(0,    0)   scale(1);    }
  35%       { transform: translate(-28px, 22px) scale(1.06); }
  68%       { transform: translate(22px, -16px) scale(0.97); }
}

@keyframes blobDrift2 {
  0%, 100% { transform: translate(0,    0)    scale(1);    }
  42%       { transform: translate(38px, -22px) scale(1.09); }
  74%       { transform: translate(-22px, 28px) scale(0.94); }
}

@keyframes blobDrift3 {
  0%, 100% { transform: translate(0,    0)    scale(1);    }
  28%       { transform: translate(-22px, -28px) scale(1.04); }
  62%       { transform: translate(32px, 18px)  scale(1.08); }
}

/* ── Typewriter cursor ──────────────────────────────────────── */
.tw-cursor {
  display: inline-block;
  color: var(--accent-violet-light);
  font-weight: 300;
  animation: twBlink 0.75s step-start infinite;
  margin-left: 1px;
  opacity: 1;
  transition: opacity 0.4s ease;
}

@keyframes twBlink {
  50% { opacity: 0; }
}

/* ── Scroll Progress Bar ────────────────────────────────────── */
.scroll-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-violet), var(--accent-cyan));
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.5), 0 0 20px rgba(34, 211, 238, 0.2);
  z-index: 110;
  border-radius: 0 2px 2px 0;
  pointer-events: none;
}

/* Nav needs position relative for the absolute bar */
.nav { position: fixed; overflow: visible; }

/* ── Section Label Slide-in ─────────────────────────────────── */
.slide-label {
  opacity: 0;
  transform: translateX(-18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.slide-label.slide-visible {
  opacity: 1;
  transform: translateX(0);
}

/* ── Counter Glow Burst ─────────────────────────────────────── */
@keyframes counterGlow {
  0%   { text-shadow: none; }
  25%  { text-shadow: 0 0 18px rgba(34, 211, 238, 0.9), 0 0 36px rgba(34, 211, 238, 0.4); }
  100% { text-shadow: 0 0 6px rgba(34, 211, 238, 0.25); }
}

.counter-done {
  animation: counterGlow 1.2s ease forwards;
}

/* ── Dual-row Marquee ───────────────────────────────────────── */
.marquee-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.marquee-track-reverse {
  animation: marqueeReverse 36s linear infinite;
}

@keyframes marqueeReverse {
  0%   { transform: translateX(-50%); }
  100% { transform: translateX(0); }
}

/* ── Testimonial Glow Sweep ─────────────────────────────────── */
.testimonial-card {
  position: relative;
  overflow: hidden;
}

.testimonial-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    108deg,
    transparent 25%,
    rgba(139, 92, 246, 0.05) 45%,
    rgba(167, 139, 250, 0.10) 52%,
    rgba(139, 92, 246, 0.05) 58%,
    transparent 75%
  );
  background-size: 300% 100%;
  background-position: -100% 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.testimonial-card.sweep-active::after {
  opacity: 1;
  animation: sweepAcross 0.85s ease forwards;
}

@keyframes sweepAcross {
  from { background-position: -100% 0; }
  to   { background-position: 250% 0; }
}

/* ── Card Tilt — 3D setup ───────────────────────────────────── */
.service-card,
.cs-card,
.blog-card {
  transform-style: preserve-3d;
  will-change: transform;
}

/* Inner highlight that tracks cursor */
.tilt-shine {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.service-card:hover .tilt-shine,
.cs-card:hover .tilt-shine,
.blog-card:hover .tilt-shine {
  opacity: 1;
}

/* ── Magnetic button reset override ────────────────────────── */
/* Prevent transition conflict with magnetic JS */
.hero-ctas .btn,
.footer-cta-section .btn-primary {
  transition: background var(--transition-normal),
              box-shadow var(--transition-normal),
              color var(--transition-normal),
              border-color var(--transition-normal);
}

/* ── Reduced motion: disable all new animations ─────────────── */
@media (prefers-reduced-motion: reduce) {
  .hero-blob,
  .tw-cursor,
  .counter-done,
  .testimonial-card.sweep-active::after,
  .slide-label {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .cursor-dot, .cursor-ring { display: none; }
}
