/* ============================================================
   FITBOARD — SITE-WIDE MOTION & TYPE EFFECTS LIBRARY
   Opt-in via the fx-* classes below. Purely additive — link this
   after fitboard-tokens.css on any page and use these classes;
   nothing here is wired into a page until you apply the classes.
   Requires js/effects.js for reveal-on-scroll, count-up, magnetic
   buttons, and progress rails (marquee + gradient text are CSS-only).
   ============================================================ */

/* Bricolage Grotesque must be linked on the page (see index.html's Google
   Fonts <link>) — this only sets which face to use once it's loaded. */
.fx-display {
  font-family: 'Bricolage Grotesque', var(--font), system-ui, sans-serif;
  font-weight: 500;
}

/* ---------- scroll reveal (needs js/effects.js) ----------
   Visible by default so content never gets stuck invisible if the
   script fails to load — js/effects.js arms the hidden starting
   state itself (via .fx-armed on <html>) once it's actually running. */
.fx-reveal { opacity: 1; }
.fx-armed .fx-reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.fx-reveal.fx-in { opacity: 1; transform: translateY(0); }

/* ---------- kinetic word-mask reveal ----------
   Markup: <span class="fx-wm"><span class="fx-wi" style="--d:0">word</span></span>
   Repeat per word, incrementing --d for stagger. Needs js/effects.js
   only if you want it to (re)play on scroll-into-view; otherwise it
   plays once on page load. */
.fx-wm { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.1em; margin-bottom: -0.1em; }
.fx-wm .fx-wi {
  display: inline-block;
  font-family: 'Bricolage Grotesque', var(--font), system-ui, sans-serif;
  transform: translateY(112%);
  animation: fx-word-up 0.85s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(var(--d, 0) * 55ms + 160ms);
}
@keyframes fx-word-up { to { transform: translateY(0); } }

.fx-fade-in {
  opacity: 0;
  animation: fx-rise 0.75s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes fx-rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- gradient-clip accent text (terracotta family only) ---------- */
.fx-grad-text {
  background: linear-gradient(100deg, var(--terra-600) 10%, var(--terra-300) 45%, var(--terra-600) 85%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.fx-num, .fx-ghost {
  font-family: 'Bricolage Grotesque', var(--font), system-ui, sans-serif;
  font-weight: 600;
  background: linear-gradient(160deg, var(--terra-600) 0%, var(--terra-300) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- ambient glow + grain ----------
   Markup: a positioned ancestor (position:relative;overflow:clip) holding
   <div class="fx-atmo"><div class="fx-orb fx-orb-a"></div><div class="fx-orb fx-orb-b"></div></div>
   <div class="fx-grain"></div> */
.fx-atmo { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.fx-atmo .fx-orb { position: absolute; border-radius: 50%; filter: blur(64px); }
.fx-atmo .fx-orb-a {
  width: 480px; height: 480px; left: -160px; top: -220px;
  background: radial-gradient(circle at 35% 35%, var(--terra-500) 0%, rgba(194, 101, 42, 0) 70%);
  opacity: 0.3;
  animation: fx-drift-a 16s ease-in-out infinite alternate;
}
.fx-atmo .fx-orb-b {
  width: 380px; height: 380px; right: -120px; top: 40px;
  background: radial-gradient(circle at 40% 40%, var(--terra-300) 0%, rgba(238, 143, 88, 0) 70%);
  opacity: 0.28;
  animation: fx-drift-b 20s ease-in-out infinite alternate;
}
.fx-atmo.on-dark .fx-orb-a { opacity: 0.18; }
.fx-atmo.on-dark .fx-orb-b { opacity: 0.14; }
@keyframes fx-drift-a { from { transform: translate(0, 0); } to { transform: translate(50px, 40px); } }
@keyframes fx-drift-b { from { transform: translate(0, 0); } to { transform: translate(-40px, -30px); } }

.fx-grain {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- marquee ticker (CSS-only, no JS needed) ----------
   Markup: <div class="fx-marquee"><div class="fx-marquee-track">
     <div class="fx-marquee-row">...items...</div>
     <div class="fx-marquee-row" aria-hidden="true">...same items again...</div>
   </div></div> */
.fx-marquee { overflow: hidden; border-bottom: 1px solid var(--slate-200); background: var(--surface-raised); }
.fx-marquee-track { display: flex; width: max-content; animation: fx-scroll-x 32s linear infinite; }
.fx-marquee-row { display: flex; }
.fx-marquee:hover .fx-marquee-track { animation-play-state: paused; }
.fx-marquee-item {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 30px;
  font-size: 15px; font-weight: 500; letter-spacing: -0.005em;
  color: var(--slate-700); white-space: nowrap;
}
.fx-marquee-item .fx-sep { color: var(--primary); font-size: 12px; }
@keyframes fx-scroll-x { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- numbered step list (gradient numeral + icon + rail) ----------
   Markup:
   <div class="fx-steplist" data-fx-rail>
     <div class="fx-rail"></div><div class="fx-rail-fill"></div>
     <div class="fx-steprow fx-reveal">
       <div class="fx-stepnum fx-num">01</div>
       <div class="fx-stepicon">...icon...</div>
       <div><h3>Title</h3><p class="fx-step-desc">...</p><p class="fx-step-note">...</p></div>
     </div>
     ...
   </div> */
.fx-steplist { position: relative; padding-left: 28px; border-top: 1px solid var(--slate-200); }
.fx-steprow {
  display: grid;
  grid-template-columns: 72px 44px 1fr;
  gap: 24px;
  align-items: start;
  padding: 32px 20px;
  margin: 0 -20px;
  border-radius: 16px;
  border-bottom: 1px solid var(--slate-200);
  transition: background 0.25s ease;
}
.fx-steprow:hover { background: var(--surface-raised); }
.fx-steprow:hover .fx-stepicon { background: var(--primary); color: #fff; transform: scale(1.06); }
.fx-stepnum {
  font-size: 46px;
  font-weight: 700;
  line-height: 0.82;
  letter-spacing: -0.02em;
  padding-top: 4px;
}
.fx-stepicon {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--terra-50); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.fx-steprow h3 { margin: 4px 0 6px; font-size: 1.05rem; font-weight: 700; color: var(--p900); font-family: var(--font); }
.fx-step-desc { font-size: 0.9375rem; color: var(--text-sub); line-height: 1.6; max-width: 56ch; }
.fx-step-note { font-size: 0.8125rem; color: var(--slate-500); font-style: italic; margin-top: 8px; }

@media (max-width: 720px) {
  .fx-steprow { grid-template-columns: 40px 1fr; }
  .fx-steprow .fx-stepicon { display: none; }
  .fx-stepnum { font-size: 34px; }
}

/* ---------- scroll-filling progress rail (needs js/effects.js) ----------
   Markup: a wrapper with [data-fx-rail] (position:relative) containing:
   <div class="fx-rail"></div><div class="fx-rail-fill"></div> + your list */
.fx-rail { position: absolute; left: 3px; top: 6px; bottom: 6px; width: 2px; background: var(--slate-200); }
.fx-rail.fx-rail-dark { background: rgba(255, 255, 255, 0.12); }
.fx-rail-fill {
  position: absolute; left: 3px; top: 0; width: 2px; height: 0%;
  background: linear-gradient(var(--terra-600), var(--terra-300));
  transition: height 0.15s linear;
}

/* ---------- magnetic buttons (needs js/effects.js) ----------
   Add class="fx-magnetic" to any <a>/<button>. */
.fx-magnetic { display: inline-flex; }

/* ---------- FAQ accordion (native <details>, CSS-only) ----------
   Markup: <details class="fx-faq-item" name="faq-group">
     <summary class="fx-faq-q"><span>Question</span><span class="fx-faq-plus"></span></summary>
     <div class="fx-faq-a-wrap"><div><p class="fx-faq-a">Answer</p></div></div>
   </details> */
.fx-faq-plus { width: 22px; height: 22px; position: relative; display: inline-block; }
.fx-faq-plus::before, .fx-faq-plus::after {
  content: ""; position: absolute; background: var(--slate-500); border-radius: 2px;
  transition: transform 0.3s cubic-bezier(0.65, 0, 0.35, 1), background 0.15s ease;
}
.fx-faq-plus::before { top: 10px; left: 3px; width: 16px; height: 2px; }
.fx-faq-plus::after { top: 3px; left: 10px; width: 2px; height: 16px; }
.fx-faq-item[open] .fx-faq-plus::after { transform: rotate(90deg); opacity: 0; }
.fx-faq-item[open] .fx-faq-plus::before { background: var(--primary); }
.fx-faq-item[open] .fx-faq-q { color: var(--primary); }
.fx-faq-item > .fx-faq-a-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s cubic-bezier(0.65, 0, 0.35, 1);
}
.fx-faq-item[open] > .fx-faq-a-wrap { grid-template-rows: 1fr; }
.fx-faq-item summary { list-style: none; cursor: pointer; }
.fx-faq-item summary::-webkit-details-marker { display: none; }

/* ---------- footer wordmark ---------- */
.fx-foot-word { display: inline-block; transition: opacity 0.25s ease; }
.fx-foot-word:hover { opacity: 0.75; }

@media (prefers-reduced-motion: reduce) {
  .fx-armed .fx-reveal { opacity: 1; transform: none; }
  .fx-fade-in { opacity: 1; animation: none; }
  .fx-wm .fx-wi { transform: none; animation: none; }
  .fx-atmo .fx-orb-a, .fx-atmo .fx-orb-b { animation: none; }
  .fx-marquee-track { animation: none; }
}

@media (max-width: 860px) {
  .fx-marquee-item { padding: 14px 20px; font-size: 13.5px; }
}
