/* ===== Klearvision shared custom styles ===== */
/* Brand palette derived from the Klearvision logo (purple/violet family). */

:root {
  --color-navy: #2A0A3A;        /* deep brand purple (page-dark / nav text) */
  --color-navy-700: #3D0B4D;    /* slightly lighter dark purple */
  --color-navy-800: #2A0A3A;
  --color-electric: #8B2BA0;    /* primary brand purple */
  --color-electric-200: #E0BCEB;/* very light lavender (on-dark accents) */
  --color-electric-300: #C77FE0;/* light lavender accent */
  --color-electric-600: #6B1A7B;/* darker brand purple (hover states) */
  --color-cyan: #C77FE0;        /* light-purple accent (was cyan) */
  --color-mist: #FAF5FB;        /* lavender-tinted off-white */
  --color-ink: #1A0823;
}

html { scroll-behavior: smooth; }

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

.bg-grid {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 56px 56px;
}

.container-page {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  width: 100%;
}
@media (min-width: 640px) {
  .container-page { padding-left: 2rem; padding-right: 2rem; }
}
@media (min-width: 1024px) {
  .container-page { padding-left: 2.5rem; padding-right: 2.5rem; }
}

/* Buttons */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  border-radius: 0.75rem;
  background: var(--color-electric);
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem; font-weight: 600;
  color: white;
  box-shadow: 0 8px 30px rgba(11, 28, 61, 0.08);
  transition: all 0.2s;
  text-decoration: none;
  cursor: pointer;
  border: none;
}
.btn-primary:hover {
  background: var(--color-electric-600);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}
.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem; font-weight: 600;
  color: white;
  backdrop-filter: blur(8px);
  transition: all 0.2s;
  text-decoration: none;
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(11, 28, 61, 0.15);
  background: white;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem; font-weight: 600;
  color: var(--color-navy);
  transition: all 0.2s;
  text-decoration: none;
}
.btn-ghost:hover {
  border-color: var(--color-electric);
  color: var(--color-electric);
  transform: translateY(-2px);
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  border-radius: 9999px;
  border: 1px solid rgba(139, 43, 160, 0.2);
  background: rgba(139, 43, 160, 0.06);
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem; font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-electric);
}

/* Form inputs */
.input {
  width: 100%;
  border-radius: 0.75rem;
  border: 1px solid rgb(226, 232, 240);
  background: white;
  padding: 0.7rem 0.9rem;
  font-size: 0.9rem;
  color: var(--color-ink);
  transition: border-color 150ms, box-shadow 150ms;
  font-family: inherit;
}
.input::placeholder { color: #94a3b8; }
.input:focus {
  outline: none;
  border-color: var(--color-electric);
  box-shadow: 0 0 0 3px rgba(139, 43, 160, 0.2);
}

/* Card hover lift utility */
.card-lift { transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s; }
.card-lift:hover { transform: translateY(-4px); }

/* Nav link transitions */
.nav-link { transition: color 0.15s, background-color 0.15s; }

/* =====================================================================
   Animations
   ===================================================================== */

/* Keyframes */
@keyframes kv-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes kv-fade-in-up {
  from { opacity: 0; transform: translate3d(0, 24px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes kv-fade-in-down {
  from { opacity: 0; transform: translate3d(0, -24px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes kv-fade-in-left {
  from { opacity: 0; transform: translate3d(-32px, 0, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes kv-fade-in-right {
  from { opacity: 0; transform: translate3d(32px, 0, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes kv-zoom-in {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes kv-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
@keyframes kv-pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(199, 127, 224, 0.55); }
  50%      { box-shadow: 0 0 0 14px rgba(199, 127, 224, 0); }
}
@keyframes kv-pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.25); opacity: 0.7; }
}
@keyframes kv-shine {
  0%   { transform: translateX(-120%); }
  60%  { transform: translateX(120%); }
  100% { transform: translateX(120%); }
}
@keyframes kv-bg-pan {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes kv-blob {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(20px, -10px) scale(1.05); }
  66%      { transform: translate(-15px, 10px) scale(0.97); }
}
@keyframes kv-bounce-arrow {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(4px); }
}
@keyframes kv-spin-slow {
  to { transform: rotate(360deg); }
}

/* Reveal-on-scroll utilities (set initial state, JS toggles .is-visible) */
.reveal {
  opacity: 0;
  transform: translate3d(0, 24px, 0);
  transition: opacity 700ms cubic-bezier(0.22, 1, 0.36, 1),
              transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.reveal-up    { transform: translate3d(0, 24px, 0); }
.reveal-down  { transform: translate3d(0, -24px, 0); }
.reveal-left  { transform: translate3d(-32px, 0, 0); }
.reveal-right { transform: translate3d(32px, 0, 0); }
.reveal-zoom  { transform: scale(0.94); }
.reveal-fade  { transform: none; }

.reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

/* Stagger delays (apply to children of a container with .reveal-stagger) */
.reveal-stagger > .reveal:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger > .reveal:nth-child(2) { transition-delay: 80ms; }
.reveal-stagger > .reveal:nth-child(3) { transition-delay: 160ms; }
.reveal-stagger > .reveal:nth-child(4) { transition-delay: 240ms; }
.reveal-stagger > .reveal:nth-child(5) { transition-delay: 320ms; }
.reveal-stagger > .reveal:nth-child(6) { transition-delay: 400ms; }
.reveal-stagger > .reveal:nth-child(7) { transition-delay: 480ms; }
.reveal-stagger > .reveal:nth-child(8) { transition-delay: 560ms; }

/* Manual delay helpers */
.delay-100 { transition-delay: 100ms !important; }
.delay-200 { transition-delay: 200ms !important; }
.delay-300 { transition-delay: 300ms !important; }
.delay-400 { transition-delay: 400ms !important; }
.delay-500 { transition-delay: 500ms !important; }

/* Direct animation utilities (no scroll trigger) */
.anim-fade-in       { animation: kv-fade-in 700ms ease-out both; }
.anim-fade-in-up    { animation: kv-fade-in-up 700ms cubic-bezier(0.22, 1, 0.36, 1) both; }
.anim-fade-in-down  { animation: kv-fade-in-down 700ms cubic-bezier(0.22, 1, 0.36, 1) both; }
.anim-fade-in-left  { animation: kv-fade-in-left 700ms cubic-bezier(0.22, 1, 0.36, 1) both; }
.anim-fade-in-right { animation: kv-fade-in-right 700ms cubic-bezier(0.22, 1, 0.36, 1) both; }
.anim-zoom-in       { animation: kv-zoom-in 600ms cubic-bezier(0.22, 1, 0.36, 1) both; }
.anim-float         { animation: kv-float 5s ease-in-out infinite; }
.anim-pulse-glow    { animation: kv-pulse-glow 2.4s ease-out infinite; }
.anim-pulse-dot     { animation: kv-pulse-dot 1.8s ease-in-out infinite; }
.anim-blob          { animation: kv-blob 14s ease-in-out infinite; }
.anim-spin-slow     { animation: kv-spin-slow 22s linear infinite; }

/* Animated gradient background helper (apply on a navy/electric/cyan gradient) */
.bg-animated-gradient {
  background-size: 220% 220%;
  animation: kv-bg-pan 14s ease infinite;
}

/* Shimmering "shine" sweep across an element (e.g. on hover) */
.shine {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.shine::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent 30%,
    rgba(255, 255, 255, 0.35) 50%,
    transparent 70%
  );
  transform: translateX(-120%);
  pointer-events: none;
}
.shine:hover::after {
  animation: kv-shine 1100ms ease-out forwards;
}

/* Gentle hover scale */
.hover-grow { transition: transform 250ms cubic-bezier(0.22, 1, 0.36, 1); }
.hover-grow:hover { transform: scale(1.03); }

/* Underline grow on hover (e.g. for links) */
.link-underline {
  position: relative;
  display: inline-block;
}
.link-underline::after {
  content: '';
  position: absolute;
  left: 0; bottom: -2px;
  height: 2px; width: 100%;
  background: currentColor;
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
}
.link-underline:hover::after { transform: scaleX(1); }

/* Card hover - upgraded */
.card-lift:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px -20px rgba(11, 28, 61, 0.25);
}

/* Icon micro-bounce on hover (apply to wrapper) */
.icon-bounce > i,
.icon-bounce > svg { transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1); }
.icon-bounce:hover > i,
.icon-bounce:hover > svg { transform: translateX(4px); }

/* Button shine + lift augmentation (ride on existing .btn-primary) */
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent 30%,
    rgba(255, 255, 255, 0.28) 50%,
    transparent 70%
  );
  transform: translateX(-120%);
  pointer-events: none;
}
.btn-primary:hover::before {
  animation: kv-shine 900ms ease-out forwards;
}

/* Navbar link slide-up underline */
.nav-link-desktop {
  position: relative;
}
.nav-link-desktop::after {
  content: '';
  position: absolute;
  left: 12px; right: 12px;
  bottom: 4px;
  height: 2px;
  background: var(--color-electric);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
  border-radius: 2px;
}
.nav-link-desktop:hover::after,
.nav-link-desktop.is-active::after { transform: scaleX(1); }

/* Reduced motion - respect user preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}
