/**
 * FSM Flow Website — Shared Styles
 * Poppins (headings) + Cabin (body) — matching the web-app
 * Palette: indigo / slate / rose — minimal gradients
 */

/* ─── Base ────────────────────────────────────────── */
html {
  font-family:
    "Cabin",
    system-ui,
    -apple-system,
    sans-serif;
  scroll-behavior: smooth;
}
h1,
h2,
h3,
h4,
h5,
h6,
.font-heading {
  font-family:
    "Poppins",
    system-ui,
    -apple-system,
    sans-serif;
}

/* ─── Gradient backgrounds ────────────────────────── */
.gradient-hero {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 30%, #3730a3 60%, #4f46e5 100%);
}
.gradient-hero-light {
  background: linear-gradient(135deg, #312e81 0%, #4f46e5 100%);
}
.gradient-mesh {
  background-image: radial-gradient(at 27% 37%, rgba(99, 102, 241, 0.12) 0, transparent 50%), radial-gradient(at 97% 21%, rgba(129, 140, 248, 0.1) 0, transparent 50%), radial-gradient(at 52% 99%, rgba(165, 180, 252, 0.06) 0, transparent 50%);
}

/* ─── Glass ───────────────────────────────────────── */
.glass {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ─── Dot pattern ─────────────────────────────────── */
.dot-pattern {
  background-image: radial-gradient(rgba(99, 102, 241, 0.12) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* ─── Scrollbar ───────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.3);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.5);
}

/* ─── Nav ─────────────────────────────────────────── */
.nav-scrolled {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(20px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.nav-link-active {
  font-weight: 600;
}

/* ─── Mobile menu ─────────────────────────────────── */
.mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}
.mobile-menu.open {
  max-height: 420px;
}

/* ─── Reveal animations (IntersectionObserver) ────── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

/* ─── Stagger children ───────────────────────────── */
.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.stagger-children.revealed > *:nth-child(1) {
  transition-delay: 0.1s;
  opacity: 1;
  transform: translateY(0);
}
.stagger-children.revealed > *:nth-child(2) {
  transition-delay: 0.2s;
  opacity: 1;
  transform: translateY(0);
}
.stagger-children.revealed > *:nth-child(3) {
  transition-delay: 0.3s;
  opacity: 1;
  transform: translateY(0);
}
.stagger-children.revealed > *:nth-child(4) {
  transition-delay: 0.3s;
  opacity: 1;
  transform: translateY(0);
}
.stagger-children.revealed > *:nth-child(5) {
  transition-delay: 0.4s;
  opacity: 1;
  transform: translateY(0);
}
.stagger-children.revealed > *:nth-child(6) {
  transition-delay: 0.5s;
  opacity: 1;
  transform: translateY(0);
}
.stagger-children.revealed > *:nth-child(7) {
  transition-delay: 0.55s;
  opacity: 1;
  transform: translateY(0);
}
.stagger-children.revealed > *:nth-child(8) {
  transition-delay: 0.6s;
  opacity: 1;
  transform: translateY(0);
}

/* ─── Feature card hover ─────────────────────────── */
.feature-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(99, 102, 241, 0.1);
}

/* ─── Pricing popular ─────────────────────────────── */
.pricing-popular {
  border: 2px solid #6366f1;
  box-shadow: 0 0 40px rgba(99, 102, 241, 0.12);
}

/* ─── Ticker ──────────────────────────────────────── */
@keyframes ticker {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}
.ticker-track {
  animation: ticker 30s linear infinite;
}

/* ─── SVG illustration animations ─────────────────── */

/* Bars grow from bottom */
@keyframes barGrow {
  from {
    transform: scaleY(0);
  }
  to {
    transform: scaleY(1);
  }
}
.illus-bar {
  transform-origin: bottom;
  animation: barGrow 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  opacity: 0;
}
.illus-bar.revealed {
  opacity: 1;
}

/* Fade in and slide up */
@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Draw line (stroke-dashoffset) */
@keyframes drawLine {
  to {
    stroke-dashoffset: 0;
  }
}

/* Pulse dot */
@keyframes pulseDot {
  0%,
  100% {
    r: 4;
    opacity: 0.8;
  }
  50% {
    r: 6;
    opacity: 1;
  }
}

/* Typing indicator bounce */
@keyframes typingBounce {
  0%,
  60%,
  100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-4px);
  }
}

/* Float gentle */
@keyframes floatGentle {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}
.animate-float-gentle {
  animation: floatGentle 4s ease-in-out infinite;
}

/* Slide in from left */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Slide in from right */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Node appear */
@keyframes nodeAppear {
  from {
    opacity: 0;
    transform: scale(0.7);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Sparkle */
@keyframes sparkle {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(0.8) rotate(0deg);
  }
  50% {
    opacity: 1;
    transform: scale(1.2) rotate(180deg);
  }
}

/* Breathing glow */
@keyframes breatheGlow {
  0%,
  100% {
    filter: drop-shadow(0 0 6px rgba(99, 102, 241, 0.2));
  }
  50% {
    filter: drop-shadow(0 0 16px rgba(99, 102, 241, 0.4));
  }
}

/* ─── Illustration container ─────────────────────── */
.illus-container svg {
  width: 100%;
  height: auto;
  max-width: 540px;
}

/* ─── Illustration: Dashboard ─────────────────────── */
.illus-dashboard .kpi-card {
  animation: fadeSlideUp 0.5s ease-out both;
}
.illus-dashboard .kpi-card:nth-child(2) {
  animation-delay: 0.15s;
}
.illus-dashboard .kpi-card:nth-child(3) {
  animation-delay: 0.3s;
}
.illus-dashboard .kpi-card:nth-child(4) {
  animation-delay: 0.45s;
}

.illus-dashboard .bar {
  transform-origin: bottom;
  animation: barGrow 0.6s cubic-bezier(0.4, 0, 0.2, 1) both;
}
.illus-dashboard .bar:nth-child(1) {
  animation-delay: 0.5s;
}
.illus-dashboard .bar:nth-child(2) {
  animation-delay: 0.6s;
}
.illus-dashboard .bar:nth-child(3) {
  animation-delay: 0.7s;
}
.illus-dashboard .bar:nth-child(4) {
  animation-delay: 0.8s;
}
.illus-dashboard .bar:nth-child(5) {
  animation-delay: 0.9s;
}
.illus-dashboard .bar:nth-child(6) {
  animation-delay: 1s;
}
.illus-dashboard .bar:nth-child(7) {
  animation-delay: 1.1s;
}

.illus-dashboard .activity-row {
  animation: slideInRight 0.4s ease-out both;
}
.illus-dashboard .activity-row:nth-child(1) {
  animation-delay: 0.8s;
}
.illus-dashboard .activity-row:nth-child(2) {
  animation-delay: 0.95s;
}
.illus-dashboard .activity-row:nth-child(3) {
  animation-delay: 1.1s;
}

/* ─── Illustration: Scheduler ─────────────────────── */
.illus-scheduler .job-block {
  animation: slideInLeft 0.5s ease-out both;
}
.illus-scheduler .job-block:nth-child(1) {
  animation-delay: 0.3s;
}
.illus-scheduler .job-block:nth-child(2) {
  animation-delay: 0.5s;
}
.illus-scheduler .job-block:nth-child(3) {
  animation-delay: 0.7s;
}
.illus-scheduler .job-block:nth-child(4) {
  animation-delay: 0.9s;
}

/* ─── Illustration: AI Chat ──────────────────────── */
.illus-chat .chat-bubble {
  animation: fadeSlideUp 0.4s ease-out both;
}
.illus-chat .chat-bubble:nth-child(1) {
  animation-delay: 0.2s;
}
.illus-chat .chat-bubble:nth-child(2) {
  animation-delay: 0.6s;
}
.illus-chat .chat-bubble:nth-child(3) {
  animation-delay: 1s;
}
.illus-chat .chat-bubble:nth-child(4) {
  animation-delay: 1.4s;
}

.illus-chat .typing-dot {
  animation: typingBounce 1.4s ease-in-out infinite;
}
.illus-chat .typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}
.illus-chat .typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

.illus-chat .sparkle-icon {
  animation: sparkle 2s ease-in-out infinite;
}

/* ─── Illustration: Workflow ─────────────────────── */
.illus-workflow .wf-node {
  animation: nodeAppear 0.4s ease-out both;
}
.illus-workflow .wf-node:nth-child(1) {
  animation-delay: 0.2s;
}
.illus-workflow .wf-node:nth-child(2) {
  animation-delay: 0.4s;
}
.illus-workflow .wf-node:nth-child(3) {
  animation-delay: 0.6s;
}
.illus-workflow .wf-node:nth-child(4) {
  animation-delay: 0.8s;
}
.illus-workflow .wf-node:nth-child(5) {
  animation-delay: 1s;
}

.illus-workflow .wf-edge {
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  animation: drawLine 0.8s ease-out forwards;
}
.illus-workflow .wf-edge:nth-child(1) {
  animation-delay: 0.6s;
}
.illus-workflow .wf-edge:nth-child(2) {
  animation-delay: 0.9s;
}
.illus-workflow .wf-edge:nth-child(3) {
  animation-delay: 1.1s;
}
.illus-workflow .wf-edge:nth-child(4) {
  animation-delay: 1.3s;
}

/* ─── Illustration: Invoice ──────────────────────── */
.illus-invoice .inv-row {
  animation: fadeSlideUp 0.4s ease-out both;
}
.illus-invoice .inv-row:nth-child(1) {
  animation-delay: 0.3s;
}
.illus-invoice .inv-row:nth-child(2) {
  animation-delay: 0.45s;
}
.illus-invoice .inv-row:nth-child(3) {
  animation-delay: 0.6s;
}
.illus-invoice .inv-row:nth-child(4) {
  animation-delay: 0.75s;
}

/* ─── Illustration: Inventory ────────────────────── */
.illus-inventory .inv-item {
  animation: fadeSlideUp 0.4s ease-out both;
}
.illus-inventory .inv-item:nth-child(1) {
  animation-delay: 0.2s;
}
.illus-inventory .inv-item:nth-child(2) {
  animation-delay: 0.35s;
}
.illus-inventory .inv-item:nth-child(3) {
  animation-delay: 0.5s;
}
.illus-inventory .inv-item:nth-child(4) {
  animation-delay: 0.65s;
}

/* ─── Page transition ─────────────────────────────── */
.page-enter {
  animation: fadeSlideUp 0.5s ease-out both;
}

/* ─── CTA button glow ─────────────────────────────── */
.btn-glow {
  position: relative;
  overflow: hidden;
}
.btn-glow::after {
  content: "";
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, #6366f1, #818cf8, #a5b4fc);
  z-index: -1;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.3s;
  filter: blur(12px);
}
.btn-glow:hover::after {
  opacity: 1;
}

/* ─── Section divider wave ────────────────────────── */
.wave-divider {
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  overflow: hidden;
  line-height: 0;
}
.wave-divider svg {
  display: block;
  width: 100%;
  height: 60px;
}

/* ─── Counter animation ─────────────────────────── */
@keyframes counter {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ─── Gradient border ─────────────────────────────── */
.gradient-border {
  position: relative;
  border-radius: 1rem;
}
.gradient-border::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, #6366f1, #818cf8, #a5b4fc, #6366f1);
  background-size: 300% 300%;
  animation: gradientShift 4s ease infinite;
  z-index: -1;
}
@keyframes gradientShift {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}
