/* === DRIPBACK · Framer-Tier FX Library ===
   Shared visual + interaction techniques for premium-tier feel:
   - Custom cursor (dot + ring follower)
   - Marquee text strips
   - Magnetic CTA buttons
   - Animated number counters
   - Letter-by-letter reveal
   - Image-mask hover reveal
   - Sticky-morph navbars
   - Animated gradient mesh
*/

/* === Custom Cursor ===
   A dot follows precisely · a ring follows with delay · grows on .magnetic / a / button hover */
.fx-cursor-dot, .fx-cursor-ring {
  position: fixed; top: 0; left: 0; pointer-events: none; z-index: 9999;
  transform: translate3d(-50%, -50%, 0); will-change: transform;
}
.fx-cursor-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent, #2B6FFF);
  box-shadow: 0 0 12px rgba(43,111,255,0.7);
  transition: transform 100ms ease, width 200ms, height 200ms, background 200ms;
  mix-blend-mode: difference;
}
.fx-cursor-ring {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1.5px solid rgba(43,111,255,0.55);
  box-shadow: 0 0 24px rgba(43,111,255,0.25);
  transition: transform 200ms ease-out, width 250ms, height 250ms, border-color 200ms, background 200ms;
}
/* Apple-style trailing dots — 4 ghost-followers fade out */
.fx-cursor-trail {
  position: fixed; top: 0; left: 0; width: 4px; height: 4px;
  border-radius: 50%; background: rgba(43,111,255,0.7);
  pointer-events: none; z-index: 9998;
  transform: translate3d(-50%, -50%, 0);
  will-change: transform, opacity;
  filter: blur(0.5px);
}
.fx-cursor-trail.t1 { background: rgba(43,111,255,0.55); }
.fx-cursor-trail.t2 { background: rgba(43,111,255,0.4); }
.fx-cursor-trail.t3 { background: rgba(43,111,255,0.25); }
.fx-cursor-trail.t4 { background: rgba(43,111,255,0.12); }
.fx-cursor-ring.expand {
  width: 64px; height: 64px;
  border-color: var(--accent, #2B6FFF);
  background: rgba(43,111,255,0.05);
}
.fx-cursor-dot.expand {
  width: 12px; height: 12px;
  background: var(--accent, #2B6FFF);
}
.fx-cursor-ring.text {
  width: 80px; height: 80px;
  background: var(--accent, #2B6FFF); border-color: var(--accent, #2B6FFF);
  mix-blend-mode: difference;
}
@media (max-width: 1024px), (pointer: coarse) {
  .fx-cursor-dot, .fx-cursor-ring { display: none; }
}

/* === Marquee text strip ===
   Use: <div class="fx-marquee"><div class="fx-marquee-track"><span>· text · text · </span><span>· text · text · </span></div></div>
   The track has 2 identical children for seamless loop. */
.fx-marquee {
  overflow: hidden; width: 100%; display: flex;
  border-top: 1px solid var(--line, rgba(255,255,255,0.08));
  border-bottom: 1px solid var(--line, rgba(255,255,255,0.08));
}
.fx-marquee-track {
  display: flex; flex: 0 0 auto; gap: 0;
  animation: marquee 38s linear infinite;
  will-change: transform;
}
.fx-marquee-track > span {
  font-family: var(--font-serif, serif); font-style: italic;
  font-size: clamp(48px, 8vw, 120px); line-height: 1;
  white-space: nowrap; padding: 28px 0;
  color: var(--ink, #fff); flex: 0 0 auto;
}
.fx-marquee-track > span em {
  font-style: normal; font-family: var(--font-mono, monospace);
  font-size: 0.4em; vertical-align: 0.7em; color: var(--accent, #2B6FFF);
  margin: 0 0.4em;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.fx-marquee:hover .fx-marquee-track { animation-play-state: paused; }

/* Smaller mono-marquee variant (e.g., trust-strip) */
.fx-marquee-mono .fx-marquee-track > span {
  font-family: var(--font-mono, monospace); font-style: normal;
  font-size: 13px; padding: 14px 0; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--ink-2, #aaa);
}
.fx-marquee-mono .fx-marquee-track {
  animation-duration: 25s;
}

/* === Magnetic Button === */
.fx-magnetic {
  display: inline-flex; align-items: center; gap: 10px;
  position: relative; cursor: pointer;
  transition: transform 250ms cubic-bezier(0.5, 1.25, 0.75, 1.25);
  will-change: transform;
}
.fx-magnetic-inner {
  display: inline-block;
  transition: transform 250ms cubic-bezier(0.5, 1.25, 0.75, 1.25);
  will-change: transform;
}

/* === Animated Counter === */
.fx-counter { font-variant-numeric: tabular-nums; }

/* === Letter-by-letter reveal ===
   Use: .fx-split-text > span.letter (auto-generated by JS) */
.fx-split-text { display: inline-block; }
.fx-split-text .word {
  display: inline-block; overflow: hidden; vertical-align: bottom;
}
.fx-split-text .letter {
  display: inline-block; opacity: 0; transform: translateY(120%);
  transition: opacity 600ms cubic-bezier(0.5, 1.25, 0.75, 1.25),
              transform 600ms cubic-bezier(0.5, 1.25, 0.75, 1.25);
}
.fx-split-text.visible .letter { opacity: 1; transform: translateY(0); }

/* === Image-mask hover reveal === */
.fx-mask {
  position: relative; overflow: hidden;
  cursor: pointer;
}
.fx-mask-inner {
  transition: transform 700ms cubic-bezier(0.32, 0.72, 0, 1),
              filter 700ms cubic-bezier(0.32, 0.72, 0, 1);
  will-change: transform, filter;
}
.fx-mask:hover .fx-mask-inner {
  transform: scale(1.06); filter: brightness(1.05) saturate(1.15);
}
.fx-mask::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.6));
  pointer-events: none;
}

/* === Animated Gradient Mesh (background) === */
.fx-mesh {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(circle at 20% 20%, rgba(43,111,255,0.15), transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(212,168,89,0.10), transparent 50%),
    radial-gradient(circle at 50% 100%, rgba(34,197,94,0.08), transparent 50%);
  filter: blur(60px); opacity: 0.7;
  animation: meshDrift 25s ease-in-out infinite alternate;
}
@keyframes meshDrift {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-3%, 2%) scale(1.05); }
}

/* === Sticky-Morph Navbar ===
   Add .scrolled class via JS when scrolled past 40px */
.fx-nav-morph {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  padding: 32px 48px; display: flex; align-items: center;
  justify-content: space-between;
  transition: padding 400ms cubic-bezier(0.32, 0.72, 0, 1),
              background 400ms, backdrop-filter 400ms,
              border-color 400ms;
  border-bottom: 1px solid transparent;
}
.fx-nav-morph.scrolled {
  padding: 14px 48px;
  background: rgba(10,10,11,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom-color: var(--line, rgba(255,255,255,0.08));
}

/* === Big Numeric Display ===
   Year, version, count, etc. as graphic element */
.fx-big-num {
  font-family: var(--font-serif, serif);
  font-size: clamp(120px, 22vw, 320px);
  font-weight: 500; line-height: 0.85;
  letter-spacing: -0.04em; color: transparent;
  -webkit-text-stroke: 1px var(--ink, #fff);
  opacity: 0.12; pointer-events: none;
  user-select: none;
}
.fx-big-num.filled {
  color: var(--accent, #2B6FFF);
  -webkit-text-stroke: 0;
  opacity: 0.06;
}

/* === Tilt-on-hover card === */
.fx-tilt {
  transition: transform 400ms cubic-bezier(0.32, 0.72, 0, 1);
  transform-style: preserve-3d; will-change: transform;
}

/* === Asymmetric line-divider === */
.fx-divider-asym {
  position: relative; height: 1px; background: var(--line);
  margin: 80px 0; overflow: visible;
}
.fx-divider-asym::before {
  content: ""; position: absolute; top: -1px; left: 0;
  width: 30%; height: 3px; background: var(--accent);
}

/* Hide default cursor when fx-cursor active */
html.fx-cursor-on,
html.fx-cursor-on *:not(input):not(textarea):not(select) {
  cursor: none !important;
}
@media (max-width: 1024px), (pointer: coarse) {
  html.fx-cursor-on, html.fx-cursor-on * { cursor: auto !important; }
}

/* ============================================================
   ANIMATED BACKGROUNDS — subtle, Enterprise-tier, GPU-accel
   Stack: <section class="… fx-bg-host"><div class="fx-bg fx-bg-mesh"></div>…</section>
   .fx-bg-host: position: relative; isolation: isolate; z-index:0
   .fx-bg     : absolute; inset:0; pointer-events:none; z-index:-1
   ============================================================ */
.fx-bg-host { position: relative; isolation: isolate; }
.fx-bg-host > .wrap, .fx-bg-host > * { position: relative; }
.fx-bg {
  position: absolute; inset: 0; pointer-events: none;
  z-index: 0; overflow: hidden;
}
.fx-bg-host > .fx-bg { z-index: 0; }
.fx-bg-host > *:not(.fx-bg) { position: relative; z-index: 1; }

/* — Mesh: slow-drifting conic gradient, brand-tinted — */
.fx-bg-mesh::before, .fx-bg-mesh::after {
  content: ""; position: absolute; inset: -25%;
  background:
    radial-gradient(60% 50% at 20% 30%, rgba(43,111,255,0.10), transparent 70%),
    radial-gradient(45% 40% at 80% 70%, rgba(255,176,32,0.07),  transparent 70%),
    radial-gradient(50% 55% at 50% 90%, rgba(43,111,255,0.06),  transparent 75%);
  filter: blur(40px);
  animation: fxbgMesh 28s ease-in-out infinite alternate;
  will-change: transform;
}
.fx-bg-mesh::after {
  background:
    radial-gradient(40% 35% at 70% 20%, rgba(43,111,255,0.08),  transparent 70%),
    radial-gradient(55% 45% at 30% 75%, rgba(82,82,91,0.10),    transparent 75%);
  animation-duration: 38s;
  animation-direction: alternate-reverse;
}
@keyframes fxbgMesh {
  0%   { transform: translate3d(0,0,0)        scale(1);    }
  50%  { transform: translate3d(2%,-1.5%,0)   scale(1.06); }
  100% { transform: translate3d(-1.5%,1%,0)   scale(1.02); }
}

/* — Grid: technical lattice that drifts diagonally — */
.fx-bg-grid::before {
  content: ""; position: absolute; inset: -10%;
  background-image:
    linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 50%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 50%, transparent 100%);
  animation: fxbgGridDrift 60s linear infinite;
  will-change: transform;
}
@keyframes fxbgGridDrift {
  from { transform: translate3d(0,0,0); }
  to   { transform: translate3d(-56px,-56px,0); }
}

/* — Aurora: 3 soft orbs orbiting slowly — */
.fx-bg-aurora { filter: blur(60px); }
.fx-bg-aurora::before, .fx-bg-aurora::after {
  content: ""; position: absolute;
  width: 50vw; height: 50vw; border-radius: 50%;
  opacity: 0.55; will-change: transform;
}
.fx-bg-aurora::before {
  left: -20vw; top: -10vw;
  background: radial-gradient(circle, rgba(43,111,255,0.18), transparent 60%);
  animation: fxbgAuroraA 22s ease-in-out infinite alternate;
}
.fx-bg-aurora::after {
  right: -15vw; bottom: -10vw;
  background: radial-gradient(circle, rgba(255,176,32,0.12), transparent 60%);
  animation: fxbgAuroraB 30s ease-in-out infinite alternate;
}
@keyframes fxbgAuroraA {
  0%   { transform: translate3d(0,0,0)      scale(1);   }
  100% { transform: translate3d(20vw,15vh,0) scale(1.2); }
}
@keyframes fxbgAuroraB {
  0%   { transform: translate3d(0,0,0)       scale(1);   }
  100% { transform: translate3d(-18vw,-12vh,0) scale(1.15); }
}

/* — Dots: subtle pulsing dot-mesh — */
.fx-bg-dots::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.10) 1.2px, transparent 1.6px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, #000 30%, transparent 100%);
  animation: fxbgDotsPulse 6s ease-in-out infinite alternate;
}
@keyframes fxbgDotsPulse {
  from { opacity: 0.55; }
  to   { opacity: 1;    }
}

/* — Noise: animated film grain (SVG turbulence) — */
.fx-bg-noise {
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.06 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: 0.5;
  animation: fxbgNoise 0.8s steps(6) infinite;
}
@keyframes fxbgNoise {
  0%   { transform: translate(0,0); }
  20%  { transform: translate(-4%,3%); }
  40%  { transform: translate(3%,-4%); }
  60%  { transform: translate(-2%,2%); }
  80%  { transform: translate(2%,-1%); }
  100% { transform: translate(0,0); }
}

/* — Beam: diagonal scanline, slow sweep (for tech-feel sections) — */
.fx-bg-beam::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(43,111,255,0.06) 50%, transparent 70%);
  animation: fxbgBeam 14s linear infinite;
  will-change: transform;
}
@keyframes fxbgBeam {
  from { transform: translateX(-30%); }
  to   { transform: translateX(30%);  }
}

/* — Reduce-motion respects user preference — */
@media (prefers-reduced-motion: reduce) {
  .fx-bg-mesh::before, .fx-bg-mesh::after,
  .fx-bg-grid::before,
  .fx-bg-aurora::before, .fx-bg-aurora::after,
  .fx-bg-dots::before, .fx-bg-noise, .fx-bg-beam::before {
    animation: none !important;
  }
}
