/* ============================================================
   SILVER FERN - Animations & Motion
   Taste-skill compliance: MOTION_INTENSITY 5
   - Hero entry animation
   - Scroll-reveal (.reveal class)
   - Hover physics on cards and CTAs
   - Nav scroll-state
   ============================================================ */

/* 1. Hero Entry */
@keyframes sf-rise {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes sf-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.hero-eyebrow  { animation: sf-rise 0.55s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both; }
.hero-headline { animation: sf-rise 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.22s both; }
.hero-subtext  { animation: sf-rise 0.6s  cubic-bezier(0.16, 1, 0.3, 1) 0.38s both; }
.hero-ctas     { animation: sf-rise 0.55s cubic-bezier(0.16, 1, 0.3, 1) 0.52s both; }
.hero-image    { animation: sf-fade-in 1.1s ease 0.05s both; }

/* 2. Scroll Reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
/* Stagger children inside a reveal group */
.reveal-group > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal-group.is-visible > * {
  opacity: 1;
  transform: translateY(0);
}
.reveal-group.is-visible > *:nth-child(1) { transition-delay: 0.05s; opacity:1; transform:none; }
.reveal-group.is-visible > *:nth-child(2) { transition-delay: 0.12s; opacity:1; transform:none; }
.reveal-group.is-visible > *:nth-child(3) { transition-delay: 0.19s; opacity:1; transform:none; }
.reveal-group.is-visible > *:nth-child(4) { transition-delay: 0.26s; opacity:1; transform:none; }
.reveal-group.is-visible > *:nth-child(5) { transition-delay: 0.33s; opacity:1; transform:none; }
.reveal-group.is-visible > *:nth-child(6) { transition-delay: 0.40s; opacity:1; transform:none; }

/* Ensure equipment catalog grid cards and tables are immediately visible without scroll delays */
#product-grid > *,
.equipment-catalog-container .product-card,
.equipment-catalog-container .b2b-data-table-wrap,
#table-view-container {
  opacity: 1;
  transform: none;
}

/* 3. Hover Physics - Product Cards */
.product-card {
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.22s ease;
  will-change: transform;
}
.product-card:hover {
  transform: translateY(-5px) scale(1.012);
  box-shadow: 0 16px 36px rgba(27, 67, 50, 0.14);
}
/* Active press feedback */
.product-card:active {
  transform: translateY(-1px) scale(0.99);
  transition-duration: 0.08s;
}

/* 4. Hover Physics - Primary Buttons */
.btn {
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.18s ease,
              background-color 0.15s ease,
              border-color 0.15s ease;
  will-change: transform;
}
.btn:hover {
  transform: translateY(-2px);
}
.btn:active {
  transform: translateY(0) scale(0.98);
  transition-duration: 0.06s;
}
.btn-primary:hover {
  box-shadow: 0 8px 24px rgba(255, 90, 0, 0.35);
}
.btn-canopy:hover, .btn-primary-canopy:hover {
  box-shadow: 0 8px 24px rgba(27, 67, 50, 0.3);
}

/* 5. Nav - Scroll-elevated state */
.site-nav {
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}
.site-nav.scrolled {
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
  background-color: var(--color-canopy-dark, #132E22);
}

/* ── 6. Nav Link hover underline ── */
.nav-link {
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0; right: 0;
  height: 2px;
  background: var(--color-highvis);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.nav-link:hover::after,
.nav-link.active::after { transform: scaleX(1); }

/* ── 7. Service Cards hover ── */
.service-card {
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.22s ease,
              border-color 0.2s ease;
}
.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(27, 67, 50, 0.12);
  border-color: var(--color-canopy-mid);
}

/* ── 8. Compliance & Info Cards hover ── */
.compliance-card {
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.2s ease;
}
.compliance-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.08);
}

/* ── 9. Trust Badge strip micro-animation ── */
.trust-badge {
  transition: transform 0.18s ease, color 0.18s ease;
}
.trust-badge:hover {
  transform: translateY(-2px);
  color: var(--color-canopy);
}

/* ── 10. Quote badge pulse when item added ── */
@keyframes sf-badge-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.45); }
  70%  { transform: scale(0.92); }
  100% { transform: scale(1); }
}
.nav-quote-badge.pop { animation: sf-badge-pop 0.38s cubic-bezier(0.34, 1.56, 0.64, 1); }

/* ── 11. Add-to-quote button success transition ── */
.add-quote-btn {
  transition: background-color 0.25s ease, color 0.25s ease,
              transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── 12. Page-in fade (applied to main) ── */
@keyframes sf-page-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
main { animation: sf-page-in 0.35s ease both; }

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