.hero-animation {
  --hero-animation-panel-aspect: 620 / 635;
  --hero-animation-title: clamp(1.28rem, 1.75vw, 1.62rem);
  --hero-animation-caption: clamp(1.04rem, 1.18vw, 1.16rem);
  --hero-animation-font-main: clamp(1rem, 1.15vw, 1.08rem);
  --hero-animation-font-donation: clamp(1rem, 1.15vw, 1.08rem);
  --hero-animation-font-secondary: clamp(1rem, 1.15vw, 1.08rem);
  --hero-animation-font-nonprofit: clamp(1rem, 1.15vw, 1.08rem);

  position: relative;
  isolation: isolate;
  justify-self: end;
  box-sizing: border-box;
  width: min(100%, 520px);
  min-width: 0;
  padding: clamp(1rem, 2vw, 1.75rem);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  overflow: hidden;
  display: grid;
  gap: clamp(0.35rem, 0.75vw, 0.55rem);
}

.hero-animation::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 51%;
  z-index: 1;
  width: min(76%, 390px);
  aspect-ratio: 1;
  background: url("../assets/hero_ch_mark.webp") center / contain no-repeat;
  filter: blur(0.4px);
  mix-blend-mode: screen;
  opacity: 0.16;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.hero-animation__shell {
  position: relative;
  z-index: 2;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  aspect-ratio: var(--hero-animation-panel-aspect);
  min-height: 460px;
}

.hero-animation__header {
  position: relative;
  z-index: 2;
  display: grid;
  gap: clamp(0.5rem, 0.8vw, 0.7rem);
  min-width: 0;
  text-align: center;
}

.hero-animation__title {
  max-width: 100%;
  min-width: 0;
  margin: 0;
  font-size: var(--hero-animation-title);
  font-weight: 700;
  line-height: 1.2;
  color: #EDEFF1;
  text-shadow: 0 2px 12px rgba(4, 8, 20, 0.65);
  overflow-wrap: break-word;
  text-wrap: balance;
  white-space: normal;
}

.hero-animation__subtitle,
.hero-animation__tagline {
  max-width: 100%;
  min-width: 0;
  margin: 0;
  font-size: var(--hero-animation-caption);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.45;
  color: #070D1C;
  overflow-wrap: break-word;
  text-wrap: balance;
  white-space: nowrap;
}

.hero-animation__tagline {
  position: relative;
  z-index: 2;
  text-align: center;
}

.hero-animation__flow {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.hero-animation__path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-animation__path--primary {
  stroke: rgba(255, 255, 255, 0.22);
  stroke-width: 1.5;
}

.hero-animation__path--secondary {
  stroke: rgba(255, 255, 255, 0.14);
  stroke-width: 1;
}

.hero-animation__path--impact {
  stroke: rgba(255, 255, 255, 0.22);
  stroke-width: 1.5;
}

.hero-animation__path.is-active {
  stroke-width: 2;
  filter: drop-shadow(0 0 4px rgba(255, 215, 102, 0.24));
}

.hero-animation__path--primary.is-active,
.hero-animation__path--impact.is-active,
.hero-animation__path--secondary.is-active {
  stroke: #FFD766;
}

#hero-animation-path-created-collector.is-active,
#hero-animation-path-collector-contract.is-active {
  stroke-width: 2.35;
  filter: drop-shadow(0 0 5px rgba(255, 215, 102, 0.34));
}

.hero-animation__node {
  opacity: 0.72;
  transform-box: fill-box;
  transform-origin: center;
  transition: opacity 0.4s ease-in-out, filter 0.4s ease-in-out, transform 0.4s ease-in-out;
}

.hero-animation__flow.is-resetting .hero-animation__node {
  transition-duration: 0.28s;
}

.hero-animation__node-box {
  fill: transparent;
  stroke: rgba(255, 255, 255, 0.32);
  stroke-width: 1;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.55));
}

.hero-animation__node--primary.is-active,
.hero-animation__node--donation.is-active {
  opacity: 1;
  filter: url("#hero-animation-blue-glow");
}

.hero-animation__node--primary.is-active .hero-animation__node-box,
.hero-animation__node--donation.is-active .hero-animation__node-box,
.hero-animation__node--secondary.is-active .hero-animation__node-box {
  fill: #0E3CAF;
  stroke: rgba(80, 143, 206, 0.86);
}

.hero-animation__node--donation.is-active {
  transform: scale(1.015);
}

.hero-animation__node--secondary {
  opacity: 0.68;
}

.hero-animation__node--secondary.is-active {
  opacity: 0.9;
  filter: drop-shadow(0 0 10px rgba(80, 143, 206, 0.22));
}

.hero-animation__node--nonprofit .hero-animation__node-box {
  stroke: rgba(34, 197, 94, 0.35);
}

.hero-animation__node--nonprofit.is-active {
  opacity: 1;
  filter: url("#hero-animation-green-glow");
}

.hero-animation__node--nonprofit.is-active .hero-animation__node-box {
  fill: rgba(34, 197, 94, 0.7);
  stroke: rgba(238, 248, 255, 0.68);
}

.hero-animation__node.is-pulsing {
  transform: scale(1.03);
}

.hero-animation__text {
  font-family: "Poppins", Arial, sans-serif;
  text-anchor: middle;
  fill: #EDEFF1;
  fill-opacity: 0.68;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.38));
  pointer-events: none;
}

.hero-animation__node--secondary .hero-animation__text {
  fill: #EDEFF1;
  fill-opacity: 0.6;
}

.hero-animation__node--nonprofit .hero-animation__text {
  fill: #EDEFF1;
  fill-opacity: 0.66;
}

.hero-animation__node--primary.is-active .hero-animation__text,
.hero-animation__node--donation.is-active .hero-animation__text,
.hero-animation__node--secondary.is-active .hero-animation__text {
  fill: #EDEFF1;
  fill-opacity: 1;
  font-weight: 900;
  filter: drop-shadow(0 1px 2px rgba(4, 8, 20, 0.64)) drop-shadow(0 0 6px rgba(237, 239, 241, 0.24));
}

.hero-animation__node--nonprofit.is-active .hero-animation__text {
  fill: #EDEFF1;
  fill-opacity: 1;
  filter: drop-shadow(0 0 6px rgba(237, 239, 241, 0.8));
}

.hero-animation__text--main {
  font-size: var(--hero-animation-font-donation);
  font-weight: 700;
}

.hero-animation__text--donation {
  font-size: var(--hero-animation-font-donation);
  font-weight: 800;
}

.hero-animation__text--secondary {
  font-size: var(--hero-animation-font-secondary);
  font-weight: 600;
}

.hero-animation__text--nonprofit {
  font-size: var(--hero-animation-font-donation);
  font-weight: 700;
}

.hero-animation__pulse {
  opacity: 0;
  fill: #ffffff;
  filter: drop-shadow(0 0 9px rgba(255, 255, 255, 0.95)) drop-shadow(0 0 16px rgba(26, 96, 230, 0.8));
}

@media (max-width: 1100px) {
  .hero-animation {
    justify-self: center;
    order: -1;
    width: min(100%, 470px);
  }

  .hero-animation__header,
  .hero-animation__tagline {
    width: min(100%, 22rem);
    margin-inline: auto;
  }

  .hero-animation__subtitle,
  .hero-animation__tagline {
    white-space: normal;
  }

  .hero-animation__shell {
    min-height: 430px;
  }
}

@media (max-width: 540px) {
  .hero-animation {
    --hero-animation-panel-aspect: 1 / 1;
    --hero-animation-title: clamp(1.22rem, 4.6vw, 1.45rem);
    --hero-animation-caption: clamp(1rem, 3.4vw, 1.12rem);
    --hero-animation-font-main: clamp(1rem, 1.15vw, 1.08rem);
    --hero-animation-font-donation: clamp(1rem, 1.15vw, 1.08rem);
    --hero-animation-font-secondary: clamp(1rem, 1.15vw, 1.08rem);
    --hero-animation-font-nonprofit: clamp(1rem, 1.15vw, 1.08rem);
    padding: 0.75rem;
    width: calc(100vw - 4rem);
    max-width: calc(100vw - 4rem);
    gap: 0.25rem;
  }

  .hero-animation__header {
    gap: 0.75rem;
  }

  .hero-animation__title {
    width: min(100%, 15rem);
    margin-inline: auto;
  }

  .hero-animation__shell {
    min-height: 300px;
  }

  .hero-animation__flow {
    transform: scale(0.94);
    transform-origin: center center;
  }
}
