/* 
 * MadAutomate Core Stylesheet
 * Enterprise AI Automation Design System
 * Inspired by Stripe, Claude, and Linear.
 */

/* ==========================================================================
   1. Design Tokens & CSS Variables
   ========================================================================== */
:root {
  /* Color System */
  --bg-primary: #F8F6F1;
  --surface: #FFFFFF;
  --text-primary: #171717;
  --text-secondary: #5F5F5F;
  --border: #E6E1D8;
  --accent: #D66B45;
  --accent-hover: #BF5935;
  --accent-light: #F7E7DD;
  --green: #2F8F5B;
  --yellow: #D8A032;
  --red: #D9534F;
  
  /* Fonts */
  --font-family: 'Geist', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'Geist Mono', 'Courier New', Courier, monospace;

  /* Typography Scale (PRD Spec with fluid clamping for responsiveness) */
  --font-size-hero: clamp(2.5rem, 5vw, 4.5rem);      /* ~40px to 72px */
  --font-size-h1: clamp(2.2rem, 4vw, 3.5rem);        /* ~35px to 56px */
  --font-size-h2: clamp(1.8rem, 3vw, 3rem);          /* ~28px to 48px */
  --font-size-h3: clamp(1.4rem, 2vw, 2rem);          /* ~22px to 32px */
  --font-size-body: 1.125rem;                        /* 18px */
  --font-size-button: 1rem;                          /* 16px */
  --font-size-small: 0.9375rem;                      /* 15px */
  --font-size-nav: 0.9375rem;                        /* 15px */

  /* Line Heights */
  --lh-hero: 1.1;
  --lh-heading: 1.25;
  --lh-body: 1.6;
  
  /* Grid & Spacing System (8px Grid) */
  --container-max-width: 1280px;
  --section-spacing: 140px;
  --section-spacing-mobile: 80px;
  --component-spacing: 32px;
  --card-padding: 32px;
  --button-padding-y: 16px;
  --button-padding-x: 28px;
  
  /* Transitions & Shadows (Strictly NO glows, using premium flat elevations) */
  --transition-fast: 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-medium: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 4px 12px rgba(23, 23, 23, 0.03);
  --card-shadow-hover: 0 2px 8px rgba(0, 0, 0, 0.04), 0 16px 32px rgba(23, 23, 23, 0.06);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

/* ==========================================================================
   2. Base Settings & Resets
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-family);
  font-size: 16px;
  scroll-behavior: smooth;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  overflow-x: hidden;
  line-height: var(--lh-body);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

input, button, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
}

ul, ol {
  list-style: none;
}

img, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ==========================================================================
   3. Grid & Layout System
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

.grid-12 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--component-spacing);
}

/* On mobile, columns stack */
.col-12, .col-8, .col-7, .col-6, .col-5, .col-4, .col-3 {
  grid-column: span 1;
}

@media (min-width: 768px) {
  .grid-12 {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }
  /* Dynamic columns for tablet/desktop */
  .col-12 { grid-column: span 12; }
  .col-8  { grid-column: span 8; }
  .col-7  { grid-column: span 7; }
  .col-6  { grid-column: span 6; }
  .col-5  { grid-column: span 5; }
  .col-4  { grid-column: span 4; }
  .col-3  { grid-column: span 3; }
}

.section {
  padding-top: var(--section-spacing);
  padding-bottom: var(--section-spacing);
  position: relative;
}

@media (max-width: 768px) {
  .section {
    padding-top: var(--section-spacing-mobile);
    padding-bottom: var(--section-spacing-mobile);
  }
}

/* Section Header styling */
.section-header {
  margin-bottom: 56px;
  max-width: 720px;
}

.section-tag {
  font-size: var(--font-size-small);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 16px;
  display: inline-block;
}

.section-title {
  font-size: var(--font-size-h2);
  font-weight: 700;
  line-height: var(--lh-heading);
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.section-desc {
  font-size: var(--font-size-body);
  color: var(--text-secondary);
  line-height: var(--lh-body);
}

/* ==========================================================================
   4. Typography Styles
   ========================================================================== */
.hero-title {
  font-size: var(--font-size-hero);
  font-weight: 800;
  line-height: var(--lh-hero);
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.h1 {
  font-size: var(--font-size-h1);
  font-weight: 700;
  line-height: var(--lh-heading);
  letter-spacing: -0.02em;
}

.h2 {
  font-size: var(--font-size-h2);
  font-weight: 700;
  line-height: var(--lh-heading);
  letter-spacing: -0.02em;
}

.h3 {
  font-size: var(--font-size-h3);
  font-weight: 600;
  line-height: var(--lh-heading);
  letter-spacing: -0.01em;
}

.text-body {
  font-size: var(--font-size-body);
  line-height: var(--lh-body);
}

.text-small {
  font-size: var(--font-size-small);
  color: var(--text-secondary);
}

.lead {
  font-size: 1.25rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.text-accent {
  color: var(--accent);
}

/* ==========================================================================
   5. Component Library
   ========================================================================== */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-button);
  font-weight: 500;
  padding: var(--button-padding-y) var(--button-padding-x);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--accent);
  color: var(--surface);
  border: 1px solid var(--accent);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-secondary {
  background-color: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background-color: var(--bg-primary);
  border-color: var(--text-secondary);
}

.btn-text {
  padding: 8px 16px;
  color: var(--accent);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-text:hover {
  color: var(--accent-hover);
}

.btn-text svg {
  transition: transform var(--transition-fast);
}

.btn-text:hover svg {
  transform: translateX(4px);
}

.btn-sm {
  padding: 10px 20px;
  font-size: var(--font-size-small);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 100px;
  font-size: var(--font-size-small);
  font-weight: 500;
  background-color: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.badge-accent {
  background-color: var(--accent-light);
  border-color: var(--accent-light);
  color: var(--accent);
}

.badge-green {
  background-color: #EBF7EE;
  border-color: #EBF7EE;
  color: var(--green);
}

/* Card System */
.card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--card-padding);
  box-shadow: var(--card-shadow);
  transition: transform var(--transition-medium), box-shadow var(--transition-medium), border-color var(--transition-medium);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
  border-color: #D6CEC1;
}

.card-title {
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.card-desc {
  font-size: var(--font-size-small);
  color: var(--text-secondary);
  line-height: var(--lh-body);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background-color: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  color: var(--accent);
}

/* Inputs and Forms */
.form-group {
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: var(--font-size-small);
  font-weight: 600;
  color: var(--text-primary);
}

.form-control {
  width: 100%;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background-color: var(--surface);
  border: 1px solid var(--border);
  font-size: var(--font-size-button);
  color: var(--text-primary);
  transition: border-color var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

/* Navigation Header */
.header-wrapper {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: rgba(248, 246, 241, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: padding var(--transition-medium), background-color var(--transition-medium), border-color var(--transition-medium);
}

.header-wrapper.scrolled {
  padding-top: 4px;
  padding-bottom: 4px;
  background-color: rgba(248, 246, 241, 0.95);
  border-bottom-color: var(--border);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
  transition: height var(--transition-medium);
}

.header-wrapper.scrolled .nav-container {
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.logo-img {
  height: 42px;
  width: auto;
  display: block;
}

.logo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent);
}

.nav-menu {
  display: none;
}

.nav-link {
  font-size: var(--font-size-nav);
  font-weight: 500;
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
  background-color: rgba(0, 0, 0, 0.02);
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Mobile Nav Toggle */
.mobile-toggle {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  cursor: pointer;
  z-index: 1010;
}

.mobile-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background-color: var(--text-primary);
  transition: transform var(--transition-medium), opacity var(--transition-medium);
}

@media (min-width: 1024px) {
  .nav-menu {
    display: flex;
    align-items: center;
    gap: 16px;
  }
  .mobile-toggle {
    display: none;
  }
}

/* Mobile Nav Drawer */
.nav-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  height: 100vh;
  background-color: var(--bg-primary);
  z-index: 999;
  padding: 100px 24px 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: right var(--transition-slow);
}

.nav-drawer.open {
  right: 0;
}

.nav-drawer-links {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.nav-drawer-link {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

/* ==========================================================================
   6. Custom Page Layouts & Specific Sections
   ========================================================================== */

/* Hero Section (New Design) */
.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  isolation: isolate;
  --bg: #F8F6F1;
  --card: #FFFFFF;
  --ink: #171717;
  --ink-soft: #55524C;
  --ink-faint: #8A867C;
  --accent: #D66B45;
  --accent-soft: #F4D9CC;
  --accent-wash: #FBEEE7;
  --border: #E7E2D8;
  --border-soft: #EFEBE2;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(23,23,23,0.04), 0 1px 1px rgba(23,23,23,0.03);
  --shadow-md: 0 8px 24px -8px rgba(23,23,23,0.10), 0 2px 6px -2px rgba(23,23,23,0.05);
}

.hero-section .bg-field {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: var(--bg);
}

.hero-section .bg-glow-1 {
  position: absolute;
  top: -12%;
  right: -8%;
  width: 55vw;
  height: 55vw;
  max-width: 800px;
  max-height: 800px;
  background: radial-gradient(circle at 50% 50%, rgba(214,107,69,0.14) 0%, rgba(214,107,69,0.05) 45%, rgba(214,107,69,0) 72%);
  filter: blur(2px);
  z-index: -1;
}

.hero-section .bg-glow-2 {
  position: absolute;
  bottom: -18%;
  left: -10%;
  width: 40vw;
  height: 40vw;
  max-width: 600px;
  max-height: 600px;
  background: radial-gradient(circle at 50% 50%, rgba(23,23,23,0.035) 0%, rgba(23,23,23,0) 70%);
  z-index: -1;
}

.hero-section .bg-grain {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.35;
  background-image: radial-gradient(circle, rgba(23,23,23,0.035) 0.6px, transparent 0.6px);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse 70% 60% at 60% 30%, black 30%, transparent 75%);
}

.hero-section .hero-inner {
  flex: 1;
  display: flex;
  align-items: center;
  max-width: 1360px;
  margin: 0 auto;
  width: 100%;
  padding: 64px 64px 80px;
  gap: 64px;
}

.hero-section .col-left {
  flex: 0 0 46%;
  max-width: 560px;
  text-align: left;
}

.hero-section .col-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.hero-section .badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  box-shadow: var(--shadow-sm);
  opacity: 0;
  animation: heroFadeUp .7s cubic-bezier(.16,1,.3,1) .05s forwards;
}

.hero-section .badge .dot-wrap {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-wash);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-section .badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(214,107,69,0.5);
  animation: heroPulse 2.4s ease-in-out infinite;
}

.hero-section h1.headline {
  font-family: 'Inter Tight', sans-serif;
  font-weight: 800;
  font-size: 60px;
  line-height: 1.04;
  letter-spacing: -0.025em;
  margin: 26px 0 0;
  color: var(--ink);
  opacity: 0;
  animation: heroFadeUp .8s cubic-bezier(.16,1,.3,1) .14s forwards;
}

.hero-section h1.headline em {
  font-style: normal;
  color: var(--accent);
  position: relative;
}

.hero-section .subhead {
  font-size: 19px;
  line-height: 1.62;
  color: var(--ink-soft);
  margin: 22px 0 0;
  max-width: 480px;
  font-weight: 400;
  opacity: 0;
  animation: heroFadeUp .8s cubic-bezier(.16,1,.3,1) .24s forwards;
}

.hero-section .cta-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 34px;
  opacity: 0;
  animation: heroFadeUp .8s cubic-bezier(.16,1,.3,1) .34s forwards;
}

.hero-section .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  padding: 13px 22px;
  border-radius: 12px;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .18s cubic-bezier(.16,1,.3,1), box-shadow .18s ease, background .18s ease, border-color .18s ease;
  white-space: nowrap;
}

.hero-section .btn-primary {
  background: var(--ink);
  color: #FBF9F4;
  box-shadow: 0 1px 2px rgba(23,23,23,0.15), 0 6px 16px -6px rgba(23,23,23,0.35);
  border: 1px solid transparent;
}

.hero-section .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(23,23,23,0.18), 0 10px 22px -6px rgba(23,23,23,0.4);
  background: var(--ink);
}

.hero-section .btn-primary svg {
  transition: transform .22s ease;
}

.hero-section .btn-primary:hover svg {
  transform: translateX(3px);
}

.hero-section .btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--border);
}

.hero-section .btn-secondary:hover {
  border-color: var(--ink-faint);
  background: rgba(23,23,23,0.02);
  transform: translateY(-2px);
}

.hero-section .proof {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--border-soft);
  opacity: 0;
  animation: heroFadeUp .8s cubic-bezier(.16,1,.3,1) .44s forwards;
}

.hero-section .stars {
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 1px;
  display: block;
  margin-bottom: 4px;
}

.hero-section .proof-label {
  font-size: 13px;
  color: var(--ink-faint);
  font-weight: 500;
}

.hero-section .proof-stats {
  display: flex;
  gap: 22px;
}

.hero-section .stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero-section .stat b {
  font-family: 'Inter Tight', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.hero-section .stat span {
  font-size: 12.5px;
  color: var(--ink-faint);
  font-weight: 500;
}

.hero-section .stat-divider {
  width: 1px;
  align-self: stretch;
  background: var(--border);
}

/* Animations */
@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes heroPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(214,107,69,0.35); }
  50% { box-shadow: 0 0 0 4px rgba(214,107,69,0); }
}

/* Right side workflow visualization */
.hero-section .flow-wrap {
  position: relative;
  width: 100%;
  max-width: 420px;
  height: 620px;
  opacity: 0;
  animation: heroFadeIn 1s cubic-bezier(.16,1,.3,1) .3s forwards;
}

@keyframes heroFadeIn { to { opacity: 1; } }

.hero-section .flow-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, transparent 0%, var(--border) 6%, var(--border) 94%, transparent 100%);
  transform: translateX(-0.5px);
  z-index: 0;
}

.hero-section .node {
  position: relative;
  z-index: 1;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 244px;
  margin: 0 auto;
  animation: heroFloatY 6s ease-in-out infinite;
}

.hero-section .node:nth-child(2) { animation-delay: .3s; }
.hero-section .node:nth-child(4) { animation-delay: .9s; }
.hero-section .node:nth-child(6) { animation-delay: 1.5s; }
.hero-section .node:nth-child(8) { animation-delay: 2.1s; }
.hero-section .node:nth-child(10) { animation-delay: 2.7s; }

@keyframes heroFloatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.hero-section .node.node-primary {
  border-color: rgba(214,107,69,0.35);
  box-shadow: 0 1px 2px rgba(214,107,69,0.08), 0 10px 24px -8px rgba(214,107,69,0.28);
}

.hero-section .node-icon {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent-wash);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-section .node.node-primary .node-icon {
  background: linear-gradient(155deg, var(--accent) 0%, #C1552F 100%);
}

.hero-section .node-icon svg { width: 18px; height: 18px; }

.hero-section .node-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.hero-section .node-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
}

.hero-section .node-sub {
  font-size: 12px;
  color: var(--ink-faint);
  font-weight: 500;
}

.hero-section .connector {
  position: relative;
  z-index: 1;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-section .connector svg { opacity: 0.55; }

.hero-section .badge-float {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #FFFFFF;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 6px 12px 6px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  box-shadow: var(--shadow-md);
  animation: heroFloatY 5s ease-in-out infinite, heroPopIn .6s cubic-bezier(.16,1,.3,1) both;
}

.hero-section .badge-float .check {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #E7F3EA;
  color: #3A8A54;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

@keyframes heroPopIn { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: scale(1); } }

.hero-section .bf-1 { top: 26px; right: -18px; animation-delay: .8s, .55s; }
.hero-section .bf-2 { top: 224px; left: -30px; animation-delay: 1.4s, .75s; }
.hero-section .bf-3 { top: 420px; right: -22px; animation-delay: .5s, .95s; }
.hero-section .bf-4 { bottom: 6px; left: -14px; animation-delay: 1.9s, 1.15s; }

@media (max-width: 1180px) {
  .hero-section .hero-inner { flex-direction: column; padding: 48px 32px 64px; gap: 56px; }
  .hero-section .col-left { flex: none; max-width: 640px; text-align: left; }
  .hero-section .col-right { width: 100%; }
  .hero-section h1.headline { font-size: 48px; }
  .hero-section .badge-float { display: none; }
}

@media (max-width: 560px) {
  .hero-section h1.headline { font-size: 38px; }
  .hero-section .subhead { font-size: 17px; }
  .hero-section .cta-row { flex-direction: column; align-items: stretch; }
  .hero-section .proof { flex-direction: column; align-items: flex-start; gap: 14px; }
  .hero-section .flow-wrap { height: 560px; }
  .hero-section .node { width: 100%; }
}

/* Trusted By */
.trusted-section {
  padding-top: 0;
  padding-bottom: var(--section-spacing);
  text-align: center;
}

.trusted-title {
  font-size: var(--font-size-small);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 32px;
}

.logo-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 48px;
  opacity: 0.6;
}

.logo-item {
  height: 28px;
  filter: grayscale(100%) contrast(150%);
  opacity: 0.7;
  transition: opacity var(--transition-fast);
}

.logo-item:hover {
  opacity: 1;
}

/* Interactive Workflow Simulation */
.workflow-diagram {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

.workflow-canvas {
  width: 100%;
  min-height: 280px;
}

.workflow-node {
  padding: 16px 20px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  position: absolute;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  font-size: var(--font-size-small);
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
  transition: border-color var(--transition-medium), background-color var(--transition-medium);
}

.workflow-node.active {
  border-color: var(--accent);
  background-color: var(--accent-light);
}

.workflow-node svg {
  color: var(--accent);
}

.node-trigger { top: 15%; left: 8%; }
.node-agent { top: 40%; left: 42%; }
.node-crm { top: 15%; right: 8%; }
.node-comms { top: 65%; right: 8%; }
.node-dashboard { top: 65%; left: 8%; }

.workflow-path {
  fill: none;
  stroke: var(--border);
  stroke-width: 2;
  stroke-dasharray: 6 4;
  transition: stroke var(--transition-medium);
}

.workflow-path.active {
  stroke: var(--accent);
  stroke-dashoffset: -20;
  animation: dash 1s linear infinite;
}

@keyframes dash {
  to {
    stroke-dashoffset: -40;
  }
}

/* ROI Savings Calculator */
.calculator-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: grid;
  grid-template-columns: 1fr;
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

@media (min-width: 900px) {
  .calculator-card {
    grid-template-columns: 1fr 1fr;
  }
}

.calc-inputs {
  padding: 40px;
  border-bottom: 1px solid var(--border);
}

@media (min-width: 900px) {
  .calc-inputs {
    border-bottom: none;
    border-right: 1px solid var(--border);
  }
}

.calc-outputs {
  padding: 40px;
  background-color: rgba(248, 246, 241, 0.5);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.slider-group {
  margin-bottom: 32px;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  font-size: var(--font-size-small);
  font-weight: 600;
  margin-bottom: 12px;
}

.slider-val {
  color: var(--accent);
}

.slider-input {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  outline: none;
  -webkit-appearance: none;
}

.slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--surface);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.slider-input::-webkit-slider-thumb:hover {
  background: var(--accent-hover);
  transform: scale(1.1);
}

.metric-display {
  margin-bottom: 32px;
}

.metric-label {
  font-size: var(--font-size-small);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 8px;
}

.metric-value {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.metric-value-accent {
  color: var(--accent);
}

/* Tabs System */
.tab-container {
  margin-bottom: 40px;
}

.tab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
}

.tab-btn {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-small);
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab-btn:hover {
  color: var(--text-primary);
  background-color: rgba(0,0,0,0.02);
}

.tab-btn.active {
  color: var(--accent);
  background-color: var(--accent-light);
  font-weight: 600;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeIn var(--transition-medium);
}

/* FAQ Accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.faq-item {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.faq-question {
  padding: 24px;
  font-weight: 600;
  font-size: 1.125rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.faq-question::after {
  content: '+';
  font-size: 1.5rem;
  color: var(--text-secondary);
  transition: transform var(--transition-fast);
}

.faq-item.open .faq-question::after {
  transform: rotate(45deg);
  color: var(--accent);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-medium), padding var(--transition-medium);
  padding: 0 24px;
  color: var(--text-secondary);
  font-size: var(--font-size-small);
  line-height: var(--lh-body);
}

.faq-item.open .faq-answer {
  max-height: 300px;
  padding-bottom: 24px;
}

/* Pricing Grid */
.price-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.price-card.featured {
  border-color: var(--accent);
  position: relative;
}

.price-card.featured::before {
  content: 'RECOMMENDED';
  position: absolute;
  top: -12px;
  left: 32px;
  background-color: var(--accent);
  color: var(--surface);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 100px;
  letter-spacing: 0.05em;
}

.price-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 24px;
  margin-bottom: 24px;
}

.price-cost {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 16px;
  margin-bottom: 8px;
}

.price-period {
  font-size: var(--font-size-small);
  color: var(--text-secondary);
  font-weight: 400;
}

.price-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 32px;
}

.price-feature-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--font-size-small);
}

.price-feature-item svg {
  color: var(--green);
  flex-shrink: 0;
}

/* Case Study Before/After Pipeline */
.pipeline-comparison {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  margin-top: 40px;
}

@media (min-width: 768px) {
  .pipeline-comparison {
    grid-template-columns: 1fr 1fr;
  }
}

.pipeline-side {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  background-color: var(--surface);
}

.pipeline-side.before {
  border-left: 4px solid var(--red);
}

.pipeline-side.after {
  border-left: 4px solid var(--green);
  background-color: #FAFCFA;
}

.pipeline-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}

.pipeline-step {
  padding: 16px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--font-size-small);
  position: relative;
}

.pipeline-side.after .pipeline-step {
  background-color: #FFFFFF;
}

.pipeline-step::after {
  content: '↓';
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-secondary);
  font-weight: bold;
}

.pipeline-step:last-child::after {
  display: none;
}

/* Footer */
.footer {
  background-color: var(--surface);
  border-top: 1px solid var(--border);
  padding-top: 80px;
  padding-bottom: 40px;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 48px;
  margin-bottom: 60px;
}

@media (max-width: 768px) {
  .footer-top {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

.footer-col-title {
  font-size: var(--font-size-small);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-bottom: 24px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-link {
  font-size: var(--font-size-small);
  color: var(--text-secondary);
}

.footer-link:hover {
  color: var(--text-primary);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: var(--font-size-small);
  color: var(--text-secondary);
}

/* Newsletter Input Form */
.newsletter-form {
  display: flex;
  gap: 8px;
}

.newsletter-form .form-control {
  padding: 10px 14px;
}

/* ==========================================================================
   7. Animation Keyframes & Classes
   ========================================================================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.animate-fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.delay-100 { transition-delay: 100ms; }
.delay-200 { transition-delay: 200ms; }
.delay-300 { transition-delay: 300ms; }
