* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

:root {
  --bg: #0a0a0b;
  --bg-raised: #111113;
  --bg-code: #161618;
  --border: #222225;
  --text: #ededef;
  --text-dim: #8a8a8e;
  --text-dimmer: #5a5a5e;
  --accent: #6ee7b7;
  --accent-dim: #34d399;
  --mono: "SF Mono", "Cascadia Code", "Fira Code", "JetBrains Mono", Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* Nav */
nav {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
nav .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
}
.logo span { color: var(--accent); }
nav a.nav-link {
  color: var(--text-dim);
  font-size: 14px;
  margin-left: 28px;
}
nav a.nav-link:hover { color: var(--text); text-decoration: none; }

/* Hero */
.hero {
  padding: 100px 0 80px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  position: relative;
  overflow: hidden;
}
#ascii-hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
.hero > * { position: relative; z-index: 1; }
.hero h1 {
  font-size: 48px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -1.5px;
}
.hero h1 span { color: var(--accent); }
.hero p {
  margin-top: 20px;
  font-size: 18px;
  color: var(--text-dim);
  max-width: 460px;
  line-height: 1.7;
}
.hero-tagline {
  margin-top: 16px;
  font-size: 15px;
  color: var(--text-dimmer);
  font-style: italic;
  max-width: 460px;
}
.hero-cta {
  margin-top: 32px;
  display: flex;
  gap: 12px;
}
.btn {
  display: inline-block;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
  font-family: var(--sans);
  cursor: pointer;
  border: none;
}
.btn-primary {
  background: var(--accent);
  color: #0a0a0b;
}
.btn-primary:hover { background: var(--accent-dim); text-decoration: none; }
.btn-secondary {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.btn-secondary:hover { color: var(--text); border-color: var(--text-dimmer); text-decoration: none; }

/* SMS mockup */
.hero-mockup {
  position: relative;
}
#ascii-sms-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  border-radius: 16px;
}
.sms-mockup {
  position: relative;
  z-index: 1;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  font-family: var(--sans);
  font-size: 14px;
}
.sms-header {
  text-align: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.sms-contact {
  font-size: 15px;
  font-weight: 600;
}
.sms-number {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  margin-top: 4px;
}
.sms-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
}
.msg-in {
  background: #222228;
  color: var(--text);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.msg-out {
  background: #1a3a2a;
  color: #a7f3d0;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.msg-time {
  font-size: 11px;
  color: var(--text-dimmer);
  margin-top: 2px;
}
.msg-group { display: flex; flex-direction: column; }
.msg-group.right { align-items: flex-end; }
.msg-group.left { align-items: flex-start; }
.msg-typing {
  background: #222228;
  color: var(--text-dimmer);
  align-self: flex-start;
  padding: 10px 16px;
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  font-size: 20px;
  letter-spacing: 3px;
}

/* Section shared */
section { padding: 80px 0; }
section + section { border-top: 1px solid var(--border); }
.section-label {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 12px;
}
.section-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 40px;
}

/* How it works */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.step {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.step-num {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 12px;
}
.step h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}
.step p {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.6;
}

/* Features */
.features-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.feature {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px;
}
.feature h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}
.feature p {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.6;
}
.feature-icon {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 12px;
  display: block;
}

/* Architecture */
.arch-diagram {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 2;
  color: var(--text-dim);
  overflow-x: auto;
}
.arch-diagram .hl { color: var(--accent); }
.arch-diagram .dim { color: var(--text-dimmer); }

/* CTA */
.cta-section {
  text-align: center;
  padding: 80px 0;
  position: relative;
  overflow: hidden;
}
#ascii-cta-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
.cta-section > * { position: relative; z-index: 1; }
.cta-section h2 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -1px;
}
.cta-section p {
  color: var(--text-dim);
  font-size: 16px;
  margin-bottom: 32px;
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
}
footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
footer p { font-size: 13px; color: var(--text-dimmer); }
footer a { color: var(--text-dim); font-size: 13px; margin-left: 20px; }

/* Responsive */
@media (max-width: 768px) {
  .hero { grid-template-columns: 1fr; padding: 60px 0 40px; }
  .hero h1 { font-size: 36px; }
  .features-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .hero-mockup { order: -1; }
}

/* Voice overlay */
#voice-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(10,10,11,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}
#voice-overlay.visible { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.voice-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px 48px;
  text-align: center;
  min-width: 320px;
  max-width: 400px;
}

/* Ringing state */
#call-ring { display: block; }
#call-active { display: none; }
#voice-overlay.incall #call-ring { display: none; }
#voice-overlay.incall #call-active { display: block; }

.ring-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 0 auto 24px;
}
.ring-avatar {
  position: relative;
  z-index: 2;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a3a2a, #0d2a1d);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 28px;
  color: var(--accent);
}
.pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--accent);
  animation: pulseRing 1.8s ease-out infinite;
}
.pulse-ring:nth-child(2) { animation-delay: 0.6s; }
.pulse-ring:nth-child(3) { animation-delay: 1.2s; }
@keyframes pulseRing {
  0%   { transform: scale(0.85); opacity: 0.7; }
  100% { transform: scale(1.8);  opacity: 0; }
}

.call-label {
  font-size: 13px;
  color: var(--text-dimmer);
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}
.call-name {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 28px;
}

.call-buttons {
  display: flex;
  justify-content: center;
  gap: 32px;
}
.call-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s, opacity 0.1s;
}
.call-btn:hover { transform: scale(1.08); }
.call-btn.answer { background: #16a34a; }
.call-btn.decline { background: #dc2626; }

/* Active call state */
.call-timer {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--text-dimmer);
  margin-bottom: 24px;
}
.waveform {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 40px;
  margin-bottom: 28px;
}
.waveform .bar {
  width: 5px;
  height: 8px;
  background: var(--accent);
  border-radius: 3px;
  transition: height 0.1s;
}
.waveform.speaking .bar { animation: wave 0.6s ease-in-out infinite alternate; }
.waveform.speaking .bar:nth-child(2) { animation-delay: 0.1s; }
.waveform.speaking .bar:nth-child(3) { animation-delay: 0.2s; }
.waveform.speaking .bar:nth-child(4) { animation-delay: 0.3s; }
.waveform.speaking .bar:nth-child(5) { animation-delay: 0.4s; }
@keyframes wave {
  from { height: 8px; }
  to   { height: 32px; }
}

.incall-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
}
.incall-btn {
  padding: 10px 24px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--sans);
  transition: opacity 0.1s;
}
.incall-btn:hover { opacity: 0.85; }
.incall-btn.mute { background: #333338; color: var(--text); }
.incall-btn.mute.muted { background: #222225; color: var(--text-dimmer); }
.incall-btn.end { background: #dc2626; color: #fff; }

.status-text {
  font-size: 13px;
  color: var(--text-dimmer);
  margin-bottom: 16px;
  min-height: 18px;
}

/* Beta modal */
#ascii-modal-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
#try-modal .modal-card {
  position: relative;
  z-index: 1;
}
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(10,10,11,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
.modal-backdrop.visible { display: flex; }
.modal-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.modal-card h3 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.modal-sub {
  font-size: 14px;
  color: var(--text-dim);
  margin-top: -8px;
}
.modal-input {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 15px;
  color: var(--text);
  font-family: var(--sans);
  outline: none;
  transition: border-color 0.15s;
}
.modal-input:focus { border-color: var(--accent); }
.modal-submit { width: 100%; justify-content: center; }
.modal-status {
  font-size: 13px;
  color: var(--accent);
  min-height: 18px;
  text-align: center;
}
.modal-status.error { color: #f87171; }

/* Try it modal phone */
.try-phone {
  text-align: center;
  margin-top: 16px;
}
.try-phone-number {
  display: block;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--accent);
  text-decoration: none;
}
.try-phone-number:hover {
  text-decoration: underline;
}
.try-phone-hint {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 8px;
}

/* ASCII art banner */
.ascii-banner {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  overflow: hidden;
  line-height: 0;
  height: 160px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.ascii-banner canvas {
  display: block;
  width: 100%;
  height: 160px;
}
