@media (prefers-reduced-motion: no-preference) {
  .photo-motion .section-photo {
    position: relative;
    isolation: isolate;
    overflow: visible;
    background: none;
  }
  .photo-motion .section-photo img {
    border-radius: inherit;
    opacity: 0;
  }
  .photo-motion .section-photo.is-visible::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(ellipse at 35% 28%, #e0fbff, #8ed5ed 58%, #69badb);
    animation: slime-stretch 1.5s ease-in-out both;
  }
  .photo-motion .section-photo.is-visible img {
    animation: slime-reveal 1.5s ease-in-out both;
  }
}

@keyframes slime-stretch {
  0% {
    opacity: 0;
    transform: translateY(34%) scale(.12, .07);
    border-radius: 53% 47% 47% 53% / 58% 59% 41% 42%;
  }
  22% {
    opacity: 1;
    transform: translateY(9%) scale(.24, .53);
    border-radius: 54% 46% 43% 57% / 68% 67% 33% 32%;
  }
  42% {
    opacity: 1;
    transform: translateY(17%) scale(.71, .43);
    border-radius: 45% 55% 54% 46% / 64% 48% 52% 36%;
  }
  72% {
    opacity: .85;
    transform: translateY(-1%) scale(1.04, .98);
    border-radius: 44% 56% 37% 63% / 45% 49% 51% 55%;
  }
  100% {
    opacity: 0;
    transform: none;
    border-radius: 24px 8px 24px 8px;
  }
}

@keyframes slime-reveal {
  0%, 39% {
    opacity: 0;
    clip-path: inset(65% 43% 21% 43% round 45% 50% 42% 55%);
  }
  67% {
    opacity: 1;
    clip-path: inset(10% 11% 9% 11% round 40% 47% 40% 50%);
  }
  100% {
    opacity: 1;
    clip-path: inset(0 round 0%);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .hero-content {
    --letter-duration: 1040ms;
  }
  .hero-content .math-letter {
    display: inline-block;
    white-space: pre;
  }
  .hero-content .math-letter.revealed {
    animation-name: hero-letter-land;
    animation-timing-function: cubic-bezier(.25, .6, .35, 1);
  }
  .math-letter {
    position: relative;
    opacity: 0;
  }
  .math-letter.revealed {
    animation: math-letter-land var(--letter-duration, 420ms) cubic-bezier(.22,.72,.33,1) var(--letter-delay, 0ms) both;
  }
}
@keyframes math-letter-land {
  from { top: -.55em; opacity: 0; }
  to { top: 0; opacity: 1; }
}


@keyframes hero-letter-land {
  from { transform: translateY(-.24em); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
