/* KD Web Co — Brand tokens & global styles */

:root {
  /* Brand primaries (hex for direct use) */
  --brand-navy: #1e1b4b;
  --brand-navy-2: #2a2560;
  --brand-indigo: #4338ca;
  --brand-violet: #6366f1;
  --brand-purple: #8b5cf6;
  --brand-lavender: #a5b4fc;

  /* Neutrals */
  --soft-lilac: #f5f3ff;
  --ice-blue: #e0e7ff;
  --slate: #6b7280;
  --slate-2: #9ca3af;
  --off-white: #f9fafb;
  --white: #ffffff;
  --ink: #0f0d2e;

  /* Semantic */
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;

  /* Surfaces (light default) */
  --surface: #ffffff;
  --surface-alt: #f5f3ff;
  --text: #1e1b4b;
  --text-muted: #6b7280;
}

* { box-sizing: border-box; }
html, body, #root { height: 100%; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  background: var(--surface);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* Font helpers */
.font-display { font-family: 'Instrument Serif', 'Cormorant Garamond', Georgia, serif; font-weight: 400; letter-spacing: -0.01em; }
.font-body { font-family: 'Inter', sans-serif; }

/* ============= LIQUID GLASS ============= */
.liquid-glass {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.18), 0 8px 32px rgba(30, 27, 75, 0.18);
  position: relative;
  overflow: hidden;
}
.liquid-glass::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.2px;
  background: linear-gradient(180deg,
    rgba(255,255,255,0.45) 0%, rgba(255,255,255,0.12) 25%,
    rgba(255,255,255,0) 45%, rgba(255,255,255,0) 60%,
    rgba(255,255,255,0.14) 80%, rgba(255,255,255,0.45) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}
.liquid-glass-violet {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.14), rgba(139, 92, 246, 0.08));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(165, 180, 252, 0.28);
  box-shadow: 0 8px 32px rgba(67, 56, 202, 0.12);
}
.liquid-glass-dark {
  background: rgba(15, 13, 46, 0.55);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid rgba(165, 180, 252, 0.18);
}

/* ============= ANIMATIONS ============= */
@keyframes fade-rise {
  from { opacity: 0; transform: translateY(24px); filter: blur(4px); }
  to   { opacity: 1; transform: translateY(0); filter: blur(0); }
}
.animate-fade-rise { animation: fade-rise 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
.float-y { animation: float-y 4s ease-in-out infinite; }

@keyframes shimmer-x {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}
.shimmer-x::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer-x 2.2s ease-in-out infinite;
}

@keyframes mesh-drift {
  0%   { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(5%, -6%) scale(1.08); }
  66%  { transform: translate(-4%, 4%) scale(0.96); }
  100% { transform: translate(0, 0) scale(1); }
}
.mesh-blob { animation: mesh-drift 14s ease-in-out infinite; }

@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.55); }
  70%  { box-shadow: 0 0 0 18px rgba(99, 102, 241, 0); }
  100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}
.pulse-ring { animation: pulse-ring 2.2s ease-out infinite; }

/* ============= UTILITY ============= */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { scrollbar-width: none; }

.grain {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence baseFrequency='0.9' numOctaves='2'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

.focus-ring:focus-visible {
  outline: 2px solid var(--brand-violet);
  outline-offset: 2px;
  border-radius: 999px;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px; font-weight: 500; font-size: 15px;
  padding: 14px 24px; transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border: none; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--brand-violet); color: white; }
.btn-primary:hover { background: var(--brand-purple); box-shadow: 0 12px 28px -10px rgba(99,102,241,0.6); }
.btn-light { background: white; color: var(--brand-navy); }
.btn-light:hover { background: var(--brand-lavender); }
.btn-ghost { background: transparent; color: var(--brand-navy); }
.btn-ghost:hover { background: var(--ice-blue); }
.btn-glass { background: rgba(255,255,255,0.08); color: white; border: 1px solid rgba(255,255,255,0.2); backdrop-filter: blur(12px); }
.btn-glass:hover { background: rgba(255,255,255,0.16); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 500;
  background: var(--ice-blue); color: var(--brand-indigo);
}

/* ============= MOBILE RESPONSIVE ============= */
@media (max-width: 768px) {
  /* Global tightening */
  html, body { overflow-x: hidden; }
  body { font-size: 15px; }

  /* Any section with hard-coded big padding tightens up */
  section { padding-left: 16px !important; padding-right: 16px !important; }

  /* Buttons full-width when they share a row */
  .btn { padding: 13px 20px; font-size: 14px; }

  /* Hero type scale override via clamp already handles, but extra breathing room */
  h1.font-display { line-height: 0.96 !important; }

  /* Nav sits flush and compact */
  .liquid-glass-violet, .liquid-glass-dark {
    /* Navbar container padding tighter on phones */
  }

  /* Cookie banner: wrap to bottom full width */
  .cookie-banner-mobile { left: 12px !important; right: 12px !important; transform: none !important; border-radius: 20px !important; flex-wrap: wrap; padding: 14px !important; }

  /* Hide the floating cursor trail entirely on touch devices */
  .cursor-trail { display: none !important; }

  /* Tables become cards-lite */
  .admin-table-wrap { overflow-x: auto; }

  /* Generic big-padding sections shrink vertically */
  .section-lg { padding-top: 72px !important; padding-bottom: 72px !important; }

  /* Footer brand columns */
  footer { padding: 56px 16px 24px !important; }
}

@media (max-width: 560px) {
  /* Hero headline: smaller, comfortable on a 375px viewport */
  h1.font-display { font-size: clamp(36px, 10vw, 56px) !important; }

  /* Chips + small paragraphs scale slightly */
  p { font-size: 15px; }

  /* Stacked CTA buttons full width and vertical */
  .hero-cta-stack { flex-direction: column !important; align-items: stretch !important; width: 100%; }
  .hero-cta-stack > a { width: 100%; justify-content: center; }

  /* Partners row: two per line on small phones */
  .partners-row { gap: 20px !important; }
  .partners-row > * { font-size: 18px !important; }
}

/* Touch-device: kill cursor trail & hover transforms that cause jump */
@media (hover: none) {
  .cursor-trail { display: none !important; }
  .btn:hover { transform: none; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* Selection */
::selection { background: var(--brand-lavender); color: var(--brand-navy); }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--ice-blue); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand-lavender); }
