/* e-api — /api : developer hero as an IDE window with data-flow, bento use-cases. Scoped to main:has(.api-hero) */

/* hero layout */
main:has(.api-hero) .api-hero-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.08fr);gap:clamp(32px,5vw,92px);align-items:center;position:relative}
html body main:not(#v2) .api-hero{padding-block:clamp(64px,7vw,120px) clamp(130px,11vw,190px)!important}
html body main:not(#v2) .api-hero .tag{direction:ltr;unicode-bidi:isolate;background:#52e3a414!important;border:1px solid #52e3a440!important;padding:7px 14px!important;border-radius:999px;box-shadow:none!important}
html body main:not(#v2) .api-hero .tag:before{content:'';width:7px;height:7px;border-radius:50%;background:var(--v2-mint);box-shadow:0 0 0 0 #52e3a488;animation:e-api-ping 2.4s ease-out infinite}
html body main:not(#v2) .api-hero h1{font-size:clamp(38px,5.2vw,84px)!important}
html body main:not(#v2) .api-hero .actions{display:flex;flex-wrap:wrap;justify-content:flex-start;gap:14px;margin-top:clamp(26px,3vw,40px)}
html body main:not(#v2) .api-hero .actions .btn{white-space:nowrap}

/* IDE window */
html body main:not(#v2) .api-hero pre{
  position:relative;z-index:1;direction:ltr;text-align:left;margin:0;padding:0;overflow:hidden;display:grid;grid-template-rows:auto auto auto;align-content:start;height:auto!important;min-height:0!important;
  border-radius:22px!important;color:#d9f3e6!important;
  background:linear-gradient(180deg,#0b1d14f2,#06120bf5)!important;
  border:1px solid #52e3a42e!important;
  box-shadow:0 0 0 1px #ffffff0a inset,0 70px 120px -50px #000,0 0 110px #52e3a41c,0 30px 60px -30px #0c6b4a66!important;
  backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);
  transform:perspective(1400px) rotateY(var(--e-ry,-4deg)) rotateX(var(--e-rx,2deg));transform-style:preserve-3d;
  transition:transform .8s var(--v2-ease);
}
html[dir=rtl] body main:not(#v2) .api-hero pre{--e-ry:5deg}
html body main:not(#v2) .api-hero pre:before{content:'';position:absolute;inset:0;pointer-events:none;border-radius:inherit;
  background:radial-gradient(520px 260px at var(--mx,80%) var(--my,0%),#52e3a41f,transparent 65%)}
html body main:not(#v2) .api-hero pre>small{
  position:relative;display:flex;align-items:center;min-height:50px;padding:0 20px 0 84px;font-size:13px;font-weight:500;letter-spacing:0;text-transform:none;
  color:#8fb3a1!important;border-bottom:1px solid #ffffff12;background:#ffffff06;
}
html body main:not(#v2) .api-hero pre>small:before{content:'';position:absolute;left:20px;top:50%;width:11px;height:11px;margin-top:-5.5px;border-radius:50%;background:#ff5f57;box-shadow:19px 0 0 #febc2e,38px 0 0 #28c840}
html body main:not(#v2) .api-hero pre code{display:block;padding:24px 26px 26px;font-size:clamp(13px,1.15vw,16px);line-height:2;color:#d9f3e6!important;background:none!important;white-space:pre;overflow-x:auto;counter-reset:e-ln;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace!important}
html body main:not(#v2) .api-hero pre code *{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace!important}
.e-ln{display:block;counter-increment:e-ln;white-space:pre;position:relative;padding-inline-start:2.6em}
.e-ln:before{content:counter(e-ln);position:absolute;left:0;width:1.6em;text-align:right;color:#4f7a64;font-size:.85em}
html body main:not(#v2) .api-hero pre code .e-ln{color:#d9f3e6!important}
html body main:not(#v2) .api-hero pre code .e-ln .m{color:#52e3a4!important;font-weight:700}
html body main:not(#v2) .api-hero pre code .e-ln .p{color:#fff!important}
html body main:not(#v2) .api-hero pre code .e-ln .k{color:#9bf0c8!important}
html body main:not(#v2) .api-hero pre code .e-ln .s{color:#f4cf86!important}
html body main:not(#v2) .api-hero pre code .e-ln .x{color:#7fa593!important}
html body main:not(#v2) .api-hero pre>footer{
  display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 22px;border-top:1px solid #ffffff12;background:#52e3a40d;font-size:14px;
}
html body main:not(#v2) .api-hero pre>footer span{position:relative;display:inline-flex;align-items:center;gap:10px;color:var(--v2-mint)!important;font-weight:600}
html body main:not(#v2) .api-hero pre>footer span:before{content:'';width:8px;height:8px;border-radius:50%;background:var(--v2-mint);box-shadow:0 0 12px var(--v2-mint)}
html body main:not(#v2) .api-hero pre>footer span:after{content:'';position:absolute;left:0;top:50%;width:8px;height:8px;margin-top:-4px;border-radius:50%;border:1px solid var(--v2-mint);animation:e-api-ring 2.6s ease-out infinite;opacity:0}
html[dir=rtl] body main:not(#v2) .api-hero pre>footer span:after{left:auto;right:0}
html body main:not(#v2) .api-hero pre>footer b{color:#cfe9dc!important;font-weight:500;background:#ffffff10;border-radius:999px;padding:3px 12px}

/* data-flow overlay */
.e-flow{position:absolute;inset:0;width:100%;height:100%;z-index:0;pointer-events:none;overflow:visible}
.e-flow path.rail{fill:none;stroke:#52e3a4;stroke-opacity:.2;stroke-width:1.2}
.e-flow path.rail.out{stroke-dasharray:4 7;stroke-opacity:.34;animation:e-api-dash 1.6s linear infinite}
.e-flow .pulse{fill:#52e3a4;filter:drop-shadow(0 0 6px #52e3a4)}
.e-flow .chip rect{fill:#0c2217;stroke:#52e3a455;stroke-width:1}
.e-flow .chip path,.e-flow .chip circle{fill:none;stroke:#9bf0c8;stroke-width:1.5;stroke-linecap:round}
.e-flow .e-ring{fill:none;stroke:#52e3a4;stroke-width:1.2;transform-box:fill-box;transform-origin:center;animation:e-api-ripple 3.4s ease-out infinite;opacity:0}
.e-paused *{animation-play-state:paused!important}
@keyframes e-api-dash{to{stroke-dashoffset:-22}}
@keyframes e-api-ripple{0%{transform:scale(.3);opacity:.7}100%{transform:scale(1.6);opacity:0}}
@keyframes e-api-ping{0%{box-shadow:0 0 0 0 #52e3a499}80%,100%{box-shadow:0 0 0 10px #52e3a400}}
@keyframes e-api-ring{0%{transform:scale(1);opacity:.9}100%{transform:scale(3.4);opacity:0}}

/* use-case bento */
.api-cases{display:grid!important;grid-template-columns:repeat(6,minmax(0,1fr))!important;gap:clamp(14px,1.6vw,22px)!important;margin-top:0}
.api-cases>article{grid-column:span 2;position:relative;overflow:hidden;padding:clamp(26px,2.6vw,38px)!important;min-height:300px;display:flex!important;flex-direction:column;gap:0;text-align:start}
.api-cases>article:nth-child(1),.api-cases>article:nth-child(4){grid-column:span 4}
.api-cases>article>i{position:absolute;inset-inline-end:clamp(18px,2vw,30px);inset-block-start:-.06em;font-style:normal;font-size:clamp(110px,11vw,190px);font-weight:800;line-height:1;letter-spacing:-.06em;color:#0f4b2410;pointer-events:none;transition:transform .8s var(--v2-ease),color .5s}
.api-cases>article:hover>i{transform:translateY(8px);color:#0f4b2418}
.api-cases>article h3{position:relative;z-index:1;margin:auto 0 12px;font-size:clamp(24px,2.1vw,34px)!important;font-weight:800!important;letter-spacing:-.03em;line-height:1.12;color:var(--v2-ink)!important}
.api-cases>article p{position:relative;z-index:1;margin:0;max-width:38ch;font-size:clamp(15px,1.15vw,18px)!important;line-height:1.7!important;color:var(--v2-muted)!important}
.api-cases>article .e-art{width:132px;height:80px;margin-bottom:28px;overflow:visible}
.api-cases>article:nth-child(1) .e-art,.api-cases>article:nth-child(4) .e-art{width:176px;height:106px}
.api-cases .e-art *{stroke:#087d43;fill:none;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.api-cases .e-art .f{fill:#52e3a4;stroke:none}
.api-cases .e-art .dash{stroke-dasharray:3 6;animation:e-api-dash 1.4s linear infinite}
.api-cases .e-art .blink{animation:e-api-blink 1.4s ease-in-out infinite}
.api-cases .e-art .blink.ea-b2{animation-delay:.2s}.api-cases .e-art .blink.ea-b3{animation-delay:.4s}
.api-cases .e-art .rip{transform-box:fill-box;transform-origin:center;animation:e-api-ripple 3s ease-out infinite;opacity:0}
.api-cases .e-art .rip.ea-r2{animation-delay:1s}.api-cases .e-art .rip.ea-r3{animation-delay:2s}
@keyframes e-api-blink{0%,100%{opacity:.25}50%{opacity:1}}
/* webhook card: dark */
html body main:not(#v2) .api-cases>article.v2-card:nth-child(3){
  background-color:var(--v2-ink)!important;border-color:#52e3a433!important;
  background-image:radial-gradient(360px 260px at 80% 0%,#145833cc,transparent 70%)!important;
}
html body main:not(#v2) .api-cases>article:nth-child(3) h3{color:#fff!important}
html body main:not(#v2) .api-cases>article:nth-child(3) p{color:var(--v2-on-dark-muted)!important}
html body main:not(#v2) .api-cases>article:nth-child(3)>i{color:#52e3a414}
.api-cases>article:nth-child(3) .e-art *{stroke:#52e3a4}
.api-cases>article:nth-child(3) .e-art .f{fill:#52e3a4}
html body main:not(#v2) .api-cases>article.v2-card:nth-child(2){background-image:linear-gradient(160deg,#f1f8f3,#fff 60%)!important}

/* developer CTA */
html body main:not(#v2) .developer-cta{padding-block:clamp(72px,9vw,150px)!important}
html body main:not(#v2) .developer-cta>.wrap{display:flex!important;align-items:center;justify-content:space-between;gap:clamp(28px,5vw,80px)}
html body main:not(#v2) .developer-cta h2{font-size:clamp(32px,4.4vw,68px)!important;max-width:16ch;text-wrap:balance;margin:14px 0 0!important}
html body main:not(#v2) .developer-cta .wrap>div>span{display:inline-flex;color:var(--v2-mint)!important;font-size:15px;font-weight:500;background:none!important;border:0!important;padding:0!important}
html body main:not(#v2) .developer-cta .btn{white-space:nowrap;flex:none}

@media(max-width:1000px){
  main:has(.api-hero) .api-hero-grid{grid-template-columns:1fr}
  html body main:not(#v2) .api-hero pre{transform:none}
  .api-cases{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .api-cases>article,.api-cases>article:nth-child(1),.api-cases>article:nth-child(4){grid-column:span 1;min-height:260px}
}
@media(max-width:640px){
  .api-cases{grid-template-columns:1fr!important}
  .api-cases>article{min-height:0;padding-bottom:42px!important}
  html body main:not(#v2) .developer-cta>.wrap{flex-direction:column;align-items:flex-start}
  html body main:not(#v2) .api-hero pre code{padding:18px 16px}
}
@media(prefers-reduced-motion:reduce){
  html body main:not(#v2) .api-hero pre{transform:none;transition:none}
  .e-flow *,.api-cases .e-art *,.api-hero .tag:before,.api-hero pre>footer span:after{animation:none!important}
}

main:has(.api-hero) :is(h1,h2,h3){unicode-bidi:normal!important}
