/* ============================================================
   Kemnile — Shared Design Tokens & Utilities
   Import this file in every HTML page:
     <link rel="stylesheet" href="/static/theme.css">
   ============================================================ */

/* ---------- Google Fonts (loaded once) ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Outfit:wght@700;800;900&family=Poppins:wght@400;500;600;700;800;900&display=swap');

/* ---------- CSS Custom Properties ---------- */
:root {
  --k-panel-bg: rgba(255,255,255,0.82);
  --k-panel-border: rgba(255,255,255,0.5);
  --k-panel-shadow: 0 14px 40px rgba(15,23,42,0.10);
  --k-radius: 1.5rem;            /* 24px – bubbly, modern */
  --k-radius-lg: 2rem;           /* 32px – hero cards */
  --k-transition-fast: 180ms ease;
  --k-transition: 280ms ease;
  --k-midnight: #050510;
  --k-neon-purple: #a855f7;
  --k-neon-cyan: #22d3ee;
  --k-neon-amber: #fbbf24;
  --k-spring: cubic-bezier(0.34,1.56,0.64,1);
  --k-font-primary: 'Inter', 'Poppins', system-ui, sans-serif;
}

.dark {
  --k-panel-bg: rgba(10,14,30,0.55);
  --k-panel-border: rgba(139,92,246,0.1);
  --k-panel-shadow: 0 16px 46px rgba(2,8,23,0.45);
}

/* ---------- Base ---------- */
*, *::before, *::after {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

body {
  font-family: var(--k-font-primary, 'Inter', 'Poppins', system-ui, sans-serif);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Panel / Glass card ---------- */
.k-panel {
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--k-panel-border);
  background: var(--k-panel-bg);
  box-shadow: var(--k-panel-shadow);
  border-radius: var(--k-radius-lg);
  transition: transform var(--k-transition-fast), box-shadow var(--k-transition);
}

.k-panel:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 44px rgba(15,23,42,0.14);
}

.dark .k-panel:hover {
  box-shadow: 0 18px 50px rgba(2,8,23,0.60);
}

/* ---------- Legal pages panel ---------- */
.k-legal-panel {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--k-panel-border);
  background: var(--k-panel-bg);
  box-shadow: var(--k-panel-shadow);
  border-radius: var(--k-radius-lg);
}

.k-legal-content h2,
.k-legal-content h3 { color: inherit; }

.k-legal-content p,
.k-legal-content li { color: rgb(55 65 81); }

.dark .k-legal-content p,
.dark .k-legal-content li { color: rgb(203 213 225); }

/* ---------- Brand gradient text ---------- */
.k-brand-gradient {
  background: linear-gradient(135deg, #c084fc, #818cf8 40%, #22d3ee 80%, #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.k-gradient-text {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #14b8a6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dark .k-gradient-text {
  background: linear-gradient(135deg, #a78bfa 0%, #c084fc 50%, #2dd4bf 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---------- Background patterns (set accent via data-attr or class) ---------- */
.k-bg-blue-purple {
  background:
    radial-gradient(1200px 460px at 8% -10%, rgba(59,130,246,0.18), transparent 55%),
    radial-gradient(1200px 460px at 95% -18%, rgba(168,85,247,0.16), transparent 55%),
    linear-gradient(160deg, #eff6ff, #f8fafc);
}
.dark .k-bg-blue-purple {
  background:
    radial-gradient(ellipse 900px 700px at 50% 20%, rgba(88,28,135,0.14), transparent 70%),
    radial-gradient(ellipse 600px 400px at 80% 60%, rgba(6,182,212,0.04), transparent 60%),
    radial-gradient(ellipse 400px 300px at 20% 80%, rgba(139,92,246,0.06), transparent 60%),
    radial-gradient(ellipse 100% 100% at 50% 50%, #0a0818 0%, #050510 100%);
}

.k-bg-green-blue {
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(16,185,129,0.18), transparent 45%),
    radial-gradient(1200px 500px at 100% -20%, rgba(59,130,246,0.16), transparent 50%),
    linear-gradient(160deg, #f0f4ff, #f7fffc);
}
.dark .k-bg-green-blue {
  background:
    radial-gradient(900px 450px at 5% -10%, rgba(16,185,129,0.14), transparent 55%),
    radial-gradient(900px 450px at 95% -20%, rgba(59,130,246,0.14), transparent 55%),
    linear-gradient(170deg, #050b17, #0a1224 50%, #061323);
}

.k-bg-orange-blue {
  background:
    radial-gradient(900px 420px at 5% -10%, rgba(249,115,22,0.16), transparent 55%),
    radial-gradient(900px 420px at 95% -20%, rgba(59,130,246,0.14), transparent 55%),
    linear-gradient(160deg, #fff7ed, #f8fafc);
}
.dark .k-bg-orange-blue {
  background:
    radial-gradient(900px 420px at 5% -10%, rgba(249,115,22,0.14), transparent 55%),
    radial-gradient(900px 420px at 95% -20%, rgba(59,130,246,0.14), transparent 55%),
    linear-gradient(165deg, #050b17, #0a1224 50%, #061323);
}

.k-bg-blue-green {
  background:
    radial-gradient(900px 420px at 7% -8%, rgba(59,130,246,0.16), transparent 55%),
    radial-gradient(900px 420px at 95% -15%, rgba(16,185,129,0.14), transparent 55%),
    linear-gradient(160deg, #eff6ff, #f8fafc);
}
.dark .k-bg-blue-green {
  background:
    radial-gradient(900px 420px at 7% -8%, rgba(59,130,246,0.14), transparent 55%),
    radial-gradient(900px 420px at 95% -15%, rgba(16,185,129,0.12), transparent 55%),
    linear-gradient(165deg, #050b17, #0a1224 50%, #061323);
}

/* ---------- Animations ---------- */
@keyframes k-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-20px); }
}
@keyframes k-fade-in {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes k-slide-up {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes k-scale-in {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes k-slide-in {
  from { opacity: 0; transform: translateX(-30px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes k-pulse-soft {
  0%, 100% { opacity: 1; }
  50%      { opacity: .55; }
}
@keyframes k-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes k-ripple {
  to { transform: scale(4); opacity: 0; }
}

.k-float      { animation: k-float 6s ease-in-out infinite; }
.k-fade-in    { animation: k-fade-in 0.6s ease-out both; }
.k-slide-up   { animation: k-slide-up 0.6s ease-out both; }
.k-scale-in   { animation: k-scale-in 0.5s ease-out both; }
.k-slide-in   { animation: k-slide-in 0.8s ease-out both; }

/* ---------- Micro-interactions ---------- */

/* Button ripple */
.k-ripple {
  position: relative;
  overflow: hidden;
}
.k-ripple::after {
  content: '';
  position: absolute;
  width: 100%;
  padding-top: 100%;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  top: 50%; left: 50%;
  transform: translate(-50%,-50%) scale(0);
  opacity: 0;
  pointer-events: none;
}
.k-ripple:active::after {
  animation: k-ripple 0.5s ease-out;
}

/* Loading skeleton */
.k-skeleton {
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: k-shimmer 1.5s ease-in-out infinite;
  border-radius: 0.5rem;
}
.dark .k-skeleton {
  background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
  background-size: 200% 100%;
}

/* Hover lift */
.k-hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.k-hover-lift:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.12);
}

/* Focus ring */
.k-focus:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.45);
}

/* Scroll reveal (needs JS observer) */
.k-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.k-reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Animated counter helper ---------- */
/* JS sets --k-counter-end and calls the class */
.k-counter {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* ---------- Custom scrollbar ---------- */
.k-scrollbar::-webkit-scrollbar { width: 6px; }
.k-scrollbar::-webkit-scrollbar-track { background: transparent; }
.k-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(148,163,184,0.35);
  border-radius: 3px;
}
.dark .k-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(148,163,184,0.2);
}

/* ---------- Toast ---------- */
.k-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: 0 12px 32px rgba(0,0,0,0.18);
  animation: k-slide-up 0.35s ease-out both;
}
.k-toast-success { background: #059669; color: #fff; }
.k-toast-error   { background: #dc2626; color: #fff; }
.k-toast-info    { background: #2563eb; color: #fff; }

/* ---------- Neon Glow Utilities ---------- */
.k-glow-purple { text-shadow: 0 0 20px rgba(139,92,246,0.5), 0 0 60px rgba(139,92,246,0.2); }
.k-glow-cyan { text-shadow: 0 0 20px rgba(6,182,212,0.5), 0 0 60px rgba(6,182,212,0.2); }
.k-glow-amber { text-shadow: 0 0 20px rgba(245,158,11,0.5); }

/* ---------- Spring Animation Utility ---------- */
.k-spring { transition-timing-function: cubic-bezier(0.34,1.56,0.64,1); }

/* ---------- Glassmorphism Card (Enhanced) ---------- */
.k-glass-deep {
  background: rgba(8,10,24,0.75);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(139,92,246,0.15);
  border-radius: var(--k-radius-lg);
  box-shadow: 0 16px 48px rgba(139,92,246,0.08), 0 0 0 1px rgba(139,92,246,0.05);
}
