/* ============================================================
   ChurnShield — Landing-page specific sections
   Hero, problem, how-it-works, features, pricing, FAQ, CTA.
   Loaded on index.njk (and pages that reuse the same patterns).
   Depends on tokens.css, base.css, components.css.
   ============================================================ */

/* ── Marketing display headings ───────────────────── */
/* On marketing pages, section titles take the editorial serif
   while body copy stays sans for legibility. Scoped to landing
   contexts so app pages keep their sans-serif headings. */
.section-header h2,
.cta-band h2,
.audit-block h2,
.problem-panel h3 {
  font-family: var(--font-serif);
  font-weight: var(--weight-medium);
  letter-spacing: -0.015em;
  line-height: 1.1;
  text-wrap: pretty;
}

/* ── Hero ──────────────────────────────────────────── */
.hero {
  position: relative;
  padding: clamp(var(--space-10), 6vw, var(--space-16)) 0 clamp(var(--space-12), 8vw, var(--space-20));
}

.hero-grid {
  display: grid;
  gap: var(--space-12);
  align-items: center;
  grid-template-columns: 1fr;
}
@media (min-width: 1000px) {
  .hero-grid { grid-template-columns: 1.1fr 1fr; gap: var(--space-16); }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  background: var(--color-accent-soft);
  border: 1px solid var(--color-accent-ring);
  border-radius: var(--radius-full);
  color: var(--color-accent);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wider);
  margin-bottom: var(--space-6);
}
.hero-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.hero-headline {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 5.5vw, 4.2rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
  font-weight: var(--weight-medium);
  color: var(--fg);
  margin-bottom: var(--space-6);
  text-wrap: pretty;
}
.hero-headline .accent {
  color: var(--accent);
  font-style: italic;
  font-weight: var(--weight-semibold);
}

.hero-sub {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  line-height: var(--leading-lg);
  max-width: 60ch;
  margin-bottom: var(--space-8);
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.hero-guarantee {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.hero-guarantee svg { color: var(--color-accent); }

/* Hero preview panel — the chart card on the right */
.hero-preview {
  position: relative;
  padding: var(--space-6);
  background:
    linear-gradient(180deg, var(--color-surface-2), var(--color-surface-1));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}
.hero-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}
.hero-preview-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
}
.hero-preview-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-top: var(--space-4);
}
.hero-preview-stat {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-surface-3);
  border: 1px solid var(--color-border-subtle);
}
.hero-preview-stat-label {
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-1);
}
.hero-preview-stat-value {
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  letter-spacing: -0.02em;
}
.hero-preview-stat-value.accent { color: var(--color-accent); }

.hero-chart {
  width: 100%;
  height: 200px;
}

/* ── Social proof row ──────────────────────────────── */
.social-proof {
  padding: var(--space-8) 0 var(--space-12);
  border-bottom: 1px solid var(--color-border-subtle);
}
.social-proof-label {
  text-align: center;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
}

/* ── Demo video ────────────────────────────────────── */
.demo-frame {
  position: relative;
  max-width: 960px;
  margin: 0 auto;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-surface-1);
  box-shadow: var(--shadow-xl);
}
.demo-frame video { display: block; width: 100%; height: auto; }

/* ── Problem panel ─────────────────────────────────── */
.problem-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  align-items: center;
  padding: var(--space-12);
  background: radial-gradient(ellipse at top, rgba(229, 85, 108, 0.08), transparent 60%), var(--surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-xl);
}
@media (min-width: 900px) {
  .problem-panel {
    grid-template-columns: 1.2fr 1fr;
    padding: var(--space-16);
  }
}
.problem-stat {
  text-align: center;
  padding: var(--space-8);
  background: var(--color-surface-3);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-subtle);
}
.problem-stat-value {
  font-size: var(--text-6xl);
  font-weight: var(--weight-bold);
  letter-spacing: -0.035em;
  line-height: 1;
  background: linear-gradient(180deg, var(--danger-500), #A33D52);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: var(--space-3);
}
.problem-stat-label {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* ── How-it-works steps ────────────────────────────── */
.how-grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.how-step {
  position: relative;
  padding: var(--space-8);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  transition: transform var(--duration-base) var(--ease-out),
              border-color var(--duration-base) var(--ease-out);
}
.how-step:hover {
  transform: translateY(-3px);
  border-color: var(--color-border);
}
.how-step-num {
  position: absolute;
  top: var(--space-5);
  right: var(--space-5);
  font-size: var(--text-5xl);
  line-height: 1;
  font-weight: var(--weight-bold);
  color: var(--color-surface-3);
}
.how-step h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
  position: relative;
  padding-right: var(--space-10);
}
.how-step p {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
}

/* ── Features grid ─────────────────────────────────── */
.features-grid {
  display: grid;
  gap: var(--space-6);
  /* 8 features: 4 columns × 2 rows on desktop, 2 cols on tablet, 1 on mobile.
     Avoids the orphaned-pair "3-3-2" look that auto-fit produces. */
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 1024px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .features-grid { grid-template-columns: 1fr; }
}
.feature {
  padding: var(--space-8);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  transition: transform var(--duration-base) var(--ease-out),
              border-color var(--duration-base) var(--ease-out);
}
.feature:hover {
  transform: translateY(-3px);
  border-color: var(--color-border);
}
.feature h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
}
.feature p {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-sm);
}

/* ── Free audit CTA block ──────────────────────────── */
.audit-block {
  display: grid;
  gap: var(--space-8);
  align-items: center;
  padding: var(--space-12);
  background:
    linear-gradient(140deg, var(--color-accent-soft) 0%, transparent 55%),
    var(--color-surface-2);
  border: 1px solid var(--color-accent-ring);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-glow);
}
@media (min-width: 900px) {
  .audit-block { grid-template-columns: 1.2fr 1fr; padding: var(--space-16); }
}
.audit-trust {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-6);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.audit-trust > span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.audit-trust svg { width: 16px; height: 16px; color: var(--color-accent); }

/* ── Pricing ───────────────────────────────────────── */
.pricing-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-full);
  padding: 4px;
  margin: 0 auto var(--space-4);
  position: relative;
}
.pricing-toggle button {
  min-height: 44px;          /* WCAG 2.5.5 touch target */
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-muted);
  background: transparent;
  transition: background var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out);
}
.pricing-toggle button.is-active {
  background: var(--accent);
  color: var(--fg-on-accent);
}
.pricing-save-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  background: var(--color-accent-soft);
  color: var(--color-accent);
  border-radius: var(--radius-full);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-base) var(--ease-out);
}
.pricing-save-badge.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.pricing-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  align-items: stretch;
}
.pricing-card {
  display: flex;
  flex-direction: column;
  padding: var(--space-8);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  transition: transform var(--duration-base) var(--ease-out),
              border-color var(--duration-base) var(--ease-out);
  position: relative;
}
.pricing-card:hover {
  transform: translateY(-3px);
  border-color: var(--color-border);
}
.pricing-card--recommended {
  border-color: var(--accent);
  background:
    linear-gradient(180deg, rgba(63, 184, 114, 0.08) 0%, rgba(63, 184, 114, 0.02) 100%),
    var(--surface);
  box-shadow: var(--shadow-glow-green), var(--shadow-md);
}
.pricing-card--recommended::before {
  content: attr(data-highlight);
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--fg-on-accent);
  font-size: 11px;
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-widest);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1;
}

.pricing-card-name {
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-accent);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-2);
}
.pricing-card-tagline {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-5);
}
.pricing-price {
  font-size: var(--text-5xl);
  font-weight: var(--weight-bold);
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--color-text);
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-1);
}
.pricing-price .price-currency,
.pricing-price .price-cadence {
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
  color: var(--color-text-muted);
  letter-spacing: 0;
}
.pricing-price-custom {
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  color: var(--color-text);
}
.pricing-billed-note {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-2);
  min-height: 1em;
}
.pricing-features {
  list-style: none;
  padding: 0;
  margin: var(--space-6) 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  flex: 1;
}
.pricing-features li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text);
  line-height: var(--leading-sm);
}
.pricing-features svg {
  width: 16px;
  height: 16px;
  color: var(--color-accent);
  flex-shrink: 0;
  margin-top: 3px;
}

/* ── Final CTA band ────────────────────────────────── */
.cta-band {
  text-align: center;
  padding: var(--space-16);
  background:
    radial-gradient(ellipse at top, var(--color-accent-soft), transparent 50%),
    var(--color-surface-1);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-xl);
}
.cta-band h2 {
  font-size: clamp(var(--text-3xl), 4vw, var(--text-5xl));
  letter-spacing: -0.03em;
  margin-bottom: var(--space-4);
}
.cta-band p {
  color: var(--color-text-muted);
  font-size: var(--text-lg);
  max-width: 50ch;
  margin: 0 auto var(--space-6);
}

/* ── Scroll reveal ─────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  [data-reveal] {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity var(--duration-slow) var(--ease-out),
                transform var(--duration-slow) var(--ease-out);
  }
  [data-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
  }
}


