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

:root {
  --bg:        #080C14;
  --bg-alt:    #0D1420;
  --bg-card:   #111827;
  --accent:    #FF4D00;
  --accent-dim:#FF4D0020;
  --text:      #E8ECF1;
  --text-muted:#8899AA;
  --border:    rgba(255,255,255,0.07);
  --font-head: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --green:     #10B981;
  --red:       #EF4444;
  --yellow:    #F59E0B;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* ===== NAV ===== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0 clamp(24px, 5vw, 64px);
  background: rgba(8,12,20,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.nav-logo .logo-mark {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: #fff;
  font-weight: 800;
  font-family: var(--font-head);
}

.nav-tag {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links a {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 8px;
  transition: all 0.2s;
}

.nav-links a:hover {
  color: var(--text);
  background: rgba(255,255,255,0.05);
}

.nav-links a.cta-btn {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  padding: 8px 18px;
}

.nav-links a.cta-btn:hover {
  background: #e64500;
  color: #fff;
}

/* ===== DEMO PAGE ===== */
.demo-page {
  padding-top: 64px;
  min-height: 100vh;
}

.demo-hero {
  text-align: center;
  padding: 80px clamp(24px, 5vw, 80px) 40px;
}

.demo-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-dim);
  border: 1px solid rgba(255,77,0,0.2);
  border-radius: 100px;
  padding: 6px 16px;
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-bottom: 24px;
}

.demo-kicker .pulse {
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse-anim 1.8s ease-in-out infinite;
}

@keyframes pulse-anim {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.demo-hero h1 {
  font-family: var(--font-head);
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 16px;
}

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

.demo-hero p {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 32px;
  line-height: 1.65;
}

/* ===== PHONE SIMULATOR ===== */
.simulator-section {
  padding: 0 clamp(24px, 5vw, 80px) 80px;
  display: flex;
  justify-content: center;
}

.phone-frame {
  width: 100%;
  max-width: 480px;
  background: #1a1f2e;
  border-radius: 40px;
  border: 2px solid rgba(255,255,255,0.08);
  overflow: hidden;
  box-shadow: 0 40px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.05);
  position: relative;
}

.phone-notch {
  width: 120px;
  height: 28px;
  background: #0D1420;
  border-radius: 0 0 20px 20px;
  margin: 0 auto;
  position: relative;
  z-index: 10;
}

.phone-header {
  background: #0D1420;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.phone-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(16,185,129,0.5);
  animation: pulse-anim 2s ease-in-out infinite;
}

.phone-header-info h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.phone-header-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.phone-header-icon {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 1.2rem;
}

.conversation-area {
  height: 480px;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #0D1420;
  scroll-behavior: smooth;
}

.conversation-area::-webkit-scrollbar { width: 4px; }
.conversation-area::-webkit-scrollbar-track { background: transparent; }
.conversation-area::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.message {
  display: flex;
  flex-direction: column;
  animation: msg-in 0.3s ease-out forwards;
  opacity: 0;
  transform: translateY(8px);
}

@keyframes msg-in {
  to { opacity: 1; transform: translateY(0); }
}

.message.from-caller {
  align-self: flex-end;
  max-width: 85%;
}

.message.from-ai {
  align-self: flex-start;
  max-width: 88%;
}

.message .bubble {
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 0.9rem;
  line-height: 1.5;
  position: relative;
}

.from-caller .bubble {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.from-ai .bubble {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border-bottom-left-radius: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.from-ai .bubble .ai-icon {
  font-size: 0.75rem;
  flex-shrink: 0;
  color: var(--accent);
}

.message .timestamp {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
  padding: 0 4px;
}

.from-caller .timestamp { text-align: right; }

.message .status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 100px;
  margin-top: 4px;
  font-weight: 500;
}

.status-badge.confirmed {
  background: rgba(16,185,129,0.12);
  color: var(--green);
}

.status-badge.sms-sent {
  background: rgba(59,130,246,0.12);
  color: #3B82F6;
}

.status-badge.action {
  background: var(--accent-dim);
  color: var(--accent);
}

.transcription-line {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 8px 12px;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  border-left: 2px solid var(--accent);
  margin: 4px 0;
}

.transcription-line .label {
  font-weight: 700;
  color: var(--text);
  margin-right: 6px;
}

/* Phone footer */
.phone-footer {
  background: #0D1420;
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  gap: 12px;
}

.phone-footer .mic-btn {
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.07);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.phone-footer .end-call-btn {
  flex: 1;
  height: 44px;
  background: var(--red);
  border-radius: 22px;
  border: none;
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.phone-footer .end-call-btn:hover {
  background: #dc2626;
}

.phone-footer .end-call-btn:disabled {
  background: rgba(239,68,68,0.3);
  cursor: default;
}

.call-duration {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

/* ===== STAGES ===== */
.stages-section {
  padding: 60px clamp(24px, 5vw, 80px);
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
}

.stages-label {
  text-align: center;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 40px;
}

.stages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  max-width: 900px;
  margin: 0 auto;
}

.stage-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  transition: all 0.3s;
}

.stage-card.active {
  border-color: rgba(255,77,0,0.3);
  box-shadow: 0 0 20px rgba(255,77,0,0.05);
}

.stage-card.completed {
  border-color: rgba(16,185,129,0.3);
}

.stage-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(255,255,255,0.08);
  color: var(--text-muted);
  margin-bottom: 12px;
}

.stage-card.completed .stage-num {
  background: var(--green);
  color: #fff;
}

.stage-card.active .stage-num {
  background: var(--accent);
  color: #fff;
}

.stage-card h4 {
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.stage-card p {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ===== CTA ===== */
.demo-cta {
  padding: 80px clamp(24px, 5vw, 80px);
  text-align: center;
}

.demo-cta h2 {
  font-family: var(--font-head);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

.demo-cta p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 32px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.demo-cta-btns {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  padding: 12px 28px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  background: #e64500;
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  padding: 12px 28px;
  border-radius: 12px;
  font-weight: 500;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  border: 1px solid var(--border);
  cursor: pointer;
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.1);
}

/* ===== FOOTER ===== */
.footer {
  padding: 24px clamp(24px, 5vw, 64px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-logo {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-logo .logo-mark {
  width: 22px;
  height: 22px;
  background: var(--accent);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: #fff;
  font-weight: 800;
}

.footer p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ===== REPLAY CONTROLS ===== */
.replay-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px 24px;
  background: rgba(255,255,255,0.03);
  border-top: 1px solid rgba(255,255,255,0.05);
}

.replay-btn {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text);
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.replay-btn:hover {
  background: rgba(255,255,255,0.12);
}

.replay-btn.playing {
  background: var(--accent-dim);
  border-color: rgba(255,77,0,0.3);
  color: var(--accent);
}

.replay-status {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* ===== AUTO-PLAY INDICATOR ===== */
.auto-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.auto-indicator .dots span {
  display: inline-block;
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 50%;
  animation: dot-pulse 1.4s ease-in-out infinite;
}

.auto-indicator .dots span:nth-child(2) { animation-delay: 0.2s; }
.auto-indicator .dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dot-pulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

@media (max-width: 600px) {
  .nav-links a:not(.cta-btn) { display: none; }
  .phone-frame { border-radius: 28px; }
  .conversation-area { height: 380px; }
}