/* ============================================================
   Motion layer — tasteful enhancements on top of the base styles.
   Kept separate so it's easy to tune or remove.
   All autonomous motion is disabled under prefers-reduced-motion.
   ============================================================ */

/* ---------- Orbital arcs: slow continuous spin ---------- */
/* Hero arc keeps its centering translate while it rotates. */
@keyframes es-spin-hero {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}
@keyframes es-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.es-hero__media-arc { animation: es-spin-hero 26s linear infinite; }
.es-about__arc      { animation: es-spin 34s linear infinite reverse; }

/* ---------- Hero eyebrow dot: soft radar ping ---------- */
@keyframes es-ping {
  0%        { box-shadow: 0 0 0 0 rgba(207, 69, 0, 0.45); }
  70%, 100% { box-shadow: 0 0 0 9px rgba(207, 69, 0, 0); }
}
.es-hero .es-eyebrow__dot { animation: es-ping 2.8s ease-out infinite; }

/* ---------- CTA accent orb: slow breathing glow ---------- */
@keyframes es-breathe {
  0%, 100% { transform: scale(1);    opacity: 0.85; }
  50%      { transform: scale(1.14); opacity: 1; }
}
.es-cta__inner::after { animation: es-breathe 9s ease-in-out infinite; }

/* ---------- Staggered reveals within grids & lists ---------- */
/* Children share a viewport entry, so a small per-item delay
   creates a cascade instead of everything popping at once. */
.es-do__grid    .es-card:nth-child(2),
.es-cases__list .es-case:nth-child(2),
.es-proc__list  .es-proc__step:nth-child(2) { transition-delay: 0.08s; }

.es-do__grid    .es-card:nth-child(3),
.es-cases__list .es-case:nth-child(3),
.es-proc__list  .es-proc__step:nth-child(3) { transition-delay: 0.16s; }

.es-do__grid    .es-card:nth-child(4),
.es-proc__list  .es-proc__step:nth-child(4) { transition-delay: 0.24s; }

.es-do__grid    .es-card:nth-child(5) { transition-delay: 0.32s; }
.es-do__grid    .es-card:nth-child(6) { transition-delay: 0.40s; }

.es-proc__list  .es-proc__step:nth-child(5) { transition-delay: 0.32s; }
.es-proc__list  .es-proc__step:nth-child(6) { transition-delay: 0.40s; }

.es-proj__grid .es-proj:nth-child(2) { transition-delay: 0.08s; }
.es-proj__grid .es-proj:nth-child(3) { transition-delay: 0.16s; }
.es-proj__grid .es-proj:nth-child(4) { transition-delay: 0.24s; }
.es-proj__grid .es-proj:nth-child(5) { transition-delay: 0.32s; }
.es-proj__grid .es-proj:nth-child(6) { transition-delay: 0.40s; }
.es-proj__grid .es-proj:nth-child(7) { transition-delay: 0.40s; }

.es-ind__grid .es-ind__tile:nth-child(2) { transition-delay: 0.05s; }
.es-ind__grid .es-ind__tile:nth-child(3) { transition-delay: 0.10s; }
.es-ind__grid .es-ind__tile:nth-child(4) { transition-delay: 0.15s; }
.es-ind__grid .es-ind__tile:nth-child(5) { transition-delay: 0.20s; }
.es-ind__grid .es-ind__tile:nth-child(6) { transition-delay: 0.25s; }
.es-ind__grid .es-ind__tile:nth-child(7) { transition-delay: 0.30s; }
.es-ind__grid .es-ind__tile:nth-child(8) { transition-delay: 0.35s; }
.es-ind__grid .es-ind__tile:nth-child(9) { transition-delay: 0.40s; }

/* Hero entrance cascade */
.es-hero__sub   { transition-delay: 0.08s; }
.es-hero__trust { transition-delay: 0.12s; }
.es-hero__ctas  { transition-delay: 0.16s; }
.es-hero__media { transition-delay: 0.12s; }
.es-cred        { transition-delay: 0.22s; }

/* ---------- Micro-interactions ---------- */
/* Arrow nudge inside buttons */
.es-btn svg { transition: transform 160ms ease; }
.es-btn:hover svg { transform: translateX(3px); }

/* Capability card icon fills on hover */
.es-card__icon {
  transition: transform 220ms ease, background 220ms ease, color 220ms ease;
}
.es-card:hover .es-card__icon {
  transform: scale(1.08) rotate(-4deg);
  background: var(--field-sage);
  color: var(--canvas-cream);
}

/* Animated underline on nav links */
.es-nav__links a { position: relative; }
.es-nav__links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -5px;
  height: 1.5px;
  background: var(--ink-black);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 240ms cubic-bezier(0.22, 0.61, 0.36, 1);
}
.es-nav__links a:hover::after { transform: scaleX(1); }

/* Industry tiles: slide + dot grows on hover */
.es-ind__tile { transition: background 160ms ease, transform 200ms ease; }
.es-ind__tile:hover { transform: translateX(5px); }
.es-ind__dot { transition: transform 220ms ease; }
.es-ind__tile:hover .es-ind__dot { transform: scale(1.6); }

/* Case-study chips lift slightly on hover */
.es-case__chip { transition: transform 160ms ease, background 160ms ease, border-color 160ms ease; }
.es-case__chip:hover { transform: translateY(-2px); }

/* ---------- Scroll progress bar ---------- */
.es-progress {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 3px;
  transform: scaleX(0);
  transform-origin: left;
  background: linear-gradient(90deg, var(--signal-orange), var(--light-signal-orange));
  z-index: 100;
  will-change: transform;
  pointer-events: none;
}

/* ---------- Respect reduced-motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .es-hero__media-arc,
  .es-about__arc,
  .es-hero .es-eyebrow__dot,
  .es-cta__inner::after {
    animation: none !important;
  }
}
