/* 2.0. One sketch iframe sits over the three viz faces.
   Rest is empty. After 1s the canvas fades in. */

html.talk .mode-viz {
  padding: 0;
  background: var(--bg);
}

#viz-live {
  position: absolute;
  inset: 0;
  z-index: 2;
  border: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: var(--bg);
  opacity: 0;
  /* Fade in on the first visit. Leaving snaps off, so Agent
     does not dissolve over the next slide. */
  transition: opacity 0s;
}

html.talk.is-viz-on #viz-live {
  opacity: 1;
  transition: opacity 0.85s ease;
}

#viz-heading {
  position: absolute;
  z-index: 3;
  left: 3vw;
  right: 3vw;
  bottom: 4rem;
  margin: 0;
  pointer-events: none;
  visibility: hidden;
  text-align: center;
  font-family: var(--serif);
  font-size: clamp(0.82rem, 1.15vw, 1.15rem);
  font-weight: 400;
  letter-spacing: 0.16em;
  line-height: 1.12;
  text-transform: uppercase;
  color: #fff;
  text-shadow: var(--title-shadow);
  opacity: 0;
}

html.talk.is-viz-settled #viz-heading {
  visibility: visible;
  animation: viz-head-in 1.15s ease both;
}

/* AGENT matches the talk's bottom titles. The model caption stays small. */
html.talk.is-viz-agent #viz-heading {
  font-size: 5rem;
  letter-spacing: 0.1em;
}

@keyframes viz-head-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 1100px) {
  html.talk.is-viz-agent #viz-heading {
    font-size: min(5rem, 7.2vw);
  }
}

@media (max-width: 768px) {
  #viz-heading {
    bottom: 2rem;
    font-size: min(0.78rem, 3.1vw);
    letter-spacing: 0.1em;
  }

  html.talk.is-viz-agent #viz-heading {
    font-size: min(2.75rem, 8.2vw);
    letter-spacing: 0.05em;
  }
}

@media (prefers-reduced-motion: reduce) {
  #viz-live,
  html.talk.is-viz-on #viz-live {
    transition: none;
  }
  html.talk.is-viz-on #viz-live {
    opacity: 1;
  }
  html.talk.is-viz-settled #viz-heading {
    animation: none;
    opacity: 1;
  }
}
