/* ============================================================
   AI Medical Visualization Loop — hero showcase banner
   All selectors are scoped under .ai-viz and all keyframes are
   prefixed with "aiv-" so nothing leaks into the rest of the site.
   ============================================================ */

.ai-viz {
  --aiv-cyan: #00e5ff;
  --aiv-purple: #7c3aed;
  --aiv-white: rgba(235, 250, 255, 0.94);
  --aiv-soft-white: rgba(235, 250, 255, 0.76);
  --aiv-loop: 18s;

  /* Full-bleed hero backdrop: fills the hero's first screen and sits
     behind the headline/buttons (those use z-index: 2). */
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;
  max-width: none;
  margin: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.6;
  color: var(--aiv-white);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Vignette so the centered headline keeps strong contrast over the
   bright core. Painted above the scene but below the hero text. */
.ai-viz::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 55% at 50% 45%, rgba(4, 16, 24, 0.78) 0%, rgba(4, 16, 24, 0.28) 45%, transparent 72%),
    linear-gradient(to bottom, rgba(4, 16, 24, 0.35) 0%, transparent 30%, transparent 70%, rgba(4, 16, 24, 0.55) 100%);
}

.ai-viz * {
  box-sizing: border-box;
}

.ai-viz .scene {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: transparent;
  perspective: 1200px;
  isolation: isolate;
  animation: aiv-cameraDrift var(--aiv-loop) ease-in-out infinite alternate;
}

.ai-viz .ambient-glow {
  display: none;
}

.ai-viz .core-wrap {
  position: absolute;
  left: 15%;
  top: 50%;
  width: 310px;
  height: 310px;
  transform: translateY(-50%);
  z-index: 8;
  filter: drop-shadow(0 0 34px rgba(0, 229, 255, 0.38));
  animation: aiv-focusBreath 7s ease-in-out infinite;
}

.ai-viz .core {
  position: absolute;
  inset: 58px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 45%, rgba(255,255,255,0.95) 0 2px, transparent 3px),
    radial-gradient(circle, rgba(0, 229, 255, 0.5), rgba(124, 58, 237, 0.22) 40%, rgba(0, 0, 0, 0.08) 72%);
  box-shadow:
    inset 0 0 44px rgba(0, 229, 255, 0.46),
    0 0 70px rgba(0, 229, 255, 0.35),
    0 0 115px rgba(124, 58, 237, 0.25);
  animation: aiv-coreActivate var(--aiv-loop) ease-in-out infinite, aiv-breathe 3.2s ease-in-out infinite;
}

.ai-viz .core::before,
.ai-viz .core::after {
  content: "";
  position: absolute;
  inset: -44px;
  border-radius: 50%;
  border: 1px solid rgba(0, 229, 255, 0.28);
  box-shadow: 0 0 30px rgba(0, 229, 255, 0.2);
  animation: aiv-softOrbit 12s linear infinite;
}

.ai-viz .core::after {
  inset: -78px;
  border-color: rgba(124, 58, 237, 0.25);
  animation-duration: 18s;
  animation-direction: reverse;
  opacity: 0.75;
}

.ai-viz .orbit {
  position: absolute;
  inset: 24px;
  border: 1px solid rgba(0, 229, 255, 0.12);
  border-radius: 50%;
  transform: rotateX(68deg) rotateZ(0deg);
  animation: aiv-orbitSpin 9s linear infinite;
}

.ai-viz .orbit:nth-child(2) {
  inset: 38px;
  border-color: rgba(124, 58, 237, 0.18);
  transform: rotateX(72deg) rotateY(26deg);
  animation-duration: 12s;
  animation-direction: reverse;
}

.ai-viz .waveform {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transform: translateZ(90px);
  z-index: 4;
}

.ai-viz .bar {
  width: 4px;
  height: 38px;
  border-radius: 999px;
  background: linear-gradient(var(--aiv-cyan), rgba(124, 58, 237, 0.75));
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.82);
  animation: aiv-voice 1.1s ease-in-out infinite;
  opacity: 0.9;
}

.ai-viz .bar:nth-child(2n) { animation-duration: 0.84s; height: 54px; }
.ai-viz .bar:nth-child(3n) { animation-duration: 1.36s; height: 82px; }
.ai-viz .bar:nth-child(4n) { animation-duration: 1.7s; height: 30px; }

.ai-viz .particle-field,
.ai-viz .stream-particles {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}

.ai-viz .particle,
.ai-viz .stream-dot {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--aiv-cyan);
  box-shadow: 0 0 13px rgba(0, 229, 255, 0.95);
  opacity: 0;
}

.ai-viz .energy-lines {
  position: absolute;
  left: 30%;
  top: 34%;
  width: 46%;
  height: 31%;
  z-index: 5;
  opacity: 0;
  filter: drop-shadow(0 0 12px rgba(0, 229, 255, 0.52));
  animation: aiv-linesLoop var(--aiv-loop) ease-in-out infinite;
}

.ai-viz .energy-lines path {
  fill: none;
  stroke: url(#aivEnergyGradient);
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-dasharray: 12 22;
  animation: aiv-dashFlow 2.4s linear infinite;
}

.ai-viz .arrival-burst {
  position: absolute;
  right: 38.5%;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(0, 229, 255, 0.92);
  box-shadow:
    0 0 16px rgba(0, 229, 255, 0.78),
    0 0 36px rgba(124, 58, 237, 0.46);
  opacity: 0;
  z-index: 11;
  animation: aiv-arrivalBurst var(--aiv-loop) ease-out infinite;
}

.ai-viz .report {
  position: absolute;
  right: 7%;
  top: 50%;
  width: 34%;
  height: 70%;
  transform: translateY(-50%) translateZ(160px) scale(0.88);
  border: 1px solid rgba(0, 229, 255, 0.28);
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.018)),
    radial-gradient(circle at 18% 8%, rgba(0, 229, 255, 0.13), transparent 30%),
    radial-gradient(circle at 88% 92%, rgba(124, 58, 237, 0.10), transparent 34%),
    rgba(4, 11, 18, 0.38);
  backdrop-filter: blur(20px) saturate(1.45);
  -webkit-backdrop-filter: blur(20px) saturate(1.45);
  box-shadow:
    inset 0 0 34px rgba(0, 229, 255, 0.045),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 42px rgba(0, 229, 255, 0.14),
    0 24px 82px rgba(0, 0, 0, 0.48);
  padding: 20px 16px 20px 18px;
  overflow: hidden;
  z-index: 10;
  opacity: 0;
  clip-path: inset(0 100% 0 0 round 28px);
  animation: aiv-reportPopLoop var(--aiv-loop) cubic-bezier(.16, 1, .3, 1) infinite;
}

.ai-viz .report::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(120deg, transparent, rgba(0, 229, 255, 0.16), transparent);
  transform: translateX(-120%);
  animation: aiv-lightPass var(--aiv-loop) ease-in-out infinite;
  pointer-events: none;
  z-index: 3;
}

.ai-viz .report::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(0, 229, 255, 0.18);
  opacity: 0;
  animation: aiv-panelShockwave var(--aiv-loop) ease-out infinite;
  pointer-events: none;
}

.ai-viz .report-grid {
  position: relative;
  z-index: 2;
  height: 100%;
  overflow: hidden;
  padding: 0;
  pointer-events: none;
  user-select: none;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.ai-viz .report-grid::-webkit-scrollbar {
  display: none;
}

.ai-viz .report-grid::before,
.ai-viz .report-grid::after {
  bottom: 0;
  background: linear-gradient(to top, rgba(4, 11, 18, 0.72), transparent);
}

.ai-viz .scroll-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  will-change: transform;
  transform: translateY(0);
}

.ai-viz .section {
  flex-shrink: 0;
  position: relative;
  border: 1px solid rgba(0, 229, 255, 0.12);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(0, 229, 255, 0.045), rgba(124, 58, 237, 0.022));
  padding: 12px 14px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(18px);
  animation: aiv-sectionLoop var(--aiv-loop) cubic-bezier(.16, 1, .3, 1) infinite;
}

.ai-viz .section:nth-child(1) { animation-delay: 0s; }
.ai-viz .section:nth-child(2) { animation-delay: 0.16s; }
.ai-viz .section:nth-child(3) { animation-delay: 0.32s; }
.ai-viz .section:nth-child(4) { animation-delay: 0.48s; }

.ai-viz .section span {
  display: block;
  color: rgba(0, 229, 255, 0.95);
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 7px;
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.55);
}

.ai-viz .section p {
  margin: 0;
  color: rgba(235, 250, 255, 0.78);
  font-size: 11px;
  line-height: 1.66;
  letter-spacing: 0.02em;
  text-shadow: 0 0 14px rgba(0, 0, 0, 0.32);
}

.ai-viz .section strong {
  color: var(--aiv-white);
  font-weight: 650;
}

.ai-viz .scroll-hint {
  display: none;
}

.ai-viz .final-pulse {
  position: absolute;
  left: 23%;
  top: 50%;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(0, 229, 255, 0.45);
  opacity: 0;
  z-index: 18;
  animation: aiv-finalPulse var(--aiv-loop) ease-out infinite;
}

@keyframes aiv-cameraDrift {
  from { transform: scale(1.015) translate3d(-8px, 3px, 0); }
  to { transform: scale(1.045) translate3d(8px, -5px, 0); }
}

@keyframes aiv-focusBreath {
  0%, 100% { filter: drop-shadow(0 0 34px rgba(0, 229, 255, 0.38)) blur(0); }
  50% { filter: drop-shadow(0 0 58px rgba(0, 229, 255, 0.52)) blur(0.25px); }
}

@keyframes aiv-breathe {
  0%, 100% { transform: scale(0.96); opacity: 0.86; }
  50% { transform: scale(1.04); opacity: 1; }
}

@keyframes aiv-coreActivate {
  0%, 8% { filter: brightness(1.6); }
  18%, 100% { filter: brightness(1); }
}

@keyframes aiv-softOrbit {
  to { transform: rotate(360deg); }
}

@keyframes aiv-orbitSpin {
  to { transform: rotateX(68deg) rotateZ(360deg); }
}

@keyframes aiv-voice {
  0%, 100% { transform: scaleY(0.38); opacity: 0.55; }
  50% { transform: scaleY(1.35); opacity: 1; }
}

@keyframes aiv-dashFlow {
  to { stroke-dashoffset: -68; }
}

@keyframes aiv-linesLoop {
  0%, 8% { opacity: 0; transform: translateX(-12px); }
  14%, 64% { opacity: 0.86; transform: translateX(0); }
  76%, 100% { opacity: 0; transform: translateX(16px); }
}

@keyframes aiv-arrivalBurst {
  0%, 24% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.25);
  }

  29% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }

  34% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(8);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(8);
  }
}

@keyframes aiv-reportPopLoop {
  0%, 29% {
    opacity: 0;
    clip-path: inset(0 100% 0 0 round 28px);
    filter: blur(8px);
    transform: translateY(-50%) translateZ(160px) scale(0.88);
  }

  34% {
    opacity: 1;
    clip-path: inset(0 0 0 0 round 28px);
    filter: blur(0);
    transform: translateY(-50%) translateZ(160px) scale(1.035);
  }

  39%, 82% {
    opacity: 1;
    clip-path: inset(0 0 0 0 round 28px);
    filter: blur(0);
    transform: translateY(-50%) translateZ(160px) scale(1);
  }

  92%, 100% {
    opacity: 0;
    clip-path: inset(0 100% 0 0 round 28px);
    filter: blur(8px);
    transform: translateY(-50%) translateZ(160px) scale(0.9);
  }
}

@keyframes aiv-sectionLoop {
  0%, 31% {
    opacity: 0;
    transform: translateY(18px);
  }

  39%, 82% {
    opacity: 1;
    transform: translateY(0);
  }

  92%, 100% {
    opacity: 0;
    transform: translateY(-10px);
  }
}

@keyframes aiv-lightPass {
  0%, 35% { transform: translateX(-125%); opacity: 0; }
  48% { opacity: 1; }
  62% { transform: translateX(125%); opacity: 0; }
  100% { transform: translateX(125%); opacity: 0; }
}

@keyframes aiv-panelShockwave {
  0%, 30% { opacity: 0; transform: scale(0.96); }
  34% { opacity: 0.8; transform: scale(1); }
  42% { opacity: 0; transform: scale(1.08); }
  100% { opacity: 0; transform: scale(1.08); }
}

@keyframes aiv-finalPulse {
  0%, 74% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.2);
    box-shadow: 0 0 18px rgba(0, 229, 255, 0.5);
  }

  80% {
    opacity: 0.85;
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(13);
    box-shadow: 0 0 120px rgba(0, 229, 255, 0.2);
  }
}

/* injected by JS, kept here for reference / no-JS fallback parity */
@keyframes aiv-dust {
  from {
    transform: translate3d(-8px, 8px, 0) scale(.7);
    filter: blur(0);
  }
  to {
    transform: translate3d(15px, -17px, 0) scale(1.25);
    filter: blur(.4px);
  }
}

@keyframes aiv-streamToReport {
  0%, 8% {
    opacity: 0;
    transform: translate3d(0, 0, 0) scale(.25);
    filter: blur(0);
  }
  12% { opacity: .95; }
  26% {
    opacity: .9;
    transform: translate3d(32%, var(--curve), 0) scale(1.1);
    filter: blur(.1px);
  }
  31% {
    opacity: 1;
    transform: translate3d(50%, var(--rise), 0) scale(.55);
    filter: blur(.2px);
  }
  36% {
    opacity: 0;
    transform: translate3d(53%, var(--rise), 0) scale(.08);
    filter: blur(5px);
  }
  100% {
    opacity: 0;
    transform: translate3d(53%, var(--rise), 0) scale(.08);
    filter: blur(5px);
  }
}

/* ============================================================
   RESPONSIVE LAYOUT
   The scene was designed for a full 16:9 viewport with several
   fixed-px elements. These breakpoints scale the core down and
   progressively simplify the composition so it never overflows
   or overlaps on smaller screens.
   ============================================================ */

/* Large tablet / small desktop — shift the whole scene left so the
   perspective-magnified report panel stops clipping at the right edge
   (there is spare space on the left). */
@media (max-width: 1100px) {
  .ai-viz { transform: translateX(-4%); }
  .ai-viz .core-wrap { width: 260px; height: 260px; left: 13%; }
  .ai-viz .core { inset: 46px; }
  .ai-viz .report { right: 9%; }
  .ai-viz .section p { font-size: 10.5px; }
}

/* Tablet */
@media (max-width: 880px) {
  .ai-viz { transform: translateX(-7%); }
  .ai-viz .core-wrap { width: 210px; height: 210px; left: 11%; }
  .ai-viz .core { inset: 38px; }
  .ai-viz .report { width: 40%; right: 11%; height: 76%; }
  .ai-viz .section span { font-size: 9px; margin-bottom: 5px; }
  .ai-viz .section p { font-size: 9.5px; line-height: 1.55; }
  .ai-viz .section { padding: 10px 11px; }
}

/* Small tablet / large phone — drop the report panel, center the core
   so the backdrop reads as a clean glowing orb behind the headline. */
@media (max-width: 680px) {
  .ai-viz { opacity: 0.5; transform: none; }
  .ai-viz .core-wrap {
    left: 50%;
    top: 40%;
    transform: translate(-50%, -50%);
    width: 220px;
    height: 220px;
  }
  .ai-viz .core { inset: 40px; }
  .ai-viz .report,
  .ai-viz .energy-lines,
  .ai-viz .arrival-burst,
  .ai-viz .stream-particles,
  .ai-viz .final-pulse { display: none; }
}

/* Phone */
@media (max-width: 420px) {
  .ai-viz .core-wrap { width: 170px; height: 170px; }
  .ai-viz .core { inset: 30px; }
  .ai-viz .bar { height: 30px; }
  .ai-viz .bar:nth-child(3n) { height: 60px; }
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .ai-viz .scene,
  .ai-viz .core,
  .ai-viz .core::before,
  .ai-viz .core::after,
  .ai-viz .orbit,
  .ai-viz .core-wrap,
  .ai-viz .report,
  .ai-viz .report::before,
  .ai-viz .report::after,
  .ai-viz .section,
  .ai-viz .energy-lines,
  .ai-viz .energy-lines path,
  .ai-viz .arrival-burst,
  .ai-viz .final-pulse,
  .ai-viz .bar {
    animation: none !important;
  }
  .ai-viz .report,
  .ai-viz .section { opacity: 1; clip-path: none; transform: translateY(-50%) translateZ(160px); }
  .ai-viz .section { transform: none; }
}
