/* ========================================
   KLICK KONNECT — DESIGN POLISH v1
   ========================================
   Subtle motion + glow accents.
   The goal: 3-5 elements that *quietly* feel alive,
   not every pixel screaming for attention.

   Import once in each page:
   <link rel="stylesheet" href="/design-polish.css" />
   ======================================== */

/* ─────────────────────────────────────────
   LIVE PULSE DOT — for "active", "online", "new" indicators
   Usage: <span class="live-dot"></span> or <span class="live-dot live-dot-amber"></span>
   ───────────────────────────────────────── */
.live-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #10B981; /* emerald */
  position: relative;
  vertical-align: middle;
  margin-right: 8px;
  flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: livePulseRing 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
.live-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: inherit;
  opacity: 0.25;
  animation: livePulseInner 2s ease-out infinite;
  z-index: -1;
}

@keyframes livePulseRing {
  0%   { box-shadow: 0 0 0 0    rgba(16, 185, 129, 0.55); }
  70%  { box-shadow: 0 0 0 9px  rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0    rgba(16, 185, 129, 0); }
}
@keyframes livePulseInner {
  0%, 100% { opacity: 0.25; transform: scale(1); }
  50%      { opacity: 0.10; transform: scale(1.6); }
}

/* Variants */
.live-dot-amber  { background: #FBBF24; box-shadow: 0 0 0 0 rgba(251,191,36,0.7);  animation-name: livePulseRingAmber; }
.live-dot-red    { background: #E11D2E; box-shadow: 0 0 0 0 rgba(225,29,46,0.7);   animation-name: livePulseRingRed; }
.live-dot-blue   { background: #3B82F6; box-shadow: 0 0 0 0 rgba(59,130,246,0.7);  animation-name: livePulseRingBlue; }

@keyframes livePulseRingAmber { 0%{box-shadow:0 0 0 0 rgba(251,191,36,0.55);} 70%{box-shadow:0 0 0 9px rgba(251,191,36,0);} 100%{box-shadow:0 0 0 0 rgba(251,191,36,0);} }
@keyframes livePulseRingRed   { 0%{box-shadow:0 0 0 0 rgba(225,29,46,0.55);}  70%{box-shadow:0 0 0 9px rgba(225,29,46,0);}  100%{box-shadow:0 0 0 0 rgba(225,29,46,0);} }
@keyframes livePulseRingBlue  { 0%{box-shadow:0 0 0 0 rgba(59,130,246,0.55);} 70%{box-shadow:0 0 0 9px rgba(59,130,246,0);} 100%{box-shadow:0 0 0 0 rgba(59,130,246,0);} }


/* ─────────────────────────────────────────
   LIVE BADGE — "LIVE", "NEW", "HIRING"
   Usage: <span class="live-badge"><span class="live-dot"></span>HIRING NOW</span>
   ───────────────────────────────────────── */
.live-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px 5px 11px;
  border-radius: 100px;
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.28);
  color: #6EE7B7;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.live-badge-amber { background: rgba(251,191,36,0.08); border-color: rgba(251,191,36,0.28); color: #FCD34D; }
.live-badge-red   { background: rgba(225,29,46,0.10);  border-color: rgba(225,29,46,0.32);  color: #FCA5A5; }


/* ─────────────────────────────────────────
   GLOW HOVER — soft glow on hover for premium cards
   Usage: add `.glow-hover` to any card
   ───────────────────────────────────────── */
.glow-hover {
  position: relative;
  transition: transform 0.4s cubic-bezier(0.2,0.8,0.2,1), box-shadow 0.4s ease;
}
.glow-hover::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(225,29,46,0.0), rgba(225,29,46,0.15), rgba(225,29,46,0.0));
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 0;
}
.glow-hover:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 44px -16px rgba(225,29,46,0.35), 0 8px 22px -8px rgba(0,0,0,0.4);
}
.glow-hover:hover::before { opacity: 1; }
.glow-hover > * { position: relative; z-index: 1; }


/* ─────────────────────────────────────────
   AMBIENT MESH — cinematic blurred gradient blobs
   The "premium SaaS" background effect (think Linear / Stripe / Vercel)
   Multiple soft blobs drift slowly behind content. Heavily blurred so it
   feels like depth, not decoration.
   Usage: <div class="ambient-mesh"></div> as a background layer
   in a `position: relative` container with `overflow: hidden`.
   ───────────────────────────────────────── */
.ambient-mesh {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.ambient-mesh::before,
.ambient-mesh::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  will-change: transform;
}
.ambient-mesh::before {
  width: 55vw; height: 55vw;
  max-width: 700px; max-height: 700px;
  top: -10%; left: -10%;
  background: radial-gradient(circle, rgba(225,29,46,0.55) 0%, rgba(225,29,46,0) 70%);
  animation: meshDriftA 22s ease-in-out infinite alternate;
}
.ambient-mesh::after {
  width: 50vw; height: 50vw;
  max-width: 600px; max-height: 600px;
  bottom: -15%; right: -15%;
  background: radial-gradient(circle, rgba(168,85,247,0.32) 0%, rgba(168,85,247,0) 70%);
  animation: meshDriftB 28s ease-in-out infinite alternate;
}

/* A third blob, optional — add a child <span class="mesh-blob-3"></span> inside .ambient-mesh */
.ambient-mesh .mesh-blob-3 {
  position: absolute;
  width: 40vw; height: 40vw;
  max-width: 500px; max-height: 500px;
  top: 30%; left: 40%;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.32;
  background: radial-gradient(circle, rgba(56,189,248,0.22) 0%, rgba(56,189,248,0) 70%);
  animation: meshDriftC 35s ease-in-out infinite alternate;
  pointer-events: none;
  will-change: transform;
}

@keyframes meshDriftA {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(8vw, 5vh) scale(1.1); }
}
@keyframes meshDriftB {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-6vw, -4vh) scale(1.15); }
}
@keyframes meshDriftC {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-5vw, 6vh) scale(1.08); }
}

/* On mobile, soften the effect (smaller blobs, less blur cost) */
@media (max-width: 700px) {
  .ambient-mesh::before,
  .ambient-mesh::after,
  .ambient-mesh .mesh-blob-3 {
    filter: blur(60px);
    opacity: 0.4;
  }
}

/* ─────────────────────────────────────────
   INTERACTIVE MESH — cursor-reactive parallax
   Add .interactive-mesh. JS sets --px / --py (px offsets) on the
   container, which transforms as a whole. The blobs keep their own
   independent drift keyframes (set in the base .ambient-mesh rules),
   so drift + cursor parallax compose cleanly with no conflict.
   ───────────────────────────────────────── */
.interactive-mesh {
  --px: 0px;
  --py: 0px;
  transform: translate(var(--px), var(--py));
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

/* Disable cursor parallax on touch / reduced-motion (drift still runs) */
@media (hover: none) {
  .interactive-mesh { transform: none; transition: none; }
}
@media (prefers-reduced-motion: reduce) {
  .interactive-mesh { transform: none !important; }
  .interactive-mesh::before,
  .interactive-mesh::after,
  .interactive-mesh .mesh-blob-3 {
    animation: none !important;
  }
}


/* ─────────────────────────────────────────
   AMBIENT GRADIENT (legacy — still used in places, kept lighter)
   Use sparingly: ONE per page max, ideally only on homepage hero
   Usage: <div class="ambient-bg"></div> as a background layer
   ───────────────────────────────────────── */
.ambient-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background:
    radial-gradient(60vw 60vw at 15% 25%, rgba(225,29,46,0.10), transparent 60%),
    radial-gradient(50vw 50vw at 85% 75%, rgba(225,29,46,0.06), transparent 60%);
  animation: ambientDrift 28s ease-in-out infinite alternate;
  z-index: 0;
}
@keyframes ambientDrift {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(3%, -2%) scale(1.05); }
}


/* ─────────────────────────────────────────
   NUMBER TICKER — soft "counting up" feel for stats
   Adds a subtle gradient & a small underline glow
   Usage: wrap the number in <span class="stat-num">1,247</span>
   ───────────────────────────────────────── */
.stat-num {
  position: relative;
  background: linear-gradient(180deg, #fff 0%, #d4d4d8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
  letter-spacing: -0.02em;
}


/* ─────────────────────────────────────────
   SHIMMER LINE — for "loading" or "processing" states
   Replaces flat skeleton with a soft sweep
   ───────────────────────────────────────── */
.shimmer-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg,
    rgba(255,255,255,0.03) 0%,
    rgba(255,255,255,0.09) 50%,
    rgba(255,255,255,0.03) 100%);
  background-size: 800px 100%;
  animation: shimmerSweep 1.6s ease-in-out infinite;
}
@keyframes shimmerSweep {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}


/* ─────────────────────────────────────────
   FOCUS RING — soft red glow on focused inputs
   Applies to .input, .textarea, .select sitewide
   ───────────────────────────────────────── */
.input:focus,
.textarea:focus,
.select:focus {
  box-shadow: 0 0 0 4px rgba(225,29,46,0.12);
  transition: box-shadow 0.18s ease, border-color 0.15s;
}


/* ─────────────────────────────────────────
   CTA RADIAL PULSE — soft expanding glow behind a CTA section
   Adds depth + visual "attention" to a section without being loud
   Usage: <div class="cta-radial-pulse"></div> as a background layer
   ───────────────────────────────────────── */
.cta-radial-pulse {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 60% 80% at 50% 50%, rgba(255,255,255,0.18), transparent 70%);
  opacity: 0.6;
  animation: ctaRadialBreathe 7s ease-in-out infinite;
  z-index: 0;
}
@keyframes ctaRadialBreathe {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50%      { opacity: 0.7; transform: scale(1.08); }
}


/* ─────────────────────────────────────────
   PORTFOLIO ITEM REVEAL — staggered fade-up for gallery items
   Usage: each .portfolio-item gets the .pf-reveal class
   JS reads data-pf-idx and adds .visible to trigger animation
   ───────────────────────────────────────── */
.pf-reveal {
  opacity: 0;
  transform: translateY(20px) scale(0.98);
  transition: opacity 0.7s cubic-bezier(0.2, 0.8, 0.2, 1),
              transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: opacity, transform;
}
.pf-reveal.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ─────────────────────────────────────────
   RESPECT REDUCED MOTION
   Users who set "prefers-reduced-motion" get static styles.
   This is required for accessibility AND avoids motion sickness.
   ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  /* Decorative ambient effects: dim them so they don't distract */
  .ambient-bg,
  .ambient-mesh::before,
  .ambient-mesh::after,
  .ambient-mesh .mesh-blob-3,
  .cta-radial-pulse {
    animation: none !important;
    transform: none !important;
    opacity: 0.25 !important;
  }
  /* Live indicator dots: stop pulsing but keep visible */
  .live-dot,
  .live-dot::after,
  .shimmer-line {
    animation: none !important;
  }
  /* Content reveal effects: just show the content immediately */
  .fade-up,
  .pf-reveal,
  .magnetic-btn {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
  .glow-hover {
    transition: none !important;
  }
}


/* ─────────────────────────────────────────
   FADE-UP ON SCROLL — for section headings
   Usage: <h2 class="fade-up">…</h2>
   JS will add .visible when the element scrolls into view.
   ───────────────────────────────────────── */
.fade-up {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.8, 0.2, 1),
              transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: opacity, transform;
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}
/* Stagger child elements for cascading reveals */
.fade-up.fade-up-stagger > * {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s cubic-bezier(0.2, 0.8, 0.2, 1),
              transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.fade-up.fade-up-stagger.visible > *:nth-child(1) { opacity: 1; transform: translateY(0); transition-delay: 0.05s; }
.fade-up.fade-up-stagger.visible > *:nth-child(2) { opacity: 1; transform: translateY(0); transition-delay: 0.15s; }
.fade-up.fade-up-stagger.visible > *:nth-child(3) { opacity: 1; transform: translateY(0); transition-delay: 0.25s; }
.fade-up.fade-up-stagger.visible > *:nth-child(4) { opacity: 1; transform: translateY(0); transition-delay: 0.35s; }


/* ─────────────────────────────────────────
   MAGNETIC BUTTON — gentle cursor tracking on hover
   Usage: add `.magnetic-btn` to a button.
   The JS uses transform; we just need transition timing here.
   ───────────────────────────────────────── */
.magnetic-btn {
  transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1),
              box-shadow 0.22s ease;
  will-change: transform;
}


/* ─────────────────────────────────────────
   LIVE ACTIVITY WIDGET — fixed bottom-left
   Shows "X creators active right now"
   ───────────────────────────────────────── */
.live-activity-widget {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 80;
  background: rgba(20, 22, 26, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 100px;
  padding: 9px 18px 9px 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text, #fafafa);
  box-shadow: 0 8px 24px -10px rgba(0,0,0,0.5);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
}
.live-activity-widget.visible {
  opacity: 1;
  transform: translateY(0);
}
.live-activity-widget strong {
  color: #6EE7B7;
  font-weight: 700;
}
@media (max-width: 700px) {
  .live-activity-widget {
    left: 12px;
    bottom: 12px;
    font-size: 11.5px;
    padding: 7px 14px 7px 11px;
  }
}
