/* Homepage avatar variant — keeps the cinematic WebGL background and replaces the card deck. */
.story-page--avatar .story-hero-pin {
  height: 190vh;
}

.story-page--avatar .story-hero__inner {
  grid-template-columns: minmax(520px, 0.94fr) minmax(520px, 1.06fr);
  grid-template-areas: "copy avatar";
  gap: clamp(18px, 2.8vw, 48px);
}

.story-page--avatar .story-hero__copy {
  grid-area: copy;
  position: relative;
  z-index: 12;
  max-width: 620px;
}

.story-page--avatar .story-hero h1 {
  font-size: var(--cb-title-hero, clamp(58px, 5.15vw, 82px));
  font-weight: 300;
  letter-spacing: -0.052em;
}

.story-page--avatar .story-avatar {
  grid-area: avatar;
  position: relative;
  z-index: 3;
  width: min(100%, 660px);
  min-height: 610px;
  margin: 0;
  justify-self: end;
  align-self: center;
  isolation: isolate;
  pointer-events: none;
}

.story-page--avatar .story-avatar__halo {
  position: absolute;
  z-index: 0;
  left: 51%;
  top: 45%;
  width: 590px;
  height: 520px;
  border-radius: 50%;
  opacity: calc(0.82 - var(--avatar-progress, 0) * 0.16);
  background:
    radial-gradient(circle at 50% 38%, rgba(86, 187, 255, 0.25), transparent 38%),
    radial-gradient(circle at 56% 64%, rgba(107, 73, 255, 0.28), transparent 46%),
    radial-gradient(circle at 48% 76%, rgba(8, 23, 49, 0.74), transparent 65%);
  filter: blur(8px);
  transform: translate(-50%, -50%);
}

.story-page--avatar .story-avatar__image {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 24px;
  width: clamp(435px, 31.5vw, 520px);
  max-width: none;
  height: auto;
  display: block;
  object-fit: contain;
  object-position: center bottom;
  filter:
    drop-shadow(0 30px 42px rgba(0, 0, 0, 0.38))
    drop-shadow(0 0 30px rgba(92, 177, 255, 0.11));
  transform-origin: 50% 76%;
  animation: story-avatar-float 7.2s ease-in-out infinite;
  will-change: transform;
}

@keyframes story-avatar-float {
  0%, 100% {
    transform: translate3d(-50%, calc(var(--avatar-progress, 0) * -10px), 0) rotate(-0.25deg);
  }
  50% {
    transform: translate3d(-50%, calc(-9px + var(--avatar-progress, 0) * -10px), 0) rotate(0.35deg);
  }
}

.story-page--avatar .story-avatar__rings {
  position: absolute;
  z-index: 2;
  inset: 0;
  transform: translateY(calc(var(--avatar-progress, 0) * -5px));
  transition: transform 0.15s linear;
}

.story-page--avatar .story-avatar__rings span {
  --ring-angle: -12deg;
  --ring-scale: 1;
  position: absolute;
  left: 51%;
  top: 58%;
  width: 600px;
  height: 228px;
  border: 1.5px solid rgba(141, 205, 255, 0.66);
  border-radius: 50%;
  box-shadow:
    0 0 12px rgba(111, 204, 255, 0.28),
    inset 0 0 12px rgba(142, 96, 255, 0.14);
  transform: translate(-50%, -50%) rotate(var(--ring-angle)) scale(var(--ring-scale));
  animation: story-avatar-ring-pulse 5.8s ease-in-out infinite;
}

.story-page--avatar .story-avatar__rings span::before,
.story-page--avatar .story-avatar__rings span::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c5f0ff;
  box-shadow:
    0 0 4px #fff,
    0 0 13px #7bd7ff,
    0 0 24px #8d6dff;
}

.story-page--avatar .story-avatar__rings span::before {
  left: 10%;
  top: 19%;
}

.story-page--avatar .story-avatar__rings span::after {
  right: 12%;
  bottom: 19%;
}

.story-page--avatar .story-avatar__rings--back span:nth-child(1) {
  --ring-angle: -22deg;
  --ring-scale: 0.94;
  top: 55%;
  opacity: 0.76;
  border-color: rgba(100, 197, 255, 0.54);
}

.story-page--avatar .story-avatar__rings--back span:nth-child(2) {
  --ring-angle: 8deg;
  --ring-scale: 0.84;
  top: 57%;
  opacity: 0.72;
  border-color: rgba(153, 108, 255, 0.7);
  animation-delay: -2.4s;
}

.story-page--avatar .story-avatar__rings--back span:nth-child(3) {
  --ring-angle: -36deg;
  --ring-scale: 0.7;
  top: 53%;
  opacity: 0.48;
  border-color: rgba(191, 224, 255, 0.5);
  animation-delay: -4.1s;
}

.story-page--avatar .story-avatar__rings--front {
  z-index: 6;
  clip-path: inset(48% -12% -14% -12%);
}

.story-page--avatar .story-avatar__rings--front span:nth-child(1) {
  --ring-angle: -14deg;
  --ring-scale: 0.92;
  top: 62%;
  border-color: rgba(169, 112, 255, 0.82);
}

.story-page--avatar .story-avatar__rings--front span:nth-child(2) {
  --ring-angle: 18deg;
  --ring-scale: 0.78;
  top: 64%;
  opacity: 0.74;
  border-color: rgba(135, 218, 255, 0.76);
  animation-delay: -3.2s;
}

@keyframes story-avatar-ring-pulse {
  0%, 100% {
    opacity: 0.58;
    filter: brightness(0.92);
  }
  50% {
    opacity: 1;
    filter: brightness(1.28);
  }
}

.story-page--avatar .story-avatar__cloud {
  position: absolute;
  z-index: 3;
  top: 48px;
  right: 56px;
  width: 140px;
  height: 96px;
  opacity: 0.94;
  filter:
    drop-shadow(0 12px 22px rgba(0, 0, 0, 0.32))
    drop-shadow(0 0 18px rgba(148, 122, 255, 0.36));
  animation: story-avatar-cloud 8.4s ease-in-out infinite;
}

.story-page--avatar .story-avatar__cloud span {
  position: absolute;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 26%, #d4d5ff 0%, #9e9add 38%, #57519c 72%, #302d71 100%);
  box-shadow: inset -8px -8px 13px rgba(33, 30, 96, 0.38);
}

.story-page--avatar .story-avatar__cloud span:nth-child(1) { left: 18px; top: 41px; width: 82px; height: 42px; border-radius: 50px; }
.story-page--avatar .story-avatar__cloud span:nth-child(2) { left: 42px; top: 19px; width: 55px; height: 56px; }
.story-page--avatar .story-avatar__cloud span:nth-child(3) { left: 75px; top: 25px; width: 52px; height: 52px; }
.story-page--avatar .story-avatar__cloud span:nth-child(4) { left: 26px; top: 31px; width: 48px; height: 48px; }
.story-page--avatar .story-avatar__cloud span:nth-child(5) { left: 91px; top: 45px; width: 42px; height: 36px; }
.story-page--avatar .story-avatar__cloud span:nth-child(6) { left: 60px; top: 5px; width: 37px; height: 40px; }
.story-page--avatar .story-avatar__cloud span:nth-child(7) { left: 9px; top: 52px; width: 45px; height: 29px; }

@keyframes story-avatar-cloud {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(-1deg); }
  50% { transform: translate3d(8px, -8px, 0) rotate(1deg); }
}

.story-page--avatar .story-avatar__particles {
  position: absolute;
  z-index: 7;
  inset: 0;
}

.story-page--avatar .story-avatar__particles i {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #bfeeff;
  box-shadow: 0 0 5px #fff, 0 0 16px #6bd1ff, 0 0 28px #8e6cff;
  animation: story-avatar-particle 3.8s ease-in-out infinite;
}

.story-page--avatar .story-avatar__particles i:nth-child(1) { left: 11%; top: 45%; animation-delay: -.4s; }
.story-page--avatar .story-avatar__particles i:nth-child(2) { left: 21%; top: 28%; animation-delay: -1.9s; }
.story-page--avatar .story-avatar__particles i:nth-child(3) { left: 42%; top: 17%; animation-delay: -2.6s; }
.story-page--avatar .story-avatar__particles i:nth-child(4) { right: 17%; top: 31%; animation-delay: -.9s; }
.story-page--avatar .story-avatar__particles i:nth-child(5) { right: 6%; top: 51%; animation-delay: -2.2s; }
.story-page--avatar .story-avatar__particles i:nth-child(6) { right: 17%; bottom: 22%; animation-delay: -3.1s; }
.story-page--avatar .story-avatar__particles i:nth-child(7) { left: 18%; bottom: 20%; animation-delay: -1.3s; }
.story-page--avatar .story-avatar__particles i:nth-child(8) { left: 4%; bottom: 37%; animation-delay: -3.5s; }

@keyframes story-avatar-particle {
  0%, 100% { opacity: 0.35; transform: scale(0.72); }
  50% { opacity: 1; transform: scale(1.32); }
}

.story-page--avatar .story-avatar__cue {
  position: absolute;
  z-index: 10;
  left: 4%;
  right: 4%;
  bottom: -3px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  color: rgba(207, 223, 244, 0.6);
}

.story-page--avatar .story-avatar__cue > span {
  height: 1px;
  overflow: hidden;
  background: rgba(145, 205, 247, 0.15);
}

.story-page--avatar .story-avatar__cue > span i {
  display: block;
  width: calc(24% + var(--avatar-progress, 0) * 76%);
  height: 100%;
  background: linear-gradient(90deg, #78cfff, #9f8cff);
  box-shadow: 0 0 14px rgba(114, 199, 255, 0.48);
  transition: width 0.12s linear;
}

.story-page--avatar .story-avatar__cue small {
  font-size: 11px;
  line-height: 1;
  font-weight: 700;
  white-space: nowrap;
}

@media (max-width: 1280px) and (min-width: 1121px) {
  .story-page--avatar .story-hero__inner {
    grid-template-columns: minmax(470px, 0.95fr) minmax(470px, 1.05fr);
    gap: 14px;
  }

  .story-page--avatar .story-avatar {
    width: 590px;
  }

  .story-page--avatar .story-avatar__image {
    width: 455px;
  }

  .story-page--avatar .story-avatar__rings span {
    width: 540px;
  }
}

@media (max-width: 1120px) {
  .story-page--avatar .story-hero-pin {
    height: auto;
  }

  .story-page--avatar .story-hero-pin .story-hero {
    position: relative;
    top: auto;
    height: auto;
    min-height: 100svh;
    overflow: hidden;
  }

  .story-page--avatar .story-hero__inner {
    grid-template-columns: 1fr;
    grid-template-areas:
      "copy"
      "avatar";
    gap: 8px;
  }

  .story-page--avatar .story-hero__copy {
    max-width: 720px;
  }

  .story-page--avatar .story-avatar {
    width: min(100%, 680px);
    min-height: 570px;
    justify-self: center;
  }

  .story-page--avatar .story-avatar__image {
    width: min(66vw, 470px);
  }
}

@media (max-width: 760px) {
  .story-page--avatar .story-hero-pin .story-hero {
    padding-bottom: 16px;
  }

  .story-page--avatar .story-hero__inner {
    gap: 14px;
  }

  .story-page--avatar .story-hero__copy {
    order: initial;
  }

  .story-page--avatar .story-hero h1 {
    max-width: 11ch;
    font-size: clamp(45px, 13.2vw, 58px);
  }

  .story-page--avatar .story-avatar {
    width: calc(100vw - 24px);
    min-height: 450px;
    margin-inline: calc(50% - 50vw + 12px);
  }

  .story-page--avatar .story-avatar__halo {
    width: 430px;
    height: 390px;
  }

  .story-page--avatar .story-avatar__image {
    bottom: 18px;
    width: min(94vw, 385px);
  }

  .story-page--avatar .story-avatar__rings span {
    top: 59%;
    width: 450px;
    height: 174px;
  }

  .story-page--avatar .story-avatar__cloud {
    top: 30px;
    right: 12px;
    transform: scale(0.76);
    transform-origin: top right;
  }

  .story-page--avatar .story-avatar__cue {
    left: 8px;
    right: 8px;
    bottom: 0;
  }

  .story-page--avatar .story-avatar__cue small {
    font-size: 10px;
  }

  .story-page--avatar .story-hero__trust {
    margin-top: 10px;
  }
}

@media (max-width: 420px) {
  .story-page--avatar .story-avatar {
    min-height: 415px;
  }

  .story-page--avatar .story-avatar__image {
    width: min(96vw, 350px);
  }

  .story-page--avatar .story-avatar__rings span {
    width: 405px;
    height: 156px;
  }

  .story-page--avatar .story-avatar__cloud {
    right: -2px;
    transform: scale(0.65);
  }
}

@media (prefers-reduced-motion: reduce) {
  .story-page--avatar .story-avatar__image,
  .story-page--avatar .story-avatar__rings span,
  .story-page--avatar .story-avatar__cloud,
  .story-page--avatar .story-avatar__particles i {
    animation: none !important;
  }
}
