/* ==========================================================================
   HxM — Non-Stop Kinetic & Scroll-Driven Animations
   ========================================================================== */

/* 1. Continuous Ambient Loops (Non-Stoppable Living Motion) */
@keyframes pulseNode {
  0%, 100% { transform: scale(1); opacity: 0.9; box-shadow: 0 0 0 0 rgba(245, 176, 56, 0.55); }
  50% { transform: scale(1.25); opacity: 1; box-shadow: 0 0 0 8px rgba(245, 176, 56, 0); }
}

@keyframes scrollStemFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

@keyframes marqueeStream {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}

@keyframes marqueeStreamReverse {
  0% { transform: translate3d(-50%, 0, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

@keyframes hexCoreFloat {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(1.2deg); }
}

@keyframes hexOrbitSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes hexDashFlow {
  0% { stroke-dashoffset: 180; }
  100% { stroke-dashoffset: 0; }
}

@keyframes liveBeacon {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.82); }
}

@keyframes cardFloatSubtle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* 2. Hero Entrance Choreography */
.hero-wordmark-wrap {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 0.8s var(--ease-expo);
}

.is-loaded .hero-wordmark-wrap {
  clip-path: inset(0 0% 0 0);
}

.hero-wordmark-char {
  display: inline-block;
  transform: translate3d(calc(var(--spread-dir, 0) * var(--hero-p, 0) * 38px), calc(var(--hero-p, 0) * -18px), 0);
  transition: color 0.3s ease;
  will-change: transform;
}

.hero-subline-mask {
  overflow: hidden;
}

.hero-subline-inner {
  transform: translate3d(0, 115%, 0);
  opacity: 0;
  transition: transform 0.85s var(--ease-expo) 0.16s, opacity 0.65s ease 0.16s;
}

.is-loaded .hero-subline-inner {
  transform: translate3d(0, 0, 0);
  opacity: 1;
}

.hero-reveal-fade {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s ease 0.28s, transform 0.75s var(--ease-expo) 0.28s;
}

.is-loaded .hero-reveal-fade {
  opacity: 1;
  transform: translateY(0);
}

/* 3. WisdomIR-Inspired Sequential Highlight Wipe (.highlight-wipe) */
.highlight-wipe {
  display: inline;
  padding: 0.04em 0.22em;
  margin: 0 0.04em;
  background-image: linear-gradient(90deg, var(--wipe-color, var(--coral)), var(--wipe-color, var(--coral)) 50%, transparent 50%);
  background-size: 200% 100%;
  background-position: 100% 0;
  background-repeat: no-repeat;
  border-radius: 2px;
  transition: background-position 0.72s var(--ease-expo), color 0.35s ease;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.highlight-wipe--gold {
  --wipe-color: rgba(245, 176, 56, 0.36);
}

.highlight-wipe--coral {
  --wipe-color: var(--coral);
}

.highlight-wipe.is-swept {
  background-position: 0% 0;
}

.highlight-wipe--coral.is-swept {
  color: #ffffff;
}

/* 4. Scroll Reveal Stagger Classes */
[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 26px, 0);
  transition: opacity 0.78s var(--ease-expo), transform 0.78s var(--ease-expo);
  transition-delay: var(--reveal-delay, 0ms);
}

[data-reveal="left"] {
  transform: translate3d(-28px, 0, 0);
}

[data-reveal="right"] {
  transform: translate3d(28px, 0, 0);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* 5. Scroll-Driven Parallax Cutouts (H. & 10+) */
.cutout-parallax-img {
  transform: translate3d(0, calc((var(--p, 0.5) - 0.5) * -72px), 0) scale(1.12);
  will-change: transform;
}

/* 6. Outcome Viewport Ambient Orbit + Radar + Sync Wave */
@keyframes radarSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes syncWavePulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 217, 81, 0.5); }
  100% { box-shadow: 0 0 0 22px rgba(255, 217, 81, 0); }
}

.impact-orbit-bg {
  transform: rotate(var(--orbit-scroll, 0deg));
  transition: transform 0.25s linear;
  will-change: transform;
}

.radar-sweep {
  animation: radarSpin 5.5s linear infinite;
}

.sync-card.is-pulsing {
  animation: syncWavePulse 0.8s var(--ease-expo);
}

/* 7. Sticky Hexagon Core Ambient Motion */
.sticky-hex-orbit {
  transform-origin: center;
  animation: hexOrbitSpin 38s linear infinite;
}

.sticky-hex-float {
  animation: hexCoreFloat 5.2s ease-in-out infinite;
}

.sticky-hex-dash {
  stroke-dasharray: 6 6;
  animation: hexDashFlow 8s linear infinite;
}

/* 8. Continuous Kinetic Marquee */
.marquee-track {
  display: flex;
  width: max-content;
  animation: marqueeStream 34s linear infinite;
}

.marquee-track--reverse {
  animation: marqueeStreamReverse 40s linear infinite;
}

.marquee-wrap:hover .marquee-track {
  animation-play-state: paused;
}

/* 9. Case Study Curtain Transition */
.case-stage-image {
  transition: opacity 0.55s ease, transform 0.85s var(--ease-expo);
}

.case-stage-image.is-switching {
  opacity: 0.25;
  transform: scale(1.05);
}

/* 10. Live Status Pulse Dot */
.live-beacon-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--coral);
  animation: liveBeacon 1.6s ease-in-out infinite;
}

.live-beacon-dot--gold {
  background: var(--gold-bright);
}

/* 11. Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }
  .hero-wordmark-wrap {
    clip-path: none !important;
  }
  .hero-subline-inner,
  .hero-reveal-fade {
    opacity: 1 !important;
    transform: none !important;
  }
}
