/* ============================================================
   GodexWeb — Animation layer (animations.css)
   Web dev / SEO / security motion + interactivity
   Colours aligned with the logo:
     blue  #0088E8 -> rgba(0,136,232)
     teal  #1ED1A8 -> rgba(30,209,168)
     deep  #0347FA -> rgba(3,71,250)
   ============================================================ */

/* ---------- Scroll reveal ---------- */
.fx-reveal {
  opacity: 0;
  transition: opacity 0.7s cubic-bezier(.22,.61,.36,1), transform 0.7s cubic-bezier(.22,.61,.36,1);
  will-change: opacity, transform;
}
.fx-up    { transform: translateY(28px); }
.fx-left  { transform: translateX(-32px); }
.fx-right { transform: translateX(32px); }
.fx-zoom  { transform: scale(0.94); }
.fx-reveal.fx-in {
  opacity: 1;
  transform: none;
}

/* ---------- Hero code canvas ---------- */
.hero { position: relative; }
.fx-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
.hero .wrap { position: relative; z-index: 1; }

/* ---------- Typewriter line ---------- */
.fx-type {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: clamp(11px, 1.6vw, 13.5px);
  color: var(--text-dim);
  margin-top: 1.25rem;
  min-height: 1.4em;
  letter-spacing: 0.02em;
}
.fx-type-prompt { color: var(--accent); font-weight: 500; }
.fx-caret {
  display: inline-block;
  width: 8px; height: 1.1em;
  background: var(--accent);
  transform: translateY(0.15em);
  animation: fx-blink 1s steps(1) infinite;
}
@keyframes fx-blink { 50% { opacity: 0; } }

/* ---------- Floating chips (dev / SEO / security) ---------- */
.fx-chip {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--mono);
  font-size: clamp(10px, 1.3vw, 12px);
  padding: 0.5rem 0.8rem;
  background: var(--bg-raised);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(15,23,42,.10);
  cursor: default;
  user-select: none;
  transition: box-shadow .25s ease, border-color .25s ease;
  animation: fx-float 6s ease-in-out infinite;
  transform-style: preserve-3d;
}
.fx-chip:hover {
  border-color: var(--accent);
  box-shadow: 0 12px 28px rgba(0,136,232,.18);
}
.fx-chip b { color: var(--accent); font-weight: 500; }
.fx-chip .chip-ico { display: inline-flex; }
.fx-chip-1 { top: 14%; right: 4%;  animation-delay: 0s; }
.fx-chip-2 { top: 38%; right: -1%; animation-delay: -2s; }
.fx-chip-3 { bottom: 24%; right: 6%; animation-delay: -4s; }
.fx-chip-4 { top: 58%; left: -1%;  animation-delay: -3s; }
@keyframes fx-float {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 -12px; }
}
/* pulse ring on the security chip */
.fx-pulse { position: relative; }
.fx-pulse::after {
  content: '';
  position: absolute; inset: -4px;
  border: 1px solid var(--positive);
  border-radius: 8px;
  animation: fx-pulse-ring 2.2s ease-out infinite;
}
@keyframes fx-pulse-ring {
  0%   { opacity: .8; transform: scale(.92); }
  70%, 100% { opacity: 0; transform: scale(1.25); }
}

/* ---------- Hero spark bars ---------- */
.spark i {
  transform-origin: bottom;
  transform: scaleY(0);
  transition: transform .8s cubic-bezier(.34,1.4,.44,1);
}
.fx-spark-in .spark i { transform: scaleY(1); }

/* ---------- Service icon draw-on ---------- */
.service-icon svg .icon-draw,
.service-icon svg .icon-frame {
  transition: stroke-dashoffset 1.1s cubic-bezier(.4,0,.2,1);
}
.fx-draw-pending .service-icon svg .icon-draw,
.fx-draw-pending .service-icon svg .icon-frame { stroke-dashoffset: var(--fx-len, 120); }
.fx-draw-in .service-icon svg .icon-draw { transition-delay: .25s; }

/* ---------- Live dot & badges ---------- */
.hero-kicker .dot { animation: fx-dot-pulse 2s ease-in-out infinite; }
@keyframes fx-dot-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,136,232,.45); }
  50%      { box-shadow: 0 0 0 6px rgba(0,136,232,0); }
}
.dash-head .live { animation: fx-live-flicker 3s ease-in-out infinite; }
@keyframes fx-live-flicker { 0%,100% {opacity:1;} 50% {opacity:.55;} }

/* Ledger: engineered column glows, unmaintained column stays flat */
.ledger-row.fx-in .good-val { animation: fx-good-glow 2.4s ease-out 1; }
@keyframes fx-good-glow {
  0%   { text-shadow: 0 0 0 rgba(30,209,168,0); }
  30%  { text-shadow: 0 0 14px rgba(30,209,168,.55); }
  100% { text-shadow: 0 0 0 rgba(30,209,168,0); }
}

/* ---------- Buttons: magnetic + shine sweep ---------- */
.btn-primary, .nav-cta, .pricing-cta, .service-link { transition: transform .18s ease, box-shadow .25s ease, color .15s ease, background .15s ease; will-change: transform; }
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after {
  content: '';
  position: absolute;
  top: 0; left: -80%;
  width: 50%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.35), transparent);
  transform: skewX(-20deg);
  transition: left .55s ease;
}
.btn-primary:hover::after { left: 130%; }
.btn-primary:hover, .nav-cta:hover { transform: translateY(-2px); }

/* ---------- Nav links: animated underline (desktop only) ----------
   Scoped to desktop so it never shows on the mobile dropdown,
   where taps would otherwise trigger a stuck hover underline. */
@media (min-width: 1041px) {
  .nav-links a::before {
    content: '';
    position: absolute;
    left: 0; right: 100%; bottom: 8px;
    height: 2px;
    background: var(--accent);
    transition: right .25s cubic-bezier(.22,.61,.36,1);
  }
  .nav-links a:hover::before { right: 0; }
}

/* ---------- Cursor glow ---------- */
.fx-glow {
  position: fixed;
  top: 0; left: 0;
  width: 420px; height: 420px;
  margin: -210px 0 0 -210px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 40;
  background: radial-gradient(circle, rgba(0,136,232,.10) 0%, rgba(3,71,250,.06) 40%, transparent 70%);
  opacity: 0;
  transition: opacity .4s ease;
}
.fx-glow.fx-on { opacity: 1; }

/* ---------- Tilt ---------- */
.fx-tilt { transform-style: preserve-3d; transition: transform .3s ease; }

/* ---------- Reduced motion: respect user preference ---------- */
@media (prefers-reduced-motion: reduce) {
  .fx-reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .fx-chip, .hero-kicker .dot, .dash-head .live, .fx-pulse::after { animation: none !important; }
  .fx-canvas, .fx-glow, .fx-caret { display: none !important; }
  .spark i { transform: scaleY(1) !important; transition: none !important; }
  .btn-primary::after { display: none; }
}

/* ---------- Mobile: drop decorations that crowd the layout ---------- */
@media (max-width: 900px) {
  .fx-chip { display: none; }
}
