*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #09090b; color: #e4e4e7; line-height: 1.6;
  -webkit-font-smoothing: antialiased; min-height: 100vh;
  display: flex; flex-direction: column;
}
a { color: inherit; text-decoration: none; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* Nav */
.demo-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(9,9,11,0.9); backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.logo { font-weight: 700; font-size: 1rem; color: #fff; }
.logo span { color: #71717a; font-weight: 400; }
.nav-right { display: flex; align-items: center; gap: 12px; }
.demo-badge {
  font-size: 0.625rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: #f59e0b; background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.2); border-radius: 4px;
  padding: 3px 8px;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 0.875rem; font-weight: 600; border-radius: 8px;
  padding: 10px 20px; transition: all 0.2s; cursor: pointer;
  border: none; text-decoration: none; font-family: inherit;
}
.btn-sm { padding: 7px 14px; font-size: 0.8125rem; }
.btn-lg { padding: 12px 24px; }
.btn-full { width: 100%; }
.btn-primary { background: #fff; color: #09090b; }
.btn-primary:hover { background: #e4e4e7; }
.btn-outline { background: transparent; color: #e4e4e7; border: 1px solid rgba(255,255,255,0.15); }
.btn-outline:hover { border-color: rgba(255,255,255,0.3); }

/* Header */
.demo-main { flex: 1; padding: 48px 0 64px; }
.demo-header { text-align: center; margin-bottom: 48px; }
.tag { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: #6366f1; margin-bottom: 8px; }
.demo-header h1 { font-size: 2rem; font-weight: 800; color: #fff; letter-spacing: -0.03em; margin-bottom: 12px; }
.subtitle { font-size: 0.9375rem; color: #71717a; max-width: 520px; margin: 0 auto; }

/* Layout */
.demo-layout { display: grid; grid-template-columns: 420px 1fr; gap: 32px; align-items: start; }

/* Input Panel */
.demo-input-panel {
  background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px; padding: 24px;
}
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.panel-header h2 { font-size: 1rem; font-weight: 600; color: #fff; }
.sample-selector { display: flex; align-items: center; gap: 8px; }
.sample-selector label { font-size: 0.75rem; color: #71717a; }
.sample-selector select {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  color: #e4e4e7; border-radius: 6px; padding: 4px 8px; font-size: 0.75rem;
  font-family: inherit; cursor: pointer;
}
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 0.75rem; font-weight: 500; color: #a1a1aa; margin-bottom: 4px; }
.field input, .field textarea {
  width: 100%; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  color: #e4e4e7; border-radius: 8px; padding: 10px 12px; font-size: 0.875rem;
  font-family: inherit; transition: border-color 0.2s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: rgba(99,102,241,0.5); }
.field textarea { resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Output Panel */
.demo-output-panel {
  background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px; padding: 24px; min-height: 500px;
  position: relative;
}
.output-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 400px; gap: 16px; }
.empty-orb {
  width: 80px; height: 80px; border-radius: 50%; position: relative;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle, rgba(99,102,241,0.15), rgba(99,102,241,0.03));
  border: 1px solid rgba(99,102,241,0.25);
}
.empty-orb span { font-size: 0.8125rem; font-weight: 700; color: #a5b4fc; }
.orb-pulse {
  position: absolute; inset: -8px; border-radius: 50%;
  border: 1px solid rgba(99,102,241,0.15);
  animation: pulse 2.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.15); opacity: 0; }
}
.output-empty p { font-size: 0.8125rem; color: #52525b; }

/* Timeline */
.output-timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-step {
  display: flex; gap: 16px; opacity: 0; transform: translateY(8px);
  animation: stepIn 0.4s ease forwards;
}
.timeline-step.delay-1 { animation-delay: 0.6s; }
.timeline-step.delay-2 { animation-delay: 1.8s; }
.timeline-step.delay-3 { animation-delay: 3.2s; }
.timeline-step.delay-4 { animation-delay: 4.6s; }
.timeline-step.delay-5 { animation-delay: 6.0s; }
.timeline-step.delay-6 { animation-delay: 7.2s; }
@keyframes stepIn { to { opacity: 1; transform: translateY(0); } }

.step-indicator {
  display: flex; flex-direction: column; align-items: center; flex-shrink: 0; width: 32px;
}
.step-dot {
  width: 10px; height: 10px; border-radius: 50; border-radius: 50%;
  background: #27272a; border: 2px solid #3f3f46;
  transition: all 0.3s;
}
.step-dot.active { background: #6366f1; border-color: #6366f1; }
.step-dot.success { background: #22c55e; border-color: #22c55e; }
.step-dot.alert { background: #f59e0b; border-color: #f59e0b; }
.step-dot.hot { background: #ef4444; border-color: #ef4444; }
.step-line { width: 2px; flex: 1; min-height: 16px; background: rgba(255,255,255,0.06); }

.step-content { flex: 1; padding-bottom: 20px; }
.step-label { font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 4px; }
.step-label.sys { color: #6366f1; }
.step-label.tyche { color: #a5b4fc; }
.step-label.classify { color: #f59e0b; }
.step-label.route { color: #22c55e; }
.step-label.hot-label { color: #ef4444; }

.step-bubble {
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px; padding: 12px 16px; font-size: 0.8125rem; color: #d4d4d8;
  line-height: 1.6;
}
.step-bubble strong { color: #fff; }
.step-bubble .typing { color: #52525b; }

/* Classification badge */
.class-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  border-radius: 6px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em;
}
.class-hot { background: rgba(239,68,68,0.12); color: #ef4444; border: 1px solid rgba(239,68,68,0.2); }
.class-warm { background: rgba(245,158,11,0.12); color: #f59e0b; border: 1px solid rgba(245,158,11,0.2); }
.class-cold { background: rgba(99,102,241,0.12); color: #818cf8; border: 1px solid rgba(99,102,241,0.2); }
.class-junk { background: rgba(113,113,122,0.12); color: #71717a; border: 1px solid rgba(113,113,122,0.2); }

/* Route card */
.route-card {
  background: rgba(255,255,255,0.03); border-radius: 8px; padding: 12px 16px;
  border-left: 3px solid #6366f1; margin-top: 8px;
}
.route-card p { font-size: 0.8125rem; color: #a1a1aa; margin: 0; }
.route-card strong { color: #fff; }

/* Actions */
.demo-actions { display: flex; gap: 12px; justify-content: center; margin-top: 32px; }

/* Footer */
.demo-footer {
  padding: 16px 0; border-top: 1px solid rgba(255,255,255,0.04);
  text-align: center;
}
.demo-footer p { font-size: 0.75rem; color: #3f3f46; }
.demo-footer a { color: #6366f1; }

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

/* Responsive */
@media (max-width: 800px) {
  .demo-layout { grid-template-columns: 1fr; }
  .demo-output-panel { min-height: 300px; }
  .demo-header h1 { font-size: 1.5rem; }
  .field-row { grid-template-columns: 1fr; }
  .panel-header { flex-direction: column; align-items: flex-start; gap: 8px; }
}
