/* Carey Creative — Home and Services page motion.
   Hero entrance runs on load in pure CSS; scroll reveals are driven by
   js/animations.js, which adds the .reveal class, so everything stays
   visible without JavaScript. All motion is switched
   off for visitors who prefer reduced motion. */

:root {
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --reveal-distance: 28px;
  --reveal-duration: .8s;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: none; }
}
@keyframes fade-down {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: none; }
}
@keyframes rise-line {
  from { opacity: 0; transform: translateY(60%); }
  to   { opacity: 1; transform: none; }
}
@keyframes gradient-slide {
  from { background-position: 0% 50%; }
  to   { background-position: 200% 50%; }
}
@keyframes gradient-drift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
@keyframes panel-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Hero entrance ---------- */
.hero .nav { animation: fade-down .7s var(--ease-out) both; }
.home-hero__kicker { animation: fade-up .8s var(--ease-out) .15s both; }
.home-hero__line { display: block; animation: rise-line .9s var(--ease-out) both; }
.home-hero__line:nth-child(1) { animation-delay: .3s; }
.home-hero__line:nth-child(2) { animation-delay: .45s; }
.home-hero__line:nth-child(3) { animation-delay: .6s; }
.home-hero .hero__lede { animation: fade-up .9s var(--ease-out) .8s both; }
.home-hero__cta { animation: fade-up .9s var(--ease-out) .95s both; }

/* Services hero */
.hero__kicker { animation: fade-up .8s var(--ease-out) .15s both; }
.hero__title { animation: rise-line .9s var(--ease-out) .3s both; }
.hero__body:not(.home-hero) .hero__lede { animation: fade-up .9s var(--ease-out) .55s both; }
.hero__cta { animation: fade-up .9s var(--ease-out) .7s both; }

/* ---------- Living gradients ---------- */
.gradient-rule {
  background: linear-gradient(90deg, var(--indigo-500), #d9a4b8, var(--orange-500), #d9a4b8, var(--indigo-500));
  background-size: 200% 100%;
  animation: gradient-slide 8s linear infinite;
}
.built-for {
  background-size: 200% 200%;
  animation: gradient-drift 16s ease-in-out infinite;
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(var(--reveal-distance));
  transition:
    opacity var(--reveal-duration) var(--ease-out),
    transform var(--reveal-duration) var(--ease-out);
  transition-delay: var(--reveal-delay, 0s);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Hover polish ---------- */
.card, .tier, .fit-card { transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out); }
.card:hover, .tier:hover { transform: translateY(-4px); box-shadow: var(--shadow-card-lg); }
.card--dark:hover { box-shadow: 0 12px 32px rgba(0, 0, 0, .35); }
.card__icon { transition: transform .3s var(--ease-out), background .3s ease; }
.card:hover .card__icon { transform: scale(1.08) rotate(-4deg); }
.btn span[aria-hidden="true"] { transition: transform .2s var(--ease-out); }
.btn:hover span[aria-hidden="true"] { transform: translateX(4px); }

/* Services cards */
.svc-card { transition: transform .3s var(--ease-out), border-color .3s ease, box-shadow .3s var(--ease-out); }
.svc-card:hover { transform: translateY(-6px); border-color: var(--indigo-500); box-shadow: 0 16px 40px rgba(0, 0, 0, .4); }
.svc-card__num { transition: background .3s ease, color .3s ease; }
.svc-card:hover .svc-card__num { background: var(--indigo-500); color: var(--paper); }
.svc-card__go span { transition: transform .2s var(--ease-out); }
.svc-card:hover .svc-card__go span { transform: translateX(4px); }
.connect-card, .stat { transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out); }
.connect-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0, 0, 0, .35); }
.stat:hover { transform: translateY(-4px); box-shadow: var(--shadow-card-lg); }

/* ---------- Accordion ---------- */
.accordion__panel:not([hidden]) { animation: panel-in .35s var(--ease-out); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .reveal { opacity: 1; transform: none; }
}
