/* ============================================================
   THE TOOTH DENTAL CARE — animations.css
   ============================================================ */

/* ── Scroll Animation States ────────────────────────────────── */
[data-animate] {
  opacity: 0;
  transition-property: opacity, transform;
  transition-duration: 0.7s;
  transition-timing-function: cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: opacity, transform;
}

[data-animate="fade-up"]    { transform: translateY(36px); }
[data-animate="fade-down"]  { transform: translateY(-36px); }
[data-animate="fade-left"]  { transform: translateX(40px); }
[data-animate="fade-right"] { transform: translateX(-40px); }
[data-animate="zoom-in"]    { transform: scale(0.9); }
[data-animate="zoom-up"]    { transform: scale(0.92) translateY(24px); }

[data-animate].is-visible {
  opacity: 1;
  transform: none;
}

/* Stagger delays for grid children.
   Scalable rule: reveals ALL children (not just the first N) so any
   number of future cards get the same opacity/transform treatment.
   Per-child stagger timing is still handled by the [data-delay="..."]
   attribute set on each card in the markup. */
[data-stagger] > * { opacity: 0; transform: translateY(28px); transition: opacity 0.6s cubic-bezier(0.22,0.61,0.36,1), transform 0.6s cubic-bezier(0.22,0.61,0.36,1); }
[data-stagger].is-visible > * { opacity: 1; transform: none; }

/* Transition delays */
[data-delay="0"]    { transition-delay: 0ms !important; }
[data-delay="100"]  { transition-delay: 100ms !important; }
[data-delay="200"]  { transition-delay: 200ms !important; }
[data-delay="300"]  { transition-delay: 300ms !important; }
[data-delay="400"]  { transition-delay: 400ms !important; }
[data-delay="500"]  { transition-delay: 500ms !important; }
[data-delay="600"]  { transition-delay: 600ms !important; }
[data-delay="700"]  { transition-delay: 700ms !important; }
[data-delay="800"]  { transition-delay: 800ms !important; }
[data-delay="900"]  { transition-delay: 900ms !important; }
[data-delay="1000"] { transition-delay: 1000ms !important; }
[data-delay="1100"] { transition-delay: 1100ms !important; }
[data-delay="1200"] { transition-delay: 1200ms !important; }

/* ── Hero Entrance Animations ───────────────────────────────── */
.hero-badge {
  opacity: 0;
  transform: translateY(16px);
  animation: heroItemIn 0.65s 0.5s cubic-bezier(0.22,0.61,0.36,1) forwards;
}

.hero-heading {
  opacity: 0;
  transform: translateY(24px);
  animation: heroItemIn 0.72s 0.65s cubic-bezier(0.22,0.61,0.36,1) forwards;
}

.hero-desc {
  opacity: 0;
  transform: translateY(20px);
  animation: heroItemIn 0.65s 0.8s cubic-bezier(0.22,0.61,0.36,1) forwards;
}

.hero-actions {
  opacity: 0;
  transform: translateY(16px);
  animation: heroItemIn 0.65s 0.95s cubic-bezier(0.22,0.61,0.36,1) forwards;
}

.hero-trust {
  opacity: 0;
  transform: translateY(12px);
  animation: heroItemIn 0.65s 1.1s cubic-bezier(0.22,0.61,0.36,1) forwards;
}

.hero-card {
  opacity: 0;
  transform: translateX(30px) translateY(10px);
  animation: heroCardIn 0.8s 0.9s cubic-bezier(0.22,0.61,0.36,1) forwards;
}

@keyframes heroItemIn {
  to { opacity: 1; transform: none; }
}

@keyframes heroCardIn {
  to { opacity: 1; transform: translateY(0); }
}

/* ── Button Ripple ──────────────────────────────────────────── */
.btn-primary,
.btn-sage,
.nav-book {
  position: relative;
  overflow: hidden;
}

.btn-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.28);
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
}

@keyframes ripple {
  to { transform: scale(4); opacity: 0; }
}

/* ── Card Lift Micro-interaction ────────────────────────────── */
.why-card, .intro-feature {
  will-change: transform;
}

/* ── Ticker (optional marquee feel for hero trust) ──────────── */
@keyframes tickUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* ── Navbar Slide In ────────────────────────────────────────── */
.navbar {
  animation: navbarIn 0.5s 0.1s cubic-bezier(0.22,0.61,0.36,1) both;
}

@keyframes navbarIn {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Counter Flip ───────────────────────────────────────────── */
.counter-number {
  transition: color 0.3s;
}

/* Pulse on counter complete */
@keyframes counterPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.counter-done { animation: counterPop 0.4s cubic-bezier(0.22,0.61,0.36,1); }

/* ── Section divider line ───────────────────────────────────── */
.section-line {
  display: block;
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, var(--sage), var(--green-dark));
  border-radius: 3px;
  margin-bottom: 28px;
}

/* ── Image Zoom on Hover ────────────────────────────────────── */
.intro-img-wrap img {
  transition: transform 0.6s cubic-bezier(0.22,0.61,0.36,1);
}

.intro-img-wrap:hover img { transform: scale(1.04); }

/* ── Reduced Motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .hero-card { animation: none !important; transform: none !important; opacity: 1 !important; }
  .hero-bg-image { animation: none !important; }
  [data-animate] { opacity: 1 !important; transform: none !important; }
  [data-stagger] > * { opacity: 1 !important; transform: none !important; }
}
