:root {
  --bg: #0a0f1a;
  --bg-elevated: #111827;
  --bg-card: #1a2236;
  --fg: #e8ecf4;
  --fg-muted: #8b97b0;
  --accent: #22d68a;
  --accent-dim: rgba(34, 214, 138, 0.12);
  --accent-glow: rgba(34, 214, 138, 0.25);
  --border: rgba(139, 151, 176, 0.15);
  --radius: 12px;
  --radius-sm: 8px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Inter', -apple-system, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: 'Space Grotesk', sans-serif;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

/* Hero */
.hero {
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  background: radial-gradient(ellipse at 30% 20%, var(--accent-dim) 0%, transparent 50%),
              radial-gradient(ellipse at 70% 80%, rgba(34, 100, 214, 0.06) 0%, transparent 50%),
              var(--bg);
}

.hero-inner {
  max-width: 720px;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(34, 214, 138, 0.2);
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 32px;
}

.hero h1 {
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 24px;
}

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

.hero-sub {
  font-size: 1.15rem;
  color: var(--fg-muted);
  max-width: 560px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

.hero-ctas {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 40px;
}

.btn-hero-primary {
  display: inline-flex;
  align-items: center;
  padding: 14px 28px;
  background: var(--accent);
  color: #0a0f1a;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: opacity 0.15s;
}
.btn-hero-primary:hover { opacity: 0.88; }

.btn-hero-ghost {
  display: inline-flex;
  align-items: center;
  padding: 14px 24px;
  background: transparent;
  color: var(--fg-muted);
  font-size: 0.95rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}
.btn-hero-ghost:hover { color: var(--fg); border-color: rgba(139,151,176,0.4); }

.hero-stat {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.stat-number {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--fg-muted);
  max-width: 260px;
}

/* Hero scenario quote */
.hero-scenario {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 520px;
}

.scenario-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.scenario-text {
  font-size: 1rem;
  color: var(--fg);
  font-style: italic;
  line-height: 1.5;
}

/* Problem */
.problem {
  padding: 120px 24px;
  background: var(--bg-elevated);
}

.problem-inner {
  max-width: 1080px;
  margin: 0 auto;
}

.problem h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  text-align: center;
  margin-bottom: 64px;
  line-height: 1.2;
}

.problem-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
}

.problem-card {
  padding: 32px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.problem-icon {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 16px;
  opacity: 0.7;
}

.problem-card h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.problem-card p {
  color: var(--fg-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* How */
.how {
  padding: 120px 24px;
}

.how-inner {
  max-width: 720px;
  margin: 0 auto;
}

.how h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  text-align: center;
  margin-bottom: 16px;
}

.how-sub {
  text-align: center;
  color: var(--fg-muted);
  margin-bottom: 64px;
  font-size: 1.05rem;
}

.how-steps {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.step {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.step-num {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(34, 214, 138, 0.2);
  border-radius: 50%;
}

.step-content h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.step-content p {
  color: var(--fg-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* Features */
.features {
  padding: 120px 24px;
  background: var(--bg-elevated);
}

.features-inner {
  max-width: 1080px;
  margin: 0 auto;
}

.features h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  text-align: center;
  margin-bottom: 64px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.feature-card {
  padding: 32px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s;
}

.feature-card:hover {
  border-color: rgba(34, 214, 138, 0.3);
}

.feature-highlight {
  border-color: rgba(34, 214, 138, 0.25);
  background: linear-gradient(135deg, var(--bg) 0%, rgba(34, 214, 138, 0.04) 100%);
}

.feature-card h3 {
  font-size: 1.15rem;
  margin-bottom: 12px;
}

.feature-card p {
  color: var(--fg-muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* Closing */
.closing {
  padding: 140px 24px;
  text-align: center;
  background: radial-gradient(ellipse at 50% 50%, var(--accent-dim) 0%, transparent 60%),
              var(--bg);
}

.closing-inner {
  max-width: 640px;
  margin: 0 auto;
}

.closing h2 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: 24px;
}

.closing-sub {
  color: var(--fg-muted);
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 16px;
}

.closing-sub-2 {
  font-size: 0.95rem;
  margin-bottom: 40px;
}

.closing-cta {
  margin-top: 8px;
}

/* Footer */
.site-footer {
  padding: 48px 24px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
}

.footer-brand {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.footer-tagline {
  color: var(--fg-muted);
  font-size: 0.9rem;
}

/* ---- Email Preview Widget ---- */
.preview {
  padding: 120px 24px;
  background: var(--bg-elevated);
}

.preview-inner {
  max-width: 1040px;
  margin: 0 auto;
}

.preview-header {
  text-align: center;
  margin-bottom: 16px;
}

.preview-header h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 12px;
}

.preview-sub {
  font-size: 1.1rem;
  color: var(--fg-muted);
}

.preview-context {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 32px 0 40px;
  flex-wrap: wrap;
}

.preview-invoice-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 5px 14px;
}

.preview-invoice-desc {
  font-size: 0.95rem;
  color: var(--fg);
}

.preview-invoice-desc strong {
  color: var(--accent);
}

/* Outer email client shell */
.email-client {
  display: grid;
  grid-template-columns: 220px 1fr;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 460px;
}

/* Timeline sidebar */
.email-timeline {
  padding: 32px 24px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
}

.timeline-stop {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  cursor: pointer;
  position: relative;
  z-index: 1;
}

.stop-dot {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  margin-top: 3px;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.timeline-stop.active .stop-dot {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.timeline-stop:hover:not(.active) .stop-dot {
  border-color: rgba(34, 214, 138, 0.4);
}

.stop-info {
  padding-bottom: 4px;
}

.stop-day {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
  transition: color 0.2s;
}

.timeline-stop.active .stop-day {
  color: var(--accent);
}

.stop-label {
  font-size: 0.88rem;
  color: var(--fg);
  font-weight: 500;
}

.timeline-connector {
  width: 2px;
  background: var(--border);
  height: 32px;
  margin-left: 6px;
  flex-shrink: 0;
}

/* Email pane */
.email-pane {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.email-tone-badges {
  display: flex;
  gap: 8px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
  flex-wrap: wrap;
}

.tone-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 100px;
  cursor: pointer;
  border: 1px solid var(--border);
  color: var(--fg-muted);
  background: transparent;
  transition: all 0.15s;
  letter-spacing: 0.03em;
}

.tone-badge:hover { border-color: rgba(139,151,176,0.4); color: var(--fg); }

.tone-badge.active.tone-friendly  { background: rgba(34, 214, 138, 0.12); color: var(--accent); border-color: rgba(34, 214, 138, 0.35); }
.tone-badge.active.tone-nudge     { background: rgba(34, 214, 138, 0.12); color: var(--accent); border-color: rgba(34, 214, 138, 0.35); }
.tone-badge.active.tone-firm      { background: rgba(251, 146, 60, 0.1);  color: #fb923c;       border-color: rgba(251, 146, 60, 0.35); }
.tone-badge.active.tone-final     { background: rgba(224, 85, 85, 0.1);   color: #f87171;       border-color: rgba(224, 85, 85, 0.35); }

/* Email frames */
.email-frame {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
}

.email-frame.active {
  display: flex;
}

.email-header-row {
  padding: 20px 28px 16px;
  border-bottom: 1px solid var(--border);
}

.email-from,
.email-to,
.email-subject {
  font-size: 0.85rem;
  color: var(--fg-muted);
  line-height: 1.7;
}

.email-from strong { color: var(--fg); }

.email-subject {
  margin-top: 4px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--fg);
}

.email-body {
  padding: 24px 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.email-body p {
  font-size: 0.93rem;
  color: var(--fg);
  line-height: 1.75;
}

.email-sig {
  margin-top: 6px;
  font-weight: 500;
}

.email-sig span {
  display: block;
  font-size: 0.82rem;
  color: var(--fg-muted);
  font-weight: 400;
}

/* Preview note */
.preview-note {
  text-align: center;
  margin-top: 28px;
  font-size: 0.88rem;
  color: var(--fg-muted);
  line-height: 1.6;
}

/* ---- Preview responsive ---- */
@media (max-width: 720px) {
  .email-client {
    grid-template-columns: 1fr;
  }

  .email-timeline {
    flex-direction: row;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 16px 16px;
    overflow-x: auto;
    gap: 0;
  }

  .timeline-stop {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    min-width: 80px;
  }

  .stop-dot {
    margin-top: 0;
  }

  .timeline-connector {
    width: 32px;
    height: 2px;
    margin-left: 0;
    align-self: center;
    margin-top: -20px;
  }

  .stop-info {
    padding-bottom: 0;
  }
}

/* ---- ROI Calculator ---- */
.roi-calc {
  padding: 120px 24px;
  background: var(--bg);
}

.roi-calc-inner {
  max-width: 860px;
  margin: 0 auto;
}

.roi-header {
  text-align: center;
  margin-bottom: 56px;
}

.roi-eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(34, 214, 138, 0.2);
  padding: 5px 14px;
  border-radius: 100px;
  margin-bottom: 20px;
}

.roi-header h2 {
  font-size: clamp(1.8rem, 4vw, 2.75rem);
  margin-bottom: 12px;
}

.roi-sub {
  color: var(--fg-muted);
  font-size: 1.05rem;
}

/* Two-column layout: sliders left, output right */
.roi-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

/* Slider column */
.roi-sliders {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.roi-slider-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.roi-slider-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.92rem;
  color: var(--fg-muted);
}

.roi-val {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
}

/* Custom range slider — cross-browser */
.roi-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--bg-card);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  /* Filled track up to thumb via gradient — updated via JS-free CSS trick */
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 20% 100%; /* initial value — overwritten immediately by JS */
  background-repeat: no-repeat;
  /* Ensure 44px touch target height */
  min-height: 44px;
  padding: 19px 0; /* centers the track vertically within the 44px */
  box-sizing: border-box;
}

.roi-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent), 0 2px 8px rgba(34, 214, 138, 0.35);
  cursor: pointer;
  transition: box-shadow 0.15s;
}

.roi-slider::-webkit-slider-thumb:hover,
.roi-slider:focus::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px var(--accent-glow), 0 2px 8px rgba(34, 214, 138, 0.5);
}

.roi-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent), 0 2px 8px rgba(34, 214, 138, 0.35);
  cursor: pointer;
}

.roi-slider::-moz-range-track {
  height: 6px;
  background: var(--bg-card);
  border-radius: 3px;
}

.roi-slider-bounds {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--fg-muted);
  opacity: 0.6;
}

/* Output panel */
.roi-output {
  background: var(--bg-card);
  border: 1px solid rgba(34, 214, 138, 0.25);
  border-radius: var(--radius);
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 0 0 60px rgba(34, 214, 138, 0.06);
}

.roi-loss-line {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.roi-loss-label {
  font-size: 0.85rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.roi-loss-amount {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.4rem, 5vw, 3.2rem);
  font-weight: 700;
  color: var(--fg);
  line-height: 1.1;
}

.roi-recovery-line {
  font-size: 0.95rem;
  color: var(--fg-muted);
  line-height: 1.6;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

.roi-recovery-amount {
  color: var(--accent);
  font-weight: 700;
}

.roi-return-line {
  font-size: 0.88rem;
  color: var(--fg-muted);
}

.roi-return-mult {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent);
}

.roi-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  background: var(--accent);
  color: #0a0f1a;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.98rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  margin-top: 8px;
  transition: opacity 0.15s, transform 0.15s;
}

.roi-cta:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

/* Mobile: stack sliders above output */
@media (max-width: 720px) {
  .roi-body {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .roi-output {
    padding: 28px 24px;
  }
}

/* Responsive */
@media (max-width: 640px) {
  .hero {
    min-height: 80vh;
    padding: 60px 20px;
  }
  
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .problem, .how, .features, .closing {
    padding: 80px 20px;
  }
  
  .step {
    flex-direction: column;
    gap: 12px;
  }
  
  .problem-grid, .features-grid {
    grid-template-columns: 1fr;
  }
}