html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  background: #000;
  overflow: hidden;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

/* Text bar height, used across devices */
:root {
  --textbar-h: 100px;
}

#slide {
  position: relative;
  width: 100vw;
  height: 100dvh;
  background: #000;
  overflow: hidden;
}

/* Two stacked images for crossfade */
.slide-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(100dvh - var(--textbar-h));
  object-fit: contain;
  background: #000;
  opacity: 0;
  transition: opacity 900ms ease;
}

.slide-img.active {
  opacity: 1;
}

/* Text bar below image */
#slide-text-wrap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--textbar-h);
  padding: 10px 16px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: #000;
}

#slide-text {
  color: #fff;
  text-align: center;
  font-size: clamp(14px, 4vw, 36px);
  font-weight: 600;
  line-height: 1.2;
  max-width: 95%;
  overflow-wrap: break-word;
}

/* Tablet */
@media (max-width: 1024px) {
  :root {
    --textbar-h: 90px;
  }

  #slide-text {
    font-size: clamp(14px, 4vw, 28px);
  }
}

/* Phone */
@media (max-width: 768px) {
  :root {
    --textbar-h: 76px;
  }

  #slide-text {
    font-size: clamp(13px, 4.8vw, 20px);
    line-height: 1.25;
  }
}

/* Small phones */
@media (max-width: 480px) {
  :root {
    --textbar-h: 66px;
  }

  #slide-text {
    font-size: clamp(12px, 5vw, 18px);
  }
}