.blend-experiment .hero{isolation:isolate}
.hero-kenburns {
  position: absolute;
  inset: 0;
  /* Keep the opening crop as About covers the bottom of the photo. */
  min-height: calc(100vh + var(--surface-radius));
  min-height: calc(100svh + var(--surface-radius));
  overflow: hidden;
  pointer-events: none;
}
.hero-landscape {
  position: absolute;
  inset: 0;
  transform-origin: center;
  animation: hero-centered-zoom 48s ease-in-out infinite;
}

@keyframes hero-centered-zoom {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.025); }
}

.hero-landscape > img {
  position: absolute;
  inset: 0;
  animation: hero-photo-drift 24s linear -12s infinite;
}

.hero-landscape > .hero-photo-overlap {
  opacity: 0;
  mask-image: linear-gradient(to right, #000 44%, transparent 56%);
  mask-size: 300% 100%;
  mask-repeat: no-repeat;
  mask-position: right;
  animation: hero-photo-drift 24s linear infinite,
    hero-photo-crossfade 24s linear infinite;
}

.hero-landscape img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center calc(50% + var(--hero-parallax-y, 0px));
}

/* Fixed overscan keeps the photo covering the hero throughout the pan. */
@keyframes hero-photo-drift {
  from { transform: translateX(-4%) scale(1.1); }
  to { transform: translateX(4%) scale(1.1); }
}

/* Sweep a feathered edge across the photo so only a narrow area blends. */
@keyframes hero-photo-crossfade {
  0%, 23% { opacity: 0; mask-position: right; }
  24% { opacity: 1; mask-position: right; }
  46%, 54% { opacity: 1; mask-position: left; }
  76% { opacity: 1; mask-position: right; }
  77%, 100% { opacity: 0; mask-position: right; }
}

/* Adjust the rendered cloud band without adding another copy of the photo. */
.hero-kenburns::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  -webkit-backdrop-filter: contrast(1.16);
  backdrop-filter: contrast(1.16);
  -webkit-mask-image: linear-gradient(transparent 38%, #000 53%, #000 62%, transparent 73%);
  mask-image: linear-gradient(transparent 38%, #000 53%, #000 62%, transparent 73%);
  animation: hero-cloud-contrast 16s ease-in-out infinite;
}

@keyframes hero-cloud-contrast {
  0%, 100% { opacity: 0; }
  50% { opacity: .65; }
}

.hero-cloud-puffs > span {
  opacity: 0;
  position: absolute;
  top: calc(44% - 250px);
  left: 1%;
  width: clamp(200px, 42vw, 560px);
  aspect-ratio: 2;
  background: url("assets/home/hills-sky-clouds-aqua.jpg") 33% 50% / 350% auto no-repeat;
  filter: saturate(.9) brightness(1.06);
  -webkit-mask-image: radial-gradient(ellipse closest-side, #000 8%, rgba(0,0,0,.55) 48%, rgba(0,0,0,.12) 75%, transparent 96%);
  mask-image: radial-gradient(ellipse closest-side, #000 8%, rgba(0,0,0,.55) 48%, rgba(0,0,0,.12) 75%, transparent 96%);
  animation: hero-puff-drift 100s linear -63s infinite;
  --puff-start: calc(-100% - 1vw);
  --puff-end: 16vw;
}

.hero-cloud-puffs > span + span {
  top: calc(var(--hero-heading-center, 42%) - 50px);
  left: auto;
  right: 0;
  width: clamp(230px, 46vw, 620px);
  background-position: 93% 62%;
  translate: 0 -50%;
  animation-duration: 88s;
  animation-delay: -20s;
  --puff-start: -20vw;
  --puff-end: 100%;
  --puff-opacity: .85;
}

@keyframes hero-puff-drift {
  0% { opacity: 0; transform: translateX(var(--puff-start)); }
  38%, 68% { opacity: var(--puff-opacity, .75); }
  100% { opacity: 0; transform: translateX(var(--puff-end)); }
}

.hero-motion-paused :is(.hero-landscape, .hero-landscape > img),
.hero-motion-paused .hero-cloud-puffs > span,
.hero-motion-paused .hero-kenburns::after {
  animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
  .blend-experiment .hero:not(.hero-motion-opt-in) :is(.hero-landscape, .hero-landscape > img),
  .blend-experiment .hero:not(.hero-motion-opt-in) .hero-cloud-puffs > span,
  .blend-experiment .hero:not(.hero-motion-opt-in) .hero-kenburns::after {
    animation-name: none;
  }

}

.blend-tools {
  position: absolute;
  /* Clear the next section's rounded overlap and raised surface. */
  bottom: max(calc(var(--surface-radius, 20px) + 40px), env(safe-area-inset-bottom));
  right: max(16px, env(safe-area-inset-right));
  z-index: 30;
}

.blend-tools button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.blend-tools button:hover,
.blend-tools button:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.blend-tools .motion-play-icon,
.blend-tools [data-paused="true"] .motion-pause-icon { display: none; }
.blend-tools [data-paused="true"] .motion-play-icon { display: inline; }

.blend-tools button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.entrance-pending .blend-tools { visibility: hidden; }
