/* Demo page styles — matches theme.css design system */

/* Demo Hero */
.demo-hero {
  min-height: 60vh;
  display: flex;
  align-items: center;
  padding: 120px 40px 80px;
  position: relative;
  overflow: hidden;
}
.demo-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 40%, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 40%, black 30%, transparent 80%);
}
.demo-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 60% at 50% 0%, rgba(0, 212, 170, 0.06) 0%, transparent 70%);
}
.demo-hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 1;
}
.demo-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-dim);
  border: 1px solid rgba(0, 212, 170, 0.25);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 36px;
}
.demo-headline {
  font-size: clamp(2.8rem, 6vw, 5rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 28px;
  max-width: 700px;
}
.demo-headline em {
  font-style: italic;
  color: var(--accent);
}
.demo-sub {
  font-size: 1.1rem;
  color: var(--fg-muted);
  max-width: 540px;
  margin-bottom: 48px;
  line-height: 1.7;
}
.demo-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #0E1117;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 14px 28px;
  border-radius: 12px;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.2s;
  cursor: pointer;
  border: none;
}
.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  color: var(--fg);
  font-weight: 500;
  font-size: 0.9rem;
  padding: 14px 28px;
  border-radius: 12px;
  text-decoration: none;
  border: 1px solid var(--border);
  transition: border-color 0.2s;
  cursor: pointer;
}
.btn-secondary:hover { border-color: rgba(0, 212, 170, 0.4); }

/* Call Simulator */
.call-sim {
  padding: 80px 40px;
  border-top: 1px solid var(--border);
}
.call-sim-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.call-sim-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
}
.call-sim-label {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.call-sim-context {
  font-size: 0.82rem;
  color: var(--fg-muted);
  background: var(--surface);
  padding: 6px 14px;
  border-radius: 100px;
  border: 1px solid var(--border);
}

/* Phone Frame */
.phone-frame {
  max-width: 420px;
  margin: 0 auto;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 36px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(0,212,170,0.1),
    0 32px 64px rgba(0,0,0,0.4),
    0 0 80px rgba(0, 212, 170, 0.05);
}
.phone-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: rgba(0,212,170,0.06);
  border-bottom: 1px solid rgba(0,212,170,0.15);
}
.phone-contact {
  display: flex;
  align-items: center;
  gap: 12px;
}
.phone-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(0,212,170,0.15);
  border: 2px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  transition: border-color 0.3s;
}
.phone-contact-info { display: flex; flex-direction: column; gap: 2px; }
.phone-contact-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--fg);
}
.phone-contact-status {
  font-size: 0.75rem;
  color: var(--accent);
}
.phone-timer {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--fg-muted);
  font-weight: 500;
}

.call-body { min-height: 340px; position: relative; }
.call-state { padding: 28px 24px; }

/* Ringing state */
#state-ringing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  min-height: 340px;
}
.ring-animation {
  position: relative;
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0;
  animation: ringExpand 2.5s ease-out infinite;
}
.ring-1 { width: 60px; height: 60px; animation-delay: 0s; }
.ring-2 { width: 80px; height: 80px; animation-delay: 0.6s; }
.ring-3 { width: 100px; height: 100px; animation-delay: 1.2s; }
@keyframes ringExpand {
  0% { transform: scale(0.5); opacity: 0.8; }
  100% { transform: scale(1.4); opacity: 0; }
}
.phone-icon-large { color: var(--accent); position: relative; z-index: 1; }
.ring-text {
  font-size: 0.9rem;
  color: var(--fg);
  font-weight: 500;
  text-align: center;
}
.ring-sub {
  font-size: 0.78rem;
  color: var(--fg-muted);
  text-align: center;
  margin-top: -8px;
}
.call-actions {
  display: flex;
  gap: 12px;
  width: 100%;
}
.call-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
}
.call-btn:hover:not(:disabled) { opacity: 0.85; transform: scale(0.98); }
.call-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.call-btn-accept {
  background: var(--accent);
  color: #0E1117;
}
.call-btn-decline {
  background: rgba(255,80,80,0.1);
  color: #ff7070;
  border: 1px solid rgba(255,80,80,0.2);
}

/* Active call state */
#state-active {
  display: flex;
  flex-direction: column;
  height: 340px;
}
.transcript {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.transcript-bubble { max-width: 85%; }
.ai-bubble { align-self: flex-start; }
.caller-bubble { align-self: flex-end; }
.bubble-label {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 4px;
  padding: 0 4px;
}
.ai-bubble .bubble-label { color: var(--accent); }
.caller-bubble .bubble-label { text-align: right; }
.bubble-text {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  border-top-left-radius: 4px;
  padding: 12px 14px;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--fg);
}
.caller-bubble .bubble-text {
  background: rgba(0,212,170,0.08);
  border-color: rgba(0,212,170,0.2);
  border-top-left-radius: 16px;
  border-top-right-radius: 4px;
}
.call-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(0,212,170,0.05);
  border-top: 1px solid rgba(0,212,170,0.1);
}
.call-waveform {
  display: flex;
  align-items: center;
  gap: 3px;
}
.wave-bar {
  width: 3px;
  height: 16px;
  background: var(--accent);
  border-radius: 2px;
  animation: waveAnim 1.2s ease-in-out infinite;
}
.wave-bar:nth-child(1) { animation-delay: 0.0s; }
.wave-bar:nth-child(2) { animation-delay: 0.1s; }
.wave-bar:nth-child(3) { animation-delay: 0.2s; }
.wave-bar:nth-child(4) { animation-delay: 0.3s; }
.wave-bar:nth-child(5) { animation-delay: 0.4s; }
.wave-bar:nth-child(6) { animation-delay: 0.2s; }
.wave-bar:nth-child(7) { animation-delay: 0.3s; }
.wave-bar:nth-child(8) { animation-delay: 0.1s; }
.wave-bar:nth-child(9) { animation-delay: 0.0s; }
.wave-bar:nth-child(10) { animation-delay: 0.2s; }
@keyframes waveAnim {
  0%, 100% { height: 8px; opacity: 0.5; }
  50% { height: 20px; opacity: 1; }
}
.live-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: livePulse 1.5s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Ended state */
#state-ended {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 340px;
  gap: 16px;
  padding: 32px 24px;
}
.call-ended-content { text-align: center; }
.call-ended-icon {
  color: var(--accent);
  opacity: 0.7;
  margin-bottom: 8px;
}
.call-ended-content h3 {
  font-size: 1.4rem;
  margin-bottom: 8px;
}
.call-ended-content p {
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin-bottom: 20px;
}
.call-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}
.result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--fg-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
}
.result-item strong { color: var(--fg); }
.btn-restart {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--fg);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s;
}
.btn-restart:hover { border-color: rgba(0,212,170,0.4); }

/* Call controls */
.call-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}
.ctrl-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--fg-muted);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.ctrl-btn:hover { border-color: rgba(0,212,170,0.3); color: var(--fg); }

/* Scenario pills */
.scenario-pills {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
  flex-wrap: wrap;
}
.scenario-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--fg-muted);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.2s;
}
.scenario-pill:hover { border-color: rgba(0,212,170,0.3); color: var(--fg); }
.scenario-pill.active {
  background: var(--accent-dim);
  border-color: rgba(0,212,170,0.35);
  color: var(--accent);
}
.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.5;
}
.scenario-pill.active .pill-dot { opacity: 1; animation: blink 2s ease-in-out infinite; }
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Features section */
.features-section {
  padding: 100px 40px;
  border-top: 1px solid var(--border);
}
.features-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 24px;
  transition: border-color 0.2s, transform 0.2s;
}
.feature-card:hover {
  border-color: rgba(0,212,170,0.3);
  transform: translateY(-2px);
}
.feature-icon {
  width: 44px;
  height: 44px;
  background: var(--accent-dim);
  border: 1px solid rgba(0,212,170,0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: 16px;
}
.feature-name {
  font-size: 0.95rem;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.feature-desc {
  font-size: 0.82rem;
  color: var(--fg-muted);
  line-height: 1.6;
}

/* Explainer */
.explainer {
  padding: 100px 40px;
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.explainer-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
}
.explainer-card {
  flex: 1;
  text-align: center;
  padding: 28px 20px;
}
.explainer-num {
  font-family: 'Instrument Serif', serif;
  font-size: 3rem;
  color: var(--accent);
  opacity: 0.3;
  letter-spacing: -0.04em;
  margin-bottom: 16px;
}
.explainer-card h3 {
  font-size: 1rem;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}
.explainer-card p {
  font-size: 0.82rem;
  color: var(--fg-muted);
  line-height: 1.65;
}
.explainer-connector {
  color: var(--border);
  flex-shrink: 0;
}

/* CTA */
.demo-cta {
  padding: 120px 40px;
  text-align: center;
}
.demo-cta-inner { max-width: 640px; margin: 0 auto; }
.demo-cta-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--fg-muted);
  letter-spacing: 0.04em;
  margin-bottom: 36px;
}
.demo-cta-headline {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.demo-cta-headline em { font-style: italic; color: var(--accent); }
.demo-cta-sub {
  color: var(--fg-muted);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 48px;
}
.demo-cta-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.demo-cta-note {
  font-size: 0.78rem;
  color: var(--fg-muted);
}

/* Utility */
.hidden { display: none !important; }

/* Responsive */
@media (max-width: 768px) {
  .demo-hero { padding: 100px 20px 60px; }
  .demo-headline { font-size: 2.4rem; }
  .call-sim { padding: 60px 20px; }
  .phone-frame { border-radius: 28px; }
  .features-section { padding: 60px 20px; }
  .features-grid { grid-template-columns: 1fr; }
  .explainer { padding: 60px 20px; }
  .explainer-inner { flex-direction: column; gap: 8px; }
  .explainer-connector { transform: rotate(90deg); }
  .demo-cta { padding: 80px 20px; }
  .demo-actions { flex-direction: column; }
  .scenario-pills { flex-direction: column; align-items: center; }
}
@media (max-width: 1024px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
}