/* ClientServed — Design tokens */
:root {
  /* Base */
  --bg: #FBF7F2;
  --bg-2: #F5EFE6;
  --bg-card: #FFFFFF;
  --ink: #0F0F0E;
  --ink-2: #2A2A27;
  --muted: #6B665C;
  --muted-2: #9A9488;
  --line: rgba(15,15,14,0.08);
  --line-2: rgba(15,15,14,0.12);

  /* Accents */
  --accent: #D9552B;
  --accent-2: #B83E17;
  --accent-soft: #FCE7D9;
  --gold: #B8882E;
  --gold-soft: #F4EAD1;
  --green: #2E7D5B;
  --green-soft: #D9ECE1;
  --blue: #25507A;
  --violet: #5A4BC7;

  /* Type */
  --font-sans: 'Inter Tight', 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Radii */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-2xl: 28px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(15,15,14,0.04), 0 1px 1px rgba(15,15,14,0.03);
  --shadow-md: 0 4px 12px rgba(15,15,14,0.05), 0 2px 4px rgba(15,15,14,0.04);
  --shadow-lg: 0 24px 56px -18px rgba(15,15,14,0.18), 0 8px 20px -10px rgba(15,15,14,0.08);
  --shadow-glow: 0 0 0 1px rgba(217,85,43,0.18), 0 18px 50px -18px rgba(217,85,43,0.45);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; max-width: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; }

img { display: block; max-width: 100%; }

/* Ambient background texture */
.ambient {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(1000px 600px at 85% -10%, rgba(217,85,43,0.08), transparent 60%),
    radial-gradient(800px 500px at 0% 20%, rgba(184,136,46,0.05), transparent 60%);
}

.noise {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.06 0 0 0 0 0.06 0 0 0 0 0.05 0 0 0 0.08 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* Layout */
.container { max-width: 1240px; margin: 0 auto; padding: 0 28px; position: relative; z-index: 2; }
.container-wide { max-width: 1360px; margin: 0 auto; padding: 0 28px; position: relative; z-index: 2; }

/* Type */
h1, h2, h3, h4 { font-family: var(--font-sans); font-weight: 500; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: clamp(44px, 6.2vw, 88px); line-height: 0.98; letter-spacing: -0.035em; font-weight: 500; }
h2 { font-size: clamp(34px, 4.2vw, 56px); line-height: 1.02; letter-spacing: -0.028em; }
h3 { font-size: clamp(20px, 1.6vw, 24px); line-height: 1.15; letter-spacing: -0.02em; font-weight: 500; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--muted); font-weight: 500;
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(217,85,43,0.15); }
.eyebrow .dot.live { animation: pulse 1.6s ease-in-out infinite; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(217,85,43,0.15); }
  50% { box-shadow: 0 0 0 6px rgba(217,85,43,0.05); }
}

.lede { font-size: clamp(15px, 2vw, 19px); line-height: 1.55; color: var(--muted); max-width: 560px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px; border-radius: 999px;
  font-size: 14.5px; font-weight: 500; letter-spacing: -0.01em;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease, color .18s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--ink); color: #FBF7F2;
  box-shadow: 0 6px 16px -8px rgba(15,15,14,0.4), inset 0 1px 0 rgba(255,255,255,0.12);
}
.btn-primary:hover { background: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow-glow); }
.btn-ghost { color: var(--ink); }
.btn-ghost:hover { background: rgba(15,15,14,0.05); }
.btn-outline {
  border: 1px solid var(--line-2); color: var(--ink); background: rgba(255,255,255,0.6); backdrop-filter: blur(6px);
}
.btn-outline:hover { border-color: var(--ink); background: #fff; }
.btn-sm { padding: 8px 14px; font-size: 13px; }

.arrow-right { transition: transform .2s ease; }
.btn:hover .arrow-right { transform: translateX(3px); }

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
}

/* Section */
section { position: relative; z-index: 2; }
.section-pad { padding: 120px 0; }
.section-pad-sm { padding: 80px 0; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* Dividers */
.hairline { height: 1px; background: var(--line); width: 100%; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(15,15,14,0.15); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(15,15,14,0.3); }

/* Utility */
.row { display: flex; }
.col { display: flex; flex-direction: column; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.gap-32 { gap: 32px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }

/* Chip */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 500;
  background: var(--bg-2); color: var(--ink-2); border: 1px solid var(--line);
}
.chip-accent { background: var(--accent-soft); color: var(--accent-2); border-color: rgba(217,85,43,0.2); }
.chip-green { background: var(--green-soft); color: var(--green); border-color: rgba(46,125,91,0.2); }

/* Marquee */
.marquee { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { display: flex; gap: 64px; animation: marquee 40s linear infinite; width: max-content; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Dot grid bg for select sections */
.dots-bg {
  background-image: radial-gradient(rgba(15,15,14,0.08) 1px, transparent 1px);
  background-size: 18px 18px;
}

/* Chat bubble typing dots */
@keyframes bounce-dot {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-4px); opacity: 1; }
}

/* Gradient pill */
.gradient-ring {
  background: conic-gradient(from 90deg, var(--accent), var(--gold), var(--accent));
  padding: 1.5px; border-radius: 999px;
}

/* Focus */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ==========================================================================
   Responsive layout classes
   --------------------------------------------------------------------------
   Layout-affecting properties live here (not in inline JSX styles) so
   media queries can override them — inline styles win specificity.
   Breakpoints: mobile ≤640px, tablet ≤1024px, plus a Nav-only ≤820px.
   ========================================================================== */

/* Hero */
.cs-hero-section { padding: 140px 0 60px; }
.cs-hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.cs-hero-demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cs-hero-stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: 72px; padding: 22px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cs-hero-stats-grid .cs-hero-stat + .cs-hero-stat { border-left: 1px solid var(--line); }

/* Story / HowItWorks */
.cs-story-intro-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 64px; align-items: start; }
.cs-story-step-grid { display: grid; grid-template-columns: 80px 1fr 1.1fr; gap: 32px; padding: 28px 0; align-items: center; }
.cs-story-step-num { font-size: clamp(30px, 6vw, 44px); }

/* Features */
.cs-features-pair-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.cs-feature-website-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 48px; align-items: center; }
.cs-crm-table-wrap { width: 100%; }
.cs-crm-table { display: grid; grid-template-columns: 1.2fr 0.7fr 0.8fr 0.9fr; }

/* Compare + Testimonials */
.cs-compare-intro { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: end; }
.cs-compare-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr; }
.cs-testimonials-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* Pricing */
.cs-pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: stretch; }

/* FinalCTA padding */
.cs-finalcta { padding: 80px 56px; }

/* Decorative blobs — large radial-gradient halos that have no purpose on mobile
   (paint cost + potential horizontal-overflow with negative offsets). */
.cs-blob { /* class hook only; visuals stay inline */ }

/* Tablet (≤ 1024px) */
@media (max-width: 1024px) {
  .cs-hero-grid              { grid-template-columns: 1fr; gap: 36px; }
  .cs-hero-demo-grid         { grid-template-columns: 1fr; }
  .cs-hero-stats-grid        { grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 48px; }
  .cs-story-intro-grid       { grid-template-columns: 1fr; gap: 36px; }
  .cs-story-step-grid        { grid-template-columns: 80px 1fr; gap: 24px; }
  .cs-story-step-grid > .cs-story-step-visual { grid-column: 1 / -1; margin-top: 12px; }
  .cs-features-pair-grid     { grid-template-columns: 1fr; gap: 16px; }
  .cs-feature-website-grid   { grid-template-columns: 1fr; gap: 28px; }
  .cs-compare-intro          { grid-template-columns: 1fr; gap: 24px; align-items: start; }
  .cs-testimonials-grid      { grid-template-columns: repeat(2, 1fr); }
  .cs-pricing-grid           { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile (≤ 640px) */
@media (max-width: 640px) {
  /* Container + section rhythm */
  .container, .container-wide { padding: 0 18px; }
  .section-pad    { padding: 64px 0; }
  .section-pad-sm { padding: 44px 0; }

  /* Hero */
  .cs-hero-section           { padding: 80px 0 32px; }
  .cs-hero-grid              { gap: 28px; }
  .cs-hero-stats-grid        { gap: 16px; padding: 18px 0; }
  .cs-hero-stats-grid .cs-hero-stat + .cs-hero-stat { border-left: none; }
  .cs-hero-stats-grid .cs-hero-stat { padding: 0 8px !important; }

  /* Story */
  .cs-story-intro-grid       { gap: 24px; }
  .cs-story-step-grid        { grid-template-columns: 1fr; gap: 12px; padding: 18px 0; }
  .cs-story-step-grid > .cs-story-step-num { font-size: clamp(28px, 9vw, 40px); }
  .cs-story-step-graph       { display: none; }

  /* Features */
  .cs-feature-website-grid   { gap: 20px; }
  /* Horizontal-scroll wrapper for the dense CRM table — preserves all columns
     rather than silently hiding info. */
  .cs-crm-table-wrap         { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .cs-crm-table              { min-width: 560px; }

  /* Compare table — restructure each row so the metric label stacks above
     the two value cells (which themselves stay side-by-side). */
  .cs-compare-row            { grid-template-columns: 1fr 1fr; grid-template-areas: "label label" "left right"; row-gap: 6px; }
  .cs-compare-row > .cs-compare-label { grid-area: label; }
  .cs-compare-row > .cs-compare-left  { grid-area: left;  }
  .cs-compare-row > .cs-compare-right { grid-area: right; }

  /* Testimonials + Pricing */
  .cs-testimonials-grid      { grid-template-columns: 1fr; }
  .cs-pricing-grid           { grid-template-columns: 1fr; }

  /* FinalCTA */
  .cs-finalcta               { padding: 48px 22px; }

  /* Decorative + dev-only — hide on phones for paint budget and overflow safety */
  .cs-blob                   { display: none; }
  .noise                     { display: none; }
  .cs-tweaks-panel           { display: none; }

  /* Touch targets — bump button height to ≥44px (Apple/Google guideline) */
  .btn      { padding: 12px 18px; font-size: 14px; }
  .btn-sm   { padding: 12px 16px; font-size: 14px; }

  /* Marquee gap shrink */
  .marquee-track { gap: 32px; }
}

/* Tweaks panel sizing (always; the display:none above only kicks in on mobile) */
.cs-tweaks-panel { width: min(280px, 90vw); }

/* Hover-only affordances — phones don't get sticky hover state after tap */
@media (hover: hover) {
  .btn-primary:hover { background: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow-glow); }
  .btn-ghost:hover   { background: rgba(15,15,14,0.05); }
  .btn-outline:hover { border-color: var(--ink); background: #fff; }
}
@media (hover: none) {
  /* Override the unconditional :hover rules in the existing CSS so they don't
     stick on touch. Same selectors, neutral values. */
  .btn-primary:hover { background: var(--ink); transform: none; box-shadow: 0 6px 16px -8px rgba(15,15,14,0.4), inset 0 1px 0 rgba(255,255,255,0.12); }
  .btn-ghost:hover   { background: transparent; }
  .btn-outline:hover { border-color: var(--line-2); background: rgba(255,255,255,0.6); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .marquee-track { animation: none; }
  .eyebrow .dot.live { animation: none; }
}
