/* ───────────────────────────────────────────────────────────────────────
   features.css — the "system overview" page (.f- prefix).
   The page reuses the shared .de- chassis (css/de-act.css) for the act,
   includes, and compare sections; this file owns the page-unique loop
   scene, the four-engine cards, and a couple of page-hook overrides.
   Load order: style.css → de-act.css → features.css.
   ─────────────────────────────────────────────────────────────────────── */

.features-page {
  --f-good: #4ade80;
  --f-good-dim: rgba(74, 222, 128, 0.14);
  --f-bad: #ee3a39;
  --f-line: rgba(255, 255, 255, 0.1);
}

/* ─── hero subhead (intro scene only; fades when the act engages) ─── */
.f-hero-sub {
  max-width: 40rem;
  margin: 4px 0 0;
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  line-height: 1.55;
  color: var(--text-mid, rgba(255, 255, 255, 0.75));
  transition: opacity 0.45s ease, transform 0.45s ease, max-height 0.45s ease, margin 0.45s ease;
}
.de-act.is-engaged .f-hero-sub {
  opacity: 0;
  max-height: 0;
  margin: 0;
  transform: translateY(-8px);
  pointer-events: none;
  overflow: hidden;
}
/* At intro the stage is hidden but its min-height still reserves a row;
   with the extra subhead that overflows the viewport and align-content:center
   pulls the headline up under the nav. Drop the reservation until engaged. */
.features-page #system-loop:not(.is-engaged) .de-act-stage-sticky {
  min-height: 0;
  height: 0;
  overflow: hidden;
}
/* desktop: reclaim viewport height so the wheel + nodes get room to breathe
   (chassis caps it at 600px; the mobile @media block overrides this back to auto) */
.features-page .de-act-stage-sticky { height: min(74vh, 700px); max-height: 720px; }

/* desktop: widen the stage column so the loop uses the horizontal space too
   (the copy rail keeps enough room; scoped to desktop so mobile stays single-column) */
@media (min-width: 1101px) {
  .features-page .de-act-inner { grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.52fr); }
}

/* ════════════════════════════════════════════════════════════════════
   THE SYSTEM LOOP — persistent scene inside .de-act-stage-sticky.
   Sits behind the (empty) .de-beat placeholders that drive setLoopStage.
   ════════════════════════════════════════════════════════════════════ */
.f-loop-stage {
  position: absolute;
  inset: 0;
  overflow: visible;
}

/* the transparent beat placeholders never need to catch the pointer */
.features-page .de-act-stage-sticky .de-beat {
  pointer-events: none;
}

/* ─── trace layer ─── */
.f-traces {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.f-arc {
  fill: none;
  stroke: var(--f-good);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;          /* hidden until lit (pathLength=1) */
  opacity: 0.9;
  filter: drop-shadow(0 0 5px rgba(74, 222, 128, 0.55));
  transition: stroke-dashoffset 0.7s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
}
.f-arc.is-lit {
  stroke-dashoffset: 0;
}
.f-arc--return {
  stroke-dasharray: 5 7;
  opacity: 0;
}
.f-loop-stage.is-closed .f-arc--return {
  opacity: 0.75;
  stroke-dashoffset: 0;
}

/* ─── center boat + AI core ─── */
.f-boat {
  position: absolute;
  left: 60%;
  top: 53%;
  width: clamp(180px, 25%, 280px);
  transform: translate(-50%, -50%);
  opacity: 0.16;
  filter: grayscale(0.3) brightness(0.85);
  transition: opacity 0.7s ease, filter 0.7s ease;
  pointer-events: none;
}
.f-loop-stage.is-flywheel .f-boat {
  opacity: 0.42;
  filter: none;
}

.f-core {
  position: absolute;
  left: 66%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 3;
}
.f-core-chip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 9px;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  border: 1px solid rgba(74, 222, 128, 0.4);
  background: rgba(74, 222, 128, 0.07);
  box-shadow: 0 0 0 rgba(74, 222, 128, 0);
  transition: box-shadow 0.6s ease, border-color 0.6s ease, background 0.6s ease;
}
.f-core-chip span {
  border-radius: 2px;
  background: rgba(74, 222, 128, 0.28);
  transition: background 0.5s ease, box-shadow 0.5s ease;
}
.f-loop-stage.is-flywheel .f-core-chip {
  border-color: var(--f-good);
  background: rgba(74, 222, 128, 0.16);
  box-shadow: 0 0 34px rgba(74, 222, 128, 0.6), inset 0 0 14px rgba(74, 222, 128, 0.3);
  animation: f-core-pulse 2.4s ease-in-out infinite;
}
.f-loop-stage.is-flywheel .f-core-chip span {
  background: var(--f-good);
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.8);
}
@keyframes f-core-pulse {
  0%, 100% { box-shadow: 0 0 22px rgba(74, 222, 128, 0.45), inset 0 0 12px rgba(74, 222, 128, 0.25); }
  50% { box-shadow: 0 0 44px rgba(74, 222, 128, 0.75), inset 0 0 18px rgba(74, 222, 128, 0.4); }
}

/* perpetual "current" on the lit ring once the flywheel closes */
.f-loop-stage.is-flywheel .f-arc.is-lit {
  animation: f-arc-flow 2.8s ease-in-out infinite;
}
@keyframes f-arc-flow {
  0%, 100% { opacity: 0.55; filter: drop-shadow(0 0 4px rgba(74, 222, 128, 0.4)); }
  50% { opacity: 1; filter: drop-shadow(0 0 9px rgba(74, 222, 128, 0.85)); }
}

/* ─── nodes ─── */
.f-node {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 2;
  opacity: 0.32;
  filter: grayscale(0.85);
  transition: opacity 0.55s ease, filter 0.55s ease, transform 0.55s ease;
}
.f-node.is-lit {
  opacity: 1;
  filter: none;
}
.f-node-label {
  font-family: var(--de-mono, 'JetBrains Mono', monospace);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim, rgba(255, 255, 255, 0.45));
  white-space: nowrap;
  transition: color 0.5s ease;
}
.f-node.is-lit .f-node-label {
  color: var(--f-good);
}

/* node positions (match SVG endpoints; preserveAspectRatio=none).
   Left = feed (DMS → Inventory); right = closed loop (Marketing → Sales → Analytics). */
.f-node--dms        { left: 11%;   top: 28.1%; }
.f-node--inventory  { left: 29%;   top: 23.4%; }
.f-node--marketing  { left: 66%;   top: 18.8%; }
.f-node--sales      { left: 83.3%; top: 65.6%; }
.f-node--analytics  { left: 48.7%; top: 65.6%; }

/* icon node (DMS) */
.f-node-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--f-line);
  background: rgba(10, 14, 16, 0.9);
  color: var(--text-mid, rgba(255, 255, 255, 0.75));
  transition: border-color 0.5s ease, color 0.5s ease, box-shadow 0.5s ease;
}
.f-node.is-lit .f-node-badge {
  border-color: var(--f-good);
  color: var(--f-good);
  box-shadow: 0 0 22px rgba(74, 222, 128, 0.4);
}
/* panel nodes use their screenshot on desktop; the badge is the mobile face */
.f-node--panel .f-node-badge { display: none; }

/* panel node (window chrome + real screenshot) */
.f-win {
  width: clamp(124px, 13.5vw, 166px);
  margin: 0;
  border-radius: 9px;
  overflow: hidden;
  border: 1px solid var(--f-line);
  background: #0a0e10;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5);
  transition: border-color 0.5s ease, box-shadow 0.5s ease;
}
.f-node.is-lit .f-win {
  border-color: rgba(74, 222, 128, 0.55);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.55), 0 0 22px rgba(74, 222, 128, 0.28);
}
.f-win-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid var(--f-line);
}
.f-win-bar span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}
.f-win-bar em {
  margin-left: 6px;
  font-family: var(--de-mono, monospace);
  font-style: normal;
  font-size: 0.5rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim, rgba(255, 255, 255, 0.45));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.f-win img {
  display: block;
  width: 100%;
  height: 96px;
  object-fit: cover;
  object-position: top center;
}
/* the Marketing ad is square (1:1) — show it whole instead of the cropped band */
.f-node--marketing .f-win img { height: auto; }
/* the Analytics report is tall — keep a legible band, just past the header bar */
.f-node--analytics .f-win img { height: 122px; object-position: center 15%; }
/* Sales SMS is the hero proof — give it more room + bigger text */
.f-node--sales .f-win { width: clamp(176px, 15.5vw, 200px); }

/* ─── red broken-vendor cluster (beat 1 only) ─── */
.f-broken {
  position: absolute;
  left: 4%;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 4;
  transition: opacity 0.5s ease;
}
.f-broken-tile {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid rgba(238, 58, 57, 0.5);
  background: rgba(238, 58, 57, 0.1);
  color: rgba(255, 120, 119, 0.95);
  box-shadow: 0 0 18px rgba(238, 58, 57, 0.22);
  opacity: 0;
  transform: translateX(-12px) scale(0.92);
  transition: opacity 0.45s ease, transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}
.f-broken-tile i {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--f-bad);
}
.f-broken-tile i::before,
.f-broken-tile i::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 3px;
  width: 8px;
  height: 1.6px;
  background: #fff;
  border-radius: 2px;
}
.f-broken-tile i::before { transform: rotate(45deg); }
.f-broken-tile i::after  { transform: rotate(-45deg); }

/* show when broken; dissolve away (scatter + fade) once the loop builds */
.f-loop-stage.is-broken .f-broken-tile {
  opacity: 1;
  transform: translateX(0) scale(1);
  transition-delay: calc(var(--d, 0) * 70ms);
  animation: f-broken-jitter 2.6s ease-in-out infinite;
  animation-delay: calc(var(--d, 0) * 120ms);
}
.f-loop-stage:not(.is-broken) .f-broken {
  opacity: 0;
  pointer-events: none;
}
.f-loop-stage:not(.is-broken) .f-broken-tile {
  opacity: 0;
  transform: translateX(-24px) scale(0.7) rotate(-12deg);
}
@keyframes f-broken-jitter {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(-1px, 1px) scale(1); }
  50% { transform: translate(1px, -1px) scale(0.99); }
  75% { transform: translate(-1px, -1px) scale(1); }
}

/* ════════════════════════════════════════════════════════════════════
   FOUR ENGINES
   ════════════════════════════════════════════════════════════════════ */
.f-engines {
  padding: 100px clamp(20px, 4vw, 44px);
  max-width: 1180px;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.f-engines.is-visible {
  opacity: 1;
  transform: none;
}
.f-engines-head {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 48px;
}
.f-engines-head h2 {
  margin: 14px 0 14px;
  font-size: clamp(1.8rem, 3.4vw, 2.9rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.08;
  color: #fff;
}
.f-engines-head h2 span { color: var(--f-good); }
.f-engines-head p {
  font-size: 1.02rem;
  line-height: 1.55;
  color: var(--text-mid, rgba(255, 255, 255, 0.75));
}
.f-engines-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.f-engine {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px 22px 20px;
  border-radius: 16px;
  border: 1px solid var(--f-line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
  text-decoration: none;
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.f-engine:hover {
  border-color: rgba(74, 222, 128, 0.45);
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4), 0 0 24px rgba(74, 222, 128, 0.12);
}
.f-engine-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: var(--f-good-dim);
  color: var(--f-good);
}
.f-engine h3 {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 700;
  color: #fff;
}
.f-engine-line {
  margin: 0;
  flex: 1;
  font-size: 0.94rem;
  line-height: 1.5;
  color: var(--text-mid, rgba(255, 255, 255, 0.75));
}
.f-engine-line b { color: #fff; font-weight: 700; }
.f-engine-go {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--de-mono, monospace);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--f-good);
}
.f-engine-go svg { transition: transform 0.25s ease; }
.f-engine:hover .f-engine-go svg { transform: translateX(4px); }

.f-engines-foot {
  margin-top: 44px;
  text-align: center;
}
.f-engines-foot-label {
  margin: 0 0 14px;
  font-family: var(--de-mono, monospace);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim, rgba(255, 255, 255, 0.45));
}

@media (max-width: 960px) {
  .f-engines-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .f-engines-grid { grid-template-columns: 1fr; }
  .f-engines { padding-top: 72px; padding-bottom: 72px; }
}

/* ════════════════════════════════════════════════════════════════════
   PAGE-HOOK OVERRIDES of shared chassis (allowed via .features-page)
   ════════════════════════════════════════════════════════════════════ */
.features-page .de-includes-grid {
  grid-template-columns: repeat(2, 1fr);
}
/* the 2-col override outranks the chassis ≤880 collapse — restore it on phones */
@media (max-width: 880px) {
  .features-page .de-includes-grid { grid-template-columns: 1fr; }
}
.features-page .de-includes-pillar {
  color: var(--f-good);
}

/* capability-map cards are links to their pillar deep-dive */
.features-page a.de-includes-col {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.features-page a.de-includes-col:hover {
  border-color: rgba(74, 222, 128, 0.5);
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4), 0 0 24px rgba(74, 222, 128, 0.14);
}
.f-col-go {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 18px;
  font-family: var(--de-mono, monospace);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--f-good);
}
.f-col-go svg { transition: transform 0.25s ease; }
.features-page a.de-includes-col:hover .f-col-go svg { transform: translateX(4px); }

/* ════════════════════════════════════════════════════════════════════
   PREMIUM FX — depth, bloom, flowing current, reactor core
   ════════════════════════════════════════════════════════════════════ */

/* ambient green wash + vignette behind the loop */
.f-loop-stage::before {
  content: '';
  position: absolute;
  inset: -16%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 58% 54% at 50% 47%, rgba(74, 222, 128, 0.12), transparent 62%),
    radial-gradient(ellipse 90% 80% at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.55));
  opacity: 0.55;
  transition: opacity 0.7s ease;
}
.f-loop-stage.is-flywheel::before { opacity: 1; }

/* drifting ambient particles */
.f-particles { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.f-particle {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(74, 222, 128, 0.5);
  box-shadow: 0 0 7px rgba(74, 222, 128, 0.65);
  opacity: 0;
  animation: f-drift var(--dur, 8s) ease-in-out var(--dly, 0s) infinite;
}
@keyframes f-drift {
  0% { opacity: 0; transform: translateY(10px) scale(0.5); }
  35% { opacity: 0.7; }
  70% { opacity: 0.45; }
  100% { opacity: 0; transform: translateY(-22px) scale(1); }
}

/* traces: keep them above the wash, below the nodes */
.f-traces { z-index: 1; }
.f-boat { z-index: 1; }

/* faint always-on base circuit (the "unpowered" wiring) */
.f-arc-base {
  fill: none;
  stroke: rgba(74, 222, 128, 0.13);
  stroke-width: 1.4;
}

/* the closed-loop track the cycle rides on */
.f-loop-ring {
  fill: none;
  stroke: rgba(74, 222, 128, 0.1);
  stroke-width: 1.2;
  transition: stroke 0.6s ease;
}
.f-loop-stage.is-flywheel .f-loop-ring { stroke: rgba(74, 222, 128, 0.32); }

/* richer bloom on the lit bright arcs */
.f-arc.is-lit {
  filter: drop-shadow(0 0 2px rgba(74, 222, 128, 0.9))
          drop-shadow(0 0 7px rgba(74, 222, 128, 0.65))
          drop-shadow(0 0 16px rgba(74, 222, 128, 0.4));
}

/* flowing light packet along each lit trace */
.f-arc-flow {
  fill: none;
  stroke: #d8ffe8;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-dasharray: 0.06 0.94;
  stroke-dashoffset: 1;
  opacity: 0;
  filter: drop-shadow(0 0 6px rgba(74, 222, 128, 0.95));
  transition: opacity 0.4s ease;
}
.f-arc-flow.is-lit {
  opacity: 1;
  animation: f-flow 2.2s linear infinite;
}
@keyframes f-flow {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

/* reactor core — halo + rotating ring around the chip */
.f-core-chip { position: relative; }
.f-core-chip::before {
  content: '';
  position: absolute;
  inset: -42px;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(74, 222, 128, 0.32), transparent 70%);
  opacity: 0.45;
  transition: opacity 0.6s ease;
}
.f-core-chip::after {
  content: '';
  position: absolute;
  inset: -13px;
  border-radius: 15px;
  border: 1px dashed rgba(74, 222, 128, 0.35);
}
.f-loop-stage.is-flywheel .f-core-chip::before { opacity: 1; }
.f-loop-stage.is-flywheel .f-core-chip::after {
  border-color: rgba(74, 222, 128, 0.6);
  animation: f-ring-spin 9s linear infinite;
}
@keyframes f-ring-spin { to { transform: rotate(360deg); } }

/* boat: bring it forward as the heart, with a rim-light */
.f-boat {
  opacity: 0.2;
  filter: grayscale(0.2) brightness(0.9);
}
.f-loop-stage.is-flywheel .f-boat {
  opacity: 0.5;
  filter: brightness(1.02) drop-shadow(0 8px 32px rgba(74, 222, 128, 0.32));
}

/* glass panels — gradient border + sheen + richer lit glow */
.f-win {
  position: relative;
  border: 1px solid transparent;
  background:
    linear-gradient(#0a0e10, #0a0e10) padding-box,
    linear-gradient(150deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.03)) border-box;
}
.f-win::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.1), transparent 42%);
}
.f-node.is-lit .f-win {
  background:
    linear-gradient(#0a0e10, #0a0e10) padding-box,
    linear-gradient(150deg, rgba(74, 222, 128, 0.75), rgba(74, 222, 128, 0.12)) border-box;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), 0 0 26px rgba(74, 222, 128, 0.32);
}

/* Sales node — AI SMS thread (replaces the dashboard screenshot) */
.f-win.f-sms { width: clamp(150px, 16vw, 178px); }
.f-sms-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 9px 9px 8px;
  background: #0a0e10;
}
.f-sms-bubble {
  max-width: 92%;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 0.66rem;
  line-height: 1.3;
}
.f-sms-in {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.82);
  border-bottom-left-radius: 3px;
}
.f-sms-out {
  align-self: flex-end;
  background: rgba(74, 222, 128, 0.18);
  border: 1px solid rgba(74, 222, 128, 0.4);
  color: #eafff1;
  border-bottom-right-radius: 3px;
}
.f-sms-stamp {
  align-self: flex-end;
  margin-top: 2px;
  font-family: var(--de-mono, monospace);
  font-size: 0.46rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--f-good);
}

/* AI-core spokes — wired to every node, energized on the final beat */
.f-spoke {
  fill: none;
  stroke: rgba(74, 222, 128, 0.5);
  stroke-width: 1;
  stroke-dasharray: 2 6;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.f-spoke.is-lit {
  opacity: 0.5;
  animation: f-spoke-flow 3s linear infinite;
}
@keyframes f-spoke-flow { to { stroke-dashoffset: -32; } }

/* "what flows" labels riding each connection (appear with their arc) */
.f-flow-label {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 3;
  font-family: var(--de-mono, monospace);
  font-size: 0.52rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(170, 255, 200, 0.95);
  white-space: nowrap;
  padding: 2px 8px;
  border-radius: 100px;
  background: rgba(5, 10, 8, 0.74);
  border: 1px solid rgba(74, 222, 128, 0.28);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}
.f-flow-label.is-lit { opacity: 1; }
.f-flow-label--1 { left: 20%;   top: 22%; }
.f-flow-label--2 { left: 47%;   top: 12.5%; }
.f-flow-label--3 { left: 80.5%; top: 33%; }
.f-flow-label--4 { left: 66%;   top: 83%; }
.f-flow-label--5 { left: 46%;   top: 35%; }

/* the flywheel comet — races the ring once it closes */
.f-loop-spin {
  fill: none;
  stroke: #d8ffe8;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-dasharray: 0.16 0.84;
  stroke-dashoffset: 1;
  opacity: 0;
  filter: drop-shadow(0 0 8px rgba(74, 222, 128, 0.95));
}
.f-loop-stage.is-flywheel .f-loop-spin {
  opacity: 0.95;
  animation: f-spin 2.6s linear infinite;
}
@keyframes f-spin { to { stroke-dashoffset: 0; } }
/* packets race a touch faster once the wheel is spinning */
.f-loop-stage.is-flywheel .f-arc-flow.is-lit { animation-duration: 1.7s; }

/* compounding payoff — one number that climbs as the wheel turns */
.f-metric {
  position: absolute;
  left: 8.5%;
  top: 70%;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(74, 222, 128, 0.4);
  background: linear-gradient(180deg, rgba(74, 222, 128, 0.12), rgba(5, 10, 8, 0.72));
  box-shadow: 0 0 30px rgba(74, 222, 128, 0.25);
  opacity: 0;
  transform: translateY(10px) scale(0.96);
  transition: opacity 0.6s ease, transform 0.6s ease;
  pointer-events: none;
}
.f-metric.is-lit { opacity: 1; transform: none; }
.f-metric-num {
  font-size: clamp(1.7rem, 2.7vw, 2.4rem);
  font-weight: 850;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--f-good);
}
.f-metric-label {
  font-family: var(--de-mono, monospace);
  font-size: 0.56rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-mid, rgba(255, 255, 255, 0.75));
  max-width: 156px;
}

/* ─── before/after crossfade (Inventory node + its mobile detail card) ─── */
.f-ba-stage { position: relative; width: 100%; aspect-ratio: 16 / 10; overflow: hidden; }
.f-win .f-ba-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.f-ba-before { animation: f-ba-rev 4.4s ease-in-out infinite; }
.f-ba-after { opacity: 0; animation: f-ba-fwd 4.4s ease-in-out infinite; }
@keyframes f-ba-fwd { 0%, 38% { opacity: 0; } 52%, 90% { opacity: 1; } 100% { opacity: 0; } }
@keyframes f-ba-rev { 0%, 38% { opacity: 1; } 52%, 90% { opacity: 0; } 100% { opacity: 1; } }
.f-ba-tag {
  position: absolute;
  left: 7px;
  bottom: 7px;
  font-family: var(--de-mono, monospace);
  font-size: 0.5rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 100px;
}
.f-ba-tag--before { background: rgba(238, 58, 57, 0.85); color: #fff; animation: f-ba-rev 4.4s ease-in-out infinite; }
.f-ba-tag--after { background: rgba(74, 222, 128, 0.92); color: #04140b; opacity: 0; animation: f-ba-fwd 4.4s ease-in-out infinite; }

/* ─── SMS bubbles type in (Sales node + its mobile detail card) ─── */
.f-sms-bubble, .f-sms-stamp { opacity: 0; transform: translateY(7px); transition: opacity 0.35s ease, transform 0.35s ease; }
.f-sms-bubble.is-in, .f-sms-stamp.is-in { opacity: 1; transform: none; }

/* active-node detail card — mobile only (desktop nodes show their own panels) */
.f-detail { display: none; }

/* ════════════════════════════════════════════════════════════════════
   MOBILE (portrait) — keep the FULL animated flywheel. Nodes become
   glowing icon-badges (screenshot panels can't orbit a phone-width ring);
   all the FX (traces, packets, spin comet, spokes, core halo, particles,
   wash, bloom) stay on. The copy rail above narrates each beat.
   ════════════════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .f-flow-label { display: none; } /* too dense on the small wheel — the copy carries it */
  .f-boat { display: none; }       /* faint backdrop muddies at this size */

  /* INTRO: big hero header + paragraph; both shrink/hide as the wheel engages.
     (.f-hero-sub shows at intro and hides on engage via the base .is-engaged rule.) */
  .features-page #system-loop:not(.is-engaged) .de-act-headline { font-size: clamp(2.8rem, 10vw, 3.6rem); }
  .f-hero-sub { font-size: 1.06rem; }

  /* stage = animated wheel on top + active-node detail card below */
  .features-page .de-act-stage-sticky {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    margin: 0 auto;
  }
  .f-loop-stage {
    position: relative;
    inset: auto;
    width: 100%;
    aspect-ratio: 1.42 / 1;
  }

  /* nodes → icon badges on the ring */
  .f-node--panel .f-win { display: none; }
  .f-node--panel .f-node-badge { display: flex; }
  .f-node-badge {
    width: clamp(30px, 9.5vw, 42px);
    height: clamp(30px, 9.5vw, 42px);
  }
  .f-node-badge svg { width: 54%; height: 54%; }
  .f-node-label { font-size: 0.5rem; letter-spacing: 0.1em; }
  .f-core-chip { width: 42px; height: 42px; padding: 7px; }

  /* compounding payoff: its own row below the wheel (flows, so it never overlaps),
     collapsed until the final beat, then large + centered */
  .f-metric {
    position: static;
    order: 9;
    align-self: center;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    align-items: center;
    text-align: center;
    gap: 5px;
    max-height: 0;
    margin: 0;
    padding: 0 28px;
    opacity: 0;
    overflow: hidden;
    transform: translateY(8px);
    transition: max-height 0.5s ease, opacity 0.5s ease, transform 0.5s ease, padding 0.4s ease, margin 0.4s ease;
  }
  .f-metric.is-lit {
    max-height: 140px;
    margin-top: 10px;
    padding: 14px 30px;
    opacity: 1;
    transform: none;
  }
  .f-metric-num { font-size: 2.5rem; }
  .f-metric-label { font-size: 0.54rem; max-width: none; }

  /* active-node detail card — the real screenshot for the current beat */
  .f-detail {
    display: block;
    width: 100%;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    text-align: center;
    transition: max-height 0.45s ease, opacity 0.4s ease, transform 0.4s ease;
    transform: translateY(8px);
  }
  .f-detail.is-shown { max-height: 240px; opacity: 1; transform: none; }
  .f-detail .f-win { display: block; max-width: 100%; margin: 0 auto; text-align: left; overflow: hidden; }
  .f-detail .f-win img { display: block; width: 100%; height: auto; }

  /* marketing: square ad */
  .f-detail[data-node="marketing"] .f-win { width: 170px; }
  /* analytics: crop the tall report to a legible, well-merchandised top band */
  .f-detail[data-node="analytics"] .f-win { width: min(100%, 300px); }
  .f-detail[data-node="analytics"] .f-win img { height: 138px; object-fit: cover; object-position: center 16%; }

  /* detail card widths (the type-in + crossfade animations are global) */
  .f-detail .f-win.f-sms { width: min(100%, 320px); }
  .f-detail[data-node="inventory"] .f-win { width: min(100%, 252px); }
}

/* ════════════════════════════════════════════════════════════════════
   REDUCED MOTION — kill perpetual + jitter loops, keep static states
   ════════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .f-loop-stage.is-flywheel .f-core-chip,
  .f-loop-stage.is-flywheel .f-core-chip::after,
  .f-loop-stage.is-flywheel .f-arc.is-lit,
  .f-arc-flow.is-lit,
  .f-spoke.is-lit,
  .f-loop-stage.is-broken .f-broken-tile {
    animation: none !important;
  }
  .f-arc { transition: stroke-dashoffset 0.01s, opacity 0.01s; }
  .f-particles { display: none; }
  .f-arc-flow { display: none; }
  .f-loop-spin { display: none; }
  /* detail cards: rest on the resolved state instead of looping */
  .f-ba-before, .f-ba-after, .f-ba-tag--before, .f-ba-tag--after { animation: none !important; }
  .f-ba-after, .f-ba-tag--after { opacity: 1 !important; }
  .f-sms-bubble, .f-sms-stamp { opacity: 1 !important; transform: none !important; }
}
