/* ==========================================================================
   ANIMATIONS & INTERACTION ENGINE STYLES
   Mayank Yadav Portfolio — Motion-Rich, Interactive, Web3-Native Aesthetic
   ========================================================================== */

/* ===== 1. Multi-Layer Custom Cursor System (Desktop Only) ===== */
@media (pointer: fine) {
  body.custom-cursor-active,
  body.custom-cursor-active a,
  body.custom-cursor-active button,
  body.custom-cursor-active .btn,
  body.custom-cursor-active .social-icon-link,
  body.custom-cursor-active .nav-toggle,
  body.custom-cursor-active .product-showcase-card,
  body.custom-cursor-active .archive-project-card,
  body.custom-cursor-active .build-card,
  body.custom-cursor-active .identity-glyph-canvas {
    cursor: none !important;
  }

  body.custom-cursor-active input,
  body.custom-cursor-active textarea {
    cursor: text !important;
  }
}

.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 999999;
  transform: translate(-50%, -50%);
  opacity: 0;
  will-change: transform, width, height, top, left;
}

.cursor-dot {
  width: 6px;
  height: 6px;
  background-color: var(--accent-violet, #a78bfa);
  box-shadow: 0 0 10px rgba(167, 139, 250, 0.8), 0 0 4px #a78bfa;
  transition: opacity 0.3s ease, transform 0.15s ease, background-color 0.25s ease;
}

.cursor-ring {
  width: 36px;
  height: 36px;
  border: 1.5px solid rgba(167, 139, 250, 0.45);
  background-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              height 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.25s ease,
              background-color 0.25s ease,
              opacity 0.3s ease,
              box-shadow 0.25s ease,
              border-radius 0.25s ease;
}

.cursor-ring.active,
.cursor-dot.active {
  opacity: 1;
}

.cursor-ring.cursor-clicking {
  transform: translate(-50%, -50%) scale(0.82);
  border-color: var(--accent-cyan, #38bdf8);
}

/* Cursor Contextual Label Badge */
.cursor-label {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #ffffff;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.9);
}

.cursor-label.visible {
  opacity: 1;
  transform: scale(1);
}

/* Cursor States */
.cursor-ring.cursor-hover-link {
  width: 50px;
  height: 50px;
  border-color: var(--accent-violet, #a78bfa);
  background-color: rgba(167, 139, 250, 0.08);
  box-shadow: 0 0 20px rgba(167, 139, 250, 0.25);
}

.cursor-ring.cursor-hover-btn {
  width: 62px;
  height: 62px;
  border-color: var(--accent-violet, #a78bfa);
  background-color: rgba(167, 139, 250, 0.12);
  box-shadow: 0 0 25px rgba(167, 139, 250, 0.35);
}

.cursor-ring.cursor-hover-portal {
  width: 72px;
  height: 72px;
  border-color: var(--accent-cyan, #38bdf8);
  background-color: rgba(56, 189, 248, 0.12);
  box-shadow: 0 0 28px rgba(56, 189, 248, 0.3);
}

.cursor-ring.cursor-hover-project {
  width: 82px;
  height: 82px;
  border-color: rgba(167, 139, 250, 0.45);
  background-color: rgba(167, 139, 250, 0.06);
  backdrop-filter: blur(2px);
}

.cursor-ring.cursor-hover-canvas {
  width: 76px;
  height: 76px;
  border-color: var(--accent-emerald, #34d399);
  background-color: rgba(52, 211, 153, 0.1);
  box-shadow: 0 0 24px rgba(52, 211, 153, 0.25);
}

.cursor-ring.cursor-hover-terminal {
  width: 86px;
  height: 48px;
  border-radius: 12px;
  border-color: var(--accent-cyan, #38bdf8);
  background-color: rgba(15, 23, 42, 0.85);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
}

.cursor-ring.cursor-hover-copy {
  width: 68px;
  height: 68px;
  border-color: var(--accent-emerald, #34d399);
  background-color: rgba(52, 211, 153, 0.12);
  box-shadow: 0 0 22px rgba(52, 211, 153, 0.3);
}

/* Click Ripple Feedback */
.cursor-click-ripple {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 999998;
  transform: translate(-50%, -50%);
  border: 1.5px solid var(--accent-violet, #a78bfa);
  animation: cursorRipple 0.55s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

@keyframes cursorRipple {
  0% {
    width: 0px;
    height: 0px;
    opacity: 0.95;
    border-color: var(--accent-cyan, #38bdf8);
  }
  100% {
    width: 75px;
    height: 75px;
    opacity: 0;
    border-color: rgba(167, 139, 250, 0);
  }
}

/* ===== 2. Hero Magnetic Typography & Character Nodes ===== */
.hero-main-title {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.25em;
  user-select: none;
}

.mag-char-wrap {
  display: inline-block;
  position: relative;
  will-change: transform;
}

.mag-char-inner {
  display: inline-block;
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
  transition: color 0.2s ease, text-shadow 0.2s ease, transform 0.15s ease;
  will-change: transform;
}

[data-founder-last-name] .mag-char-inner,
.hero-main-title .accent-text .mag-char-inner {
  color: var(--accent-violet, #a78bfa);
  -webkit-text-fill-color: var(--accent-violet, #a78bfa);
}

.mag-char-wrap.char-in-light .mag-char-inner {
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
  text-shadow: 0 0 24px rgba(167, 139, 250, 0.8),
               0 0 12px rgba(56, 189, 248, 0.6);
}

/* ===== 3. Procedural 3D Cryptographic Identity Glyph ===== */
.identity-glyph-container {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 80px;
  height: 80px;
  cursor: grab;
  border-radius: 12px;
  background: rgba(15, 15, 22, 0.6);
  border: 1px solid rgba(167, 139, 250, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), inset 0 0 15px rgba(167, 139, 250, 0.05);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.identity-glyph-container:hover {
  border-color: var(--accent-violet, #a78bfa);
  box-shadow: 0 6px 25px rgba(167, 139, 250, 0.25), inset 0 0 20px rgba(167, 139, 250, 0.1);
}

.identity-glyph-container:active {
  cursor: grabbing;
}

.identity-glyph-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* ===== 4. 3D Card Tilt & Mouse Spotlight Sheen ===== */
.product-showcase-card,
.hat-product-card,
.capability-item,
.skill-matrix-card,
.archive-project-card,
.timeline-content,
.community-card,
.social-channel-card,
.about-principles-card,
.conn-card,
.build-card,
.hero-architecture-terminal {
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.3s ease,
              box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

/* Mouse-tracking Radial Spotlight */
.product-showcase-card::before,
.hat-product-card::before,
.capability-item::before,
.skill-matrix-card::before,
.archive-project-card::before,
.social-channel-card::before,
.about-principles-card::before,
.conn-card::before,
.hero-architecture-terminal::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    480px circle at var(--mouse-x, -999px) var(--mouse-y, -999px),
    rgba(167, 139, 250, 0.09),
    transparent 65%
  );
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  border-radius: inherit;
  z-index: 1;
}

.product-showcase-card:hover::before,
.hat-product-card:hover::before,
.capability-item:hover::before,
.skill-matrix-card:hover::before,
.archive-project-card:hover::before,
.social-channel-card:hover::before,
.about-principles-card:hover::before,
.conn-card:hover::before,
.hero-architecture-terminal:hover::before {
  opacity: 1;
}

/* GetNextIn Visual Moment: Neon Icon Glow & Parallax */
.product-visual-app-icon {
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), filter 0.3s ease;
  filter: drop-shadow(0 8px 24px rgba(56, 189, 248, 0.35));
}

.product-showcase-card:hover .product-visual-app-icon {
  filter: drop-shadow(0 12px 32px rgba(56, 189, 248, 0.55));
}

/* ===== 5. 6 Meaningful Easter Eggs Suite Styles ===== */

/* Konami Fullscreen Matrix Beam */
.konami-matrix-beam {
  position: fixed;
  inset: 0;
  z-index: 9999999;
  background: radial-gradient(circle at center, rgba(167, 139, 250, 0.25) 0%, rgba(5, 5, 8, 0.95) 75%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.konami-matrix-beam.active {
  opacity: 1;
  pointer-events: auto;
}

.konami-beam-inner {
  text-align: center;
  padding: 3rem;
  border: 1px solid var(--accent-violet, #a78bfa);
  border-radius: 16px;
  background: rgba(15, 15, 22, 0.9);
  box-shadow: 0 0 60px rgba(167, 139, 250, 0.4), inset 0 0 30px rgba(56, 189, 248, 0.2);
  animation: konamiPulse 2s infinite alternate;
}

@keyframes konamiPulse {
  0% { transform: scale(0.98); box-shadow: 0 0 40px rgba(167, 139, 250, 0.3); }
  100% { transform: scale(1.02); box-shadow: 0 0 80px rgba(56, 189, 248, 0.5); }
}

.konami-beam-glitch {
  font-family: var(--font-mono, monospace);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent-cyan, #38bdf8);
  letter-spacing: 0.15em;
  margin-bottom: 0.75rem;
  text-shadow: 0 0 16px var(--accent-cyan, #38bdf8);
}

.konami-beam-sub {
  font-family: var(--font-mono, monospace);
  font-size: 0.85rem;
  color: var(--text-muted, #94a3b8);
  letter-spacing: 0.08em;
}

/* Brand Logo Surge Spin */
.brand-surge-spin {
  animation: logoSurgeSpin 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes logoSurgeSpin {
  0% { transform: rotate(0deg) scale(1); filter: drop-shadow(0 0 0px var(--accent-violet)); }
  50% { transform: rotate(180deg) scale(1.25); filter: drop-shadow(0 0 20px var(--accent-violet)); }
  100% { transform: rotate(360deg) scale(1); filter: drop-shadow(0 0 0px var(--accent-violet)); }
}

/* Global Notification / Copy Toast */
.hq-global-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: rgba(15, 15, 22, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(167, 139, 250, 0.35);
  padding: 0.7rem 1.3rem;
  border-radius: 24px;
  color: #ffffff;
  font-family: var(--font-mono, monospace);
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65), 0 0 18px rgba(167, 139, 250, 0.25);
  z-index: 9999999;
  opacity: 0;
  transform: translateY(14px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.hq-global-toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ===== 6. Scroll Progress Bar ===== */
.scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 2.5px;
  background: linear-gradient(90deg, #a78bfa, #38bdf8, #34d399);
  z-index: 9999999;
  pointer-events: none;
  transition: width 0.05s ease-out;
  box-shadow: 0 0 12px rgba(167, 139, 250, 0.8);
}

/* ===== 7. Bi-Directional Cross-Highlight Pulse ===== */
.cross-highlight-active {
  border-color: var(--accent-violet, #a78bfa) !important;
  box-shadow: 0 0 30px rgba(167, 139, 250, 0.35), inset 0 0 15px rgba(167, 139, 250, 0.1) !important;
  transform: translateY(-3px) scale(1.01) !important;
}

/* ===== 8. Mobile & Touch Optimizations ===== */
@media (max-width: 768px), (pointer: coarse) {
  .cursor-dot,
  .cursor-ring,
  .cursor-click-ripple {
    display: none !important;
  }

  body.custom-cursor-active,
  body.custom-cursor-active a,
  body.custom-cursor-active button,
  body.custom-cursor-active .btn {
    cursor: auto !important;
  }

  /* Safe tap feedback */
  .btn:active,
  .product-showcase-card:active,
  .social-channel-card:active {
    transform: scale(0.98) !important;
  }
}

/* ===== 9. Accessibility: Prefers Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .cursor-dot,
  .cursor-ring,
  .cursor-click-ripple {
    display: none !important;
  }

  .identity-glyph-canvas {
    opacity: 0.75;
  }
}
