/* ============================================================
   SparkReach — global design system
   Premium animated SaaS theme: glassmorphism, neon, gradients
   ============================================================ */

:root {
  --c-ink-900:#070B17;
  --c-ink-700:#1A2238;
  --c-ink-500:#48527A;
  --c-ink-400:#6B739B;
  --c-ink-200:#C9CFE0;
  --c-ink-100:#E6E9F2;
  --c-paper:#FBFCFE;
  --c-spark-500:#3760EE;
  --c-spark-400:#5F82FB;
  --c-spark-300:#8EA8FF;
  --c-violet-500:#7C5CFF;
  /* accent palette */
  --c-success:#6AFB92;
  --c-warning:#FFFF33;
  --c-danger:#DC143C;
  --c-dark:#2C3539;
  /* gradient primary */
  --gr-primary: linear-gradient(135deg, #3760EE 0%, #5F82FB 35%, #7C5CFF 70%, #B16BFF 100%);
  --gr-cool:    linear-gradient(135deg, #244BD8 0%, #5F82FB 50%, #8EA8FF 100%);
  --gr-warm:    linear-gradient(135deg, #7C5CFF 0%, #B16BFF 100%);
  --gr-success: linear-gradient(135deg, #34D399 0%, #6AFB92 100%);
  --gr-mesh: radial-gradient(60% 60% at 20% 10%, rgba(95,130,251,0.18) 0%, rgba(95,130,251,0) 60%),
             radial-gradient(50% 50% at 90% 0%,  rgba(124,92,255,0.16) 0%, rgba(124,92,255,0) 60%),
             radial-gradient(40% 40% at 60% 100%, rgba(143,168,255,0.18) 0%, rgba(143,168,255,0) 60%);
}

html { scroll-behavior: smooth; }
body { font-family: 'Geist', system-ui, sans-serif; background: var(--c-paper); color: var(--c-ink-900); -webkit-font-smoothing: antialiased; }
::selection { background:#DCE6FF; color:#0E1F66; }

/* ============================================================
   PATTERNS
   ============================================================ */
.bg-grid {
  background-image:
    linear-gradient(to right, rgba(14,20,38,0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(14,20,38,0.04) 1px, transparent 1px);
  background-size: 64px 64px;
}
.bg-grid-fine {
  background-image:
    linear-gradient(to right, rgba(14,20,38,0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(14,20,38,0.05) 1px, transparent 1px);
  background-size: 24px 24px;
}
.ring-gradient { background: conic-gradient(from 180deg, #3760EE, #5F82FB, #8EA8FF, #3760EE); }

/* ============================================================
   ANIMATED BACKGROUND BLOBS
   ============================================================ */
.bg-blobs { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: -1; }
.bg-blobs::before,
.bg-blobs::after,
.bg-blobs > span {
  content: ""; position: absolute; border-radius: 9999px; filter: blur(80px); opacity: .35;
  will-change: transform;
}
.bg-blobs::before {
  width: 480px; height: 480px; top: -120px; left: -100px;
  background: radial-gradient(closest-side, #5F82FB, transparent 70%);
  animation: blob-1 28s ease-in-out infinite;
}
.bg-blobs::after {
  width: 560px; height: 560px; top: 30%; right: -180px;
  background: radial-gradient(closest-side, #B16BFF, transparent 70%);
  animation: blob-2 32s ease-in-out infinite;
}
.bg-blobs > span {
  width: 420px; height: 420px; bottom: -150px; left: 35%;
  background: radial-gradient(closest-side, #8EA8FF, transparent 70%);
  animation: blob-3 36s ease-in-out infinite;
}
@keyframes blob-1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(120px,60px) scale(1.15); } }
@keyframes blob-2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-90px,80px) scale(1.1); } }
@keyframes blob-3 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(60px,-100px) scale(1.2); } }

/* ============================================================
   GLASS NAVBAR
   ============================================================ */
.nav-glass {
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  background: rgba(251,252,254,0.72);
  border: 1px solid rgba(14,20,38,0.06);
  box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset, 0 8px 24px -16px rgba(14,20,38,0.10);
}
.nav-glass-floating {
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  background: rgba(255,255,255,0.62);
  border: 1px solid rgba(14,20,38,0.06);
  box-shadow:
    0 10px 40px -10px rgba(14,20,38,0.10),
    0 1px 0 rgba(255,255,255,0.8) inset,
    0 0 0 1px rgba(255,255,255,0.4) inset;
}
.nav-link { position: relative; transition: color .2s ease; }
.nav-link::after {
  content:""; position:absolute; left:12px; right:12px; bottom:6px; height:2px; border-radius:2px;
  background: var(--gr-primary);
  transform: scaleX(0); transform-origin: left center;
  transition: transform .35s cubic-bezier(.22,1,.36,1);
  opacity: 0;
}
/* Underline is decorative now; the sliding pill carries the visual */
.nav-link.is-active { color:#0E1F66; font-weight:600; }

/* ============================================================
   BUTTONS — premium animated
   ============================================================ */
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:.5rem;
  font-weight:500; border-radius:12px; position:relative; overflow:hidden;
  transition: transform .18s ease, box-shadow .25s ease, background .2s ease, color .2s ease;
  will-change: transform;
}
.btn:active { transform: translateY(1px) scale(.98); }

.btn-primary {
  color:#fff;
  background: linear-gradient(180deg,#1A2238 0%,#070B17 100%);
  box-shadow:
    0 1px 0 rgba(255,255,255,.18) inset,
    0 1px 2px rgba(7,11,23,.4),
    0 8px 24px -8px rgba(7,11,23,.45);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255,255,255,.2) inset, 0 4px 8px rgba(7,11,23,.3), 0 18px 40px -12px rgba(55,96,238,.55); }

.btn-accent {
  color:#fff;
  background: var(--gr-primary);
  background-size: 200% 200%; background-position: 0% 0%;
  box-shadow:
    0 1px 0 rgba(255,255,255,.25) inset,
    0 1px 2px rgba(20,44,140,.4),
    0 10px 28px -8px rgba(55,96,238,.5);
  transition: background-position .6s ease, transform .18s, box-shadow .25s;
}
.btn-accent:hover {
  background-position: 100% 100%;
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 rgba(255,255,255,.3) inset,
    0 4px 8px rgba(20,44,140,.3),
    0 20px 44px -10px rgba(124,92,255,.7);
}
.btn-accent::after {
  content:""; position:absolute; inset:-2px; border-radius:14px; pointer-events:none; z-index:-1;
  background: var(--gr-primary);
  filter: blur(16px); opacity:0; transition: opacity .3s;
}
.btn-accent:hover::after { opacity: .85; }

.btn-secondary {
  color:#0E1426;
  background: rgba(255,255,255,.92);
  border:1px solid rgba(14,20,38,.08);
  backdrop-filter: blur(8px);
  box-shadow:
    0 1px 0 rgba(255,255,255,.8) inset,
    0 1px 2px rgba(14,20,38,.04),
    0 6px 16px -8px rgba(14,20,38,.10);
}
.btn-secondary:hover {
  transform: translateY(-1px); background:#fff;
  box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 4px 8px rgba(14,20,38,.05), 0 12px 32px -10px rgba(14,20,38,.18);
}
.btn-ghost { color:#0E1426; }
.btn-ghost:hover { background: rgba(14,20,38,.05); }

.btn .icon-shift { transition: transform .25s cubic-bezier(.22,1,.36,1); }
.btn:hover .icon-shift { transform: translateX(3px); }

/* Ripple effect overlay (driven by JS adding .ripple span) */
.btn .ripple {
  position:absolute; border-radius:50%;
  background: rgba(255,255,255,.5);
  transform: scale(0); animation: ripple .6s ease-out;
  pointer-events:none;
}
@keyframes ripple {
  to { transform: scale(4); opacity: 0; }
}

/* ============================================================
   GLASS CARDS
   ============================================================ */
.glass-card {
  background: rgba(255,255,255,.7);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border:1px solid rgba(14,20,38,.06);
  box-shadow: 0 1px 0 rgba(255,255,255,.8) inset, 0 12px 36px -16px rgba(14,20,38,.10);
}

/* Gradient-border hover card */
.gradient-card {
  position:relative; border-radius: 18px; background: #fff;
  transition: transform .35s cubic-bezier(.22,1,.36,1), box-shadow .35s;
}
.gradient-card::before {
  content:""; position:absolute; inset:0; border-radius: inherit; padding:1px;
  background: linear-gradient(135deg, rgba(95,130,251,0), rgba(95,130,251,0), rgba(124,92,255,0));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
          mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events:none; transition: background .4s;
}
.gradient-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 1px 0 rgba(255,255,255,.8) inset,
    0 20px 50px -16px rgba(55,96,238,.25),
    0 8px 20px -10px rgba(124,92,255,.2);
}
.gradient-card:hover::before {
  background: linear-gradient(135deg, rgba(55,96,238,.7), rgba(95,130,251,.7), rgba(124,92,255,.8));
}

/* ============================================================
   ICONS — animated micro
   ============================================================ */
.icon-tile {
  position:relative; transition: transform .35s cubic-bezier(.22,1,.36,1), box-shadow .35s;
}
.icon-tile::after {
  content:""; position:absolute; inset:-4px; border-radius: inherit;
  background: radial-gradient(closest-side, rgba(95,130,251,.6), transparent 70%);
  opacity:0; filter: blur(10px); transition: opacity .3s; pointer-events:none; z-index:-1;
}
.icon-tile:hover { transform: translateY(-2px) scale(1.06) rotate(-2deg); }
.icon-tile:hover::after { opacity:.7; }
.icon-hover { transition: transform .25s cubic-bezier(.22,1,.36,1); }
.icon-hover:hover { transform: translateY(-2px) scale(1.06); }

/* Floating icons */
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.animate-float { animation: float 6s ease-in-out infinite; }
@keyframes float-slow { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-8px) rotate(2deg); } }
.animate-float-slow { animation: float-slow 7s ease-in-out infinite; }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.animate-shimmer { animation: shimmer 2.4s linear infinite; }

/* Confetti */
@keyframes confetti {
  0% { transform: translateY(-20px) rotate(0); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}
.confetti-piece { position:absolute; width:8px; height:14px; top:-20px; animation: confetti 3s linear forwards; }

/* ============================================================
   FLOATING-LABEL INPUTS
   ============================================================ */
.flabel { position:relative; display:block; }
.flabel input,
.flabel textarea,
.flabel select {
  width:100%; height:52px; padding: 22px 14px 8px; border-radius:12px;
  background: rgba(255,255,255,.85); backdrop-filter: blur(8px);
  border:1px solid rgba(14,20,38,.10); font-size: 14px; color:#0E1426;
  outline:none; transition: border-color .2s, box-shadow .2s, background .2s;
}
.flabel textarea { padding-top: 28px; height: auto; min-height: 96px; resize: vertical; }
.flabel input:focus,
.flabel textarea:focus,
.flabel select:focus {
  border-color: #5F82FB;
  box-shadow: 0 0 0 4px rgba(95,130,251,.15), 0 0 24px -8px rgba(124,92,255,.4);
  background: #fff;
}
.flabel > span {
  position:absolute; left:14px; top:16px; font-size:14px; color:#6B739B; pointer-events:none;
  transition: all .2s ease;
  background: transparent;
}
.flabel input:focus + span,
.flabel input:not(:placeholder-shown) + span,
.flabel textarea:focus + span,
.flabel textarea:not(:placeholder-shown) + span,
.flabel.filled > span {
  top: 6px; font-size: 11px; color:#3760EE; font-weight: 500;
  letter-spacing: 0.02em;
}

/* ============================================================
   UTILITIES — mask + marquee
   ============================================================ */
.mask-fade-x {
  -webkit-mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
          mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
}
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.marquee-track { animation: marquee 38s linear infinite; }
details > summary { list-style:none; cursor:pointer; }
details > summary::-webkit-details-marker { display:none; }

/* Neon focus ring for inputs that aren't .flabel (used in signup) */
.field {
  width:100%; height:44px; padding:0 14px; border-radius:10px;
  background:white; border:1px solid #E6E9F2; font-size:14px; color:#0E1426;
  outline:none; transition: all .15s;
}
.field:focus { border-color:#5F82FB; box-shadow:0 0 0 4px rgba(95,130,251,.15); }
.field::placeholder { color:#9AA2C0; }

/* Status / accent chips */
.chip-success { background: rgba(106,251,146,.15); color:#0B7A3A; border:1px solid rgba(106,251,146,.4); }
.chip-warning { background: rgba(255,255,51,.18);  color:#857B00; border:1px solid rgba(255,180,0,.5); }
.chip-danger  { background: rgba(220,20,60,.10);   color:#A2102B; border:1px solid rgba(220,20,60,.3); }

/* Animated number transition helper */
.counter { font-variant-numeric: tabular-nums; }

/* ============================================================
   NAV RESPONSIVE VISIBILITY — not relying on Tailwind CDN scan
   ============================================================ */
.nav-desktop-links { display: none; }
@media (min-width: 1024px) { .nav-desktop-links { display: flex; } }
.nav-signin-link { display: none; }
@media (min-width: 640px) { .nav-signin-link { display: inline-flex; } }

/* Smooth section enter */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; transition-duration: .001s !important; }
}
