/* ============================================================
   MFS Native Framer Components — Conic Gradient + Tilt Card
   v4 — May 27, 2026
   - WHITE conic
   - Rim is a CHILD with z-index: -1 (behind host content)
   - Host content (text) untouched, always on top
   ============================================================ */

/* ---------- Conic Rim (child sibling, sits BEHIND host content) ---- */
.conic-rim {
  position: absolute;
  inset: calc(-1 * var(--conic-bleed, 1px));
  border-radius: inherit;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;                /* sits at base of stacking context */
}
.conic-rim::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1000%;
  height: 1000%;
  transform: translate(-50%, -50%) rotate(0deg);
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    transparent 200deg,
    var(--conic-color, #ffffff) 320deg,
    var(--conic-color, #ffffff) 360deg
  );
  /* Single-pulse animation: one full 360° lap each time .is-pulsing fires.
     JS toggles .is-pulsing on/off every var(--conic-interval). */
  animation: conic-spin var(--conic-lap, 1.2s) cubic-bezier(.4, 0, .6, 1);
  animation-play-state: paused;
  animation-iteration-count: 1;
  opacity: 0;
  transition: opacity .25s ease;
}
.conic-rim.is-pulsing::before {
  animation-play-state: running;
  opacity: 1;
}
.conic-rim::after {
  /* Mask paints the inner area with host's bg so only a thin rim shows.
     This sits BELOW the host's own content (text/icons) which renders
     at the host's natural z-index above z:0. */
  content: "";
  position: absolute;
  inset: var(--conic-margin, 1.5px);
  border-radius: inherit;
  background: var(--conic-bg, #0a0a0a);
  backdrop-filter: blur(var(--conic-blur, 0px));
  -webkit-backdrop-filter: blur(var(--conic-blur, 0px));
}
/* Legacy .is-on kept for backwards compatibility but no longer used */
.conic-rim.is-on::before { animation-play-state: running; opacity: 1; }

@keyframes conic-spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .conic-rim::before { animation: none; }
}

/* ---------- Per-target tuning ----------------------------------- */
/* For pills with text, we need the text node to stack above the rim.
   We use `display: flow-root` + a wrapper-less trick: the host's
   ::before/::after stay clean. The rim is z-index: 0, host content
   (text) is implicitly z-index: auto which paints AFTER siblings in
   document order. Since .conic-rim is appended LAST, it stacks ABOVE
   the text. SOLUTION: prepend the rim before any text content via JS,
   AND give it z-index: 0 with host receiving isolation: isolate so its
   own text has its own stacking context above the rim background. */

.conic-rim--pill {
  --conic-margin: 1.5px;
  --conic-bg: #1a1a1a;
  --conic-color: #ffffff;
  --conic-duration: 5s;
}
.hero2pre__pill.is-active .conic-rim--pill {
  --conic-bg: #ffffff;
  --conic-color: #ffffff;
}

.conic-rim--prompt-bm {
  --conic-margin: 1.2px;
  --conic-bg: rgba(10,10,10,.88);
  --conic-blur: 6px;
  --conic-color: #ffffff;
  --conic-duration: 6s;
}

.conic-rim--prompt-wf {
  --conic-margin: 1.2px;
  --conic-bg: rgba(10,10,10,.88);
  --conic-blur: 6px;
  --conic-color: #ffffff;
  --conic-duration: 6s;
}

/* Hosts get isolation so rim doesn't bleed out, and text inside stacks
   above the rim. Position is set by JS if needed. */
.has-conic-rim {
  isolation: isolate;
}
/* All direct text-bearing children get pulled above the rim */
.has-conic-rim > *:not(.conic-rim) {
  position: relative;
  z-index: 1;
}

/* ---------- Tilt Card (unchanged) ------------------------------- */
.tilt-card {
  transform-style: preserve-3d;
  transform-origin: center center;
  transition: transform .35s cubic-bezier(.2,.7,.25,1),
              box-shadow .35s cubic-bezier(.2,.7,.25,1);
  will-change: transform;
}
.tilt-card.is-tilting {
  transition: transform .08s linear, box-shadow .25s ease;
}

@media (prefers-reduced-motion: reduce) {
  .tilt-card { transition: none; transform: none !important; }
}

.tilt-gyro-prompt {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: #ffffff;
  color: #0a0a0a;
  border: 0;
  border-radius: 999px;
  font-family: 'Satoshi', system-ui, sans-serif;
  font-weight: 600;
  font-size: 13px;
  padding: 10px 18px;
  z-index: 9999;
  box-shadow: 0 6px 24px rgba(0,0,0,.35);
  cursor: pointer;
  display: none;
}
.tilt-gyro-prompt.show { display: inline-flex; }
