/* ==========================================================================
   AfriGrow Home — Animation system
   Hero entrance timeline, page-load transition, micro-interactions.
   All heavy animation is skipped under prefers-reduced-motion (see style.css).
   ========================================================================== */

/* ----- Page load veil ----- */
.load-veil {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: var(--forest-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s var(--ease-out), visibility 0.6s var(--ease-out);
}

.load-veil.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.load-veil__mark {
  width: 56px;
  height: 56px;
  opacity: 0.9;
  animation: markPulse 1.4s var(--ease-in-out) infinite;
}

@keyframes markPulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.12); opacity: 1; }
}

/* ----- Hero entrance timeline (driven by .is-ready class added via JS) ----- */
.hero__eyebrow,
.hero h1,
.hero__sub,
.hero__actions,
.hero__stats,
.hero__scroll {
  animation: none;
}

.hero.is-ready .hero__eyebrow {
  animation: riseIn 0.9s var(--ease-out) 0.15s forwards;
}

.hero.is-ready h1 {
  animation: riseIn 1.05s var(--ease-out) 0.32s forwards;
}

.hero.is-ready .hero__sub {
  animation: riseIn 0.9s var(--ease-out) 0.55s forwards;
}

.hero.is-ready .hero__actions {
  animation: riseIn 0.9s var(--ease-out) 0.72s forwards;
}

.hero.is-ready .hero__stats {
  animation: riseIn 0.9s var(--ease-out) 0.9s forwards;
}

.hero.is-ready .hero__scroll {
  animation: fadeIn 1s var(--ease-out) 1.4s forwards;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(26px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ----- Button micro-interaction: subtle press ----- */
.btn {
  will-change: transform;
}

.btn:active {
  transform: scale(0.97) translateY(0);
}

/* ----- Nav underline is handled in style.css; add link hover lift ----- */
.footer-col a,
.contact-info-item a {
  transition: color var(--dur-fast) var(--ease-out);
}

/* ----- Basket / product card entrance stagger handled by [data-reveal-group] ----- */

/* ----- Number count-up target style ----- */
.hero__stat b[data-count] {
  display: inline-block;
}

/* ----- Marquee-style ticker for trust strip (optional, subtle) ----- */
.trust-strip {
  overflow: hidden;
  border-top: 1px solid var(--color-line);
  border-bottom: 1px solid var(--color-line);
  padding-block: 1.1rem;
  background: var(--cream);
}

.trust-strip__track {
  display: flex;
  gap: 3.5rem;
  white-space: nowrap;
  animation: marquee 26s linear infinite;
  width: max-content;
}

.trust-strip:hover .trust-strip__track {
  animation-play-state: paused;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.trust-strip__item {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.trust-strip__item svg {
  color: var(--terracotta);
  width: 16px;
  height: 16px;
}

@media (prefers-reduced-motion: reduce) {
  .trust-strip__track {
    animation: none;
  }
  .hero.is-ready .hero__eyebrow,
  .hero.is-ready h1,
  .hero.is-ready .hero__sub,
  .hero.is-ready .hero__actions,
  .hero.is-ready .hero__stats,
  .hero.is-ready .hero__scroll {
    animation: none;
    opacity: 1;
    filter: none;
    transform: none;
  }
}

/* ----- Modal fade for filter transitions on product grid ----- */
.product-grid.is-filtering .product-card {
  transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}

/* ----- Basket tab underline animation on products page ----- */
.basket-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--color-line);
  margin-bottom: 2.5rem;
  overflow-x: auto;
}

.basket-tab {
  padding: 0.85rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-muted);
  position: relative;
  white-space: nowrap;
}

.basket-tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--terracotta);
  transform: scaleX(0);
  transition: transform var(--dur-fast) var(--ease-out);
}

.basket-tab.is-active {
  color: var(--forest-deep);
  font-weight: 600;
}

.basket-tab.is-active::after {
  transform: scaleX(1);
}
