/* =========================================================================
   Spero FX — CSS layer for spero-fx.js
   Loads after spero.css. Pure visual effects; no layout changes.
   ========================================================================= */

/* ----- 1. Cursor spotlight ------------------------------------------- */
.fx-spotlight {
  position: relative;
  isolation: isolate;
  --fx-x: 50%;
  --fx-y: 50%;
  --fx-opacity: 0;
}
.fx-spotlight::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background: radial-gradient(
    circle 480px at var(--fx-x) var(--fx-y),
    rgba(204, 193, 133, 0.18) 0%,
    rgba(204, 193, 133, 0.05) 35%,
    transparent 65%
  );
  opacity: var(--fx-opacity);
  transition: opacity 0.35s ease;
  mix-blend-mode: screen;
  z-index: 0;
}
.fx-spotlight > * { position: relative; z-index: 1; }
/* Light hero variant — softer */
.hero--division.fx-spotlight::after {
  background: radial-gradient(
    circle 520px at var(--fx-x) var(--fx-y),
    rgba(204, 193, 133, 0.14) 0%,
    rgba(204, 193, 133, 0.03) 40%,
    transparent 65%
  );
}

/* ----- 2. Scroll-drawn seams ---------------------------------------- */
/* Existing seam selectors already use ::before; we override the width animation */
[data-seam="gradient"]::before,
[data-seam="hairline"]::before {
  transform-origin: center;
  transform: scaleX(0);
  transition: transform 1.2s cubic-bezier(.4,0,.2,1);
}
[data-seam="gradient"].fx-seam-drawn::before,
[data-seam="hairline"].fx-seam-drawn::before {
  transform: scaleX(1);
}

/* ----- 5. Magnetic + gold sweep -------------------------------------- */
.btn--gold.fx-magnetic,
.btn--green.fx-magnetic {
  position: relative;
  overflow: hidden;
  transition: transform .25s cubic-bezier(.2,.6,.2,1), box-shadow .25s ease;
  --btn-sweep-x: 50%;
}
.btn--gold.fx-magnetic::after,
.btn--green.fx-magnetic::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(
    circle 140px at var(--btn-sweep-x) 50%,
    rgba(255, 255, 255, 0.35) 0%,
    transparent 60%
  );
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
  mix-blend-mode: overlay;
}
.btn--gold.fx-magnetic:hover::after,
.btn--green.fx-magnetic:hover::after {
  opacity: 1;
}
.btn--gold.fx-magnetic:hover,
.btn--green.fx-magnetic:hover {
  box-shadow: 0 14px 36px -12px rgba(204, 193, 133, 0.55);
}

/* ----- 6. Hero portrait — breathing glow ----------------------------- */
.family-hero__card {
  transition: transform .35s cubic-bezier(.2,.6,.2,1);
  transform-style: preserve-3d;
}
.family-hero__portrait {
  animation: fxBreath 4.5s ease-in-out infinite;
}
@keyframes fxBreath {
  0%, 100% {
    box-shadow:
      0 16px 40px -16px rgba(0,0,0,.5),
      0 0 0 0 rgba(204, 193, 133, 0.3),
      0 0 24px -2px rgba(204, 193, 133, 0.35);
  }
  50% {
    box-shadow:
      0 16px 40px -16px rgba(0,0,0,.5),
      0 0 0 6px rgba(204, 193, 133, 0.08),
      0 0 36px -2px rgba(204, 193, 133, 0.55);
  }
}

/* ----- 7. Sticky TOC rail -------------------------------------------- */
.fx-toc {
  position: fixed;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 14px;
  pointer-events: auto;
}
.fx-toc__item {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--charcoal);
  text-decoration: none;
  opacity: .42;
  transition: opacity .25s ease, color .25s ease;
}
.fx-toc__item:hover { opacity: 1; color: var(--green-700); }
.fx-toc__item.is-active { opacity: 1; color: var(--gold-800); }
.fx-toc__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  transition: width .25s ease, background .25s ease, box-shadow .25s ease;
  flex-shrink: 0;
}
.fx-toc__item.is-active .fx-toc__dot {
  width: 18px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--green-700), var(--gold-600));
  box-shadow: 0 0 12px rgba(204, 193, 133, .5);
}
.fx-toc__label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: max-width .35s cubic-bezier(.2,.6,.2,1), padding .25s ease;
  padding: 0;
}
.fx-toc__item:hover .fx-toc__label,
.fx-toc__item.is-active .fx-toc__label {
  max-width: 180px;
  padding-right: 8px;
}
/* On dark hero/band sections — invert via mix-blend if needed */
@media (max-width: 1180px) {
  .fx-toc { display: none; }
}

/* ----- 8. Animated dashboard mocks ----------------------------------- */
.dashboard-mock, .bar-chart {
  position: relative;
}
/* Skeleton state (#10) before fx-dash-live applied */
.dashboard-mock:not(.fx-dash-live) .dashboard-mock__stat-value,
.bar-chart:not(.fx-dash-live) .bar-chart__bar {
  position: relative;
}
.dashboard-mock:not(.fx-dash-live) .dashboard-mock__stat-value {
  background: linear-gradient(90deg, rgba(255,255,255,.08) 0%, rgba(255,255,255,.18) 50%, rgba(255,255,255,.08) 100%);
  background-size: 200% 100%;
  animation: fxShimmer 1.4s infinite linear;
  color: transparent !important;
  border-radius: 4px;
}
@keyframes fxShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.dashboard-mock.fx-dash-live .dashboard-mock__stat-value {
  animation: none;
  background: none;
  color: var(--white) !important;
  transition: color .4s ease;
}
/* Bar chart pulse — bars rise from zero */
.bar-chart .bar-chart__bar {
  transform-origin: bottom;
  transform: scaleY(0);
  transition: transform 1.1s cubic-bezier(.2,.7,.2,1);
  transition-delay: var(--bar-delay, 0ms);
}
.bar-chart.fx-dash-live .bar-chart__bar {
  transform: scaleY(1);
}
/* Latest-point pulsing dot — added to first dashboard mock with a path */
.dashboard-mock.fx-dash-live::before {
  content: "";
  position: absolute;
  right: 14px;
  top: 14px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gold-500);
  box-shadow: 0 0 0 0 rgba(204, 193, 133, .7);
  animation: fxPulseDot 2s ease-in-out infinite;
  z-index: 4;
}
@keyframes fxPulseDot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(204, 193, 133, .55); }
  50% { box-shadow: 0 0 0 10px rgba(204, 193, 133, 0); }
}

/* ----- 4. Strike-through animation on stop-list ---------------------- */
.stop-list li > div {
  position: relative;
}
.stop-list li:not(.stop-list__sum) > div::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 1px;
  background: linear-gradient(90deg, var(--gold-300), var(--gold-500), var(--gold-300));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .7s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 0 8px rgba(204, 193, 133, .5);
  pointer-events: none;
}
.stop-list li.fx-strike:not(.stop-list__sum) > div::after {
  transform: scaleX(1);
}
.stop-list li.fx-strike:not(.stop-list__sum) strong,
.stop-list li.fx-strike:not(.stop-list__sum) em {
  opacity: .55;
  transition: opacity .5s ease;
}

/* ----- 9. Deliverable card hover preview ----------------------------- */
.deliverable-card {
  transition: transform .35s cubic-bezier(.2,.6,.2,1), box-shadow .35s ease, border-color .35s ease;
}
.deliverable-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 28px 60px -28px rgba(0,0,0,.35);
  border-color: rgba(204, 193, 133, .55);
}
.deliverable-card--platform:hover {
  box-shadow: 0 28px 60px -28px rgba(0,0,0, .6);
}
.deliverable-card__chips span {
  transition: transform .25s ease, background .25s ease, color .25s ease;
}
.deliverable-card--platform:hover .deliverable-card__chips span:hover {
  background: rgba(204, 193, 133, .2);
  color: var(--white);
  transform: translateY(-2px);
}
/* Tiny PDF "pages" peek behind the PDF card on hover */
.deliverable-card:not(.deliverable-card--platform) {
  overflow: visible;
}
.deliverable-card:not(.deliverable-card--platform)::after {
  content: "";
  position: absolute;
  right: -8px; top: 12px; bottom: 12px;
  width: 14px;
  background: linear-gradient(90deg, rgba(204,193,133,.18) 0%, rgba(204,193,133,0) 100%);
  border-radius: 0 var(--radius) var(--radius) 0;
  opacity: 0;
  transition: opacity .35s ease, transform .35s ease;
  transform: translateX(-8px);
  pointer-events: none;
}
.deliverable-card:not(.deliverable-card--platform):hover::after {
  opacity: 1;
  transform: translateX(0);
}

/* ----- 11. Stepped timeline ------------------------------------------ */
.timeline { position: relative; }
.timeline .timeline__step {
  cursor: pointer;
  transition: transform .3s cubic-bezier(.2,.6,.2,1), opacity .3s ease;
}
.timeline .timeline__step:not(:hover):not(.is-active) {
  opacity: .55;
}
.timeline .timeline__step:hover {
  transform: translateY(-4px);
  opacity: 1;
}
.timeline .timeline__step.is-active {
  opacity: 1;
}
.timeline .timeline__node {
  transition: background .3s ease, color .3s ease, box-shadow .3s ease, transform .3s ease;
}
.timeline .timeline__step.is-active .timeline__node,
.timeline .timeline__step:hover .timeline__node {
  background: linear-gradient(135deg, var(--green-700), var(--gold-600));
  color: var(--white);
  box-shadow: 0 12px 28px -10px rgba(204, 193, 133, .6);
  transform: scale(1.08);
}

/* ----- Reduce motion ------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .family-hero__portrait { animation: none; }
  .bar-chart .bar-chart__bar { transform: none; }
  [data-seam] .seam, [data-seam]::before { transform: none !important; }
}
