/* ==========================================================================
   PCPMotion — shared animation primitives
   --------------------------------------------------------------------------
   CSS support for assets/js/motion-engine.js. These classes are not applied
   to any page yet — they exist so a future section can opt in by adding the
   class name, without inventing new CSS each time. Colors/easing reuse the
   tokens already defined in assets/css/site.css (:root), so there is one
   source of truth for brand values.

   Every rule here animates only `transform` and `opacity` (per project
   guardrails) and every effect has a `prefers-reduced-motion` fallback.
   ========================================================================== */

/* --- CinematicReveal / ScrollTextReveal ------------------------------------ */
.pcp-split-mask {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding-bottom: 0.06em;
  margin-bottom: -0.06em;
}
.pcp-split-unit {
  display: inline-block;
  will-change: transform, opacity;
}

/* --- MagneticButton --------------------------------------------------------- */
.pcp-magnetic {
  display: inline-block;
  will-change: transform;
}
@media (prefers-reduced-motion: reduce) {
  .pcp-magnetic { transform: none !important; }
}

/* --- AnimatedCard ------------------------------------------------------------ */
.pcp-card-animated {
  will-change: transform, box-shadow;
  transition: transform 0.55s var(--ease-spring, cubic-bezier(0.22, 1, 0.36, 1)),
              box-shadow 0.55s var(--ease-spring, cubic-bezier(0.22, 1, 0.36, 1)),
              border-color 0.55s ease;
}
.pcp-card-animated.is-hovered {
  transform: translateY(-4px);
  box-shadow: 0 30px 60px -30px rgba(212, 175, 55, 0.35), 0 0 0 1px rgba(212, 175, 55, 0.30);
}
@media (prefers-reduced-motion: reduce) {
  .pcp-card-animated { transition: none; }
  .pcp-card-animated.is-hovered { transform: none; }
}

/* --- LightSweep --------------------------------------------------------------- */
.pcp-light-sweep {
  position: relative;
  overflow: hidden;
}
.pcp-sweep-bar {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  width: 40%;
  background: linear-gradient(115deg, transparent 20%, rgba(255, 255, 255, 0.35) 50%, transparent 80%);
  transform: translateX(-160%) skewX(-12deg);
  will-change: transform;
}
@media (prefers-reduced-motion: reduce) {
  .pcp-sweep-bar { display: none; }
}

/* --- Canvas-based utilities: GoldParticleField / EcosystemNetwork ------------- */
.pcp-canvas-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: block;
}
.pcp-canvas-layer[data-interactive="true"] {
  pointer-events: auto;
}

/* --- ParallaxLayer ------------------------------------------------------------- */
.pcp-parallax-layer {
  will-change: transform;
}
@media (prefers-reduced-motion: reduce) {
  .pcp-parallax-layer { transform: none !important; }
}

/* --- SectionTransition ---------------------------------------------------------- */
.pcp-section-transition {
  position: relative;
}
.pcp-section-transition-overlay {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  will-change: opacity;
}
.pcp-section-transition > * {
  position: relative;
  z-index: 1;
}

/* --- GlobalGlobe / PhoenixJourney placeholders ----------------------------------- */
.pcp-globe-mount,
.pcp-phoenix-mount {
  position: relative;
}

/* --- InteractiveCard ----------------------------------------------------------
   Motion mechanics only. JS (PCPMotion.InteractiveCard) writes `transform` and
   the --mx/--my pointer position; everything visual is driven from the
   .is-hovered class so the two never contend for the same property. */
.pcp-icard {
  position: relative;
  will-change: transform;
}
.pcp-icard > * { position: relative; z-index: 1; }

/* Soft spotlight that follows the pointer. */
.pcp-icard::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 0%),
              rgba(212, 175, 55, 0.10), transparent 68%);
  opacity: 0;
  transition: opacity 450ms ease;
}
.pcp-icard.is-hovered::after { opacity: 1; }

/* Touch: no tilt, no spotlight — a restrained press state instead. */
@media (hover: none) {
  .pcp-icard { transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1); }
  .pcp-icard::after { display: none; }
  .pcp-icard:active { transform: scale(0.985); }
}

@media (prefers-reduced-motion: reduce) {
  .pcp-icard { transform: none !important; transition: none; }
  .pcp-icard::after { display: none; }
}

/* Hidden only while JS is confirmed running, so the cards are readable if it
   never arrives. The rescue pass in assets/js/reveals.js also clears these. */
.pcp-js [data-pillar] { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .pcp-js [data-pillar] { opacity: 1 !important; transform: none !important; }
}
