/* ─── RESET & BASE ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface-2: #1c2330;
  --fg: #e6edf3;
  --fg-2: #8b949e;
  --fg-3: #6e7681;
  --accent: #e8a434;
  --accent-dim: rgba(232, 164, 52, 0.12);
  --border: rgba(255,255,255,0.07);
  --radius: 10px;
  --radius-lg: 16px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'DM Sans', system-ui, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

/* ─── TYPOGRAPHY SCALE ─── */
.label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ─── NAVBAR ─── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 20px 48px;
  background: rgba(13,17,23,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.navbar-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 1200px;
  margin: 0 auto;
}
.wordmark {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--fg);
  letter-spacing: -0.03em;
}
.badge {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--accent);
  color: #0d1117;
  padding: 2px 7px;
  border-radius: 3px;
}

/* ─── HERO ─── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 48px 80px;
}
.hero-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
.hero-text { max-width: 520px; }
.hero-headline {
  font-size: clamp(2.4rem, 4vw, 3.8rem);
  font-weight: 900;
  color: var(--fg);
  line-height: 1.08;
  margin-bottom: 24px;
}
.hero-sub {
  font-size: 1.05rem;
  color: var(--fg-2);
  line-height: 1.7;
  max-width: 460px;
}

/* ─── CHAT WIDGET ─── */
.hero-chat { display: flex; justify-content: flex-end; }
.chat-window {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0,0,0,0.5);
}
.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--fg-2);
}
.chat-header-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #3fb950;
  box-shadow: 0 0 6px #3fb950;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.chat-body {
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-line { display: flex; }
.chat-line.user { justify-content: flex-end; }
.chat-line.bot { justify-content: flex-start; }
.bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.875rem;
  line-height: 1.5;
}
.bot .bubble {
  background: var(--surface-2);
  color: var(--fg);
  border-bottom-left-radius: 4px;
}
.user .bubble {
  background: var(--accent-dim);
  border: 1px solid rgba(232,164,52,0.2);
  color: var(--fg);
  border-bottom-right-radius: 4px;
}
.bubble.amber {
  background: var(--accent-dim);
  border: 1px solid rgba(232,164,52,0.2);
  color: var(--accent);
}
.chat-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--fg-3);
}
.live-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #3fb950;
}

/* ─── STATS ─── */
.stats-section {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 48px 48px;
}
.stats-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: stretch;
  gap: 0;
}
.stat {
  flex: 1;
  padding: 0 32px;
}
.stat:first-child { padding-left: 0; }
.stat:last-child { padding-right: 0; }
.stat-num {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 2.4rem;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 10px;
}
.stat-desc {
  font-size: 0.875rem;
  color: var(--fg-2);
  line-height: 1.5;
}
.stat-divider {
  width: 1px;
  background: var(--border);
  flex-shrink: 0;
}

/* ─── HOW ─── */
.how-section {
  padding: 96px 48px;
  max-width: 1200px;
  margin: 0 auto;
}
.how-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 20px;
}
.how-headline {
  font-size: clamp(2rem, 3.5vw, 3rem);
  color: var(--fg);
  margin-bottom: 28px;
  max-width: 600px;
}
.how-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  max-width: 800px;
}
.how-body p {
  font-size: 1rem;
  color: var(--fg-2);
  line-height: 1.7;
}
.how-quote {
  margin-top: 40px;
  padding: 28px 32px;
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.1rem;
  font-style: italic;
  color: var(--fg-2);
  line-height: 1.6;
}

/* ─── FEATURES ─── */
.features-section {
  padding: 96px 48px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.features-section > *,
.features-section .features-label,
.features-section .features-headline {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}
.features-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 20px;
}
.features-headline {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  color: var(--fg);
  margin-bottom: 56px;
  max-width: 480px;
}
.features-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.feature-card {
  background: var(--surface);
  padding: 36px 32px;
  transition: background 0.2s;
}
.feature-card:hover { background: var(--surface-2); }
.feature-icon {
  margin-bottom: 20px;
}
.feature-card h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 12px;
}
.feature-card p {
  font-size: 0.9rem;
  color: var(--fg-2);
  line-height: 1.65;
}

/* ─── FLOW ─── */
.flow-section {
  padding: 96px 48px;
  max-width: 1200px;
  margin: 0 auto;
}
.flow-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 20px;
}
.flow-headline {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  color: var(--fg);
  margin-bottom: 56px;
  max-width: 560px;
}
.flow-steps {
  display: flex;
  align-items: center;
  gap: 0;
}
.step {
  flex: 1;
  padding: 32px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.step-num {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 0.75rem;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}
.step-body h4 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 10px;
}
.step-body p {
  font-size: 0.875rem;
  color: var(--fg-2);
  line-height: 1.6;
}
.step-arrow {
  padding: 0 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.flow-divider {
  margin-top: 48px;
  padding: 20px 28px;
  background: var(--accent-dim);
  border: 1px solid rgba(232,164,52,0.2);
  border-radius: var(--radius);
  text-align: center;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--accent);
}

/* ─── CLOSING ─── */
.closing-section {
  padding: 120px 48px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.closing-inner {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}
.closing-headline {
  font-size: clamp(2.2rem, 4vw, 3.5rem);
  font-weight: 900;
  color: var(--fg);
  line-height: 1.1;
  margin-bottom: 28px;
}
.closing-sub {
  font-size: 1.05rem;
  color: var(--fg-2);
  line-height: 1.75;
  max-width: 640px;
  margin: 0 auto 48px;
}
.closing-product {
  display: inline-block;
  padding: 24px 36px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.cp-tag {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.cp-sub {
  font-size: 0.9rem;
  color: var(--fg-2);
  line-height: 1.5;
}

/* ─── FOOTER ─── */
.site-footer {
  padding: 32px 48px;
  border-top: 1px solid var(--border);
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-tagline {
  display: block;
  font-size: 0.8rem;
  color: var(--fg-3);
  margin-top: 4px;
}
.footer-meta {
  font-size: 0.75rem;
  color: var(--fg-3);
}

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-chat { justify-content: flex-start; }
  .how-body { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr 1fr; }
  .flow-steps { flex-direction: column; }
  .step-arrow { transform: rotate(90deg); padding: 12px 0; }
  .stats-inner { flex-direction: column; gap: 24px; }
  .stat-divider { display: none; }
  .stat { padding: 0; }
}

/* ─── FLOATING INTAKE WIDGET ─── */
#intake-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: 'DM Sans', system-ui, sans-serif;
}

@media (max-width: 600px) {
  #intake-widget { bottom: 16px; right: 16px; left: 16px; }
}

#widget-launcher {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(232,164,52,0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}
#widget-launcher:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 28px rgba(232,164,52,0.5);
}
#widget-launcher svg { width: 28px; height: 28px; fill: #0d1117; }

#widget-panel {
  display: none;
  position: absolute;
  bottom: 72px;
  right: 0;
  width: min(400px, calc(100vw - 32px));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 32px 80px rgba(0,0,0,0.6);
  overflow: hidden;
  flex-direction: column;
  max-height: min(560px, calc(100vh - 120px));
}

#widget-panel.open { display: flex; }

#widget-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
#widget-header-text { flex: 1; }
#widget-header-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--fg);
}
#widget-header-sub {
  font-size: 0.7rem;
  color: var(--fg-3);
}
#widget-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--fg-3);
  font-size: 1.2rem;
  line-height: 1;
  border-radius: 4px;
  transition: color 0.2s;
}
#widget-close:hover { color: var(--fg); }

#widget-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 240px;
}

.widget-msg {
  display: flex;
  animation: msgIn 0.2s ease;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.widget-msg.bot { justify-content: flex-start; }
.widget-msg.user { justify-content: flex-end; }

.widget-bubble {
  max-width: 82%;
  padding: 9px 13px;
  border-radius: 12px;
  font-size: 0.875rem;
  line-height: 1.5;
}
.widget-msg.bot .widget-bubble {
  background: var(--surface-2);
  color: var(--fg);
  border-bottom-left-radius: 4px;
}
.widget-msg.user .widget-bubble {
  background: var(--accent-dim);
  border: 1px solid rgba(232,164,52,0.2);
  color: var(--fg);
  border-bottom-right-radius: 4px;
}
.widget-bubble.qualified {
  background: var(--accent-dim);
  border: 1px solid rgba(232,164,52,0.3);
  color: var(--accent);
  text-align: center;
}

.widget-typing {
  font-size: 0.8rem;
  color: var(--fg-3);
  padding: 4px 0 8px;
  animation: msgIn 0.3s ease;
}

#widget-footer {
  padding: 12px 14px;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
#widget-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 10px 14px;
  font-size: 0.875rem;
  color: var(--fg);
  outline: none;
  resize: none;
  max-height: 90px;
  line-height: 1.4;
  font-family: 'DM Sans', system-ui, sans-serif;
  transition: border-color 0.2s;
}
#widget-input::placeholder { color: var(--fg-3); }
#widget-input:focus { border-color: var(--accent); }
#widget-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.2s;
}
#widget-send:disabled { opacity: 0.4; cursor: not-allowed; }
#widget-send svg { width: 16px; height: 16px; fill: #0d1117; }

@media (max-width: 600px) {
  #widget-panel {
    bottom: 72px;
    right: 0;
    left: 0;
    width: 100%;
  }
  #widget-launcher { width: 54px; height: 54px; }
}

@media (max-width: 600px) {
  .hero, .how-section, .features-section, .flow-section, .closing-section { padding: 72px 24px; }
  .navbar { padding: 16px 24px; }
  .stats-section { padding: 32px 24px; }
  .site-footer { padding: 24px; }
  .features-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; gap: 16px; text-align: center; }
}