/* Additional depth and light for the current DOCTA composition. */
[data-implant-scene] {
  --scene-light: 156 175 136;
  --scene-accent: var(--sage-dark);
}

[data-implant-scene][data-active-step="implante"] {
  --scene-light: 184 151 123;
  --scene-accent: var(--brown);
}

[data-implant-scene][data-active-step="coroa"] {
  --scene-light: 198 107 74;
  --scene-accent: var(--clay-ink);
}

[data-implant-scene] .implant-glow {
  background: radial-gradient(
    ellipse at var(--scene-pointer-x, 50%) var(--scene-pointer-y, 50%),
    rgb(var(--scene-light) / .42) 0%,
    rgb(var(--scene-light) / .23) 30%,
    rgb(228 168 142 / .1) 48%,
    transparent 68%
  );
  pointer-events: none;
}

.implant-callout,
.callout-dot {
  transition: color .3s ease, border-color .3s ease, background .3s ease, box-shadow .3s ease;
}

[data-active-step="planejamento"] .callout-three,
[data-active-step="implante"] .callout-one,
[data-active-step="coroa"] .callout-two {
  color: var(--scene-accent);
}

[data-active-step="planejamento"] .callout-three .callout-dot,
[data-active-step="implante"] .callout-one .callout-dot,
[data-active-step="coroa"] .callout-two .callout-dot {
  border-color: var(--scene-accent);
  background: var(--scene-accent);
  box-shadow: 0 0 0 5px var(--blush), 0 0 0 6px rgb(var(--scene-light) / .55);
}

.universe-card { isolation: isolate; }
.universe-card > * { position: relative; z-index: 1; }
.universe-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: radial-gradient(
    300px circle at var(--glow-pointer-x, 50%) var(--glow-pointer-y, 25%),
    rgb(245 222 211 / .14),
    transparent 70%
  );
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s ease;
}

@media (hover: hover) and (pointer: fine) and (min-width: 960px) and (prefers-reduced-motion: no-preference) {
  /* A cápsula se expande; a área de interação e os links permanecem estáveis. */
  html[data-motion="on"] .site-header::before {
    transition: transform .5s cubic-bezier(.22, 1, .36, 1),
      border-color .5s ease, box-shadow .5s ease;
  }

  html[data-motion="on"] .site-header:is(:hover, :focus-within)::before {
    transform: scale(1.015, 1.125);
    border-color: #ffffffb3;
    box-shadow: 0 16px 38px #2b262314, inset 0 1px 0 #ffffff70;
  }

  html[data-motion="on"] [data-implant-scene] { perspective: 1100px; }

  /* Depth acts on the image: the figure retains its centered scroll transform. */
  html[data-motion="on"] .implant-art {
    perspective: 1000px;
  }

  html[data-motion="on"] .implant-art img {
    rotate: var(--pointer-tilt-x, 1) var(--pointer-tilt-y, 0) 0 var(--pointer-tilt-angle, 0deg);
    transition: rotate .55s var(--ease);
  }

  html[data-motion="on"] .is-pointer-lit .implant-art img {
    transition-duration: .18s;
  }

  html[data-motion="on"] .universe-card.is-pointer-lit::before { opacity: 1; }

  html[data-motion="on"] .button-arrow {
    translate: var(--arrow-pointer-x, 0px) var(--arrow-pointer-y, 0px);
    transition: translate .25s var(--ease);
  }
}

/* Brief entry gestures preserve the native opening and focus behavior of these controls. */
html[data-motion="on"] .treatment-dialog[open] {
  animation: docta-dialog-arrive .3s ease-out both;
}

html[data-motion="on"] .faq-list details[open] > p {
  animation: docta-detail-arrive .26s ease-out both;
}

@keyframes docta-dialog-arrive {
  from { opacity: .35; translate: 0 12px; }
  to { opacity: 1; translate: 0 0; }
}

@keyframes docta-detail-arrive {
  from { opacity: .35; translate: 0 -4px; }
  to { opacity: 1; translate: 0 0; }
}

html[data-motion="off"] .implant-art img { rotate: none; }
html[data-motion="off"] .button-arrow { translate: none; }
html[data-motion="off"] .universe-card::before { opacity: 0; }
html[data-motion="off"] .implant-callout,
html[data-motion="off"] .callout-dot { transition: none; }

@media (prefers-reduced-motion: reduce) {
  .implant-art img { rotate: none !important; }
  .button-arrow { translate: none !important; }
  .universe-card::before { opacity: 0 !important; }
  .implant-callout,
  .callout-dot { transition: none !important; }
  .treatment-dialog[open],
  .faq-list details[open] > p { animation: none !important; }
}

/* Folga para o parallax do GSAP: a imagem precisa sobrar dentro da máscara,
   senão o deslocamento abre uma fresta na borda do card. A folga é dada pela
   caixa, e não por `scale` — o GSAP escreve `scale: none` inline ao assumir a
   transformação, o que anularia a propriedade individual. */
html[data-motion="on"] .treatment-card > img,
html[data-motion="on"] .doctor-portrait img {
  top: -7%;
  bottom: auto;
  height: 114%;
  max-height: none;
}

html[data-motion="on"] .doctor-portrait img {
  position: absolute;
  left: 0;
  width: 100%;
  object-fit: cover;
}

/* O parallax do hero só existe no desktop; no celular a foto tem outro
   posicionamento e não pode receber esta folga. */
@media (min-width: 960px) {
  html[data-motion="on"] .hero-photo {
    inset: -30px -2% -36px auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .treatment-card > img,
  .doctor-portrait img {
    top: 0 !important;
    bottom: 0 !important;
    height: 100% !important;
  }
  @media (min-width: 960px) {
    .hero-photo { inset: 0 -2% -25px auto !important; }
  }
}
