/* Everything the Network Touches extends the shared Animating Spark system. */

.ent-image-hero,
.ent-slide .aas-slide__visual,
.ent-slide.aas-slide__visual,
.ent-frame-build,
.ent-video-slide .aas-slide__visual,
.ent-video-slide.aas-slide__visual,
.ent-closing-slide.aas-slide__visual,
.ent-closing-slide .aas-slide__visual {
  aspect-ratio: 4 / 3;
}

.ent-image-hero {
  height: auto;
  min-height: 0;
  aspect-ratio: 8 / 5;
}

.ent-image-hero img,
.ent-image-hero video,
.ent-closing-slide img,
.ent-section-slide img {
  border: 0;
  border-radius: 0;
}

/* The reused network, Mujicomp and scale builds are 16:9 remasters. */
.ent-slide--wide .aas-slide__visual,
.ent-slide--wide.aas-slide__visual,
.ent-slide--wide.ent-frame-build,
.ent-slide--wide .ent-frame-build,
.ent-slide--wide.ent-video-slide .aas-slide__visual,
.ent-slide--wide.ent-video-slide.aas-slide__visual {
  aspect-ratio: 16 / 9;
}

/* Section artwork is full bleed outside the sidebar variant. */
.aas-media.ent-section-slide {
  width: 100vw;
  max-width: 100vw;
}

.ent-section-slide .aas-slide__visual,
.ent-section-slide.aas-slide__visual,
.ent-section-slide.ent-frame-build,
.ent-section-slide .ent-frame-build {
  aspect-ratio: 4 / 3;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.ent-section-slide .aas-slide__visual,
.ent-section-slide .ent-frame-build {
  overflow: hidden;
}

.ent-section-slide .aas-slide__visual img,
.ent-section-slide .ent-frame-build__frame {
  border: 0;
  border-radius: 0;
  background: transparent;
}

/* Revised Keynote artwork uses its native 8:5 presentation canvas. */
.ent-slide--aspect-ratio .aas-slide__visual,
.ent-slide--aspect-ratio.aas-slide__visual,
.ent-slide--aspect-ratio.ent-frame-build,
.ent-slide--aspect-ratio .ent-frame-build,
.ent-section-slide.ent-slide--aspect-ratio .aas-slide__visual,
.ent-section-slide.ent-slide--aspect-ratio.aas-slide__visual,
.ent-section-slide.ent-slide--aspect-ratio.ent-frame-build,
.ent-section-slide.ent-slide--aspect-ratio .ent-frame-build {
  aspect-ratio: 8 / 5;
}

.ent-network-build__background {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  object-fit: cover;
}

.aas-slide--network .aas-network-build__animation.ent-network-build__graph {
  z-index: 1;
  overflow: hidden;
  animation: none;
}

.ent-network-build__edge {
  fill: none;
  stroke: #272522;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 5 6;
}

.ent-network-build__node {
  overflow: visible;
}

.aas-slide--network.is-reduced .ent-network-build__graph {
  visibility: visible;
}

/*
 * Frame builds use a stable canvas. The first image is the resting frame;
 * later frames fade over it and retain their final state.
 */
.ent-frame-build {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #e9e5dc;
  contain: layout paint;
}

.aas-slide__visual > .ent-frame-build {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
}

.aas-media .ent-frame-build__frame,
.ent-frame-build__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  object-fit: cover;
  opacity: 0;
  animation: none;
  will-change: opacity;
}

.ent-frame-build__frame:first-child {
  opacity: 1;
}

.ent-withings-build__layer {
  inset: auto;
  max-width: none;
  object-fit: fill;
}

.ent-withings-build.is-reduced .ent-frame-build__frame {
  opacity: 1;
}

/* The original Withings build introduces Tom's tweet before the full stack. */
.ent-twitter-build__single {
  clip-path: polygon(22% 40%, 34% 40%, 34% 42%, 78% 42%, 78% 58%, 34% 58%, 34% 54%, 22% 54%);
}

.ent-frame-build.is-running .ent-frame-build__frame:not(:first-child) {
  animation: ent-frame-reveal var(--ent-duration, 480ms) ease-out var(--ent-delay, 0ms) both;
}

.ent-frame-build.is-paused .ent-frame-build__frame {
  animation-play-state: paused;
}

.ent-frame-build.is-reduced .ent-frame-build__frame {
  opacity: 0;
  animation: none;
  will-change: auto;
}

.ent-frame-build.is-reduced .ent-frame-build__frame:last-child {
  opacity: 1;
}

@keyframes ent-frame-reveal {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.ent-video-slide--wide .aas-slide__visual {
  aspect-ratio: 16 / 9;
  background: #080808;
}

.ent-video-slide--wide.aas-slide__visual {
  aspect-ratio: 16 / 9;
  background: #080808;
}

.ent-video-slide video {
  display: block;
  width: 100%;
  height: 100%;
  background: #080808;
  object-fit: cover;
}

.ent-video-slide--wide video {
  object-fit: contain;
}

.ent-video-slide--ibm-wide .aas-slide__visual,
.ent-video-slide--ibm-wide.aas-slide__visual {
  aspect-ratio: 16 / 9;
  background: #080808;
}

.ent-video-slide--ibm-wide video {
  object-fit: contain;
  transform: scale(1.4);
}

.ent-video-slide.is-ended video {
  opacity: 1;
}

.ent-video-slide video:focus-visible,
.ent-frame-build:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -4px;
}

.ent-video-slide :where(button, a):focus-visible,
.ent-section-slide :where(button, a):focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.aas-media.ent-closing-slide {
  margin-bottom: 0;
}

.ent-article {
  padding-bottom: 0;
}

.ent-closing-slide .aas-slide__visual,
.ent-closing-slide .ent-frame-build {
  border-right: 0;
  border-left: 0;
  border-radius: 0;
}

/* Variant B keeps all media within its reading column as it collapses. */
.aas-reading-layout--sidebar .aas-media.ent-section-slide,
.aas-reading-layout--sidebar .aas-media.ent-closing-slide {
  width: 100%;
  max-width: 100%;
  margin-right: 0;
  margin-left: 0;
  transform: none;
}

.aas-reading-layout--sidebar .aas-media.ent-section-slide img,
.aas-reading-layout--sidebar .aas-media.ent-closing-slide img {
  border: 0;
  border-radius: 0;
}

@media (max-width: 900px) {
  .ent-frame-build__frame {
    will-change: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ent-frame-build__frame {
    transition: none;
    animation: none;
    will-change: auto;
  }
}
