/* Final Polish - Cool Vibes & Micro-interactions */

/* Smooth scroll with offset for sticky header */
html {
  scroll-padding-top: 100px;
}

/* Cursor glow effect */
body {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32"><circle cx="16" cy="16" r="8" fill="rgba(124,58,237,0.3)"/><circle cx="16" cy="16" r="3" fill="white"/></svg>') 16 16, auto;
}

/* Animated gradient background on hover for links */
a {
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Nav links with smooth underline animation */
.nav__link {
  position: relative;
  overflow: hidden;
}

.nav__link::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #7c3aed, #22d3ee);
  transform: translateX(-50%);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav__link:hover::before {
  width: 100%;
}

/* Floating animation for cards */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.card, .river__item, .feature, .neurozen-card {
  animation: float 6s ease-in-out infinite;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:nth-child(1) { animation-delay: 0s; }
.card:nth-child(2) { animation-delay: 0.5s; }
.card:nth-child(3) { animation-delay: 1s; }
.card:nth-child(4) { animation-delay: 1.5s; }

.river__item:nth-child(1) { animation-delay: 0s; }
.river__item:nth-child(2) { animation-delay: 0.3s; }
.river__item:nth-child(3) { animation-delay: 0.6s; }
.river__item:nth-child(4) { animation-delay: 0.9s; }
.river__item:nth-child(5) { animation-delay: 1.2s; }
.river__item:nth-child(6) { animation-delay: 1.5s; }

/* Hover glow effect */
.card:hover, .river__item:hover, .feature:hover, .neurozen-card:hover {
  transform: translateY(-12px) scale(1.02);
  box-shadow: 
    0 20px 60px rgba(124, 58, 237, 0.4),
    0 0 0 1px rgba(124, 58, 237, 0.5) inset,
    0 0 40px rgba(34, 211, 238, 0.3);
  animation: none;
}

/* Shimmer effect on hover */
@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}

.card::after, .river__item::after, .neurozen-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(124, 58, 237, 0.1),
    transparent
  );
  background-size: 1000px 100%;
  animation: shimmer 3s infinite;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

.card:hover::after, .river__item:hover::after, .neurozen-card:hover::after {
  opacity: 1;
}

/* Button pulse effect */
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.7); }
  50% { box-shadow: 0 0 0 10px rgba(124, 58, 237, 0); }
}

.btn--primary, .nav__cta {
  animation: pulse 2s infinite;
}

.btn--primary:hover, .nav__cta:hover {
  animation: none;
  transform: translateY(-2px) scale(1.05);
  box-shadow: 
    0 20px 50px rgba(124, 58, 237, 0.6),
    0 0 0 1px rgba(124, 58, 237, 0.8) inset;
}

/* Smooth fade-in for sections */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section {
  animation: fadeInUp 0.8s ease-out;
  animation-fill-mode: both;
}

.section:nth-child(1) { animation-delay: 0.1s; }
.section:nth-child(2) { animation-delay: 0.2s; }
.section:nth-child(3) { animation-delay: 0.3s; }
.section:nth-child(4) { animation-delay: 0.4s; }
.section:nth-child(5) { animation-delay: 0.5s; }

/* Glowing text effect for titles */
.section__title {
  position: relative;
  display: inline-block;
  animation: glow 3s ease-in-out infinite;
}

@keyframes glow {
  0%, 100% {
    text-shadow: 
      0 0 10px rgba(124, 58, 237, 0.5),
      0 0 20px rgba(124, 58, 237, 0.3),
      0 0 30px rgba(124, 58, 237, 0.2);
  }
  50% {
    text-shadow: 
      0 0 20px rgba(124, 58, 237, 0.8),
      0 0 30px rgba(124, 58, 237, 0.6),
      0 0 40px rgba(124, 58, 237, 0.4);
  }
}

/* Parallax effect on scroll */
.hero__content {
  transform-style: preserve-3d;
}

.glitch {
  transform: translateZ(50px);
}

.subtitle {
  transform: translateZ(30px);
}

.lede {
  transform: translateZ(20px);
}

/* Smooth transitions for all interactive elements */
* {
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Logo rotation on hover */
.brand__logo {
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.brand:hover .brand__logo {
  transform: rotate(360deg) scale(1.1);
}

/* Metrics counter animation */
.metric__num, .neurozen-metric__num {
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 8px;
}

.metric__label {
  display: block;
  margin-top: 4px;
}

.metric:hover .metric__num, .neurozen-metric:hover .neurozen-metric__num {
  transform: scale(1.2);
}

/* Input focus glow */
input:focus, textarea:focus {
  box-shadow: 
    0 0 0 3px rgba(124, 58, 237, 0.3),
    0 0 20px rgba(124, 58, 237, 0.2);
  border-color: #7c3aed;
  transform: translateY(-2px);
}

/* Smooth page transitions */
@keyframes pageLoad {
  from {
    opacity: 0;
    filter: blur(10px);
  }
  to {
    opacity: 1;
    filter: blur(0);
  }
}

body {
  animation: pageLoad 0.6s ease-out;
}

/* Header blur on scroll */
.site-header {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.site-header.scrolled {
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.95);
}

/* Gradient border animation */
@keyframes borderGlow {
  0%, 100% {
    border-color: rgba(124, 58, 237, 0.4);
  }
  50% {
    border-color: rgba(34, 211, 238, 0.6);
  }
}

.card, .river__item, .neurozen-card {
  animation: borderGlow 3s ease-in-out infinite;
}

/* Text selection styling */
::selection {
  background: rgba(124, 58, 237, 0.3);
  color: #fff;
}

::-moz-selection {
  background: rgba(124, 58, 237, 0.3);
  color: #fff;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: #020617;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #7c3aed, #22d3ee);
  border-radius: 6px;
  border: 2px solid #020617;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #a855f7, #38bdf8);
}

/* Particle effect on hover */
@keyframes particle {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--tx), var(--ty)) scale(0);
    opacity: 0;
  }
}

/* Badge pulse */
.neurozen-badge {
  animation: pulse 2s ease-in-out infinite;
}

/* Footer fade in */
.site-footer {
  animation: fadeInUp 0.8s ease-out 0.6s both;
}

/* Smooth color transitions */
.nav__link, .btn, .card, .river__item, .feature, .neurozen-card {
  transition: 
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    background 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Stagger animation for features */
.feature {
  opacity: 0;
  animation: fadeInUp 0.6s ease-out forwards;
}

.feature:nth-child(1) { animation-delay: 0.1s; }
.feature:nth-child(2) { animation-delay: 0.2s; }
.feature:nth-child(3) { animation-delay: 0.3s; }

/* Hero CTA buttons stagger */
.hero-actions .btn {
  opacity: 0;
  animation: fadeInUp 0.6s ease-out forwards;
}

.hero-actions .btn:nth-child(1) { animation-delay: 0.3s; }
.hero-actions .btn:nth-child(2) { animation-delay: 0.4s; }

/* Metrics stagger animation */
.metric, .neurozen-metric {
  opacity: 0;
  animation: fadeInUp 0.6s ease-out forwards;
}

.metric:nth-child(1), .neurozen-metric:nth-child(1) { animation-delay: 0.2s; }
.metric:nth-child(2), .neurozen-metric:nth-child(2) { animation-delay: 0.3s; }
.metric:nth-child(3), .neurozen-metric:nth-child(3) { animation-delay: 0.4s; }

/* Smooth hover transitions for all headings */
h1, h2, h3, h4, h5, h6 {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card h4:hover, .river__item h4:hover, .neurozen-card h4:hover {
  transform: translateX(5px);
  text-shadow: 0 0 20px rgba(124, 58, 237, 0.6);
}

/* Add subtle breathing animation to hero */
@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

.hero__content {
  animation: breathe 8s ease-in-out infinite;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
