/* One inherited light value keeps the tube, purple bloom and both cards in phase. */
@property --huanwuai-light-pulse {
  syntax: "<number>";
  inherits: true;
  initial-value: 0;
}

.huanwuai-home {
  --huanwuai-light-pulse: 0;
  animation: huanwuai-light-breathe 3.5s ease-in-out infinite;
  /* The user explicitly requires this effect with Windows animations disabled. */
  animation-duration: 3.5s !important;
  animation-iteration-count: infinite !important;
}

@keyframes huanwuai-light-breathe {
  0%, 100% { --huanwuai-light-pulse: 0; }
  50% { --huanwuai-light-pulse: 1; }
}

/* The existing continuous, dithered light field stays intact. */
.huanwuai-home::before {
  transition: none !important;
  opacity: calc(0.66 + 0.30 * var(--huanwuai-light-pulse));
  transform-origin: 50% 3.8%;
  transform:
    scaleX(calc(1 + 0.045 * var(--huanwuai-light-pulse)))
    scaleY(calc(1 + 0.10 * var(--huanwuai-light-pulse)));
}

.huanwuai-home::after {
  transition: none !important;
  opacity: calc(0.68 + 0.32 * var(--huanwuai-light-pulse));
  box-shadow:
    0 0 2px 1px #fff0ff,
    0 0 5px 2px #ffc5ff,
    0 0 calc(9px + 5px * var(--huanwuai-light-pulse)) calc(3px + 3px * var(--huanwuai-light-pulse)) rgb(255 122 250 / calc(0.65 + 0.25 * var(--huanwuai-light-pulse))),
    0 0 calc(20px + 14px * var(--huanwuai-light-pulse)) calc(9px + 6px * var(--huanwuai-light-pulse)) rgb(240 87 242 / calc(0.4 + 0.25 * var(--huanwuai-light-pulse))),
    0 8px calc(38px + 24px * var(--huanwuai-light-pulse)) calc(16px + 12px * var(--huanwuai-light-pulse)) rgb(206 55 235 / calc(0.3 + 0.18 * var(--huanwuai-light-pulse)));
}

/* A thin surface light layer lifts both cards equally without fading their content.
 * It uses no transform, so the existing 130% / 90% hover interaction stays intact.
 */
.huanwuai-home .huanwuai-card {
  border-color: rgb(214 184 248 / calc(0.30 + 0.18 * var(--huanwuai-light-pulse)));
}

.huanwuai-home .huanwuai-card::before {
  content: "";
  position: absolute;
  z-index: 3;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgb(224 181 255 / 20%), rgb(198 139 250 / 8%) 55%, rgb(198 139 250 / 3%));
  box-shadow: inset 0 1px 0 rgb(248 224 255 / 30%), inset 0 0 28px rgb(191 121 249 / 12%);
  mix-blend-mode: screen;
  opacity: calc(0.08 + 0.52 * var(--huanwuai-light-pulse));
  pointer-events: none;
  /* The shared clock already interpolates opacity; an extra transition lags. */
  transition: none !important;
}
