/* ============================================================
   Cleaning House — ch-animations.css
   Animations, transitions, scroll effects
   ============================================================ */

/* ── Keyframes ─────────────────────────────────────────────── */
@keyframes ch-fade-up {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes ch-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes ch-fade-left {
  from { opacity: 0; transform: translateX(28px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes ch-fade-right {
  from { opacity: 0; transform: translateX(-28px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes ch-scale-in {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes ch-float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-12px); }
}

@keyframes ch-pulse-ring {
  0%   { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.6); opacity: 0; }
}

@keyframes ch-shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes ch-spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes ch-bounce-soft {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

@keyframes ch-blob-morph {
  0%, 100% { border-radius: 60% 40% 70% 30% / 50% 60% 40% 50%; }
  25%       { border-radius: 40% 60% 30% 70% / 60% 40% 60% 40%; }
  50%       { border-radius: 50% 50% 50% 50% / 40% 70% 30% 60%; }
  75%       { border-radius: 70% 30% 60% 40% / 50% 40% 60% 50%; }
}

@keyframes ch-text-reveal {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0% 0 0); }
}

@keyframes ch-counter-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Scroll Reveal Classes ─────────────────────────────────── */
.ch-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.ch-reveal-left {
  opacity: 0;
  transform: translateX(-28px);
  transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.ch-reveal-right {
  opacity: 0;
  transform: translateX(28px);
  transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.ch-reveal-scale {
  opacity: 0;
  transform: scale(0.94);
  transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.ch-revealed {
  opacity: 1 !important;
  transform: none !important;
}

/* Stagger delays */
.ch-delay-1 { transition-delay: 0.1s; }
.ch-delay-2 { transition-delay: 0.2s; }
.ch-delay-3 { transition-delay: 0.3s; }
.ch-delay-4 { transition-delay: 0.4s; }
.ch-delay-5 { transition-delay: 0.5s; }
.ch-delay-6 { transition-delay: 0.6s; }

/* ── Entrance animations (immediate) ──────────────────────── */
.ch-anim-fade-up {
  animation: ch-fade-up 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.ch-anim-fade-in {
  animation: ch-fade-in 0.6s ease both;
}

.ch-anim-scale-in {
  animation: ch-scale-in 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

/* ── Persistent animations ─────────────────────────────────── */
.ch-anim-float {
  animation: ch-float 4s ease-in-out infinite;
}

.ch-anim-float-slow {
  animation: ch-float 6s ease-in-out infinite;
}

.ch-anim-float-delay {
  animation: ch-float 4.5s ease-in-out infinite;
  animation-delay: 1.5s;
}

.ch-anim-spin-slow {
  animation: ch-spin-slow 30s linear infinite;
}

.ch-anim-bounce-soft {
  animation: ch-bounce-soft 2.5s ease-in-out infinite;
}

/* ── Blob decorations ──────────────────────────────────────── */
.ch-blob-decoration {
  position: absolute;
  border-radius: 60% 40% 70% 30% / 50% 60% 40% 50%;
  animation: ch-blob-morph 12s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

.ch-blob-sage {
  background: radial-gradient(circle, rgba(107,143,113,0.18) 0%, rgba(107,143,113,0.05) 70%);
}

.ch-blob-sky {
  background: radial-gradient(circle, rgba(122,167,184,0.18) 0%, rgba(122,167,184,0.05) 70%);
}

.ch-blob-sand {
  background: radial-gradient(circle, rgba(201,185,154,0.2) 0%, rgba(201,185,154,0.05) 70%);
}

/* ── Shimmer loading effect ────────────────────────────────── */
.ch-shimmer {
  background: linear-gradient(
    90deg,
    var(--ch-sand-pale) 25%,
    var(--ch-sand-light) 50%,
    var(--ch-sand-pale) 75%
  );
  background-size: 200% auto;
  animation: ch-shimmer 1.8s linear infinite;
}

/* ── Hover effects ─────────────────────────────────────────── */
.ch-hover-lift {
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              box-shadow 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.ch-hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 50px rgba(37,45,43,0.13);
}

.ch-hover-img-zoom {
  overflow: hidden;
}

.ch-hover-img-zoom img {
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.ch-hover-img-zoom:hover img {
  transform: scale(1.04);
}

/* ── Pulse ring (active indicator) ────────────────────────── */
.ch-pulse-ring {
  position: relative;
}

.ch-pulse-ring::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid var(--ch-sage);
  animation: ch-pulse-ring 2s ease-out infinite;
}

/* ── Number counter animation ──────────────────────────────── */
.ch-stat-number {
  display: inline-block;
  animation: ch-counter-up 0.6s ease both;
}

/* ── Testimonial slide ─────────────────────────────────────── */
.ch-testimonial-track {
  display: flex;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ── Before/after slider ───────────────────────────────────── */
.ch-before-after-container {
  position: relative;
  overflow: hidden;
  border-radius: var(--ch-radius-lg);
  cursor: col-resize;
  user-select: none;
}

.ch-ba-after-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.ch-ba-clip {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  overflow: hidden;
}

.ch-ba-clip img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ch-ba-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: white;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
}

.ch-ba-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 16px rgba(37,45,43,0.2);
  z-index: 11;
  cursor: col-resize;
}

.ch-ba-handle svg {
  width: 20px;
  height: 20px;
  stroke: var(--ch-slate);
}

.ch-ba-label {
  position: absolute;
  top: 1rem;
  padding: 0.3rem 0.75rem;
  background: rgba(37,45,43,0.65);
  color: white;
  font-size: 0.78rem;
  font-weight: 500;
  border-radius: var(--ch-radius-pill);
  letter-spacing: 0.05em;
  backdrop-filter: blur(4px);
}

.ch-ba-label-before { left: 1rem; }
.ch-ba-label-after  { right: 1rem; }

/* ── Page transitions ──────────────────────────────────────── */
.ch-page-enter {
  animation: ch-fade-up 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .ch-reveal, .ch-reveal-left, .ch-reveal-right, .ch-reveal-scale {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .ch-anim-float, .ch-anim-float-slow, .ch-anim-float-delay,
  .ch-anim-spin-slow, .ch-anim-bounce-soft, .ch-blob-decoration {
    animation: none;
  }
}
