/* ============================================================
         SERVICE CARDS — animation system v3
         Idle ambient + hover gesture. GPU-only transforms.
         ============================================================ */

.svc-stage {
  isolation: isolate;
}

/* ---- Bottom row: stable position; only scale on hover.
              Push-apart still applied via :has() to siblings. ---- */
.card-hover.push-l:hover,
.card-hover.push-c:hover,
.card-hover.push-r:hover {
  transform: scale(1.025) !important;
  box-shadow: 0 22px 48px -22px rgba(0, 0, 0, 0.18);
}
.svc-row .push-l,
.svc-row .push-c,
.svc-row .push-r {
  transition:
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
.svc-row:has(.push-l:hover) .push-c:not(:hover) {
  transform: translate3d(8px, 0, 0);
}
.svc-row:has(.push-l:hover) .push-r:not(:hover) {
  transform: translate3d(14px, 0, 0);
}
.svc-row:has(.push-c:hover) .push-l:not(:hover) {
  transform: translate3d(-12px, 0, 0);
}
.svc-row:has(.push-c:hover) .push-r:not(:hover) {
  transform: translate3d(12px, 0, 0);
}
.svc-row:has(.push-r:hover) .push-l:not(:hover) {
  transform: translate3d(-14px, 0, 0);
}
.svc-row:has(.push-r:hover) .push-c:not(:hover) {
  transform: translate3d(-8px, 0, 0);
}

/* =========================================================
         1. WEB DESIGN — code editor + cursor blink + live preview
         ========================================================= */
.svc-web .editor {
  background: #0e0e10;
  border-radius: 10px;
  padding: 16px 20px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11.5px;
  line-height: 1.85;
  color: #e6e6e6;
  position: relative;
  overflow: hidden;
  height: 100%;
}
.svc-web .editor-traffic {
  margin-bottom: 12px;
}
.svc-web .editor-traffic span {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 4px;
}
.svc-web .code-row {
  white-space: pre;
  opacity: 0;
  transform: translate3d(-6px, 0, 0);
  animation: code-line-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.svc-web .code-row .caret {
  display: inline-block;
  width: 5px;
  height: 10px;
  background: #c8f062;
  margin-left: 1px;
  vertical-align: -1px;
  animation: caret-blink 1s steps(1) infinite;
}
@keyframes caret-blink {
  50% {
    opacity: 0;
  }
}
@keyframes code-line-in {
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}
/* Idle: rows reveal once on load via stagger; cycle re-runs on hover */
.svc-web .code-row.cr1 {
  animation-delay: 0.1s;
}
.svc-web .code-row.cr2 {
  animation-delay: 0.35s;
}
.svc-web .code-row.cr3 {
  animation-delay: 0.6s;
}
.svc-web .code-row.cr4 {
  animation-delay: 0.85s;
}
.svc-web .code-row.cr5 {
  animation-delay: 1.1s;
}
.svc-web .code-row.cr6 {
  animation-delay: 1.35s;
}
.svc-web:hover .code-row {
  animation: code-line-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.svc-web:hover .code-row.cr1 {
  animation-delay: 0s;
}
.svc-web:hover .code-row.cr2 {
  animation-delay: 0.12s;
}
.svc-web:hover .code-row.cr3 {
  animation-delay: 0.24s;
}
.svc-web:hover .code-row.cr4 {
  animation-delay: 0.36s;
}
.svc-web:hover .code-row.cr5 {
  animation-delay: 0.48s;
}
.svc-web:hover .code-row.cr6 {
  animation-delay: 0.6s;
}

.svc-web .preview {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 88px;
  height: 64px;
  background: #fff;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.5);
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transform: translate3d(0, 0, 0) scale(1);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform;
}
.svc-web:hover .preview {
  transform: translate3d(-2px, -2px, 0) scale(1.06);
}
.svc-web .preview .pv-bar {
  height: 3px;
  border-radius: 2px;
  background: #ececec;
}
.svc-web .preview .pv-bar.pv-accent {
  background: #c8f062;
  width: 40%;
}
.svc-web .preview .pv-block {
  flex: 1;
  background: #0b0b0c;
  border-radius: 3px;
  animation: pv-pulse 3s ease-in-out infinite;
}
@keyframes pv-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.75;
  }
}
.tok-key {
  color: #c084fc;
}
.tok-fn {
  color: #c8f062;
}
.tok-str {
  color: #fde68a;
}
.tok-tag {
  color: #7dd3fc;
}
.tok-com {
  color: #6b7280;
}

/* =========================================================
         2. SAAS — idle: subtle dot pulse + tiny chart breath
                hover: full redraw + ring + counter
         ========================================================= */
.svc-saas .chart-line {
  stroke-dasharray: 700;
  stroke-dashoffset: 0;
}
.svc-saas .chart-area {
  transition: opacity 0.6s ease;
}
.svc-saas .chart-dot,
.svc-saas .chart-pulse {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-left: -4px;
  margin-top: -4px;
  pointer-events: none;
}
.svc-saas .chart-dot {
  background: #0b0b0c;
  animation: dot-breath 2.4s ease-in-out infinite;
  will-change: transform;
}
@keyframes dot-breath {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.3);
  }
}
.svc-saas .chart-pulse {
  background: transparent;
  border: 1.5px solid rgba(11, 11, 12, 0.35);
  animation: pulse-ring 2.4s ease-out infinite;
  will-change: transform, opacity;
}
@keyframes pulse-ring {
  0% {
    transform: scale(0.6);
    opacity: 0.7;
  }
  100% {
    transform: scale(2.6);
    opacity: 0;
  }
}
.svc-saas .spark {
  animation: spark-rise 2.6s ease-in-out infinite;
  transform-origin: bottom;
}
@keyframes spark-rise {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}
.svc-saas:hover .chart-line {
  animation: chart-redraw 1.4s cubic-bezier(0.65, 0, 0.35, 1);
}
.svc-saas:hover .chart-area {
  animation: chart-fade 1.4s ease;
}
@keyframes chart-redraw {
  0% {
    stroke-dashoffset: 700;
  }
  100% {
    stroke-dashoffset: 0;
  }
}
@keyframes chart-fade {
  0%,
  50% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}
.revenue-num {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

/* =========================================================
         3. MOBILE — idle: notif blink, soft phone bob, streak shimmer
                hover: tilt + scale + 12 → 13
         ========================================================= */
.svc-mobile .phone-shell {
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  animation: phone-bob 4.5s ease-in-out infinite;
  will-change: transform;
}
@keyframes phone-bob {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -3px, 0);
  }
}
.svc-mobile:hover .phone-shell {
  animation: none;
  transform: translate3d(0, -6px, 0) rotate(-3deg);
}
.svc-mobile .streak-card {
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
  will-change: transform;
}
.svc-mobile .streak-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    transparent 30%,
    rgba(255, 255, 255, 0.55) 50%,
    transparent 70%
  );
  transform: translateX(-100%);
  animation: streak-shimmer 4s ease-in-out infinite;
}
@keyframes streak-shimmer {
  0%,
  100% {
    transform: translateX(-100%);
  }
  45% {
    transform: translateX(100%);
  }
  55% {
    transform: translateX(100%);
  }
}
.svc-mobile:hover .streak-card {
  transform: scale(1.08);
}
.streak-num {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}
.streak-num .digit-flip {
  display: inline-block;
  transition:
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.3s ease;
  will-change: transform, opacity;
}
.notif-dot {
  transition:
    transform 0.4s ease,
    background-color 0.3s ease;
  animation: notif-pulse 1.8s ease-in-out infinite;
}
@keyframes notif-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}
.svc-mobile:hover .notif-dot {
  animation: none;
  transform: scale(1.4);
  background: #c8f062;
}

/* =========================================================
         4. STRATEGY — idle: notes breathe slightly, dot pulses
                hover: notes nudge outward + journey re-fills
         ========================================================= */
.sticky-note {
  will-change: transform;
  transform: rotate(var(--rot, 0deg));
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  animation: sn-breathe 5s ease-in-out infinite;
}
@keyframes sn-breathe {
  0%,
  100% {
    transform: rotate(var(--rot, 0deg)) translate3d(0, 0, 0);
  }
  50% {
    transform: rotate(var(--rot, 0deg)) translate3d(0, -1.5px, 0);
  }
}
.sn1 {
  --rot: -2deg;
  animation-delay: 0s;
}
.sn2 {
  --rot: 1.5deg;
  animation-delay: 0.4s;
}
.sn3 {
  --rot: -1deg;
  animation-delay: 0.8s;
}
.sn4 {
  --rot: 1deg;
  animation-delay: 1.2s;
}
.sn5 {
  --rot: -1.5deg;
  animation-delay: 1.6s;
}
.sn6 {
  --rot: 2deg;
  animation-delay: 2s;
}
.svc-strategy:hover .sticky-note {
  animation: none;
}
.svc-strategy:hover .sn1 {
  transform: translate3d(-3px, -3px, 0) rotate(-4deg);
  transition-delay: 0s;
}
.svc-strategy:hover .sn2 {
  transform: translate3d(0px, -4px, 0) rotate(3deg);
  transition-delay: 0.05s;
}
.svc-strategy:hover .sn3 {
  transform: translate3d(3px, -3px, 0) rotate(-2deg);
  transition-delay: 0.1s;
}
.svc-strategy:hover .sn4 {
  transform: translate3d(-3px, 3px, 0) rotate(2deg);
  transition-delay: 0.15s;
}
.svc-strategy:hover .sn5 {
  transform: translate3d(0px, 4px, 0) rotate(-3deg);
  transition-delay: 0.2s;
}
.svc-strategy:hover .sn6 {
  transform: translate3d(3px, 3px, 0) rotate(4deg);
  transition-delay: 0.25s;
}

.journey-fill {
  transform-origin: left center;
  transform: scaleX(1);
  will-change: transform;
}
.journey-dot {
  animation: jd-pulse 1.8s ease-in-out infinite;
}
.journey-dot.jd2 {
  animation-delay: 0.3s;
}
@keyframes jd-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.4);
  }
}
.svc-strategy:hover .jf1 {
  animation: jf 0.7s cubic-bezier(0.65, 0, 0.35, 1) 0s both;
}
.svc-strategy:hover .jf2 {
  animation: jf 0.7s cubic-bezier(0.65, 0, 0.35, 1) 0.2s both;
}
.svc-strategy:hover .jf3 {
  animation: jf 0.7s cubic-bezier(0.65, 0, 0.35, 1) 0.4s both;
}
@keyframes jf {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

/* =========================================================
         5. AI AGENT — idle: full message cycle loops continuously
                hover: restart from beginning
         ========================================================= */
.agent-msg {
  will-change: transform, opacity;
  opacity: 0;
  transform: translate3d(0, 6px, 0) scale(0.97);
  animation: msg-cycle 8s cubic-bezier(0.22, 1, 0.36, 1) infinite both;
}
.agent-msg.am1 {
  animation-delay: 0s;
}
.agent-msg.am2 {
  animation-delay: 0.7s;
}
.agent-msg.am3 {
  animation-delay: 1.4s;
}
.agent-msg.am4 {
  animation-delay: 2.1s;
}
@keyframes msg-cycle {
  0% {
    opacity: 0;
    transform: translate3d(0, 6px, 0) scale(0.97);
  }
  6% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
  78% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
  85% {
    opacity: 0;
    transform: translate3d(0, -4px, 0) scale(0.98);
  }
  100% {
    opacity: 0;
    transform: translate3d(0, 6px, 0) scale(0.97);
  }
}
/* Hover restarts the cycle by re-applying the animation */
.svc-agent:hover .agent-msg {
  animation: msg-cycle 8s cubic-bezier(0.22, 1, 0.36, 1) infinite both;
}
.svc-agent:hover .am1 {
  animation-delay: 0s;
}
.svc-agent:hover .am2 {
  animation-delay: 0.7s;
}
.svc-agent:hover .am3 {
  animation-delay: 1.4s;
}
.svc-agent:hover .am4 {
  animation-delay: 2.1s;
}

.typing-dot {
  display: inline-block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  margin: 0 1px;
  opacity: 0.35;
  animation: tdot 1s ease-in-out infinite;
}
.typing-dot:nth-child(2) {
  animation-delay: 0.12s;
}
.typing-dot:nth-child(3) {
  animation-delay: 0.24s;
}
@keyframes tdot {
  0%,
  80%,
  100% {
    opacity: 0.3;
    transform: translate3d(0, 0, 0);
  }
  40% {
    opacity: 1;
    transform: translate3d(0, -2px, 0);
  }
}
.live-dot {
  position: relative;
}
.live-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: inherit;
  opacity: 0;
  animation: live-ring 1.6s ease-out infinite;
}
@keyframes live-ring {
  0% {
    transform: scale(1);
    opacity: 0.55;
  }
  100% {
    transform: scale(3);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .svc-stage *,
  .svc-row *,
  .step-card * {
    animation: none !important;
    transition: none !important;
  }
}
/* ============================================================
         PROCESS STEP CARDS — Stage 1, 2, 3
         Idle ambient + hover gesture. GPU-only.
         ============================================================ */

/* ---- Step 1: Discovery & Scope ---- */
.step-1 .brief-status {
  position: relative;
  animation: brief-status-pulse 2s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(163, 230, 53, 0.6);
}
@keyframes brief-status-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(163, 230, 53, 0.55);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(163, 230, 53, 0);
  }
}
.step-1 .brief-bar {
  transform-origin: left center;
  animation: brief-bar-write 4.5s ease-in-out infinite;
}
.step-1 .brief-bar.bb1 {
  animation-delay: 0s;
}
.step-1 .brief-bar.bb2 {
  animation-delay: 0.4s;
}
.step-1 .brief-bar.bb3 {
  animation-delay: 0.8s;
}
.step-1 .brief-bar.bb4 {
  animation-delay: 1.2s;
}
@keyframes brief-bar-write {
  0%,
  35%,
  100% {
    transform: scaleX(1);
    opacity: 1;
  }
  45% {
    transform: scaleX(0);
    opacity: 0.6;
  }
  65% {
    transform: scaleX(1);
    opacity: 1;
  }
}
.step-1 .brief-tag {
  animation: brief-tag-bob 3s ease-in-out infinite;
}
.step-1 .brief-tag.bt1 {
  animation-delay: 0s;
}
.step-1 .brief-tag.bt2 {
  animation-delay: 0.2s;
}
.step-1 .brief-tag.bt3 {
  animation-delay: 0.4s;
}
@keyframes brief-tag-bob {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -1.5px, 0);
  }
}
.step-1 .brief-check {
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: brief-check-draw 3.5s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}
@keyframes brief-check-draw {
  0% {
    stroke-dashoffset: 30;
  }
  20% {
    stroke-dashoffset: 0;
  }
  85% {
    stroke-dashoffset: 0;
  }
  100% {
    stroke-dashoffset: 30;
  }
}
.step-1:hover .brief-version {
  animation: brief-version-flip 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes brief-version-flip {
  0% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -6px, 0);
    opacity: 0;
  }
  51% {
    transform: translate3d(0, 6px, 0);
  }
  100% {
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
}

/* ---- Step 2: Design & Engineering ---- */
.step-2 .step2-line {
  opacity: 0;
  transform: translate3d(-4px, 0, 0);
  animation: s2-line 6s cubic-bezier(0.22, 1, 0.36, 1) infinite both;
}
.step-2 .step2-line.s2l1 {
  animation-delay: 0s;
}
.step-2 .step2-line.s2l2 {
  animation-delay: 0.25s;
}
.step-2 .step2-line.s2l3 {
  animation-delay: 0.5s;
}
.step-2 .step2-line.s2l4 {
  animation-delay: 0.75s;
}
@keyframes s2-line {
  0% {
    opacity: 0;
    transform: translate3d(-4px, 0, 0);
  }
  12% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
  82% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
  92% {
    opacity: 0;
    transform: translate3d(-4px, 0, 0);
  }
  100% {
    opacity: 0;
    transform: translate3d(-4px, 0, 0);
  }
}
.step-2 .step2-caret {
  display: inline-block;
  width: 5px;
  height: 10px;
  background: #c8f062;
  margin-left: 1px;
  vertical-align: -1px;
  animation: caret-blink 1s steps(1) infinite;
}
.step-2 .step2-pr {
  position: relative;
  overflow: hidden;
}
.step-2 .step2-pr::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    transparent 30%,
    rgba(16, 185, 129, 0.18) 50%,
    transparent 70%
  );
  transform: translateX(-100%);
  animation: pr-shimmer 6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes pr-shimmer {
  0%,
  60%,
  100% {
    transform: translateX(-100%);
  }
  75% {
    transform: translateX(100%);
  }
}
.step-2 .step2-diff {
  animation: diff-tick 6s ease-in-out infinite;
}
@keyframes diff-tick {
  0%,
  70%,
  100% {
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
  75% {
    transform: translate3d(0, -3px, 0);
    opacity: 0.6;
  }
  80% {
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
}
.step-2:hover .step2-line {
  animation: s2-line-hover 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.step-2:hover .step2-line.s2l1 {
  animation-delay: 0s;
}
.step-2:hover .step2-line.s2l2 {
  animation-delay: 0.1s;
}
.step-2:hover .step2-line.s2l3 {
  animation-delay: 0.2s;
}
.step-2:hover .step2-line.s2l4 {
  animation-delay: 0.3s;
}
@keyframes s2-line-hover {
  from {
    opacity: 0;
    transform: translate3d(-4px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/* ---- Step 3: Launch & Scale ---- */
.step-3 .spark-line {
  stroke-dasharray: 240;
  stroke-dashoffset: 0;
  animation: spark-redraw 5s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}
@keyframes spark-redraw {
  0% {
    stroke-dashoffset: 240;
  }
  25% {
    stroke-dashoffset: 0;
  }
  85% {
    stroke-dashoffset: 0;
  }
  100% {
    stroke-dashoffset: 240;
  }
}
.step-3 .spark-area {
  animation: spark-area-fade 5s ease infinite;
}
@keyframes spark-area-fade {
  0% {
    opacity: 0;
  }
  25% {
    opacity: 0;
  }
  45% {
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
.step-3 .mrr-num {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}
.step-3 .mrr-badge {
  display: inline-block;
  animation: mrr-badge-bob 3s ease-in-out infinite;
  will-change: transform;
}
@keyframes mrr-badge-bob {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -2px, 0);
  }
}
.step-3:hover .mrr-badge {
  animation: mrr-badge-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes mrr-badge-pop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.12);
  }
  100% {
    transform: scale(1);
  }
}

/* Shared: cards lift slightly on hover */
.step-card {
  transition:
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.step-card:hover {
  transform: translate3d(0, -3px, 0);
  box-shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.18);
}
