/* ==========================================================================
   Kinetix AI — Dark Obsidian SaaS Landing Page Stylesheet
   ==========================================================================
   Buyer Customization Guide:
   - Edit CSS variables in :root below to customize the primary palette.
   - Grid density, radial glow intensity, and glassmorphism blur can all be
     tuned directly in this file without any build step.
   ========================================================================== */

:root {
  --bg-obsidian: #09090B;
  --bg-surface: #111114;
  --bg-surface-elevated: #18181D;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text-primary: #FAFAFA;
  --text-muted: #A1A1AA;
  --accent-indigo: #6366F1;
  --accent-violet: #8B5CF6;
  --accent-glow: rgba(99, 102, 241, 0.18);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base & Typography Reset */
html {
  scroll-behavior: smooth;
  background-color: var(--bg-obsidian);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg-obsidian);
  color: var(--text-primary);
  overflow-x: hidden;
}

h1, h2, h3, h4, .font-heading {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

code, pre, .font-mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

.text-balance {
  text-wrap: balance;
}

/* Accessible Focus Rings */
:focus-visible {
  outline: 2px solid var(--accent-violet);
  outline-offset: 2px;
}

/* Custom Dark Obsidian Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-obsidian);
}

::-webkit-scrollbar-thumb {
  background: #27272A;
  border-radius: 9999px;
  border: 2px solid var(--bg-obsidian);
}

::-webkit-scrollbar-thumb:hover {
  background: #3F3F46;
}

/* ==========================================================================
   Backgrounds: Architectural Grid & Subtle Radial Glow
   ========================================================================== */
.bg-obsidian-grid {
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse 80% 65% at 50% 0%, #000 55%, transparent 100%);
  mask-image: radial-gradient(ellipse 80% 65% at 50% 0%, #000 55%, transparent 100%);
}

.hero-radial-glow {
  background: radial-gradient(
    ellipse 60% 50% at 50% 12%,
    rgba(99, 102, 241, 0.22) 0%,
    rgba(139, 92, 246, 0.10) 45%,
    rgba(9, 9, 11, 0) 78%
  );
  animation: pulseGlow 9s ease-in-out infinite alternate;
  will-change: opacity, transform;
}

@keyframes pulseGlow {
  0% {
    opacity: 0.78;
    transform: scale(1) translateY(0);
  }
  100% {
    opacity: 1;
    transform: scale(1.04) translateY(-6px);
  }
}

/* ==========================================================================
   Sticky Glassmorphic Navbar
   ========================================================================== */
.glass-nav {
  background-color: rgba(9, 9, 11, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: background-color 200ms var(--ease-out-expo), border-color 200ms var(--ease-out-expo);
}

.glass-nav.is-scrolled {
  background-color: rgba(9, 9, 11, 0.9);
  border-bottom-color: rgba(255, 255, 255, 0.11);
}

/* ==========================================================================
   Obsidian Cards & Interactive Bento Hover Sheen
   ========================================================================== */
.obsidian-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.bento-card {
  position: relative;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  transition: border-color 200ms var(--ease-out-expo), transform 200ms var(--ease-out-expo);
}

.bento-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    480px circle at var(--mouse-x, 50%) var(--mouse-y, 0%),
    rgba(99, 102, 241, 0.12),
    transparent 45%
  );
  opacity: 0;
  transition: opacity 240ms var(--ease-out-expo);
  pointer-events: none;
  z-index: 0;
}

.bento-card:hover {
  border-color: rgba(99, 102, 241, 0.35);
}

.bento-card:hover::before {
  opacity: 1;
}

.bento-card > * {
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   Primary Indigo/Violet Action Button
   ========================================================================== */
.btn-primary {
  background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
  color: #FFFFFF;
  box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.18) inset, 0 8px 24px -6px rgba(99, 102, 241, 0.45);
  transition: transform 160ms var(--ease-out-expo), filter 160ms var(--ease-out-expo), box-shadow 160ms var(--ease-out-expo);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.08);
  box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.24) inset, 0 12px 28px -6px rgba(99, 102, 241, 0.58);
}

.btn-primary:active:not(:disabled) {
  transform: scale(0.985);
}

.btn-primary:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

/* ==========================================================================
   Interactive Dashboard Mockup: Workflow Nodes & Connectors
   ========================================================================== */
.workflow-node {
  background-color: #151519;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: border-color 220ms var(--ease-out-expo), box-shadow 220ms var(--ease-out-expo), background-color 220ms var(--ease-out-expo);
}

.workflow-node[data-status="running"] {
  border-color: rgba(139, 92, 246, 0.75);
  background-color: rgba(99, 102, 241, 0.09);
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.25), 0 12px 28px -10px rgba(99, 102, 241, 0.4);
}

.workflow-node[data-status="completed"] {
  border-color: rgba(16, 185, 129, 0.45);
  background-color: rgba(16, 185, 129, 0.05);
}

.connector-track {
  position: relative;
  background-color: rgba(255, 255, 255, 0.09);
  overflow: hidden;
}

.connector-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #6366F1, #8B5CF6, #10B981);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 340ms var(--ease-out-expo);
}

.connector-track[data-active="true"] .connector-fill {
  transform: scaleX(1);
}

@media (max-width: 1023px) {
  .connector-fill {
    background: linear-gradient(180deg, #6366F1, #8B5CF6, #10B981);
    transform: scaleY(0);
    transform-origin: top center;
  }

  .connector-track[data-active="true"] .connector-fill {
    transform: scaleY(1);
  }
}

/* ==========================================================================
   FAQ Accordion Smooth Height Transition (CSS Grid Technique)
   ========================================================================== */
.faq-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 240ms var(--ease-out-expo);
}

.faq-panel[data-open="true"] {
  grid-template-rows: 1fr;
}

.faq-panel-inner {
  overflow: hidden;
}

.faq-chevron {
  transition: transform 220ms var(--ease-out-expo);
}

.faq-trigger[aria-expanded="true"] .faq-chevron {
  transform: rotate(180deg);
}

/* ==========================================================================
   Spin Animation for Loading Indicators
   ========================================================================== */
@keyframes spinSlow {
  to {
    transform: rotate(360deg);
  }
}

.animate-spin-fast {
  animation: spinSlow 0.75s linear infinite;
}

/* ==========================================================================
   Reduced Motion Compliance
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero-radial-glow {
    animation: none;
  }

  .faq-panel,
  .faq-chevron,
  .connector-fill,
  .bento-card::before,
  .btn-primary {
    transition: none;
  }
}
