/* ==========================================================
   Amerwebsite — loop & special effects + WhatsApp widget
   ========================================================== */

/* (page-wide overflow-x lock removed: it could block sideways swiping on some phones) */

/* Rotating word in hero headline */
.rotator { display: inline-block; position: relative; }
.rotator span {
  display: inline-block;
  background: linear-gradient(90deg, var(--accent), #7a5cff, var(--accent));
  background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: hue 4s linear infinite;
  padding-bottom: .06em;
}
.rotator span.out { animation: hue 4s linear infinite, wordOut .35s var(--ease) forwards; }
.rotator span.in { animation: hue 4s linear infinite, wordIn .5s var(--ease) both; }
@keyframes hue { to { background-position: 200% center; } }
@keyframes wordOut { to { opacity: 0; transform: translateY(-40%); filter: blur(6px); } }
@keyframes wordIn { from { opacity: 0; transform: translateY(40%); filter: blur(6px); } }

/* Industry chips: a glowing line runs around each border, passing chip to chip in a loop */
@property --cang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.strip li { position: relative; isolation: isolate; }
.strip li::before, .strip li::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; opacity: 0;
}
/* the moving border line */
.strip li::before {
  padding: 2px;
  background: conic-gradient(from var(--cang), transparent 0 40%, #2f5bff 68%, #9be22d 86%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: chipSpin 2.2s linear infinite, chipGlow 9s ease-in-out infinite;
}
/* the soft outer glow */
.strip li::after {
  box-shadow: 0 0 0 1px rgba(47,91,255,.18), 0 0 22px rgba(47,91,255,.30), 0 0 8px rgba(155,226,45,.35);
  animation: chipGlow 9s ease-in-out infinite;
}
.strip li svg { animation: chipIcon 9s ease-in-out infinite; }
.strip li:nth-child(2)::before { animation-delay: 0s, 1.5s; } .strip li:nth-child(2)::after, .strip li:nth-child(2) svg { animation-delay: 1.5s; }
.strip li:nth-child(3)::before { animation-delay: 0s, 3s; }   .strip li:nth-child(3)::after, .strip li:nth-child(3) svg { animation-delay: 3s; }
.strip li:nth-child(4)::before { animation-delay: 0s, 4.5s; } .strip li:nth-child(4)::after, .strip li:nth-child(4) svg { animation-delay: 4.5s; }
.strip li:nth-child(5)::before { animation-delay: 0s, 6s; }   .strip li:nth-child(5)::after, .strip li:nth-child(5) svg { animation-delay: 6s; }
.strip li:nth-child(6)::before { animation-delay: 0s, 7.5s; } .strip li:nth-child(6)::after, .strip li:nth-child(6) svg { animation-delay: 7.5s; }
@keyframes chipSpin { to { --cang: 360deg; } }
@keyframes chipGlow {
  0%, 100% { opacity: 0; }
  10%, 22% { opacity: 1; }
  34% { opacity: 0; }
}
@keyframes chipIcon {
  0%, 34%, 100% { transform: none; }
  10%, 22% { transform: scale(1.12); }
}

/* Spinning gradient border on featured card */
@property --ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.card.featured { position: relative; isolation: isolate; border-color: transparent; }
.card.featured::before {
  content: ""; position: absolute; inset: -1.5px; border-radius: inherit; z-index: -2;
  background: conic-gradient(from var(--ang), transparent 0 55%, var(--lime) 75%, var(--accent) 90%, transparent);
  animation: rotateBorder 4s linear infinite;
}
.card.featured::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--dark); z-index: -1; }
@keyframes rotateBorder { to { --ang: 360deg; } }
.card.featured .card-icon { animation: glowPulse 2.6s ease-in-out infinite; }
@keyframes glowPulse { 50% { box-shadow: 0 0 0 8px rgba(200,244,90,.12), 0 0 30px rgba(200,244,90,.35); } }

/* Mouse-follow spotlight on cards */
.spot { position: relative; }
.spot > :not(.glow) { position: relative; z-index: 1; }
.spot .glow {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
  border-radius: inherit;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), rgba(47,91,255,.10), transparent 60%);
}
.card.featured .glow { background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), rgba(200,244,90,.14), transparent 60%); }
.spot:hover .glow { opacity: 1; }

/* Shine sweep on primary buttons (loops) */
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after {
  content: ""; position: absolute; top: 0; left: 0; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.28), transparent);
  transform: translateX(-150%) skewX(-20deg); animation: shine 4.5s ease-in-out infinite;
  will-change: transform;
}
@keyframes shine {
  0%, 60% { transform: translateX(-150%) skewX(-20deg); }
  100%    { transform: translateX(325%) skewX(-20deg); }
}

/* Hero: chart breathing, counter pop, pill ping, drifting blob */
.chart span { animation: grow 1.1s var(--ease) both, breathe 3.2s ease-in-out 1.4s infinite; }
.chart span:nth-child(2n) { animation-delay: .15s, 1.8s; }
.chart span:nth-child(3n) { animation-delay: .25s, 2.2s; }
@keyframes breathe { 50% { transform: scaleY(.82); } }
.count { display: inline-block; }
.count.bump { animation: bump .45s var(--ease); }
@keyframes bump { 40% { transform: scale(1.35); color: var(--accent); } }
.pill i { position: relative; }
.pill i::after { content: ""; position: absolute; inset: 0; border-radius: inherit; animation: ping 2s ease-out infinite; }
@keyframes ping { from { box-shadow: 0 0 0 0 rgba(200,244,90,.8); } to { box-shadow: 0 0 0 10px rgba(200,244,90,0); } }
.hero::before { animation: drift 14s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translate(-120px, 80px) scale(1.15); } }

/* Process: steps light up one after another, in a loop */
.steps.run .step::before { animation: stepLit 8s infinite; }
.steps .step:nth-child(2)::before { animation-delay: 2s; }
.steps .step:nth-child(3)::before { animation-delay: 4s; }
.steps .step:nth-child(4)::before { animation-delay: 6s; }
@keyframes stepLit {
  0%, 22% { background: var(--ink); color: var(--lime); border-color: var(--ink); transform: scale(1.08); }
  27%, 100% { background: var(--bg); color: var(--ink); border-color: var(--line); transform: none; }
}

/* ==========================================================
   WhatsApp widget
   ========================================================== */
.wa { position: fixed; right: 24px; bottom: 24px; z-index: 80; display: flex; flex-direction: column; align-items: flex-end; gap: 14px; }
.wa-btn {
  width: 62px; height: 62px; border-radius: 50%; background: #25d366; color: #fff;
  display: grid; place-items: center; position: relative;
  box-shadow: 0 10px 30px rgba(37,211,102,.45); transition: transform .3s var(--ease);
}
.wa-btn:hover { transform: scale(1.08) rotate(-6deg); }
.wa-btn svg { width: 32px; height: 32px; }
.wa-btn::before, .wa-btn::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid #25d366;
  animation: waRing 2.4s ease-out infinite; pointer-events: none;
}
.wa-btn::after { animation-delay: 1.2s; }
@keyframes waRing { from { transform: scale(1); opacity: .8; } to { transform: scale(1.7); opacity: 0; } }
.wa-badge {
  position: absolute; top: -2px; right: -2px; width: 22px; height: 22px; border-radius: 50%;
  background: #ff3b30; color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center;
  border: 2px solid #fff; transform: scale(0); transition: transform .35s var(--ease);
}
.wa.notify .wa-badge { transform: scale(1); }
.wa.notify:not(.open) .wa-btn { animation: wiggle 2.4s ease-in-out infinite; }
@keyframes wiggle { 0%, 80%, 100% { transform: rotate(0); } 84% { transform: rotate(-12deg); } 88% { transform: rotate(10deg); } 92% { transform: rotate(-6deg); } }

.wa-pop {
  width: 330px; max-width: calc(100vw - 32px); background: #fff; border-radius: 22px; overflow: hidden;
  box-shadow: 0 24px 70px rgba(15,17,21,.22); transform-origin: bottom right;
  opacity: 0; transform: translateY(16px) scale(.9); pointer-events: none; visibility: hidden;
  transition: opacity .35s var(--ease), transform .45s cubic-bezier(.2,1.4,.4,1), visibility 0s .45s;
}
.wa.open .wa-pop { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition-delay: 0s; }
.wa-head { display: flex; align-items: center; gap: 12px; padding: 16px; background: #075e54; color: #fff; }
.wa-head b { display: block; font-size: 15px; }
.wa-head small { display: block; font-size: 12px; opacity: .75; }
.wa-avatar { position: relative; flex: none; }
.wa-avatar .logo-mark { width: 40px; height: 40px; border-radius: 50%; }
.wa-avatar .online { position: absolute; right: 0; bottom: 0; width: 11px; height: 11px; border-radius: 50%; background: #25d366; border: 2px solid #075e54; }
.wa-close { margin-left: auto; background: rgba(255,255,255,.12); border: 0; color: #fff; width: 30px; height: 30px; border-radius: 50%; font-size: 20px; line-height: 1; cursor: pointer; transition: background .2s; flex: none; }
.wa-close:hover { background: rgba(255,255,255,.25); }
.wa-body {
  padding: 22px 16px; min-height: 120px;
  background-color: #efeae2;
  background-image: radial-gradient(rgba(0,0,0,.05) 1px, transparent 1px); background-size: 14px 14px;
}
.wa-msg {
  background: #fff; border-radius: 4px 14px 14px 14px; padding: 10px 12px 20px; font-size: 14.5px; line-height: 1.5;
  position: relative; max-width: 92%; box-shadow: 0 1px 1px rgba(0,0,0,.06); display: none;
}
.wa-time { position: absolute; right: 10px; bottom: 4px; font-size: 10.5px; color: #8a8f98; }
.wa-typing { display: inline-flex; gap: 4px; background: #fff; padding: 12px 14px; border-radius: 4px 14px 14px 14px; }
.wa-typing i { width: 7px; height: 7px; border-radius: 50%; background: #9aa0a6; animation: typing 1.2s infinite; }
.wa-typing i:nth-child(2) { animation-delay: .15s; }
.wa-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
.wa.typed .wa-typing { display: none; }
.wa.typed .wa-msg { display: block; animation: wordIn .4s var(--ease); }
.wa-cta {
  display: flex; align-items: center; justify-content: center; gap: 10px; margin: 14px; height: 48px; border-radius: 999px;
  background: #25d366; color: #fff; font-weight: 600; font-size: 15px; transition: background .2s, transform .2s;
}
.wa-cta:hover { background: #1ebe5b; transform: translateY(-1px); }
.wa-cta svg { width: 20px; height: 20px; }

/* WhatsApp button in contact / hero */
.btn-wa { background: #25d366; color: #fff; }
.btn-wa:hover { background: #1ebe5b; transform: translateY(-2px); box-shadow: 0 10px 24px rgba(37,211,102,.35); }

@media (max-width: 680px) {
  .wa { right: 16px; bottom: 16px; }
  .wa-btn { width: 56px; height: 56px; }
}

/* WhatsApp widget: the outer box is invisible but as big as the popup — it must not
   catch taps/swipes meant for the page. Only the button (and the popup when open) are touchable. */
.wa { pointer-events: none; }
.wa-btn, .wa.open .wa-pop { pointer-events: auto; }
