/* Yantra24x7 AI page, section 3: "The intelligence inside your factory".
   One calm hero visual: the Edge AI Accelerator glows in the middle, four machines around it send live data on curved
   lines, and the answer card sits beside it. The scene is drawn in a 940 x 620 box (positions in %, text in cqw).
   edgeai.js reveals it on scroll and loops the chat: question, typing, answer, alert. */
.ai .ea { position: relative; background: radial-gradient(ellipse 70% 45% at 50% 0%, #fff3e4, transparent 70%), #fffdfa; overflow: hidden; }
.ea-head { max-width: 900px; margin-inline: auto; text-align: center; display: grid; justify-items: center; }
.ea-head h2 { max-width: 16em; text-wrap: balance; }
.ea-lead { margin-top: 18px !important; max-width: 760px; font-size: clamp(16px, 1.35vw, 19px); line-height: 1.65; color: #3a4a5a; }

.eh { display: grid; grid-template-columns: minmax(0, 1fr) 56px 300px; align-items: center; max-width: 1220px; margin: clamp(28px, 4vw, 52px) auto 0; }

/* ---------- the scene ---------- */
.eh-scene { position: relative; aspect-ratio: 940 / 620; }
.eh-c { position: absolute; inset: 0; container-type: inline-size; }
.eh-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.eh-orbit { stroke: #f1dcc3; stroke-width: 1.5; stroke-dasharray: 3 9; }
.eh-base path { fill: none; stroke: #e7ddd1; stroke-width: 3; stroke-linecap: round; }
.eh-flow use { fill: none; stroke: #f7861e; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 2 12; animation: ehFlow 1s linear infinite; }
.eh-flow use.bad { stroke: #e5484d; }
.eh-dots circle { fill: #f7861e; filter: drop-shadow(0 0 5px rgba(247, 134, 30, .9)); }
.eh-dots circle.bad { fill: #e5484d; filter: drop-shadow(0 0 5px rgba(229, 72, 77, .9)); }
@keyframes ehFlow { to { stroke-dashoffset: -14; } }

.eh-inside { position: absolute; left: 50%; top: 10%; z-index: 3; display: inline-flex; align-items: center; gap: .8cqw; margin: 0; padding: .7cqw 1.5cqw; border-radius: 99px; background: #fff; box-shadow: 0 0 0 1px #eadfd3, 0 1cqw 2cqw -1.2cqw rgba(60, 40, 20, .35); font-size: 1.45cqw; font-weight: 700; color: #15803d; white-space: nowrap; transform: translateX(-50%); }
.eh-inside i { width: .9cqw; height: .9cqw; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 .35cqw rgba(34, 197, 94, .22); }

/* the box */
.eh-core { position: absolute; left: 50%; top: 50%; z-index: 2; width: 32%; aspect-ratio: 1; transform: translate(-50%, -50%); display: grid; place-items: center; }
.eh-core img { position: relative; z-index: 2; width: 78%; height: auto; filter: drop-shadow(0 2.2cqw 2cqw rgba(60, 35, 10, .3)); animation: ehFloat 5s ease-in-out infinite; }
@keyframes ehFloat { 50% { transform: translateY(-1.2cqw); } }
.eh-glow { position: absolute; inset: 4%; border-radius: 50%; background: radial-gradient(closest-side, rgba(247, 134, 30, .34), rgba(247, 134, 30, .08) 60%, transparent); animation: ehGlow 3.2s ease-in-out infinite; }
.eh-ring { position: absolute; inset: 0; margin: auto; border-radius: 50%; }
.eh-ring.r1 { width: 86%; height: 86%; border: .25cqw dashed rgba(247, 134, 30, .55); animation: ehSpin 22s linear infinite; }
.eh-ring.r2, .eh-ring.r3 { width: 70%; height: 70%; border: .15cqw solid rgba(247, 134, 30, .5); animation: ehPulse 3.2s ease-out infinite; }
.eh-ring.r3 { animation-delay: 1.6s; }
@keyframes ehGlow { 50% { transform: scale(1.06); opacity: .75; } }
@keyframes ehSpin { to { transform: rotate(360deg); } }
@keyframes ehPulse { from { transform: scale(.9); opacity: .9; } to { transform: scale(1.5); opacity: 0; } }
.eh-name { position: absolute; left: 50%; top: 76%; z-index: 3; margin: 0; text-align: center; transform: translateX(-50%); white-space: nowrap; }
.eh-name small { display: block; font: 800 1.15cqw/1.3 var(--mono, ui-monospace, monospace); letter-spacing: .12em; text-transform: uppercase; color: #c25e00; }
.eh-name b { display: block; font-size: 2.3cqw; line-height: 1.25; color: #12212f; }
.eh-name span { display: block; font-size: 1.4cqw; color: #4a5968; }

/* machines */
.eh-m { position: absolute; z-index: 2; width: 25%; margin: 0; transform: translate(-50%, -50%); }
.eh-m.m1 { left: 16%; top: 24%; } .eh-m.m2 { left: 84%; top: 24%; } .eh-m.m3 { left: 16%; top: 74%; } .eh-m.m4 { left: 84%; top: 74%; }
.eh-m img { display: block; width: 100%; height: auto; filter: drop-shadow(0 1.6cqw 1.4cqw rgba(60, 40, 20, .2)); }
.eh-heat { position: absolute; inset: -12% -8% 10%; z-index: -1; border-radius: 50%; background: radial-gradient(closest-side, rgba(239, 68, 68, .32), transparent); animation: ehGlow 1.6s ease-in-out infinite; }
.eh-tag { position: absolute; left: 50%; top: 100%; display: inline-flex; align-items: center; gap: .7cqw; margin-top: .6cqw; padding: .6cqw 1.3cqw .6cqw 1cqw; border-radius: 99px; background: #fff; box-shadow: 0 0 0 1px #e6ddd1, 0 1cqw 2cqw -1.3cqw rgba(40, 30, 20, .4); font-size: 1.4cqw; line-height: 1; white-space: nowrap; transform: translateX(-50%); }
.eh-tag i { width: .9cqw; height: .9cqw; border-radius: 50%; }
.eh-tag b { font-weight: 700; color: #12212f; }
.eh-tag span { font-weight: 600; }
.eh-tag.ok i { background: #16a34a; } .eh-tag.ok span { color: #166534; }
.eh-tag.mid i { background: #d99a00; } .eh-tag.mid span { color: #854d0e; }
.eh-tag.bad { box-shadow: 0 0 0 1px #fecaca, 0 1cqw 2cqw -1.3cqw rgba(220, 38, 38, .5); animation: ehWarn 1.6s ease-in-out infinite; }
.eh-tag.bad i { background: #dc2626; } .eh-tag.bad span { color: #b91c1c; }
@keyframes ehWarn { 50% { box-shadow: 0 0 0 1px #fca5a5, 0 0 0 .8cqw rgba(239, 68, 68, .13); } }

/* ---------- link to the team ---------- */
.eh-link { position: relative; height: 3px; background: repeating-linear-gradient(90deg, #f7861e 0 6px, transparent 6px 12px); }
.eh-link i { position: absolute; left: 0; top: -4px; width: 11px; height: 11px; border-radius: 50%; background: #f7861e; box-shadow: 0 0 8px rgba(247, 134, 30, .9); animation: ehLink 1.4s linear infinite; }
@keyframes ehLink { to { left: calc(100% - 11px); } }

/* ---------- the answer card ---------- */
.eh-card { padding: 16px; border-radius: 22px; background: #fff; box-shadow: 0 0 0 1px #ebe2d7, 0 40px 70px -40px rgba(60, 40, 20, .5); }
.eh-top { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid #f0e8de; }
.eh-top img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px #fff, 0 0 0 4px #ffe2c2; }
.eh-top b { display: block; font-size: 15px; color: #12212f; }
.eh-top small { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #4a5968; }
.eh-top small i { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; }
.eh-chat { display: grid; gap: 10px; padding-top: 14px; }
.eh-chat p { margin: 0; }
.eh-q { justify-self: end; padding: 9px 13px; border-radius: 16px 16px 4px 16px; background: #12212f; color: #fff; font-size: 13px; font-weight: 600; }
.eh-slot { position: relative; min-height: 96px; }
.eh-typing { position: absolute; left: 0; top: 0; display: flex; gap: 5px; padding: 12px 14px; border-radius: 16px 16px 16px 4px; background: #fbf7f2; box-shadow: inset 0 0 0 1px #f0e2cf; }
.eh-typing i { width: 7px; height: 7px; border-radius: 50%; background: #f7861e; animation: ehDot 1s infinite; }
.eh-typing i:nth-child(2) { animation-delay: .15s; } .eh-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes ehDot { 50% { transform: translateY(-4px); } }
.eh-a { padding: 10px 13px; border-radius: 16px 16px 16px 4px; background: #fbf7f2; box-shadow: inset 0 0 0 1px #f0e2cf; font-size: 13px; line-height: 1.5; color: #12212f; }
.eh-a small { display: block; margin-bottom: 2px; font-size: 11px; font-weight: 800; color: #c25e00; }
.eh-a b { color: #b91c1c; white-space: nowrap; }
.eh-alert { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 12px; background: #fff1f0; box-shadow: inset 0 0 0 1px #fecaca; font-size: 12px; color: #4a5968; }
.eh-alert i { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: #dc2626; color: #fff; font-style: normal; font-weight: 800; font-size: 13px; }
.eh-alert b { display: block; font-size: 13px; color: #12212f; }
/* chat loop: edgeai.js sets data-c="0..3" */
.eh .eh-q, .eh .eh-typing, .eh .eh-a, .eh .eh-alert { opacity: 0; transform: translateY(6px); transition: opacity .45s, transform .45s; }
.eh[data-c="1"] .eh-q, .eh[data-c="2"] .eh-q, .eh[data-c="3"] .eh-q { opacity: 1; transform: none; }
.eh[data-c="1"] .eh-typing { opacity: 1; transform: none; }
.eh[data-c="2"] .eh-a, .eh[data-c="3"] .eh-a, .eh[data-c="3"] .eh-alert { opacity: 1; transform: none; }

/* ---------- entrance ---------- */
.eh .eh-m, .eh .eh-core, .eh .eh-name, .eh .eh-inside, .eh .eh-lines, .eh .eh-card, .eh .eh-link { opacity: 0; transition: opacity .8s, transform .8s cubic-bezier(.2, .8, .2, 1); }
.eh .eh-m { transition-delay: calc(.15s * var(--i)); }
.eh.in .eh-m, .eh.in .eh-name, .eh.in .eh-inside, .eh.in .eh-core { opacity: 1; }
.eh.in .eh-lines { opacity: 1; transition-delay: .6s; }
.eh.in .eh-link, .eh.in .eh-card { opacity: 1; transition-delay: .9s; }

/* ---------- the four steps ---------- */
.eh-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; max-width: 1220px; margin: clamp(22px, 3vw, 36px) auto 0; padding: 0; list-style: none; }
.eh-steps li { display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px; border-radius: 16px; background: #fff; box-shadow: 0 0 0 1px #eee4d8; }
.eh-steps b { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #f7861e; color: #fff; font-size: 13px; }
.eh-steps span { display: grid; gap: 2px; font-size: 12.5px; line-height: 1.4; color: #5a6878; }
.eh-steps strong { font-size: 14px; color: #12212f; }

/* keep the floating buttons out of the way while this section is on screen */
html.ea-calm .yc-launch { padding: 0 7px; }
html.ea-calm .yc-launch > span:not(.yc-mk) { display: none; }
html.ea-calm .stt { opacity: 0 !important; pointer-events: none !important; }

@media (max-width: 1000px) {
  .eh { grid-template-columns: 1fr; justify-items: center; }
  .eh-scene { width: 100%; }
  .eh-link { width: 3px; height: 40px; background: repeating-linear-gradient(180deg, #f7861e 0 6px, transparent 6px 12px); }
  .eh-link i { left: -4px; animation-name: ehLinkV; }
  @keyframes ehLinkV { from { top: 0; } to { top: calc(100% - 11px); } }
  .eh-card { width: min(100%, 420px); }
  .eh-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .eh-tag { font-size: 2.3cqw; padding: .9cqw 1.8cqw .9cqw 1.4cqw; }
  .eh-tag b { display: none; }
  .eh-tag::before { content: attr(data-n); font-weight: 700; color: #12212f; }
  .eh-inside { font-size: 2.3cqw; top: 6%; }
  .eh-name small { font-size: 1.9cqw; } .eh-name b { font-size: 3.4cqw; } .eh-name span { font-size: 2.3cqw; }
  .eh-steps { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .eh *, .eh *::before, .eh *::after { animation: none !important; transition: none !important; }
  .eh .eh-dots, .eh .eh-typing { display: none; }
  .eh .eh-q, .eh .eh-a, .eh .eh-alert { opacity: 1; transform: none; }
}

/* AI page hero: slogan + keyword line inside one h1 (content v4) */
.ai-hero h1 .h1-slogan { display: block; }
.ai-hero h1 .h1-keyword { display: block; margin-top: 16px; max-width: 34ch; font-size: clamp(17px, .9vw + 12px, 22px); line-height: 1.35; font-weight: 700; letter-spacing: -.01em; color: #3a4a5a; }
.ai-hero h1 .ai-kw .ai-name { display: inline; }
