/* Medical-imaging showcase (see medical.js). Colors come only from --ds-* tokens. */

.mi {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--ds-color-bg);
  color: var(--ds-color-ink);
}

.mi-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.mi-copy {
  position: absolute;
  z-index: 1;
  left: var(--home-gutter, max(1rem, 5.5vw, env(safe-area-inset-left, 0px)));
  top: var(--home-copy-top, 50%);
  width: min(35vw, 34rem);
  transform: var(--home-copy-shift, translateY(-50%));
}

.mi-eyebrow {
  opacity: 0;
  transform: translateY(0.5rem);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.mi-title {
  margin-top: var(--ds-space-4);
  font-family: var(--ds-font-display);
  font-weight: var(--ds-weight-regular);
  font-size: var(--home-headline, clamp(2.5rem, 0.9rem + 4.1vw, 5.6rem));
  line-height: 1.02;
  letter-spacing: var(--ds-tracking-display);
  text-wrap: balance;
}

/* Each word rises out of its own clipped line box. */
.mi-w {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-bottom: 0.14em;
  margin-bottom: -0.14em;
}

.mi-w > span {
  display: inline-block;
  transform: translateY(140%);
  transition: transform 1.15s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: calc(var(--i) * 60ms);
}

.mi-beat.is-on .mi-w > span {
  transform: none;
}

.mi-beat.is-on .mi-eyebrow {
  opacity: 1;
  transform: none;
  transition-delay: 0.05s;
}

/* Portrait (phones, tall tablets): copy on top, the drawing below. */
@media (max-aspect-ratio: 9/10) {
  .mi-copy {
    left: max(1rem, env(safe-area-inset-left, 0px));
    right: max(1rem, env(safe-area-inset-right, 0px));
    top: max(1.5rem, env(safe-area-inset-top, 0px));
    width: auto;
    transform: none;
  }

  .mi-title {
    margin-top: var(--ds-space-3);
    font-size: var(--home-headline-stacked, clamp(2.4rem, 1rem + 6.4vw, 3.8rem));
  }
}

/* Reduced motion: no transitions; the copy simply shows. */
.mi--still .mi-w > span,
.mi--still .mi-eyebrow {
  transition: none !important;
}
