/* ============================================================
   Scale Gram CRM — Marketing website
   Design tokens are mirrored from the app (client/src/index.css)
   so the site and product stay visually consistent.
   To rebrand: change --accent + swap assets/img/icon.png.
   ============================================================ */

/* Fonts are loaded via <link rel="preconnect"> + <link rel="stylesheet"> in each page's
   <head> — faster (non-render-blocking-chained) than a CSS @import. */

/* ---------- Theme tokens (mirrors the app) ---------- */
:root,
[data-theme="light"] {
  --bg-primary: #F8F9FB;
  --bg-secondary: #F1F5F9;
  --bg-card: #FFFFFF;
  --bg-hover: #F8FAFC;
  --text-primary: #0F172A;
  --text-secondary: #64748B;
  --text-tertiary: #94A3B8;
  --border: #E2E8F0;
  --border-light: #F1F5F9;
  --accent: #6C5CE7;
  --accent-hover: #5A4BD5;
  --accent-light: #F0EDFF;
  --accent-text: #FFFFFF;
  --success: #10B981;
  --success-light: #D1FAE5;
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  --info: #3B82F6;
  --info-light: #DBEAFE;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
  --shadow-xl: 0 24px 50px -12px rgba(108,92,231,0.18);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --hero-glow: radial-gradient(60% 60% at 50% 0%, rgba(108,92,231,0.12), transparent 70%);
}

[data-theme="dark"] {
  --bg-primary: #0F1117;
  --bg-secondary: #161822;
  --bg-card: #1A1D27;
  --bg-hover: #1E2130;
  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-tertiary: #64748B;
  --border: #2A2D3A;
  --border-light: #1E2130;
  --accent: #8B7CF8;
  --accent-hover: #6C5CE7;
  --accent-light: rgba(108,92,231,0.15);
  --accent-text: #FFFFFF;
  --success: #34D399;
  --success-light: rgba(16,185,129,0.15);
  --warning: #FBBF24;
  --warning-light: rgba(245,158,11,0.15);
  --info: #60A5FA;
  --info-light: rgba(59,130,246,0.15);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.4);
  --shadow-xl: 0 24px 60px -12px rgba(0,0,0,0.65);
  --hero-glow: radial-gradient(60% 60% at 50% 0%, rgba(139,124,248,0.18), transparent 70%);
}

/* ---------- Resets ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color .3s ease, color .3s ease;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: 'Outfit', 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

section { position: relative; }

.section-pad { padding: 96px 0; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-light);
  padding: 6px 14px;
  border-radius: 999px;
}

.section-head { max-width: 680px; margin: 0 auto 56px; text-align: center; }
.section-head h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 18px 0 14px; }
.section-head p { color: var(--text-secondary); font-size: 1.08rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 600;
  font-size: .95rem;
  padding: 12px 22px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); color: var(--accent-text); box-shadow: var(--shadow-md); }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-secondary { background: var(--bg-card); color: var(--text-primary); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-hover); }
.btn-lg { padding: 15px 30px; font-size: 1.02rem; }
.btn-block { width: 100%; }

/* ---------- Header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg-primary) 80%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, background .3s ease;
}
.header.scrolled { border-bottom-color: var(--border); }
.nav { display: flex; align-items: center; justify-content: flex-start; height: 70px; gap: 24px; }

.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; font-size: 1.12rem; font-family: 'Outfit', sans-serif; letter-spacing: -0.01em; }
.brand img { width: 38px; height: 38px; border-radius: 9px; }

.nav-links { display: flex; align-items: center; gap: 4px; margin-left: 36px; }
.nav-links a {
  padding: 8px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: .92rem;
  transition: color .15s ease, background .15s ease;
}
.nav-links a:hover { color: var(--text-primary); background: var(--bg-hover); }

.nav-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .15s ease;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.icon-btn svg { width: 19px; height: 19px; }

/* language switcher */
.lang { position: relative; }
.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  min-width: 148px;
  display: none;
  z-index: 60;
}
.lang.open .lang-menu { display: block; animation: fadeUp .15s ease; }
.lang-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: .9rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
}
.lang-menu button:hover { background: var(--bg-hover); }
.lang-menu button.active { color: var(--accent); font-weight: 600; }

/* Real SVG flags (emoji flags fail to render on Windows) */
.flag {
  display: inline-block;
  width: 22px;
  height: 15px;
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
  vertical-align: middle;
  box-shadow: 0 0 0 1px rgba(0,0,0,.12);
}
.flag svg { display: block; width: 100%; height: 100%; }
#langFlag { width: 24px; height: 16px; }
.btn .flag { width: 24px; height: 17px; }
.lang-menu button .flag { width: 22px; height: 15px; }
.icon-btn .chev { width: 14px; height: 14px; opacity: .6; }

/* mobile menu */
.menu-toggle { display: none; }
.mobile-nav { display: none; }

/* ---------- Hero ---------- */
.hero { padding: 80px 0 64px; text-align: center; position: relative; }
.hero::before {
  content: '';
  position: absolute;
  inset: -120px 0 auto 0;
  height: 620px;
  background: var(--hero-glow);
  pointer-events: none;
  z-index: 0;
}
.hero .container { position: relative; z-index: 1; }
.hero h1 {
  font-size: clamp(2.3rem, 6vw, 4.1rem);
  max-width: 920px;
  margin: 22px auto 20px;
}
.hero h1 .grad {
  background: linear-gradient(120deg, var(--accent), #A855F7 60%, #22D3EE);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero .sub { font-size: clamp(1.02rem, 2.2vw, 1.28rem); color: var(--text-secondary); max-width: 660px; margin: 0 auto 34px; }
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-note { margin-top: 18px; font-size: .88rem; color: var(--text-tertiary); display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }
.hero-note span { display: inline-flex; align-items: center; gap: 6px; }
.hero-note svg { width: 16px; height: 16px; color: var(--success); }

/* app preview window */
.preview {
  margin: 60px auto 0;
  max-width: 1040px;
  border-radius: var(--radius-2xl);
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  position: relative;
  z-index: 1;
}
.preview-bar { display: flex; align-items: center; gap: 8px; padding: 13px 16px; border-bottom: 1px solid var(--border); background: var(--bg-secondary); }
.preview-bar .dot { width: 11px; height: 11px; border-radius: 50%; }
.preview-bar .dot:nth-child(1) { background: #FF5F57; }
.preview-bar .dot:nth-child(2) { background: #FEBC2E; }
.preview-bar .dot:nth-child(3) { background: #28C840; }
.preview-bar .url { margin-left: 14px; font-size: .8rem; color: var(--text-tertiary); background: var(--bg-card); border: 1px solid var(--border); padding: 4px 14px; border-radius: 999px; }

.preview-body { display: grid; grid-template-columns: 210px 1fr; min-height: 440px; }
.mini-side { border-right: 1px solid var(--border); padding: 18px 14px; background: var(--bg-card); }
.mini-side .ms-brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: .92rem; margin-bottom: 22px; }
.mini-side .ms-brand img { width: 28px; height: 28px; border-radius: 7px; }
.mini-item { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: var(--radius-md); font-size: .82rem; color: var(--text-secondary); margin-bottom: 3px; }
.mini-item.active { background: var(--accent); color: #fff; font-weight: 600; }
.mini-item .ic { width: 15px; height: 15px; flex-shrink: 0; }
.mini-main { padding: 22px; background: var(--bg-primary); }
.mini-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.mini-kpi { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px; }
.mini-kpi .k-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-tertiary); margin-bottom: 7px; }
.mini-kpi .k-value { font-size: 1.5rem; font-weight: 800; font-family: 'Outfit', sans-serif; }
.mini-kpi .k-trend { font-size: .72rem; color: var(--success); font-weight: 600; }
.mini-chart { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; height: 190px; display: flex; flex-direction: column; }
.mini-chart .c-title { font-size: .82rem; font-weight: 600; margin-bottom: 4px; }
.mini-chart .c-sub { font-size: .72rem; color: var(--text-tertiary); margin-bottom: 14px; }
.bars { display: flex; align-items: flex-end; gap: 9px; flex: 1; }
.bars .bar { flex: 1; border-radius: 6px 6px 0 0; background: linear-gradient(var(--accent), var(--accent-light)); opacity: .85; }

/* ---------- Logos / stats strip ---------- */
.stats-strip { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--bg-card); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; padding: 40px 0; text-align: center; }
.stat .num { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; font-family: 'Outfit', sans-serif; background: linear-gradient(120deg, var(--accent), #A855F7); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.stat .lbl { font-size: .9rem; color: var(--text-secondary); margin-top: 4px; }

/* ---------- Feature grid ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 26px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  position: relative;
  overflow: hidden;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.feature-icon {
  width: 46px; height: 46px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  background: var(--accent-light);
  color: var(--accent);
  margin-bottom: 16px;
}
.feature-icon svg { width: 23px; height: 23px; }
.feature-card h3 { font-size: 1.12rem; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.feature-card p { color: var(--text-secondary); font-size: .92rem; }

.tag-soon { font-size: .64rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: var(--warning-light); color: var(--warning); }
.tag-live { font-size: .64rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: var(--success-light); color: var(--success); }

/* ---------- Split feature sections ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.split.reverse .split-visual { order: 2; }
.split-text h2 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); margin: 16px 0 16px; }
.split-text p { color: var(--text-secondary); font-size: 1.04rem; margin-bottom: 22px; }
.check-list li { display: flex; gap: 11px; align-items: flex-start; margin-bottom: 13px; font-size: .98rem; }
.check-list li svg { width: 21px; height: 21px; color: var(--accent); flex-shrink: 0; margin-top: 1px; }
.check-list li b { font-weight: 700; }

.split-visual { position: relative; }
.visual-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  padding: 22px;
  overflow: hidden;
}

/* chat mock */
.chat-head { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.chat-av { width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), #22D3EE); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; }
.chat-head .ch-name { font-weight: 700; font-size: .95rem; }
.chat-head .ch-status { font-size: .76rem; color: var(--success); display: flex; align-items: center; gap: 5px; }
.chat-head .ch-status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.bubble { max-width: 78%; padding: 10px 14px; border-radius: 16px; font-size: .88rem; margin-bottom: 10px; line-height: 1.45; }
.bubble.in { background: var(--bg-secondary); border-bottom-left-radius: 5px; }
.bubble.out { background: var(--accent); color: #fff; border-bottom-right-radius: 5px; margin-left: auto; }
.bubble .time { display: block; font-size: .66rem; opacity: .7; margin-top: 4px; }
.chat-tags { display: flex; gap: 7px; margin-top: 14px; flex-wrap: wrap; }
.chip { font-size: .72rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.chip.v { background: var(--success-light); color: var(--success); }
.chip.w { background: var(--warning-light); color: var(--warning); }
.chip.i { background: var(--info-light); color: var(--info); }

/* pipeline mock */
.pipe { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pipe-col { background: var(--bg-secondary); border-radius: var(--radius-lg); padding: 12px; }
.pipe-col .pc-title { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 11px; display: flex; justify-content: space-between; }
.pipe-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 11px; margin-bottom: 8px; box-shadow: var(--shadow-sm); }
.pipe-card .name { font-size: .82rem; font-weight: 600; }
.pipe-card .meta { font-size: .7rem; color: var(--text-tertiary); margin-top: 3px; }
.dot-status { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }

/* ---------- Pricing ---------- */
.pricing-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; max-width: 880px; margin: 0 auto; }
.price-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: 34px 30px;
  position: relative;
  display: flex;
  flex-direction: column;
}
.price-card.featured { border-color: var(--accent); box-shadow: var(--shadow-xl); }
.price-card.featured::before {
  content: attr(data-badge);
  position: absolute;
  top: -13px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff;
  font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 5px 16px; border-radius: 999px;
}
.price-name { font-size: 1.3rem; font-weight: 700; font-family: 'Outfit', sans-serif; }
.price-desc { color: var(--text-secondary); font-size: .92rem; margin: 6px 0 22px; min-height: 42px; }
.price-amount { display: flex; align-items: baseline; gap: 6px; margin-bottom: 4px; }
.price-amount .amt { font-size: 3rem; font-weight: 800; font-family: 'Outfit', sans-serif; }
.price-amount .per { color: var(--text-secondary); font-size: .95rem; }
.price-sub { font-size: .84rem; color: var(--text-tertiary); margin-bottom: 24px; }
.price-card .btn { width: 100%; margin-bottom: 24px; }
.price-feats li { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; margin-bottom: 12px; }
.price-feats li svg { width: 19px; height: 19px; color: var(--accent); flex-shrink: 0; margin-top: 1px; }
.price-feats li.muted { color: var(--text-tertiary); }
.price-feats li.muted svg { color: var(--text-tertiary); }
.pricing-note { text-align: center; margin-top: 32px; color: var(--text-tertiary); font-size: .9rem; }

/* ---------- FAQ ---------- */
.faq-wrap { max-width: 760px; margin: 0 auto; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: 12px; background: var(--bg-card); overflow: hidden; }
.faq-q { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; background: transparent; border: none; font-family: inherit; font-size: 1rem; font-weight: 600; color: var(--text-primary); cursor: pointer; text-align: left; }
.faq-q svg { width: 20px; height: 20px; color: var(--accent); flex-shrink: 0; transition: transform .25s ease; }
.faq-item.open .faq-q svg { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.faq-a-inner { padding: 0 22px 20px; color: var(--text-secondary); font-size: .96rem; }

/* ---------- CTA banner ---------- */
.cta-banner { text-align: center; }
.cta-box {
  background: linear-gradient(135deg, var(--accent), #7C3AED 55%, #6D28D9);
  border-radius: var(--radius-2xl);
  padding: 64px 32px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}
.cta-box::after { content: ''; position: absolute; inset: 0; background: radial-gradient(70% 120% at 50% 0%, rgba(255,255,255,.18), transparent 60%); }
.cta-box * { position: relative; z-index: 1; }
.cta-box h2 { color: #fff; font-size: clamp(1.8rem, 4vw, 2.8rem); margin-bottom: 14px; }
.cta-box p { color: rgba(255,255,255,.85); font-size: 1.12rem; max-width: 520px; margin: 0 auto 28px; }
.cta-box .btn-primary { background: #fff; color: var(--accent); }
.cta-box .btn-primary:hover { background: #fff; color: var(--accent-hover); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 56px 0 32px; background: var(--bg-card); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 40px; }
.footer-brand p { color: var(--text-secondary); font-size: .92rem; margin: 14px 0 18px; max-width: 280px; }
.footer-col h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-tertiary); margin-bottom: 16px; font-family: 'Plus Jakarta Sans', sans-serif; }
.footer-col a { display: block; color: var(--text-secondary); font-size: .92rem; padding: 5px 0; transition: color .15s ease; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 26px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.footer-bottom p { color: var(--text-tertiary); font-size: .86rem; }
.footer-langs { display: flex; gap: 12px; align-items: center; }
.footer-langs button { background: none; border: none; cursor: pointer; padding: 0; line-height: 0; opacity: .5; transition: opacity .15s ease; }
.footer-langs button:hover, .footer-langs button.active { opacity: 1; }
.footer-langs .flag { width: 26px; height: 18px; }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Responsive ---------- */

/* Tablet / small laptop */
@media (max-width: 940px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; gap: 36px; }
  .split.reverse .split-visual { order: 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .preview-body { grid-template-columns: 1fr; }
  .mini-side { display: none; }
}

/* Collapse the top nav into a hamburger before the links crowd the actions */
@media (max-width: 860px) {
  .nav { gap: 12px; }
  .nav-links { display: none; }
  .nav-actions .btn-secondary { display: none; } /* "Log in" lives in the menu */
  .menu-toggle { display: inline-flex; }

  .mobile-nav {
    display: none;
    position: fixed;
    inset: 70px 0 0 0;
    background: var(--bg-primary);
    z-index: 99;
    padding: 22px;
    flex-direction: column;
    gap: 6px;
    border-top: 1px solid var(--border);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .mobile-nav.open { display: flex; }
  .mobile-nav a { padding: 14px 16px; border-radius: var(--radius-md); font-weight: 600; font-size: 1.05rem; color: var(--text-primary); }
  .mobile-nav a:hover { background: var(--bg-hover); }
  .mobile-nav .btn { width: 100%; justify-content: center; }
  .mobile-nav .btn-secondary { margin-top: 14px; }
}

/* Phones */
@media (max-width: 680px) {
  .section-pad { padding: 56px 0; }
  .container { padding: 0 18px; }

  .hero { padding: 44px 0 48px; }
  .hero .sub { font-size: 1.02rem; }
  .hero-note { gap: 10px 16px; }

  .preview { margin-top: 36px; border-radius: var(--radius-xl); }
  .mini-main { padding: 16px; }
  .mini-kpis { grid-template-columns: 1fr; gap: 10px; }
  .mini-chart { height: 170px; }

  .section-head { margin-bottom: 40px; }
  .feature-grid { grid-template-columns: 1fr; }
  .feature-card { padding: 22px; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 28px 16px; padding: 32px 0; }

  .visual-card { padding: 16px; }
  .pipe { gap: 8px; }
  .pipe-col { padding: 9px; }
  .pipe-card { padding: 9px 10px; }

  .pricing-grid { grid-template-columns: 1fr; gap: 34px; }
  .price-card { padding: 28px 22px; }
  .price-card.featured { margin-top: 6px; } /* room for the "Pro" badge */
  .price-amount .amt { font-size: 2.6rem; }

  .faq-q { padding: 16px 18px; font-size: .95rem; }
  .faq-a-inner { padding: 0 18px 18px; }

  .cta-box { padding: 48px 22px; }

  .footer-grid { grid-template-columns: 1fr 1fr; gap: 26px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 14px; }
}

/* Small phones */
@media (max-width: 460px) {
  .brand { font-size: 1rem; }
  .brand img { width: 34px; height: 34px; }
  .nav-actions { gap: 6px; }
  .nav-actions .btn-primary { display: none; } /* CTA is in the hero + menu */

  .hero h1 { margin: 18px auto 16px; }
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { width: 100%; }
  .hero-note { flex-direction: column; align-items: center; gap: 8px; }

  .stats-grid { grid-template-columns: 1fr; gap: 22px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer-brand { grid-column: auto; }

  .eyebrow { font-size: .72rem; }
}
