/* ═══════════════════════════════════════════
   HERO , AI VISION (cenários + callouts)
   ═══════════════════════════════════════════ */

.hero-slide[data-slide-type='ai-vision'] {
  background: var(--color-black);
}

.hero-ai-vision {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}

.hero-ai-vision__scenes {
  position: absolute;
  inset: 0;
}

.hero-ai-vision__scene {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.1s var(--ease-in-out);
  pointer-events: none;
}

.hero-ai-vision__scene.is-active {
  opacity: 1;
}

.hero-ai-vision__scene img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Escurece a foto: leitura + contraste dos callouts */
.hero-ai-vision__veil {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.28) 38%, rgba(0, 0, 0, 0.62) 100%),
    linear-gradient(105deg, rgba(0, 0, 0, 0.35) 0%, transparent 55%);
}

/* Grade técnica sutil */
.hero-ai-vision__grid {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.12;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 48px 48px;
  animation: heroAiGridDrift 22s linear infinite;
}

@keyframes heroAiGridDrift {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(-48px, -48px);
  }
}

/* Acima do overlay do slide, abaixo do texto (hero-content) */
.hero-slide[data-slide-type='ai-vision'] .hero-ai-vision__callouts {
  position: absolute;
  inset: 0;
  z-index: 15;
  pointer-events: none;
}

/* ─── Callout: linha + ponto + tag + ícone (variantes por tipo de análise) ─── */
.hero-ai-callout {
  position: absolute;
  inset: 0;
  --ai-line: #22d3ee;
  --ai-glow: rgba(34, 211, 238, 0.55);
  --ai-dot-hi: #ecfeff;
  --ai-dot-mid: #22d3ee;
  --ai-dot-lo: #0891b2;
  --ai-tag-fg: #ecfeff;
  --ai-tag-bg: rgba(8, 51, 68, 0.9);
  --ai-tag-border: rgba(34, 211, 238, 0.5);
  --ai-icon: #a5f3fc;
}

.hero-ai-callout--danger {
  --ai-line: #f87171;
  --ai-glow: rgba(248, 113, 113, 0.6);
  --ai-dot-hi: #fef2f2;
  --ai-dot-mid: #f87171;
  --ai-dot-lo: #dc2626;
  --ai-tag-fg: #fef2f2;
  --ai-tag-bg: rgba(88, 28, 28, 0.92);
  --ai-tag-border: rgba(248, 113, 113, 0.55);
  --ai-icon: #fecaca;
}

.hero-ai-callout--warn {
  --ai-line: #fbbf24;
  --ai-glow: rgba(251, 191, 36, 0.55);
  --ai-dot-hi: #fffbeb;
  --ai-dot-mid: #fbbf24;
  --ai-dot-lo: #d97706;
  --ai-tag-fg: #fffbeb;
  --ai-tag-bg: rgba(92, 58, 12, 0.92);
  --ai-tag-border: rgba(251, 191, 36, 0.5);
  --ai-icon: #fde68a;
}

.hero-ai-callout--safety {
  --ai-line: #38bdf8;
  --ai-glow: rgba(56, 189, 248, 0.55);
  --ai-dot-hi: #f0f9ff;
  --ai-dot-mid: #38bdf8;
  --ai-dot-lo: #0284c7;
  --ai-tag-fg: #f0f9ff;
  --ai-tag-bg: rgba(12, 56, 92, 0.9);
  --ai-tag-border: rgba(56, 189, 248, 0.5);
  --ai-icon: #bae6fd;
}

.hero-ai-callout--ok {
  --ai-line: #4ade80;
  --ai-glow: rgba(74, 222, 128, 0.55);
  --ai-dot-hi: #ecfdf5;
  --ai-dot-mid: #4ade80;
  --ai-dot-lo: #16a34a;
  --ai-tag-fg: #ecfdf5;
  --ai-tag-bg: rgba(6, 78, 59, 0.9);
  --ai-tag-border: rgba(74, 222, 128, 0.5);
  --ai-icon: #bbf7d0;
}

.hero-ai-callout--info {
  --ai-line: #22d3ee;
  --ai-glow: rgba(34, 211, 238, 0.55);
  --ai-dot-hi: #ecfeff;
  --ai-dot-mid: #22d3ee;
  --ai-dot-lo: #0891b2;
  --ai-tag-fg: #ecfeff;
  --ai-tag-bg: rgba(8, 51, 68, 0.9);
  --ai-tag-border: rgba(34, 211, 238, 0.5);
  --ai-icon: #a5f3fc;
}

.hero-ai-callout--neutral {
  --ai-line: #c4b5fd;
  --ai-glow: rgba(196, 181, 253, 0.55);
  --ai-dot-hi: #f5f3ff;
  --ai-dot-mid: #a78bfa;
  --ai-dot-lo: #7c3aed;
  --ai-tag-fg: #f5f3ff;
  --ai-tag-bg: rgba(49, 39, 89, 0.9);
  --ai-tag-border: rgba(167, 139, 250, 0.5);
  --ai-icon: #ddd6fe;
}

.hero-ai-callout--ocr {
  --ai-line: #e879f9;
  --ai-glow: rgba(232, 121, 249, 0.5);
  --ai-dot-hi: #fdf4ff;
  --ai-dot-mid: #e879f9;
  --ai-dot-lo: #c026d3;
  --ai-tag-fg: #fdf4ff;
  --ai-tag-bg: rgba(88, 28, 88, 0.9);
  --ai-tag-border: rgba(232, 121, 249, 0.45);
  --ai-icon: #f5d0fe;
}

.hero-ai-callout--analytic {
  --ai-line: #818cf8;
  --ai-glow: rgba(129, 140, 248, 0.55);
  --ai-dot-hi: #eef2ff;
  --ai-dot-mid: #818cf8;
  --ai-dot-lo: #4f46e5;
  --ai-tag-fg: #eef2ff;
  --ai-tag-bg: rgba(36, 39, 86, 0.92);
  --ai-tag-border: rgba(129, 140, 248, 0.5);
  --ai-icon: #c7d2fe;
}

.hero-ai-callout__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.hero-ai-callout__line {
  stroke: var(--ai-line);
  stroke-width: 0.55;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 5px var(--ai-glow));
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: heroAiLineDraw 0.95s var(--ease-out) forwards;
  animation-delay: var(--ai-delay, 0ms);
}

.hero-ai-callout__dot {
  position: absolute;
  width: 11px;
  height: 11px;
  margin: 0;
  border-radius: 50%;
  background: radial-gradient(
    circle at 30% 30%,
    var(--ai-dot-hi),
    var(--ai-dot-mid) 45%,
    var(--ai-dot-lo)
  );
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.95),
    0 0 14px var(--ai-glow);
  transform: translate(-50%, -50%) scale(0);
  animation: heroAiDotIn 0.45s var(--ease-spring) forwards;
  animation-delay: calc(var(--ai-delay, 0ms) + 0.12s);
}

.hero-ai-callout__tag {
  position: absolute;
  max-width: min(220px, 46vw);
  padding: 0.32rem 0.5rem 0.36rem;
  font-family: var(--font-body);
  font-size: clamp(0.62rem, 1.05vw, 0.72rem);
  font-weight: var(--weight-semibold);
  line-height: 1.25;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ai-tag-fg);
  background: var(--ai-tag-bg);
  border: 1px solid var(--ai-tag-border);
  border-radius: var(--radius-sm);
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  transform: translate(5px, -50%) scale(0.92);
  opacity: 0;
  animation: heroAiTagIn 0.55s var(--ease-out) forwards;
  animation-delay: calc(var(--ai-delay, 0ms) + 0.38s);
}

.hero-ai-callout__tag-inner {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
}

.hero-ai-callout__icon {
  display: flex;
  flex-shrink: 0;
  color: var(--ai-icon);
  line-height: 0;
}

.hero-ai-callout__icon svg {
  width: 13px;
  height: 13px;
}

.hero-ai-callout__text {
  flex: 1;
  min-width: 0;
}

.hero-ai-callout__tag.hero-ai-callout__tag--flip {
  transform: translate(calc(-100% - 5px), -50%) scale(0.92);
  animation-name: heroAiTagInFlip;
}

@keyframes heroAiLineDraw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes heroAiDotIn {
  to {
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes heroAiTagIn {
  to {
    opacity: 1;
    transform: translate(5px, -50%) scale(1);
  }
}

@keyframes heroAiTagInFlip {
  to {
    opacity: 1;
    transform: translate(calc(-100% - 5px), -50%) scale(1);
  }
}

.hero-ai-callout--static .hero-ai-callout__line {
  animation: none;
  stroke-dashoffset: 0;
}

.hero-ai-callout--static .hero-ai-callout__dot {
  animation: none;
  transform: translate(-50%, -50%) scale(1);
}

.hero-ai-callout--static .hero-ai-callout__tag {
  animation: none;
  opacity: 1;
  transform: translate(5px, -50%) scale(1);
}

.hero-ai-callout--static .hero-ai-callout__tag.hero-ai-callout__tag--flip {
  transform: translate(calc(-100% - 5px), -50%) scale(1);
}

.hero-slide[data-slide-type='ai-vision'] .hero-content {
  z-index: var(--z-hero-content);
}

.hero-slide[data-slide-type='ai-vision'] .hero-subtitle--ai-vision {
  max-width: 520px;
}

/* ─── Mount + seção reutilizam o mesmo template (clone) ─── */
.hero-slide[data-slide-type='ai-vision'] .ai-vision-shared-mount {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.ai-vision-shared {
  position: absolute;
  inset: 0;
}

section.ai-vision-section.section {
  padding-block: 0;
  overflow: hidden;
  background: var(--color-black);
}

.ai-vision-section__canvas {
  position: relative;
  min-height: min(720px, 88vh);
  min-height: min(720px, 88dvh);
}

.ai-vision-section .ai-vision-shared-mount {
  position: absolute;
  inset: 0;
}

.ai-vision-section .hero-ai-vision__callouts {
  position: absolute;
  inset: 0;
  z-index: 15;
  pointer-events: none;
}

.ai-vision-section .hero-content {
  z-index: var(--z-hero-content);
}

.ai-vision-section .hero-subtitle--ai-vision {
  max-width: 520px;
}

.ai-vision-section .hero-content__inner {
  opacity: 1;
  transform: none;
  transition: none;
}

@media (max-width: 768px) {
  .hero-ai-callout__tag {
    /* Largura limitada à viewport (hero tem overflow:hidden , evita corte nas bordas) */
    max-width: min(240px, calc(100vw - 1.5rem));
    /* Mínimo ~11px: leitura em PT/EN com frases de vistoria */
    font-size: clamp(0.6875rem, 2.85vw, 0.78rem);
    padding: 0.3rem 0.45rem 0.34rem;
    line-height: 1.28;
  }

  .hero-ai-callout__icon svg {
    width: 12px;
    height: 12px;
  }

  .hero-ai-callout__dot {
    width: 10px;
    height: 10px;
  }

  .hero-ai-vision__grid {
    opacity: 0.07;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-ai-vision__scene {
    transition: opacity 0.4s ease;
  }

  .hero-ai-vision__grid {
    animation: none;
  }

  .hero-ai-callout__line,
  .hero-ai-callout__dot,
  .hero-ai-callout__tag {
    animation: none !important;
  }

  .hero-ai-callout__line {
    stroke-dashoffset: 0;
  }

  .hero-ai-callout__dot {
    transform: translate(-50%, -50%) scale(1);
  }

  .hero-ai-callout__tag {
    opacity: 1;
    transform: translate(5px, -50%) scale(1);
  }

  .hero-ai-callout__tag.hero-ai-callout__tag--flip {
    transform: translate(calc(-100% - 5px), -50%) scale(1);
  }
}
