.api-hero { position: relative; overflow: hidden; background: var(--bg); }
.api-hero-blob { position: absolute; border-radius: 50%; pointer-events: none; z-index: 0; }
.api-hero-blob--a { top: -60px; right: -40px; width: 440px; height: 400px; filter: blur(64px); background: radial-gradient(circle, rgba(109,93,252,.13), transparent 65%); animation: svc-drift 22s ease-in-out infinite; }
.api-hero-blob--b { bottom: 0; left: -40px; width: 360px; height: 320px; filter: blur(60px); background: radial-gradient(circle, rgba(61,220,132,.09), transparent 65%); animation: svc-drift 26s ease-in-out infinite reverse; }
.api-hero-in { position: relative; z-index: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; padding-top: 130px; padding-bottom: 80px; }
.api-hero-copy h1 { font-size: clamp(28px, 3.6vw, 52px); letter-spacing: -.04em; line-height: 1.06; margin-bottom: 16px; }
.api-hero-sub { font-size: clamp(15px, 1.3vw, 17px); color: var(--ink-soft); line-height: 1.65; max-width: 460px; margin-bottom: 26px; }
.api-hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
/* API request flow diagram */
.api-hero-visual { position: relative; }
.api-flow {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  animation: svc-float 6s ease-in-out infinite;
}

.api-flow-node {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 18px;
  position: relative;
  box-shadow: 0 2px 16px -6px rgba(14,14,24,.1);
}
.api-flow-node--client  { border-color: var(--line-2); }
.api-flow-node--gateway { border-color: rgba(109,93,252,.3); background: rgba(109,93,252,.03); }
.api-flow-node--logic   { border-color: rgba(61,220,132,.3); background: rgba(61,220,132,.03); }
.api-flow-node--db      { border-color: rgba(51,103,145,.3); background: rgba(51,103,145,.03); }
.api-flow-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--line-2);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.api-flow-node--gateway .api-flow-icon { background: rgba(109,93,252,.08); border-color: rgba(109,93,252,.2); }
.api-flow-node--logic   .api-flow-icon { background: rgba(61,220,132,.08); border-color: rgba(61,220,132,.2); }
.api-flow-node--db      .api-flow-icon { background: rgba(51,103,145,.08); border-color: rgba(51,103,145,.2); }
.api-flow-icon svg { width: 18px; height: 18px; stroke: var(--v1); stroke-width: 1.5; fill: none; }
.api-flow-node--gateway .api-flow-icon svg { stroke: var(--v1); }
.api-flow-node--logic   .api-flow-icon svg { stroke: #059669; }
.api-flow-node--db      .api-flow-icon svg { stroke: #336791; }
.api-flow-label { flex: 1; }
.api-flow-label b { display: block; font-family: var(--font-heading); font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 2px; letter-spacing: -.01em; }
.api-flow-label span { font-family: var(--font-body); font-size: 11.5px; color: var(--muted); }
.api-flow-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 7px;
  flex-shrink: 0;
}
.api-flow-badge--method { color: var(--v1); background: rgba(109,93,252,.1); border: 1px solid rgba(109,93,252,.2); }
.api-flow-badge--auth   { color: #059669; background: rgba(5,150,105,.1); border: 1px solid rgba(5,150,105,.2); }
.api-flow-badge--logic  { color: #059669; background: rgba(61,220,132,.1); border: 1px solid rgba(61,220,132,.2); }
.api-flow-badge--db     { color: #336791; background: rgba(51,103,145,.1); border: 1px solid rgba(51,103,145,.2); }

/* Connectors between nodes */
.api-flow-connector {
  display: flex;
  align-items: center;
  padding: 4px 20px;
  position: relative;
  gap: 12px;
}
.api-flow-line {
  width: 2px;
  height: 28px;
  background: linear-gradient(to bottom, var(--line-2), rgba(109,93,252,.3));
  margin: 0 9px;
  flex-shrink: 0;
}
.api-flow-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--v1);
  position: absolute;
  left: 18px;
  animation: api-travel 2s linear infinite;
}
.api-flow-dot--1 { animation-delay: 0s; }
.api-flow-dot--2 { animation-delay: .66s; }
.api-flow-dot--3 { animation-delay: 1.33s; }
@keyframes api-travel {
  0%   { top: 0;   opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}
.api-flow-tag {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
  margin-left: 24px;
}
.grid3 {
    grid-template-columns: repeat(2, 1fr);
}
/* Response line */
.api-flow-response {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 10px;
  padding: 10px 18px;
  background: rgba(5,150,105,.06);
  border: 1px solid rgba(5,150,105,.2);
  border-radius: 10px;
}
.api-flow-status {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: #059669;
}
.api-flow-time {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--muted);
}

/* Tech stack three-column */
.api-stack-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.api-stack-col { background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.api-stack-heading { font-family: var(--font-heading); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.api-stack-items { display: flex; flex-direction: column; gap: 12px; }
.api-stack-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-soft); }
.api-stack-item--featured { background: var(--bg); border-color: var(--line-2); box-shadow: 0 2px 8px -4px rgba(14,14,24,.08); }
.api-stack-ico { width: 34px; height: 34px; border-radius: 9px; background: rgba(109,93,252,.07); border: 1px solid rgba(109,93,252,.14); display: grid; place-items: center; flex-shrink: 0; }
.api-stack-item b { display: block; font-family: var(--font-heading); font-size: 13.5px; font-weight: 700; color: var(--ink); margin-bottom: 2px; letter-spacing: -.01em; }
.api-stack-item span {    display: block; font-family: var(--font-body); font-size: 11.5px; color: var(--muted); line-height: 1.4; }

/* API principles grid */
.api-principles-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.api-principle { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 24px; transition: .35s cubic-bezier(.2,.7,.2,1); }
.api-principle:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: 0 16px 32px -18px rgba(60,40,120,.14); }
.api-principle-num { font-family: var(--font-heading); font-size: 11px; font-weight: 700; color: var(--v1); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 10px; }
.api-principle h3 { font-size: 15px; font-weight: 700; margin-bottom: 8px; letter-spacing: -.015em; }
.api-principle p { font-size: 13.5px; color: var(--muted); line-height: 1.65; margin: 0; }
.api-principle code { font-family: 'JetBrains Mono', monospace; font-size: 11.5px; background: var(--bg-soft); border: 1px solid var(--line); padding: 1px 5px; border-radius: 4px; color: var(--v1); }

/* Live work cards */
.api-live-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.api-live-card { background: var(--bg); border: 1px solid var(--line); border-radius: 18px; padding: 26px; transition: .35s cubic-bezier(.2,.7,.2,1); }
.api-live-card:hover { transform: translateY(-4px); border-color: var(--line-2); box-shadow: 0 20px 40px -20px rgba(60,40,120,.16); }
.api-live-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.api-live-logo { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0; }
.api-live-logo--billnest { background: linear-gradient(135deg, #eef4ff, #e8e6ff); }
.api-live-logo--sazcars  { background: linear-gradient(135deg, #e8f8ff, #e0efff); }
.api-live-logo--wow      { background: linear-gradient(135deg, #fff0ee, #ffe8e6); }
.api-live-head h3 { font-size: 16px; font-weight: 700; margin-bottom: 3px; letter-spacing: -.015em; }
.api-live-head span { display: block; font-family: var(--font-body); font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.api-live-card p { font-size: 14px; color: var(--muted); line-height: 1.65; margin-bottom: 16px; }
.api-live-stats { display: flex; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.api-live-stat { flex: 1; text-align: center; }
.api-live-stat b { display: block; font-family: var(--font-heading); font-size: 16px; font-weight: 800; color: var(--v1); letter-spacing: -.02em; line-height: 1; margin-bottom: 3px; }
.api-live-stat span { display: block; font-family: var(--font-body); font-size: 11px; color: var(--muted); line-height: 1.3; }

/* --- API Backend responsive --- */
@media (max-width: 1024px) {
  .api-hero-in      { grid-template-columns: 1fr; padding-top: 116px; }
  .api-hero-visual  { display: none; }
  .api-stack-grid   { grid-template-columns: 1fr; }
  .api-principles-grid { grid-template-columns: repeat(2, 1fr); }
  .api-live-grid    { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .api-hero-in { padding-top: 104px; padding-bottom: 56px; }
  .api-principles-grid { grid-template-columns: 1fr; }
}

/* API flowchart horizontal SVG */
.api-flowchart-wrap { width: 100%; animation: svc-float 7s ease-in-out infinite; }
.api-chart-svg { width: 100%; height: auto; max-width: 560px; filter: drop-shadow(0 16px 40px rgba(60,40,120,.12)); }

/* Animated request dots (left → right, violet) */
.api-rq1 { animation: api-req 2.4s linear infinite; }
.api-rq2 { animation: api-req 2.4s linear infinite; animation-delay: 1.2s; }
.api-rq3 { animation: api-req2 2.4s linear infinite; animation-delay: .4s; }
.api-rq4 { animation: api-req3 2.4s linear infinite; animation-delay: .8s; }
@keyframes api-req  { 0%{transform:translateX(0);opacity:0} 8%{opacity:.9} 92%{opacity:.9} 100%{transform:translateX(93px);opacity:0} }
@keyframes api-req2 { 0%{transform:translateX(0);opacity:0} 8%{opacity:.9} 92%{opacity:.9} 100%{transform:translateX(40px);opacity:0} }
@keyframes api-req3 { 0%{transform:translateX(0);opacity:0} 8%{opacity:.9} 92%{opacity:.9} 100%{transform:translateX(42px);opacity:0} }

/* Animated response dots (right → left, green) */
.api-rs1 { animation: api-res 2.4s linear infinite; animation-delay: .6s; }
.api-rs2 { animation: api-res 2.4s linear infinite; animation-delay: 1.8s; }
.api-rs3 { animation: api-res2 2.4s linear infinite; animation-delay: .9s; }
.api-rs4 { animation: api-res3 2.4s linear infinite; animation-delay: 1.5s; }
@keyframes api-res  { 0%{transform:translateX(0);opacity:0} 8%{opacity:.9} 92%{opacity:.9} 100%{transform:translateX(-93px);opacity:0} }
@keyframes api-res2 { 0%{transform:translateX(0);opacity:0} 8%{opacity:.9} 92%{opacity:.9} 100%{transform:translateX(-40px);opacity:0} }
@keyframes api-res3 { 0%{transform:translateX(0);opacity:0} 8%{opacity:.9} 92%{opacity:.9} 100%{transform:translateX(-42px);opacity:0} }









/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   API Flowchart — 3 concurrent requests, parallel/overlap
   4s cycle. fill-mode:backwards hides dots during delay.

   Offsets:  A = 0s   B = 1.3s   C = 2.55s
   Each request: D1 delay+0, D2 delay+0.5s, D3 delay+1.0s

   Dots can overlap — exactly like real parallel API calls.
   Different sizes/shades show individual requests visually.
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* ── Request A  (primary violet, r=7) ──────────────────── */
.pd-lv   { animation: kf-lv 4s linear infinite; animation-delay: 0s;    animation-fill-mode: backwards; }
.pd-th   { animation: kf-th 4s linear infinite; animation-delay: 0.5s;  animation-fill-mode: backwards; }
.pd-rv   { animation: kf-rv 4s linear infinite; animation-delay: 1.0s;  animation-fill-mode: backwards; }

/* ── Request B  (mid violet, r=5.5, offset 1.3s) ──────── */
.pd-lv-b { animation: kf-lv 4s linear infinite; animation-delay: 1.3s;  animation-fill-mode: backwards; }
.pd-th-b { animation: kf-th 4s linear infinite; animation-delay: 1.8s;  animation-fill-mode: backwards; }
.pd-rv-b { animation: kf-rv 4s linear infinite; animation-delay: 2.3s;  animation-fill-mode: backwards; }

/* ── Request C  (blue, r=4.5, offset 2.55s) ───────────── */
.pd-lv-c { animation: kf-lv 4s linear infinite; animation-delay: 2.55s; animation-fill-mode: backwards; }
.pd-th-c { animation: kf-th 4s linear infinite; animation-delay: 3.05s; animation-fill-mode: backwards; }
.pd-rv-c { animation: kf-rv 4s linear infinite; animation-delay: 3.55s; animation-fill-mode: backwards; }

/* ── Shared keyframes (all 9 dots reuse these) ─────────── */

/* D1 segment — Browser ↔ Cloud  Δ=−62px */
@keyframes kf-lv {
  0%    { transform:translateY(0);     opacity:0; }
  1%    { opacity:1; }
  12.5% { transform:translateY(-62px); opacity:1; }
  13.5% { transform:translateY(-62px); opacity:0; }
  65%   { transform:translateY(-62px); opacity:0; }
  66%   { transform:translateY(-62px); opacity:1; }
  77.5% { transform:translateY(0);     opacity:1; }
  78.5% { opacity:0; }
  100%  { transform:translateY(0);     opacity:0; }
}

/* D2 segment — Cloud ↔ Server  Δ=+122px */
@keyframes kf-th {
  0%    { transform:translateX(0);     opacity:0; }
  1%    { opacity:1; }
  12.5% { transform:translateX(122px); opacity:1; }
  13.5% { transform:translateX(122px); opacity:0; }
  40%   { transform:translateX(122px); opacity:0; }
  41%   { transform:translateX(122px); opacity:1; }
  52.5% { transform:translateX(0);     opacity:1; }
  53.5% { opacity:0; }
  100%  { transform:translateX(0);     opacity:0; }
}

/* D3 segment — Server ↔ Database  Δ=+78px */
@keyframes kf-rv {
  0%    { transform:translateY(0);    opacity:0; }
  1%    { opacity:1; }
  12.5% { transform:translateY(78px); opacity:1; }
  13.5% { transform:translateY(78px); opacity:0; }
  16%   { transform:translateY(78px); opacity:1; }
  27.5% { transform:translateY(0);    opacity:1; }
  28.5% { opacity:0; }
  100%  { transform:translateY(0);    opacity:0; }
}

/* ============================================
   NODE.JS PAGE
   ============================================ */
