/* AI page — single hero mesh, left of copy, subtle internal motion */

.page-ai {
  --ai-mesh-fill: rgba(59, 130, 246, 0.1);
  --ai-mesh-stroke: rgba(37, 99, 235, 0.44);
  --ai-mesh-weave: rgba(37, 99, 235, 0.26);
  --ai-mesh-rim: rgba(37, 99, 235, 0.56);
}

.page-ai .service-hero {
  position: relative;
  overflow: hidden;
}

.ai-hero-mesh {
  position: absolute;
  top: 31%;
  left: calc(
    50% - min(var(--container-narrow), 100% - 2 * var(--container-padding)) / 2 - 11rem -
      var(--space-2)
  );
  width: 11rem;
  height: 12rem;
  margin: 0;
  pointer-events: none;
  transform: translateY(-50%);
  z-index: 0;
}

.page-ai .service-hero > .container {
  position: relative;
  z-index: 1;
}

.ai-hero-mesh .ai-oxo-cluster {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0.9;
}

.ai-oxo-cluster .ai-oxo-shell {
  fill: var(--ai-mesh-fill);
  stroke: var(--ai-mesh-stroke);
}

.ai-oxo-cluster .ai-oxo-shell--rim {
  stroke: var(--ai-mesh-rim);
  fill: rgba(59, 130, 246, 0.13);
}

.ai-oxo-cluster .ai-oxo-weave {
  stroke: var(--ai-mesh-weave);
}

.ai-oxo-shell {
  stroke-width: 1;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.ai-oxo-shell--rim {
  stroke-width: 1.2;
}

.ai-oxo-weave {
  fill: none;
  stroke-width: 0.7;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  opacity: 0.75;
}

.ai-oxo-cell {
  transform-box: fill-box;
  transform-origin: center;
}

.ai-oxo-cell:nth-child(1) {
  --ai-cell-i: 0;
  --ai-cell-shift: 1;
}

.ai-oxo-cell:nth-child(2) {
  --ai-cell-i: 1;
  --ai-cell-shift: -1;
}

.ai-oxo-cell:nth-child(3) {
  --ai-cell-i: 2;
  --ai-cell-shift: 1;
}

.ai-oxo-cell:nth-child(4) {
  --ai-cell-i: 3;
  --ai-cell-shift: -1;
}

.ai-oxo-cell:nth-child(5) {
  --ai-cell-i: 4;
  --ai-cell-shift: 1;
}

.ai-oxo-cell:nth-child(6) {
  --ai-cell-i: 5;
  --ai-cell-shift: -1;
}

.ai-oxo-cell:nth-child(7) {
  --ai-cell-i: 6;
  --ai-cell-shift: 1;
}

@keyframes ai-mesh-cell-breathe {
  0%,
  100% {
    transform: translate(0, 0);
  }

  50% {
    transform: translate(calc(var(--ai-cell-shift, 1) * 1px), -2px);
  }
}

@keyframes ai-mesh-weave-shift {
  0%,
  100% {
    opacity: 0.6;
    stroke-dashoffset: 0;
  }

  50% {
    opacity: 0.95;
    stroke-dashoffset: 6;
  }
}

@keyframes ai-mesh-drift {
  0%,
  100% {
    transform: translate(0, 0);
  }

  33% {
    transform: translate(4px, -5px);
  }

  66% {
    transform: translate(-3px, 3px);
  }
}

html[data-motion="ok"] .ai-hero-mesh .ai-oxo-cluster {
  animation: ai-mesh-drift 9s ease-in-out infinite;
}

html[data-motion="ok"] .ai-oxo-cell {
  animation: ai-mesh-cell-breathe 5.5s ease-in-out infinite;
  animation-delay: calc(var(--ai-cell-i, 0) * 0.42s);
}

html[data-motion="ok"] .ai-oxo-weave {
  stroke-dasharray: 4 6;
  animation: ai-mesh-weave-shift 4.2s ease-in-out infinite;
  animation-delay: calc(var(--ai-cell-i, 0) * 0.35s);
}

html[data-motion="off"] .ai-hero-mesh .ai-oxo-cluster,
html[data-motion="reduced"] .ai-hero-mesh .ai-oxo-cluster,
html[data-motion="off"] .ai-oxo-cell,
html[data-motion="reduced"] .ai-oxo-cell,
html[data-motion="off"] .ai-oxo-weave,
html[data-motion="reduced"] .ai-oxo-weave {
  animation: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .ai-hero-mesh .ai-oxo-cluster,
  .ai-oxo-cell,
  .ai-oxo-weave {
    animation: none !important;
  }
}

@media (max-width: 47.99rem) {
  .ai-hero-mesh {
    left: calc(var(--container-padding) - 5.5rem);
    top: 27%;
    opacity: 0.65;
  }
}

[data-theme="dark"].page-ai,
.page-ai[data-theme="dark"] {
  --ai-mesh-fill: rgba(96, 165, 250, 0.11);
  --ai-mesh-stroke: rgba(96, 165, 250, 0.48);
  --ai-mesh-weave: rgba(126, 231, 135, 0.24);
  --ai-mesh-rim: rgba(98, 230, 212, 0.46);
}

[data-theme="dark"] .page-ai .ai-oxo-cluster .ai-oxo-shell--rim,
.page-ai[data-theme="dark"] .ai-oxo-cluster .ai-oxo-shell--rim {
  fill: rgba(96, 165, 250, 0.14);
}
