/* Hero story camera: a single editorial scene, animated through --story-progress. */
#hero .story-stage {
  --story-progress: 0;
  --story-disc-scale: calc(.82 + var(--story-progress) * .36);
  --story-disc-y: calc(var(--story-progress) * 9%);
  --story-pet-x: calc(var(--story-progress) * -5%);
  --story-pet-y: calc(var(--story-progress) * -2%);
  --story-phone-x: calc(0% - var(--story-progress) * 24%);
  --story-phone-y: calc(12% - var(--story-progress) * 11%);
  --story-phone-rot: calc(8deg - var(--story-progress) * 8deg);
  --story-proof-x: calc(24% - var(--story-progress) * 24%);
  --story-proof-y: calc(10% - var(--story-progress) * 10%);
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 520px;
  isolation: isolate;
  overflow: visible;
  perspective: 1100px;
  pointer-events: none;
}

#hero .story-stage::before {
  content: "";
  position: absolute;
  width: min(66vw, 790px);
  aspect-ratio: 1;
  right: -3%;
  top: 50%;
  z-index: -2;
  border-radius: 50%;
  transform: translate3d(0, calc(-50% + var(--story-disc-y)), 0) scale(var(--story-disc-scale));
  transform-origin: 55% 48%;
  background:
    radial-gradient(circle at 35% 26%, rgba(255, 231, 169, .98), transparent 25%),
    radial-gradient(circle at 68% 62%, #fa7358 0, #f6a33e 36%, #f9d47d 67%, #f4b45e 100%);
  box-shadow: 0 36px 110px rgba(187, 78, 35, .24), inset -20px -28px 65px rgba(194, 71, 47, .12);
  transition: filter .3s linear;
}

#hero .story-disc {
  position: absolute;
  z-index: -1;
  right: 1%;
  top: 48%;
  width: min(57vw, 680px);
  aspect-ratio: 1.13;
  border-radius: 50%;
  background: radial-gradient(ellipse at 42% 35%, rgba(255,255,255,.38), transparent 44%), linear-gradient(145deg, #ffc962, #ef7856 74%);
  opacity: .62;
  filter: blur(1px);
  transform: translate3d(0, calc(-50% + var(--story-disc-y)), 0) scale(var(--story-disc-scale));
}

#hero .story-light {
  position: absolute;
  z-index: 1;
  width: 42%;
  height: 55%;
  right: 8%;
  top: 8%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255,247,209,.48), transparent 70%);
  filter: blur(35px);
  opacity: calc(.55 - var(--story-progress) * .2);
  animation: story-light-drift 8s ease-in-out infinite alternate;
}

#hero .story-pets {
  position: absolute;
  z-index: 2;
  width: min(69%, 790px);
  height: 94%;
  right: 2%;
  bottom: -2%;
  display: grid;
  place-items: end center;
  transform: translate3d(var(--story-pet-x), var(--story-pet-y), 0) scale(calc(1 - var(--story-progress) * .095));
  transform-origin: 70% 85%;
  filter: drop-shadow(0 28px 32px rgba(81,48,38,.16));
  will-change: transform;
}

#hero .story-pets img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
}

#hero .story-orbit {
  position: absolute;
  z-index: 4;
  left: 25%;
  top: 48%;
  width: clamp(190px, 19vw, 258px);
  height: auto;
  transform: translate3d(var(--story-phone-x), var(--story-phone-y), 0);
  transform-origin: 50% 50%;
  filter: drop-shadow(0 30px 32px rgba(45,35,35,.28));
  transition: filter .2s linear;
  will-change: transform;
}

#hero .story-orbit .phone {
  display: block;
  width: 100%;
  transform: translateZ(20px);
  transform-style: preserve-3d;
  animation: story-phone-float 5.8s ease-in-out infinite;
}

#hero .story-orbit .phone img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 34px;
  box-shadow: 0 2px 0 rgba(255,255,255,.76) inset, 0 0 0 7px #202124, 0 0 0 9px rgba(255,255,255,.65);
}

#hero .story-proof {
  position: absolute;
  z-index: 5;
  right: 4%;
  bottom: 12%;
  width: clamp(210px, 22vw, 300px);
  opacity: calc(.24 + var(--story-progress) * .76);
  transform: translate3d(var(--story-proof-x), var(--story-proof-y), 0) rotate(-5deg);
  filter: drop-shadow(0 22px 26px rgba(93,56,38,.18));
  will-change: transform, opacity;
}

#hero .story-proof > * {
  max-width: 100%;
}

#hero .story-stage.is-visible .story-light,
#hero .story-stage.is-visible .story-orbit .phone {
  animation-play-state: running;
}

#hero .story-stage:not(.is-visible) .story-light,
#hero .story-stage:not(.is-visible) .story-orbit .phone {
  animation-play-state: paused;
}

@keyframes story-phone-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -12px; }
}

@keyframes story-light-drift {
  from { transform: translate3d(-4%, -2%, 0) scale(.92); }
  to { transform: translate3d(4%, 3%, 0) scale(1.08); }
}

@media (max-width: 700px) {
  #hero .story-stage { min-height: 510px; }
  #hero .story-stage::before { width: 112vw; right: -30%; top: 44%; }
  #hero .story-disc { width: 94vw; right: -20%; top: 43%; }
  #hero .story-pets { width: 105%; height: 77%; right: -13%; bottom: -1%; }
  #hero .story-orbit {
    width: clamp(142px, 40vw, 176px);
    left: 2%; top: 41%;
    transform: translate3d(calc(var(--story-progress) * 22%), calc(13% - var(--story-progress) * 15%), 0);
  }
  #hero .story-orbit .phone img { border-radius: 25px; box-shadow: 0 1px 0 rgba(255,255,255,.76) inset, 0 0 0 5px #202124, 0 0 0 7px rgba(255,255,255,.65); }
  #hero .story-proof { width: min(62vw, 238px); right: 1%; bottom: 7%; transform: translate3d(calc(18% - var(--story-progress) * 18%), calc(12% - var(--story-progress) * 12%), 0) rotate(-4deg); }
  #hero .story-light { width: 65%; height: 44%; right: 0; top: 10%; filter: blur(24px); }
}

@media (prefers-reduced-motion: reduce) {
  #hero .story-stage *, #hero .story-stage::before, #hero .story-stage::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
