/* AbhiLeads — "How it works": three steps, each with a small loop that runs
   only while the section is on screen (.in from AL.reveal [data-al-live]).
   Shared by the landing and /buy/. */

.al-how { padding: clamp(64px, 9vw, 120px) 0; background: var(--al-white); font-family: var(--al-font); }
.al-how .al-h2 { margin-bottom: clamp(32px, 5vw, 56px); }
.al-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; counter-reset: s; }
.al-step { counter-increment: s; position: relative; padding-top: 22px; }

/* the pipeline: each step's top rule fills in turn */
.al-step::before, .al-step::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; border-radius: 2px; }
.al-step::before { background: var(--al-rule); }
.al-step::after { background: var(--al-ink); transform: scaleX(0); transform-origin: left; }
.al-how.in .al-step::after { transform: scaleX(1); transition: transform .9s var(--al-ease-io); }
.al-how.in .al-step:nth-child(2)::after { transition-delay: .55s; }
.al-how.in .al-step:nth-child(3)::after { transition-delay: 1.1s; }

.al-step h3 { margin: 18px 0 6px; font-size: 19px; font-weight: 700; font-stretch: 106%; letter-spacing: -0.01em; color: var(--al-ink); }
.al-step h3::before { content: counter(s); display: block; margin-bottom: 10px; font-size: 13px; font-weight: 700; color: var(--al-ink-3); }
.al-step p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--al-ink-2); max-width: 36ch; }

.al-mini { position: relative; height: 184px; border-radius: 20px; background: var(--al-band); display: grid; place-items: center; overflow: hidden; }

/* 1 · the search types itself */
.al-mini-type { display: flex; align-items: center; gap: 10px; width: min(260px, 84%); height: 46px; padding: 0 16px; border-radius: 999px; background: var(--al-white); border: 1px solid var(--al-rule); font-size: 15px; font-weight: 500; color: var(--al-ink); }
.al-mini-type svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--al-ink-3); stroke-width: 2; stroke-linecap: round; }
.al-mini-type span { white-space: nowrap; clip-path: inset(0 100% 0 0); }
.al-mini-type i { width: 2px; height: 20px; margin-left: -8px; background: var(--al-ink); }
.al-how.in .al-mini-type span { animation: al-typeon 4.2s steps(17, end) infinite; }
.al-how.in .al-mini-type i { animation: al-caret 1s steps(1) infinite; }

/* 2 · sources are read one after another */
.al-mini-srcs { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; width: min(220px, 80%); }
.al-mini-srcs li { position: relative; padding: 7px 12px; border-radius: 10px; background: var(--al-white); font-size: 13px; font-weight: 600; color: var(--al-ink-3); overflow: hidden; isolation: isolate; }
.al-mini-srcs li::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--al-yellow); transform: scaleX(0); transform-origin: left; }
.al-how.in .al-mini-srcs li { animation: al-ink-on 4.2s linear infinite; animation-delay: calc(var(--i) * .45s); }
.al-how.in .al-mini-srcs li::before { animation: al-fill 4.2s var(--al-ease-io) infinite; animation-delay: calc(var(--i) * .45s); }

/* 3 · rows drop into a file */
.al-mini-file { width: min(220px, 80%); padding: 14px 16px 16px; border-radius: 14px; background: var(--al-white); border: 1px solid var(--al-rule); }
.al-mini-file header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 13px; font-weight: 700; color: var(--al-ink); }
.al-mini-file header svg { width: 18px; height: 18px; fill: none; stroke: var(--al-ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 20; stroke-dashoffset: 20; }
.al-mini-file div { display: grid; grid-template-columns: 1fr 1.3fr; gap: 6px; padding: 6px 0; border-top: 1px solid var(--al-rule); opacity: 0; }
.al-mini-file div::before, .al-mini-file div::after { content: ""; height: 7px; border-radius: 4px; background: var(--al-rule-2); }
.al-mini-file div::after { background: var(--al-yellow); }
.al-how.in .al-mini-file div { animation: al-drop 4.2s var(--al-ease) infinite; animation-delay: calc(var(--i) * .32s); }
.al-how.in .al-mini-file header svg { animation: al-tick 4.2s var(--al-ease) infinite; }

@keyframes al-typeon { 0% { clip-path: inset(0 100% 0 0); } 45%, 82% { clip-path: inset(0 0 0 0); } 100% { clip-path: inset(0 0 0 0); opacity: 0; } }
@keyframes al-fill { 0% { transform: scaleX(0); opacity: 1; } 22% { transform: scaleX(1); opacity: 1; } 34%, 100% { transform: scaleX(1); opacity: 0; } }
@keyframes al-ink-on { 0% { color: var(--al-ink-3); } 22%, 80% { color: var(--al-ink); } 100% { color: var(--al-ink-3); } }
@keyframes al-drop { 0% { opacity: 0; translate: 0 -10px; } 14%, 82% { opacity: 1; translate: 0 0; } 100% { opacity: 0; translate: 0 0; } }
@keyframes al-tick { 0%, 40% { stroke-dashoffset: 20; } 55%, 85% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 0; opacity: 0; } }

@media (max-width: 820px) {
  .al-steps { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .al-how.in .al-step:nth-child(n)::after { transition-delay: 0s; }
}
@media (prefers-reduced-motion: reduce) {
  .al-mini * , .al-mini *::before, .al-mini *::after { animation: none !important; }
  .al-mini-type span { clip-path: none; }
  .al-mini-file div { opacity: 1; }
  .al-mini-file header svg { stroke-dashoffset: 0; }
  .al-step::after { transform: scaleX(1); transition: none !important; }
}
