/* ==========================================================
   Services cards v2 — bento grid with animated illustrations
   ========================================================== */
@property --svx-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@property --vx-p  { syntax: '<percentage>'; inherits: true; initial-value: 30%; }
@property --vx-n  { syntax: '<integer>'; inherits: false; initial-value: 0; }

.svx-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 22px;
}
.svx { grid-column: span 6; }
.svx-grid > .svx:nth-child(4n+1), .svx-grid > .svx:nth-child(4n+4) { grid-column: span 7; }
.svx-grid > .svx:nth-child(4n+2), .svx-grid > .svx:nth-child(4n+3) { grid-column: span 5; }
.svx-grid[data-cards="1"] > .svx { grid-column: 1 / -1; }
.svx-grid[data-cards="3"] > .svx:nth-child(3) { grid-column: 1 / -1; }

/* ---- card shell ---- */
.svx {
  --c-bg: var(--surface);
  --c-text: var(--text);
  --c-muted: var(--muted);
  --c-panel: var(--surface-2);
  --c-line: var(--line);
  --c-chip: var(--surface-2);
  --c-ink: var(--text);
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 26px;
  border-radius: 30px;
  background: var(--c-bg);
  color: var(--c-text);
  border: 1px solid var(--c-line);
  overflow: hidden;
  container-type: inline-size;
  transition: transform .6s var(--ease-out), box-shadow .6s var(--ease-out), border-color .4s;
}
.svx.feature {
  --c-bg: #0A0A0A;
  --c-text: #F4F4F5;
  --c-muted: #A1A1AA;
  --c-panel: #161618;
  --c-line: rgba(255,255,255,.1);
  --c-chip: rgba(255,255,255,.08);
  --c-ink: #F4F4F5;
}
:root[data-theme="dark"] .svx.feature { --c-bg: #1A1A1C; --c-panel: #0F0F10; }

/* animated gradient border (shows on hover) */
.svx::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(from var(--svx-a), transparent 0 55%, var(--lime) 75%, transparent 92%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0;
  transition: opacity .5s;
  pointer-events: none;
  z-index: 2;
}
/* mouse spotlight */
.svx-glow {
  position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(134,232,77,.16), transparent 45%);
  opacity: 0; transition: opacity .5s;
  pointer-events: none;
}
.svx:hover, html.js .svx[data-reveal].in:hover { transform: translateY(-8px); box-shadow: var(--shadow); border-color: transparent; }
html.js .svx[data-reveal] { transition: opacity 1s var(--ease-out), transform .8s var(--ease-out), box-shadow .6s var(--ease-out), border-color .4s; }
.svx:hover::before { opacity: 1; animation: svx-spin 4s linear infinite; }
.svx:hover .svx-glow { opacity: 1; }
@keyframes svx-spin { to { --svx-a: 360deg; } }

/* ---- top row ---- */
.svx-top { display: flex; align-items: center; justify-content: space-between; }
.svx-icon {
  width: 52px; height: 52px; border-radius: 16px;
  display: grid; place-items: center;
  background: #0A0A0A; color: var(--lime);
  transition: transform .6s var(--ease-out), border-radius .6s var(--ease-out);
}
:root[data-theme="dark"] .svx:not(.feature) .svx-icon { background: #242427; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.svx.feature .svx-icon { background: var(--lime); color: #0A0A0A; }
.svx-icon svg { width: 24px; height: 24px; }
.svx:hover .svx-icon { transform: rotate(-12deg) scale(1.08); border-radius: 50%; }
.svx-num {
  font-family: var(--display); font-weight: 800;
  font-size: 44px; line-height: 1; letter-spacing: -.03em;
  color: transparent; -webkit-text-stroke: 1.2px var(--c-line);
  transition: -webkit-text-stroke-color .4s, transform .6s var(--ease-out);
}
.svx:hover .svx-num { -webkit-text-stroke-color: var(--c-muted); transform: translateY(-3px); }

/* ---- body ---- */
.svx-body { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.svx h3 { font-size: clamp(22px, 2.3vw, 28px); line-height: 1.12; margin: 0; color: var(--c-text); }
.svx p  { color: var(--c-muted); margin: 0; max-width: 34em; }
.svx-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; padding: 0; }
.svx-tags li {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; padding: 6px 12px 6px 9px; border-radius: 99px;
  background: var(--c-chip); color: var(--c-text);
  border: 1px solid transparent;
  transition: border-color .3s, transform .3s var(--ease-out);
}
.svx-tags li svg { width: 12px; height: 12px; color: var(--lime-ink); flex: none; }
.svx.feature .svx-tags li svg { color: var(--lime); }
.svx-tags li:hover { border-color: var(--c-line); transform: translateY(-2px); }

/* ---- CTA ---- */
.svx-cta {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-top: 18px; border-top: 1px solid var(--c-line);
  font-weight: 600; font-size: 15px; color: var(--c-text); text-decoration: none;
}
.svx-cta i {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--c-line); color: var(--c-text);
  transition: background .35s, color .35s, border-color .35s, transform .5s var(--ease-out);
}
.svx-cta i svg { width: 16px; height: 16px; transition: transform .5s var(--ease-out); }
.svx:hover .svx-cta i, .svx-cta:focus-visible i { background: var(--lime); border-color: var(--lime); color: #0A0A0A; transform: rotate(45deg); }
.svx-cta:focus-visible { outline: 2px solid var(--lime); outline-offset: 4px; border-radius: 6px; }

/* ==========================================================
   Illustration panel
   ========================================================== */
.vx {
  position: relative;
  height: 190px;
  border-radius: 20px;
  background: var(--c-panel);
  overflow: hidden;
  border: 1px solid var(--c-line);
}
.vx::after { /* soft dotted texture */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(var(--c-line) 1px, transparent 1.2px);
  background-size: 16px 16px; opacity: .7;
  -webkit-mask: linear-gradient(180deg, #000, transparent 85%); mask: linear-gradient(180deg, #000, transparent 85%);
}
.vx > * { z-index: 1; }
.vx svg { display: block; }
.vx .sk { display: block; height: 9px; border-radius: 9px; background: var(--c-line); }
.vx .sk.thin { height: 7px; opacity: .7; }
.w60 { width: 60%; } .w40 { width: 40%; }

/* paused until the card is revealed, then loops */
.vx * { animation-play-state: paused; }
.svx.in .vx * { animation-play-state: running; }

/* ---- 1. Website: browser + incoming quote toast ---- */
.vx-site .vx-win {
  position: absolute; left: 22px; right: 22px; top: 22px; bottom: -20px;
  border-radius: 14px; background: var(--c-bg);
  border: 1px solid var(--c-line);
  box-shadow: 0 20px 40px -24px rgba(0,0,0,.35);
  animation: vx-float 6s ease-in-out infinite;
}
.vx-bar { display: flex; align-items: center; gap: 5px; padding: 10px 12px; border-bottom: 1px solid var(--c-line); }
.vx-bar b { width: 7px; height: 7px; border-radius: 50%; background: var(--c-line); }
.vx-bar span { flex: 1; height: 12px; margin-left: 10px; border-radius: 6px; background: var(--c-panel); max-width: 160px; }
.vx-page { padding: 16px 16px 0; display: flex; flex-direction: column; gap: 9px; }
.vx-stars { font-size: 12px; letter-spacing: 2px; color: #F5B43C; }
.vx-call {
  position: relative; align-self: flex-start;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; padding: 8px 14px; border-radius: 99px;
  background: var(--lime); color: #0A0A0A;
}
.vx-call svg { width: 13px; height: 13px; animation: vx-ring 2.4s ease-in-out infinite; }
.vx-call::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  border: 2px solid var(--lime); animation: vx-pulse 2.4s ease-out infinite;
}
.vx-toast {
  position: absolute; right: 16px; top: 54px;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 14px;
  background: var(--c-bg); color: var(--c-text);
  border: 1px solid var(--c-line);
  box-shadow: 0 18px 40px -18px rgba(0,0,0,.4);
  animation: vx-toast 6s var(--ease-out) infinite;
}
.vx-toast b { display: block; font-size: 12.5px; line-height: 1.2; }
.vx-toast small { font-size: 11px; color: var(--c-muted); }
.vx-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px rgba(134,232,77,.25); }
@keyframes vx-float { 50% { transform: translateY(-6px); } }
@keyframes vx-ring { 0%,60%,100% { transform: rotate(0); } 65% { transform: rotate(-16deg); } 75% { transform: rotate(14deg); } 85% { transform: rotate(-8deg); } }
@keyframes vx-pulse { 0% { transform: scale(1); opacity: .9; } 70%,100% { transform: scale(1.5, 1.9); opacity: 0; } }
@keyframes vx-toast {
  0%, 18% { transform: translateX(120%) scale(.9); opacity: 0; }
  28%, 78% { transform: none; opacity: 1; }
  90%, 100% { transform: translateY(-14px) scale(.96); opacity: 0; }
}

/* ---- 2. Landing page: rising bars + drawn trend line ---- */
.vx-bars {
  position: absolute; left: 22px; right: 22px; bottom: 0; top: 34px;
  display: flex; align-items: flex-end; gap: 9px;
}
.vx-bars i {
  flex: 1; height: var(--h); border-radius: 8px 8px 0 0;
  background: var(--c-line);
  transform-origin: bottom; transform: scaleY(.08);
  animation: vx-grow 5s var(--ease-out) infinite;
  animation-delay: calc(var(--k) * .08s);
}
.vx-bars i:last-child { background: var(--lime); }
.vx-line { position: absolute; left: 22px; right: 22px; top: 24px; width: calc(100% - 44px); height: calc(100% - 34px); overflow: visible; }
.vx-line path {
  fill: none; stroke: var(--c-text); stroke-width: 2.5; stroke-linecap: round;
  stroke-dasharray: 100; stroke-dashoffset: 100;
  vector-effect: non-scaling-stroke;
  animation: vx-draw 5s var(--ease-out) infinite;
}
.vx-chip {
  position: absolute; top: 16px; left: 22px;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; padding: 6px 11px; border-radius: 99px;
  background: var(--c-bg); color: var(--c-text); border: 1px solid var(--c-line);
  animation: vx-pop 5s var(--ease-out) infinite;
}
.vx-chip svg { width: 13px; height: 13px; color: var(--lime-ink); }
.svx.feature .vx-chip svg { color: var(--lime); }
@keyframes vx-grow { 0%,6% { transform: scaleY(.08); } 34%,82% { transform: scaleY(1); } 100% { transform: scaleY(.08); } }
@keyframes vx-draw { 0%,14% { stroke-dashoffset: 100; } 50%,82% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 100; opacity: 0; } }
@keyframes vx-pop { 0%,40% { transform: translateY(8px) scale(.9); opacity: 0; } 52%,84% { transform: none; opacity: 1; } 100% { opacity: 0; } }

/* ---- 3. Redesign: before / after wipe ---- */
.vx-re { --vx-p: 30%; animation: vx-wipe 6s ease-in-out infinite; animation-play-state: paused; }
.svx.in .vx-re { animation-play-state: running; }
.vx-old, .vx-new { position: absolute; inset: 18px; border-radius: 12px; }
.vx-old { background: var(--c-bg); border: 1px dashed var(--c-line); }
.vx-old span { position: absolute; background: var(--c-line); border-radius: 3px; }
.vx-old .o1 { left: 8%; top: 12%; width: 38%; height: 10px; transform: rotate(-3deg); }
.vx-old .o2 { left: 58%; top: 10%; width: 30%; height: 34px; }
.vx-old .o3 { left: 10%; top: 38%; width: 22%; height: 46px; transform: rotate(2deg); }
.vx-old .o4 { left: 40%; top: 52%; width: 48%; height: 8px; }
.vx-old .o5 { left: 40%; top: 66%; width: 30%; height: 8px; opacity: .6; }
.vx-new {
  background: var(--c-bg); border: 1px solid var(--c-line);
  clip-path: inset(0 0 0 var(--vx-p));
  padding: 14px; display: flex; flex-direction: column; gap: 8px;
  box-shadow: 0 16px 32px -20px rgba(0,0,0,.35);
}
.vx-new span { display: block; border-radius: 6px; background: var(--c-line); }
.vx-new .n1 { width: 30%; height: 8px; }
.vx-new .n2 { width: 70%; height: 14px; background: var(--c-text); opacity: .85; }
.vx-new .n3 { width: 26%; height: 18px; border-radius: 99px; background: var(--lime); }
.vx-new .n4 { display: flex; gap: 6px; background: none; flex: 1; }
.vx-new .n4 i { flex: 1; border-radius: 6px; background: var(--c-panel); border: 1px solid var(--c-line); }
.vx-handle {
  position: absolute; top: 10px; bottom: 10px; width: 2px;
  left: calc(18px + (100% - 36px) * var(--vx-p) / 100%);
  background: var(--c-text); transform: translateX(-1px);
}
.vx-handle i {
  position: absolute; top: 50%; left: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px;
  border-radius: 50%; background: var(--c-text); box-shadow: 0 0 0 4px rgba(134,232,77,.45);
}
.vx-handle i::before, .vx-handle i::after {
  content: ""; position: absolute; top: 50%; width: 0; height: 0; margin-top: -4px;
  border: 4px solid transparent;
}
.vx-handle i::before { left: 3px; border-right-color: var(--c-bg); }
.vx-handle i::after  { right: 3px; border-left-color: var(--c-bg); }
.vx-lbl {
  position: absolute; bottom: 26px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 99px; background: var(--c-panel); color: var(--c-muted); border: 1px solid var(--c-line);
}
.vx-lbl.l { left: 28px; } .vx-lbl.r { right: 28px; color: var(--c-text); }
@keyframes vx-wipe { 0%,8% { --vx-p: 88%; } 46%,58% { --vx-p: 12%; } 92%,100% { --vx-p: 88%; } }

/* ---- 4. Speed: gauge + counter + checks ---- */
.vx-gauge { position: absolute; left: 50%; top: 18px; width: 210px; max-width: 70%; transform: translateX(-50%); overflow: visible; }
.vx-gauge path { fill: none; stroke-width: 14; stroke-linecap: round; }
.vx-gauge .trk { stroke: var(--c-line); }
.vx-gauge .arc { stroke: var(--lime); stroke-dasharray: 100; stroke-dashoffset: 100; animation: vx-arc 5s var(--ease-out) infinite; }
.vx-score {
  position: absolute; left: 50%; top: 66px; transform: translateX(-50%);
  text-align: center; line-height: 1;
}
.vx-score b {
  display: block; font-family: var(--display); font-weight: 800; font-size: 44px; letter-spacing: -.03em; color: var(--c-text);
  counter-reset: vxn var(--vx-n);
  animation: vx-count 5s var(--ease-out) infinite;
}
.vx-score b::after { content: counter(vxn); }
.vx-score small { display: block; margin-top: 4px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--c-muted); }
.vx-checks { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.vx-checks span {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; padding: 5px 10px; border-radius: 99px;
  background: var(--c-bg); color: var(--c-text); border: 1px solid var(--c-line);
  opacity: .35; animation: vx-check 5s var(--ease-out) infinite;
}
.vx-checks span:nth-child(2) { animation-delay: .25s; }
.vx-checks span:nth-child(3) { animation-delay: .5s; }
.vx-checks svg { width: 12px; height: 12px; color: var(--lime-ink); }
.svx.feature .vx-checks svg { color: var(--lime); }
@keyframes vx-arc { 0%,6% { stroke-dashoffset: 100; } 50%,84% { stroke-dashoffset: 3; } 100% { stroke-dashoffset: 100; } }
@keyframes vx-count { 0%,6% { --vx-n: 0; } 50%,84% { --vx-n: 98; } 100% { --vx-n: 0; } }
@keyframes vx-check { 0%,46% { opacity: .35; transform: translateY(4px); } 56%,86% { opacity: 1; transform: none; border-color: rgba(134,232,77,.6); } 100% { opacity: .35; } }

/* ---- fallback: orbit ---- */
.vx-orbit { position: absolute; inset: 0; display: grid; place-items: center; }
.vx-orbit i { position: absolute; border-radius: 50%; border: 1px dashed var(--c-line); animation: vx-rot 18s linear infinite; }
.vx-orbit i:nth-child(1) { width: 90px; height: 90px; }
.vx-orbit i:nth-child(2) { width: 140px; height: 140px; animation-direction: reverse; }
.vx-orbit i:nth-child(3) { width: 190px; height: 190px; }
.vx-orbit i::after { content: ""; position: absolute; top: -4px; left: 50%; width: 8px; height: 8px; border-radius: 50%; background: var(--lime); }
.vx-orbit span { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: #0A0A0A; color: var(--lime); }
.vx-orbit span svg { width: 26px; height: 26px; }
@keyframes vx-rot { to { transform: rotate(360deg); } }

.svx:hover .vx { border-color: transparent; }

/* ---- narrow cards ---- */
@container (max-width: 420px) {
  .vx { height: 170px; }
  .svx-num { font-size: 36px; }
  .vx-toast { right: 10px; top: 60px; padding: 8px 11px; }
}

/* ---- responsive grid ---- */
@media (max-width: 1020px) {
  .svx-grid > .svx, .svx-grid > .svx:nth-child(n) { grid-column: span 6; }
  .svx-grid[data-cards="1"] > .svx, .svx-grid[data-cards="3"] > .svx:nth-child(3) { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .svx-grid { gap: 16px; }
  .svx-grid > .svx, .svx-grid > .svx:nth-child(n) { grid-column: 1 / -1; }
  .svx { padding: 20px; border-radius: 24px; gap: 18px; }
  .svx:hover, html.js .svx[data-reveal].in:hover { transform: none; }
}

/* ---- reduced motion: show the finished state, no loops ---- */
@media (prefers-reduced-motion: reduce) {
  .svx, .svx * , .svx::before { animation: none !important; transition: none !important; }
  .vx-bars i { transform: none; }
  .vx-line path { stroke-dashoffset: 0; }
  .vx-chip, .vx-toast { opacity: 1; transform: none; }
  .vx-re { --vx-p: 50%; }
  .vx-gauge .arc { stroke-dashoffset: 3; }
  .vx-score b { --vx-n: 98; }
  .vx-checks span { opacity: 1; }
}
