/* motion.css — Shared animation styles for all Amerikana pages */

/* ── Scroll-triggered animations ─────────────────────────────── */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.fade-up.in-view {
  opacity: 1;
  transform: translateY(0);
}

.fade-in {
  opacity: 0;
  transition: opacity 0.8s ease;
}
.fade-in.in-view {
  opacity: 1;
}

.slide-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.slide-left.in-view {
  opacity: 1;
  transform: translateX(0);
}

.slide-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.slide-right.in-view {
  opacity: 1;
  transform: translateX(0);
}

.scale-in {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.scale-in.in-view {
  opacity: 1;
  transform: scale(1);
}

/* ── Stagger children ────────────────────────────────────────── */
.stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.stagger.in-view > * {
  opacity: 1;
  transform: translateY(0);
}

/* ── Parallax container ──────────────────────────────────────── */
.parallax-section {
  position: relative;
  overflow: hidden;
}
.parallax-bg {
  position: absolute;
  inset: -20%;
  z-index: -1;
  will-change: transform;
}

/* ── Particle canvas ─────────────────────────────────────────── */
.particle-container {
  position: relative;
  overflow: hidden;
}
.particle-container canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
.particle-container > *:not(canvas) {
  position: relative;
  z-index: 1;
}

/* ── Glow effects ────────────────────────────────────────────── */
.glow-cyan {
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.1), 0 0 60px rgba(0, 240, 255, 0.05);
}
.glow-purple {
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.1), 0 0 60px rgba(139, 92, 246, 0.05);
}
.glow-magenta {
  box-shadow: 0 0 20px rgba(255, 45, 122, 0.1), 0 0 60px rgba(255, 45, 122, 0.05);
}
.glow-green {
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.1), 0 0 60px rgba(0, 255, 136, 0.05);
}

/* ── Pulse animation ─────────────────────────────────────────── */
.pulse {
  animation: pulse-glow 3s ease-in-out infinite;
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 10px rgba(0, 240, 255, 0.1); }
  50% { box-shadow: 0 0 30px rgba(0, 240, 255, 0.25); }
}

/* ── Float animation ─────────────────────────────────────────── */
.float {
  animation: float 6s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ── Gradient border animation ───────────────────────────────── */
.gradient-border {
  position: relative;
  background: var(--surface);
  border-radius: 4px;
  overflow: hidden;
}
.gradient-border::before {
  content: '';
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--cyan), var(--purple), var(--magenta), var(--green));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: gradient-rotate 4s linear infinite;
  background-size: 300% 300%;
}
@keyframes gradient-rotate {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ── Flow diagram ────────────────────────────────────────────── */
.flow-node {
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.5s ease;
}
.flow-node.flow-active {
  opacity: 1;
  transform: scale(1);
}
.flow-line {
  opacity: 0;
  transition: opacity 0.5s ease;
}
.flow-line.flow-active {
  opacity: 1;
}

/* ── Counter highlight ───────────────────────────────────────── */
[data-count] {
  font-variant-numeric: tabular-nums;
}

/* ── Compression chart container ─────────────────────────────── */
#compression-chart {
  width: 100%;
  min-height: 200px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 4px;
  padding: 16px;
  margin: 24px 0;
}

/* ── Hover lift ──────────────────────────────────────────────── */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

/* ── Text shimmer ────────────────────────────────────────────── */
.shimmer {
  background: linear-gradient(90deg, var(--text) 0%, var(--cyan) 50%, var(--text) 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 3s ease-in-out infinite;
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
