/* AutoFlux — mixed dark/light aesthetic */

/* ===== Foundation ===== */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

/* ===== Skip to content (keyboard a11y) ===== */
.skip-to-content {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 100;
  background: #3B82F6;
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.3);
  transition: top 0.2s ease;
}
.skip-to-content:focus,
.skip-to-content:focus-visible {
  top: 1rem;
  outline: 2px solid white;
  outline-offset: 2px;
}

body {
  background: #ffffff;
  color: #0F172A;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

/* Scrollbar — light ===== */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #F8FAFC; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

/* ===== Live ticker animation ===== */
.ticker-track {
  animation: tickerScroll 60s linear infinite;
  width: max-content;
}
@keyframes tickerScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ===== Gradient mesh hero background (dark sections) ===== */
.gradient-mesh {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 800px 600px at 20% 30%, rgba(59, 130, 246, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse 600px 800px at 80% 60%, rgba(96, 165, 250, 0.1) 0%, transparent 60%),
    radial-gradient(ellipse 400px 400px at 60% 20%, rgba(59, 130, 246, 0.08) 0%, transparent 60%);
  animation: meshShift 20s ease-in-out infinite;
  pointer-events: none;
}
.gradient-mesh-subtle {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 600px 400px at 50% 50%, rgba(59, 130, 246, 0.12) 0%, transparent 70%);
  pointer-events: none;
}
@keyframes meshShift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(2%, -2%) scale(1.05); }
  66% { transform: translate(-2%, 2%) scale(0.95); }
}

/* ===== Subtle grid overlay (technical feel, dark sections only) ===== */
.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(59, 130, 246, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(59, 130, 246, 0.05) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black, transparent);
  pointer-events: none;
}

/* ===== Cycling word in hero ===== */
.cycle-word {
  transition: opacity 0.3s ease;
}
.cycle-word.fading {
  opacity: 0;
}
.cycle-cursor {
  animation: blink 1s steps(2) infinite;
}
@keyframes blink {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

/* ===== Floating live cards ===== */
.live-card {
  animation-fill-mode: both;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.live-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 0 60px rgba(59, 130, 246, 0.4) !important;
}
.live-card-1 { animation: float1 6s ease-in-out infinite, fadeInUp 0.8s ease-out 0.2s both; }
.live-card-2 { animation: float2 7s ease-in-out infinite, fadeInUp 0.8s ease-out 0.5s both; }
.live-card-3 { animation: float3 8s ease-in-out infinite, fadeInUp 0.8s ease-out 0.8s both; }

@keyframes float1 { 0%,100%{transform:translate(0,0);} 50%{transform:translate(-6px,-10px);} }
@keyframes float2 { 0%,100%{transform:translate(0,0);} 50%{transform:translate(8px,-6px);} }
@keyframes float3 { 0%,100%{transform:translate(0,0);} 50%{transform:translate(-4px,-12px);} }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Animated counters ===== */
.counter {
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 30px rgba(96, 165, 250, 0.3);
}

/* ===== "Built for" niche cards (dark) ===== */
.niche-card {
  padding: 1rem;
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
}
.niche-card:hover {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
  transform: translateY(-2px);
}

/* ===== Integrations strip (light) ===== */
.integration-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: #64748B;
  font-weight: 500;
  transition: color 0.2s ease, transform 0.2s ease;
  cursor: default;
}
.integration-logo:hover {
  color: #0F172A;
  transform: translateY(-2px);
}
.integration-logo img {
  filter: grayscale(0.5);
  transition: filter 0.2s ease;
}
.integration-logo:hover img {
  filter: grayscale(0);
}

/* ===== Problem cards (light) ===== */
.problem-card {
  background: white;
  border: 1px solid #E2E8F0;
  border-top: 4px solid #3B82F6;
  border-radius: 12px;
  padding: 2rem;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.problem-card:hover {
  border-top-color: #3B82F6;
  box-shadow: 0 8px 30px rgba(59, 130, 246, 0.12);
  transform: translateY(-3px);
}

/* ===== Workflow diagram (light variant) ===== */
.workflow-diagram-light {
  position: relative;
}
.workflow-node-light {
  background: white;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.workflow-node-light:hover {
  border-color: rgba(59, 130, 246, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(59, 130, 246, 0.12);
}
.node-icon-light {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: white;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}
.node-title-light {
  font-weight: 700;
  font-size: 1.125rem;
  margin-bottom: 0.25rem;
  color: #0F172A;
}
.node-tech-light {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: #3B82F6;
  margin-bottom: 0.75rem;
  font-weight: 600;
}
.node-desc-light {
  font-size: 0.8125rem;
  color: #64748B;
  line-height: 1.5;
}
.workflow-arrow-light {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #3B82F6;
  font-size: 1.5rem;
  font-weight: bold;
}
@media (max-width: 768px) {
  .workflow-arrow-light { transform: rotate(90deg); padding: 0.5rem 0; }
}

/* ===== Module cards (light) ===== */
.module-card-light {
  position: relative;
  padding: 1.5rem;
  border-radius: 12px;
  transition: all 0.3s ease;
  cursor: default;
}
.module-built-light {
  background: white;
  border: 1px solid #E2E8F0;
  border-left: 3px solid #3B82F6;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.module-built-light:hover {
  border-color: #3B82F6;
  box-shadow: 0 8px 30px rgba(59, 130, 246, 0.12);
  transform: translateY(-3px);
}
.module-roadmap-light {
  background: #F8FAFC;
  border: 1px dashed #CBD5E1;
  opacity: 0.85;
}
.module-cta-light {
  background: rgba(59, 130, 246, 0.05);
  border: 1px dashed rgba(59, 130, 246, 0.4);
}
.module-num-light {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 1.75rem;
  color: #3B82F6;
  margin-bottom: 0.5rem;
}
.module-name-light {
  font-weight: 700;
  font-size: 1rem;
  color: #0F172A;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}
.module-tech-light {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6875rem;
  color: #64748B;
  margin-bottom: 0.75rem;
}
.module-status-light {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}
.status-built {
  background: rgba(59, 130, 246, 0.1);
  color: #3B82F6;
}
.status-roadmap {
  background: rgba(100, 116, 139, 0.1);
  color: #64748B;
}

/* ===== ROI calculator slider (light) ===== */
.roi-slider-light {
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  background: linear-gradient(to right, #3B82F6 0%, #3B82F6 25%, #E2E8F0 25%, #E2E8F0 100%);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}
.roi-slider-light::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  background: #3B82F6;
  border: 3px solid white;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(59, 130, 246, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.roi-slider-light::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 20px rgba(59, 130, 246, 0.6);
}
.roi-slider-light::-moz-range-thumb {
  width: 28px;
  height: 28px;
  background: #3B82F6;
  border: 3px solid white;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(59, 130, 246, 0.4);
}

/* ===== Pricing cards (light) ===== */
.pricing-card-light {
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.pricing-card-light:hover {
  transform: translateY(-4px);
}
.pricing-card-light:not(.shadow-\[0_0_60px_rgba\(59\,130\,246\,0\.3\)\]):hover {
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 12px 40px rgba(59, 130, 246, 0.12);
}

/* ===== FAQ items (light) ===== */
.faq-item {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 1.5rem;
  transition: all 0.2s ease;
}
.faq-item:hover {
  border-color: rgba(59, 130, 246, 0.3);
}
.faq-item[open] {
  background: white;
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.08);
}
.faq-summary {
  font-weight: 700;
  font-size: 1rem;
  color: #0F172A;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
}
.faq-summary::-webkit-details-marker { display: none; }
.faq-icon {
  color: #3B82F6;
  font-size: 1.5rem;
  font-weight: 300;
  transition: transform 0.2s ease;
}
.faq-item[open] .faq-icon {
  transform: rotate(45deg);
}
.faq-body {
  margin-top: 1rem;
  color: #64748B;
  font-size: 0.875rem;
  line-height: 1.6;
}

/* ===== Free Audit steps ===== */
.audit-step {
  background: white;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 2rem 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
}
.audit-step:hover {
  border-color: rgba(59, 130, 246, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(59, 130, 246, 0.12);
}
.audit-step-num {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3B82F6, #60A5FA);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 1.25rem;
  margin: 0 auto 1rem;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}
.audit-step-title {
  font-weight: 700;
  font-size: 1.125rem;
  color: #0F172A;
  margin-bottom: 0.5rem;
}
.audit-step-desc {
  color: #64748B;
  font-size: 0.875rem;
  line-height: 1.5;
}

/* ===== Demo section — module Loom tiles ===== */
.demo-tile {
  background: white;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  transition: all 0.3s ease;
}
.demo-tile:hover {
  border-color: rgba(59, 130, 246, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(59, 130, 246, 0.12);
}
.demo-tile-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.demo-tile-num {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 1.5rem;
  color: #3B82F6;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 10px;
  padding: 0.5rem 0.875rem;
  min-width: 56px;
  text-align: center;
  flex-shrink: 0;
}
.demo-tile-title {
  font-weight: 700;
  font-size: 1.125rem;
  color: #0F172A;
  margin-bottom: 0.25rem;
  line-height: 1.3;
}
.demo-tile-tagline {
  color: #475569;
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Placeholder state — shown until real Loom is embedded */
.demo-tile-placeholder {
  background: linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 100%);
  border: 1px dashed #CBD5E1;
  border-radius: 12px;
  padding: 2rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  aspect-ratio: 16 / 9;
  justify-content: center;
}
.demo-pending-badge {
  display: inline-flex;
  align-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #60A5FA;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.25);
  padding: 0.375rem 0.875rem;
  border-radius: 9999px;
}
.demo-pending-text {
  color: #475569;
  font-size: 0.875rem;
  max-width: 320px;
  line-height: 1.5;
}
.demo-pending-cta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #3B82F6;
  border-bottom: 1px solid rgba(59, 130, 246, 0.3);
  padding-bottom: 2px;
  transition: all 0.2s ease;
}
.demo-pending-cta:hover {
  color: #2563EB;
  border-bottom-color: #2563EB;
}

/* Loom iframe wrapper — 16:9 responsive */
.demo-tile-video {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #0F172A;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}
.demo-tile-video iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.demo-tile-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.5rem;
  border-top: 1px solid #F1F5F9;
}
.demo-tile-tier {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: #64748B;
}
.demo-tile-cta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #3B82F6;
  transition: color 0.2s ease;
}
.demo-tile-cta:hover {
  color: #2563EB;
}

/* ===== Section reveal animation ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Focus rings ===== */
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid #3B82F6;
  outline-offset: 3px;
  border-radius: 4px;
}

/* ===== Selection ===== */
::selection {
  background: #3B82F6;
  color: white;
}

/* ===== Reduce motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  /* Explicit kills for animations a 0.01ms duration doesn't truly stop visually */
  .ticker-track,
  .cycle-cursor,
  .live-card-1, .live-card-2, .live-card-3,
  .animate-pulse {
    animation: none !important;
  }
}

/* ===== n8n chat widget overrides ===== */
/* Defined on html selector for higher specificity than :root, plus !important */
/* to win against the widget's CDN-loaded stylesheet that injects after this file */
html {
  --chat--color-primary: #3B82F6 !important;
  --chat--color-primary-shade-50: #2563EB !important;
  --chat--color-primary-shade-100: #1D4ED8 !important;
  --chat--color-secondary: #0F172A !important;
  --chat--color-white: #FFFFFF !important;
  --chat--color-light: #F1F5F9 !important;
  --chat--color-medium: #64748B !important;
  --chat--color-dark: #0F172A !important;
  --chat--header--background: #0F172A !important;
  --chat--header--color: #FFFFFF !important;
  --chat--message--bot--background: #F1F5F9 !important;
  --chat--message--bot--color: #0F172A !important;
  --chat--message--user--background: #3B82F6 !important;
  --chat--message--user--color: #FFFFFF !important;
  --chat--toggle--background: #3B82F6 !important;
  --chat--toggle--hover--background: #2563EB !important;
  --chat--toggle--color: #FFFFFF !important;
  --chat--toggle--size: 60px !important;
  --chat--window--width: 400px !important;
  --chat--window--height: 600px !important;
  --chat--border-radius: 0.5rem !important;
}

/* Direct selector overrides — fallback for any DOM nodes the widget paints */
/* before/without consulting CSS variables. Targets the toggle button via */
/* common @n8n/chat class patterns. */
[class*="chat-window-toggle"],
[class*="chat-button-toggle"],
button[class*="toggle"][class*="chat"] {
  background-color: #3B82F6 !important;
  background: #3B82F6 !important;
  color: #FFFFFF !important;
}
[class*="chat-window-toggle"]:hover,
[class*="chat-button-toggle"]:hover,
button[class*="toggle"][class*="chat"]:hover {
  background-color: #2563EB !important;
  background: #2563EB !important;
}
