/* ===================================================================
   Stripe-clone diagram — embeddable build (diagram-only)
   All styles scoped under `.stripe-embed`. Drop the wrapper anywhere
   and it will not leak styles into the host page.
   =================================================================== */

.stripe-embed{
  --se-line:rgba(167,160,255,.50);
  --se-line-dim:rgba(167,160,255,.32);
  --se-pulse:#cfcaff;
  --se-pulse2:#9b97ff;
  --se-purple:#5b5bf0;
  --se-purple-dark:#1c1f55;
  --se-bg:#0a0e26;

  position:relative;
  width:100%;
  background:var(--se-bg);
  color:#e7e8ff;
  font-family:"Inter","sohne-var","Helvetica Neue",Helvetica,Arial,sans-serif;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
  letter-spacing:-0.005em;
  overflow:hidden;
  isolation:isolate;
  container:stripeEmbed / inline-size;
}
.stripe-embed *,
.stripe-embed *::before,
.stripe-embed *::after{ box-sizing:border-box }

/* optional dotted grid background — add class `with-grid` on the wrapper */
.stripe-embed.with-grid::before{
  content:"";
  position:absolute;inset:0;
  background-image:radial-gradient(rgba(167,160,255,.18) 1.05px, transparent 1.4px);
  background-size:16px 16px;
  -webkit-mask-image:radial-gradient(ellipse 110% 100% at 50% 50%, #000 55%, transparent 100%);
          mask-image:radial-gradient(ellipse 110% 100% at 50% 50%, #000 55%, transparent 100%);
  z-index:0;
  pointer-events:none;
}

/* diagram canvas — fills wrapper width, fixed aspect for positioning */
.stripe-embed .diagram{
  position:relative;
  width:100%;
  aspect-ratio: 1500 / 700;
  max-height:780px;
  margin:0 auto;
  z-index:1;
  opacity:0;
  transform:translateY(8px);
  transition:opacity .8s cubic-bezier(.4,0,.2,1), transform .8s cubic-bezier(.4,0,.2,1);
}
.stripe-embed .diagram.in-view{
  opacity:1;
  transform:none;
}

/* SVG wires — drawn first, behind nodes */
.stripe-embed .wires{
  position:absolute;inset:0;width:100%;height:100%;
  z-index:1;pointer-events:none;
  overflow:visible;
}
.stripe-embed .wires .w-base{
  fill:none;
  stroke:var(--se-line);
  stroke-width:1.4;
  stroke-dasharray:0.5 5;
  stroke-linecap:round;
  animation:seFlow 22s linear infinite;
}
.stripe-embed .wires .w-pulse{
  fill:none;
  stroke:var(--se-pulse);
  stroke-width:1.6;
  stroke-dasharray:16 240;
  stroke-linecap:round;
  filter:drop-shadow(0 0 5px rgba(207,202,255,.88));
  animation:sePulse 5s linear infinite;
  opacity:.92;
}
.stripe-embed .wires .w-pulse2{
  fill:none;
  stroke:var(--se-pulse2);
  stroke-width:1.4;
  stroke-dasharray:10 380;
  stroke-linecap:round;
  filter:drop-shadow(0 0 4px rgba(155,151,255,.65));
  animation:sePulse2 7.2s linear infinite;
  opacity:.7;
}
@keyframes seFlow{ to { stroke-dashoffset:-260; } }
@keyframes sePulse{
  from { stroke-dashoffset:260; }
  to   { stroke-dashoffset:-260; }
}
@keyframes sePulse2{
  from { stroke-dashoffset:-130; }
  to   { stroke-dashoffset:-510; }
}

/* hover focus — dim wires when any node is hovered, brighten the comet */
.stripe-embed .wires.focus-mode .w-base{ stroke-opacity:.22 }
.stripe-embed .wires.focus-mode .w-pulse{
  stroke:#fff;
  stroke-width:2.0;
  filter:drop-shadow(0 0 6px rgba(255,255,255,.95));
  animation-duration:2.6s;
}

/* nodes */
.stripe-embed .node{
  position:absolute;
  left:var(--x);top:var(--y);
  transform:translate(-50%,-50%);
  z-index:2;
  font-size:13px;font-weight:500;
  letter-spacing:-0.005em;
  display:inline-flex;align-items:center;gap:6px;
  padding:8px 13px;
  border-radius:5px;
  white-space:nowrap;
  transition:transform .25s ease, box-shadow .25s ease;
}
.stripe-embed .node:hover{
  transform:translate(-50%,-50%) scale(1.06);
  box-shadow:0 0 0 4px rgba(207,202,255,.18), 0 8px 24px rgba(91,91,240,.45);
}

.stripe-embed .node.solid-dark{
  background:var(--se-purple-dark);
  color:#fff;
  border:1px solid rgba(167,160,255,.30);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.02);
}
.stripe-embed .node.ghost.dashed{
  background:transparent;
  border:1px dashed var(--se-line-dim);
  min-width:90px;min-height:34px;
  color:transparent;
  pointer-events:none;
}
.stripe-embed .node.ghost.dashed.sq{
  min-width:34px;min-height:34px;
  width:34px;height:34px;
}
.stripe-embed .node.solid{
  background:var(--se-purple);
  color:#fff;
  border:1px solid rgba(255,255,255,.10);
  box-shadow:0 6px 20px rgba(91,91,240,.35);
  animation:seNodePulse 4s ease-in-out infinite;
}
.stripe-embed .node.solid:nth-child(odd){ animation-delay:1.2s }
.stripe-embed .node.solid:nth-child(3n){ animation-delay:2.4s }
@keyframes seNodePulse{
  0%,100% { box-shadow:0 6px 20px rgba(91,91,240,.30) }
  50%     { box-shadow:0 6px 26px rgba(140,134,255,.55), 0 0 0 1px rgba(207,202,255,.18) }
}

/* big stripe core node */
.stripe-embed .stripe-core{
  position:absolute;
  left:var(--x);top:var(--y);
  transform:translate(-50%,-50%);
  width:128px;height:128px;
  border-radius:14px;
  background:linear-gradient(160deg,#5b5bf0 0%,#4847d6 60%,#3a39bf 100%);
  box-shadow:
    0 30px 60px rgba(45,45,200,.45),
    inset 0 1px 0 rgba(255,255,255,.18);
  display:grid;place-items:center;
  z-index:3;
  animation:seCoreGlow 5.5s ease-in-out infinite;
}
.stripe-embed .stripe-core:hover{ transform:translate(-50%,-50%) scale(1.04) }
@keyframes seCoreGlow{
  0%,100%{ box-shadow:0 30px 60px rgba(45,45,200,.45),inset 0 1px 0 rgba(255,255,255,.18) }
  50%   { box-shadow:0 36px 72px rgba(80,80,235,.62),0 0 0 6px rgba(99,91,255,.10),inset 0 1px 0 rgba(255,255,255,.22) }
}
.stripe-embed .logo-text{
  color:#fff;font-weight:700;font-size:22px;letter-spacing:-0.03em;
  font-family:"Inter",sans-serif;
}

/* left icon grid */
.stripe-embed .icon-grid{
  position:absolute;
  left:var(--x);top:var(--y);
  transform:translate(-50%,-50%);
  display:grid;
  grid-template-columns:repeat(3,40px);
  grid-template-rows:repeat(2,40px);
  gap:7px;
  z-index:2;
}
.stripe-embed .ico{
  width:40px;height:40px;border-radius:8px;
  display:grid;place-items:center;
  box-shadow:0 4px 12px rgba(0,0,0,.30);
  transition:transform .25s cubic-bezier(.4,0,.2,1);
}
.stripe-embed .ico:hover{ transform:translateY(-2px) }
.stripe-embed .ico-mc{ background:#ffd93b }
.stripe-embed .ico-x { background:linear-gradient(135deg,#13b5ea,#0a8ed1) }
.stripe-embed .ico-q { background:#ffffff }
.stripe-embed .ico-h { background:linear-gradient(135deg,#ff7a59,#e55c30) }
.stripe-embed .ico-b { background:#3a3f5e }
.stripe-embed .ico-qb{ background:linear-gradient(135deg,#3a9a45,#2c7a36) }

/* right-side data-board endpoint */
.stripe-embed .endpoint-ico{
  position:absolute;
  left:var(--x);top:var(--y);
  transform:translate(-50%,-50%);
  width:40px;height:40px;
  background:#fff;
  border-radius:7px;
  z-index:2;
  display:flex;flex-direction:column;justify-content:center;
  gap:4px;padding:8px;
  box-shadow:0 4px 14px rgba(0,0,0,.35);
}
.stripe-embed .endpoint-ico .row{ height:5px;border-radius:2px }
.stripe-embed .endpoint-ico .r1{ background:#ff5b5b;width:75% }
.stripe-embed .endpoint-ico .r2{ background:#3aa8ff;width:60% }
.stripe-embed .endpoint-ico .r3{ background:#3ad684;width:80% }

/* responsive — based on the embed wrapper width, not viewport */
@container stripeEmbed (max-width:1100px){
  .stripe-embed .diagram{aspect-ratio:auto;height:680px}
}
@container stripeEmbed (max-width:720px){
  .stripe-embed .diagram{height:560px}
  .stripe-embed .stripe-core{width:88px;height:88px}
  .stripe-embed .logo-text{font-size:16px}
  .stripe-embed .node{font-size:11px;padding:7px 10px}
  .stripe-embed .icon-grid{grid-template-columns:repeat(3,30px);grid-template-rows:repeat(2,30px);gap:6px}
  .stripe-embed .ico{width:30px;height:30px}
}
