:root {
  --bg: #0a0f1e;
  --surface: #111827;
  --surface-2: #1a2540;
  --accent: #00e5b0;
  --accent-dim: #00e5b040;
  --fire: #ff6b35;
  --fire-dim: #ff6b3530;
  --text: #e2e8f0;
  --muted: #64748b;
  --border: #1e293b;
  --serif: 'Playfair Display', Georgia, serif;
  --mono: 'DM Mono', 'Fira Code', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

/* ——— HERO ——— */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  padding: 100px 80px 80px;
  min-height: 100vh;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -200px;
  right: -200px;
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, #00e5b010 0%, transparent 70%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -100px;
  left: -100px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #ff6b3508 0%, transparent 70%);
  pointer-events: none;
}

.hero-left {
  position: relative;
  z-index: 1;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 24px;
  opacity: 0.8;
}

.hero-left h1 {
  font-family: var(--serif);
  font-size: clamp(42px, 5vw, 72px);
  font-weight: 900;
  line-height: 1.05;
  color: var(--text);
  margin-bottom: 28px;
  letter-spacing: -0.02em;
}

.hero-left h1 br { display: block; }

.lede {
  font-size: 17px;
  color: #94a3b8;
  max-width: 440px;
  margin-bottom: 36px;
  font-weight: 300;
}

.hero-tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tag {
  font-family: var(--mono);
  font-size: 11px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
}

/* ——— LIVE PANEL ——— */
.hero-right {
  position: relative;
  z-index: 1;
}

.live-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  animation: panelFadeIn 0.8s ease-out;
}

@keyframes panelFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s infinite;
}

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

.panel-title {
  font-size: 11px;
  color: var(--muted);
  flex: 1;
}

.status-badge {
  font-size: 10px;
  padding: 3px 8px;
  background: var(--fire-dim);
  color: var(--fire);
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.metric {
  background: var(--surface-2);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metric-value {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.metric-value.normal { color: var(--text); }
.metric-value.warning { color: var(--fire); }

.metric-delta {
  font-size: 11px;
}
.metric-delta.up { color: var(--accent); }
.metric-delta.warn { color: var(--fire); }

/* ——— ANIMATED CHART ——— */
.chart-wrap { margin-bottom: 20px; }

.chart {
  width: 100%;
  height: 120px;
  display: block;
}

.chart-line {
  stroke-dasharray: 2000;
  stroke-dashoffset: 2000;
  animation: drawLine 2.5s ease-out 0.3s forwards;
}

.chart-area {
  opacity: 0;
  animation: fadeIn 0.6s ease-out 1.8s forwards;
}

@keyframes drawLine {
  to { stroke-dashoffset: 0; }
}

@keyframes fadeIn {
  to { opacity: 1; }
}

.chart-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  padding: 10px 14px;
  border-radius: 8px;
  margin-top: 10px;
}

.chart-label.anomaly {
  background: var(--fire-dim);
  border: 1px solid #ff6b3540;
  color: #fb923c;
  opacity: 0;
  animation: fadeIn 0.4s ease-out 2.8s forwards;
}

.alert-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--fire);
  flex-shrink: 0;
}

/* ——— INSIGHT BUBBLE ——— */
.insight-bubble {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  background: #0d2818;
  border: 1px solid #00e5b020;
  border-radius: 8px;
  opacity: 0;
  animation: slideUp 0.5s ease-out 3.2s forwards;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.insight-icon {
  color: var(--accent);
  font-size: 14px;
  flex-shrink: 0;
  padding-top: 2px;
}

.insight-text {
  font-size: 12px;
  color: #86efac;
  line-height: 1.5;
}

.insight-text strong { color: #4ade80; }

/* ——— MANIFESTO ——— */
.manifesto {
  padding: 80px 80px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--bg) 0%, #0d1628 100%);
}

.manifesto-inner {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.manifesto blockquote {
  font-family: var(--serif);
  font-size: clamp(24px, 3vw, 40px);
  font-weight: 400;
  font-style: italic;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 28px;
  letter-spacing: -0.01em;
}

.manifesto-sub {
  font-size: 15px;
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto;
}

/* ——— OBSERVATIONS ——— */
.observations {
  padding: 100px 80px;
  max-width: 1400px;
  margin: 0 auto;
}

.obs-header {
  margin-bottom: 60px;
}

.obs-header h2 {
  font-family: var(--serif);
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 700;
  margin-bottom: 12px;
}

.obs-header p { color: var(--muted); }

.obs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.obs-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  transition: border-color 0.3s, transform 0.3s;
}

.obs-card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-4px);
}

.obs-icon {
  color: var(--accent);
  margin-bottom: 20px;
  display: flex;
}

.obs-card h3 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
}

.obs-card p { font-size: 14px; color: var(--muted); line-height: 1.65; }

/* ——— HOW IT WORKS ——— */
.how {
  padding: 100px 80px;
  background: #0d1628;
  border-top: 1px solid var(--border);
}

.how-header {
  margin-bottom: 60px;
}

.how-header h2 {
  font-family: var(--serif);
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 700;
  margin-bottom: 12px;
}

.how-header p { color: var(--muted); }

.steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 800px;
}

.step {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 40px;
  padding: 40px 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}

.step:last-child { border-bottom: none; }

.step-num {
  font-family: var(--serif);
  font-size: 48px;
  font-weight: 900;
  color: var(--surface-2);
  line-height: 1;
}

.step h3 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 10px;
}

.step p { font-size: 14px; color: var(--muted); line-height: 1.65; }

/* ——— CLOSING ——— */
.closing {
  padding: 120px 80px;
  text-align: center;
}

.closing-inner { max-width: 800px; margin: 0 auto; }

.closing h2 {
  font-family: var(--serif);
  font-size: clamp(32px, 4vw, 56px);
  font-weight: 900;
  margin-bottom: 24px;
  line-height: 1.1;
}

.closing-sub {
  font-size: 17px;
  color: var(--muted);
  margin-bottom: 60px;
}

.closing-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  text-align: center;
  border-top: 1px solid var(--border);
  padding-top: 48px;
}

.stat-value {
  display: block;
  font-size: 40px;
  font-weight: 300;
  color: var(--accent);
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ——— FOOTER ——— */
footer {
  border-top: 1px solid var(--border);
  padding: 40px 80px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
}

.footer-logo {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  display: block;
  margin-bottom: 4px;
}

.footer-tagline {
  font-size: 12px;
  color: var(--muted);
}

.footer-note {
  font-size: 12px;
  color: var(--muted);
}

/* ——— HERO CTAs ——— */
.hero-ctas {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.btn-primary {
  display: inline-block;
  padding: 12px 24px;
  background: var(--accent);
  color: #0a0f1e;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: opacity 0.2s, transform 0.15s;
}

.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }

.btn-secondary {
  display: inline-block;
  padding: 12px 24px;
  background: transparent;
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: border-color 0.2s, color 0.2s;
}

.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

/* ——— SECTION SHARED ——— */
.section-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.8;
  display: block;
  margin-bottom: 16px;
}

.section-sub {
  font-size: 16px;
  color: var(--muted);
  max-width: 580px;
  margin-top: 12px;
}

/* ——— SAMPLE ALERT SECTION ——— */
.sample-alert {
  padding: 100px 80px;
  background: #0d1628;
  border-top: 1px solid var(--border);
}

.sample-alert-inner {
  max-width: 880px;
  margin: 0 auto;
}

.sample-alert h2 {
  font-family: var(--serif);
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 700;
  line-height: 1.15;
}

.alert-card {
  margin-top: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.alert-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  background: #131c2e;
  flex-wrap: wrap;
  gap: 8px;
}

.alert-card-title {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.alert-badge {
  font-size: 11px;
  padding: 3px 8px;
  background: var(--fire-dim);
  color: var(--fire);
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.alert-metric-name {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}

.alert-project {
  font-size: 11px;
  color: var(--muted);
}

.alert-time {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

/* Metric numbers + sparkline */
.alert-metric-block {
  padding: 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 40px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.alert-metric-numbers {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.alert-num-pair {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.alert-num-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.alert-num-value {
  font-size: 32px;
  font-weight: 300;
  letter-spacing: -0.03em;
}

.alert-num-value.drop { color: var(--fire); }
.alert-num-value.baseline { color: var(--text); }

.alert-num-divider {
  font-size: 13px;
  color: var(--muted);
  padding-top: 16px;
}

.deviation-chip {
  display: inline-block;
  padding: 4px 10px;
  background: var(--fire-dim);
  color: var(--fire);
  border-radius: 20px;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.deviation-label {
  display: block;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
}

.alert-sparkline-wrap {
  flex: 1;
  min-width: 200px;
}

.alert-sparkline {
  width: 100%;
  height: 60px;
  display: block;
}

/* Alert section rows */
.alert-section {
  padding: 24px;
  border-bottom: 1px solid var(--border);
}

.alert-section:last-child { border-bottom: none; }

.alert-section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.layer-num {
  font-size: 14px;
  color: var(--accent);
}

.alert-explanation {
  font-size: 14px;
  color: #94a3b8;
  line-height: 1.7;
  background: #0d2818;
  border: 1px solid #00e5b020;
  border-radius: 8px;
  padding: 16px 18px;
}

/* Recommendations */
.rec-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rec-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  counter-increment: rec;
  padding: 16px;
  background: var(--surface-2);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.rec-item::before {
  content: counter(rec);
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  opacity: 0.5;
  min-width: 24px;
  line-height: 1.2;
  margin-top: 2px;
}

.rec-list { counter-reset: rec; }

.rec-body {
  flex: 1;
}

.rec-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.65;
}

.rec-text code {
  font-family: var(--mono);
  font-size: 12px;
  background: #1e293b;
  padding: 2px 5px;
  border-radius: 3px;
  color: var(--accent);
}

.rec-feedback {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.feedback-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  line-height: 1;
}

.feedback-btn:hover { background: var(--surface-2); border-color: var(--accent-dim); }
.feedback-btn.up:hover { border-color: var(--accent); }
.feedback-btn.down:hover { border-color: var(--fire); }

.sample-cta {
  text-align: center;
  margin-top: 36px;
}

/* ——— COMPARISON TABLE ——— */
.comparison {
  padding: 100px 80px;
  border-top: 1px solid var(--border);
}

.comparison-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.comparison h2 {
  font-family: var(--serif);
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 700;
  line-height: 1.15;
}

.comp-table-wrap {
  overflow-x: auto;
  margin-top: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.comp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.comp-table thead tr {
  background: #131c2e;
  border-bottom: 1px solid var(--border);
}

.comp-table th {
  padding: 14px 18px;
  text-align: left;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.comp-table th.comp-us {
  color: var(--accent);
}

.comp-feature-col {
  min-width: 200px;
}

.comp-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.comp-table tbody tr:last-child { border-bottom: none; }
.comp-table tbody tr:hover { background: #0f1a2e; }

.comp-table td {
  padding: 14px 18px;
  vertical-align: top;
  line-height: 1.5;
}

.comp-feature {
  color: var(--text);
  font-size: 13px;
}

.comp-feature strong { display: block; }

.comp-wedge {
  display: block;
  font-size: 10px;
  color: var(--accent);
  opacity: 0.7;
  font-style: italic;
  margin-top: 2px;
}

.comp-us { background: #0a1f14 !important; }
.comp-yes { color: #4ade80; }
.comp-no { color: #64748b; }
.comp-partial { color: #fbbf24; }

.comp-highlight-row td { background: #0a1a0f; }
.comp-highlight-row .comp-us { background: #0d2318 !important; }

.comp-footnotes {
  margin-top: 20px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
  opacity: 0.7;
}

/* ——— HOW IT WORKS (updated) ——— */
.how-inner {
  max-width: 800px;
  padding: 0 80px;
  margin: 0 auto;
}

.how {
  padding: 100px 0;
  background: #0d1628;
  border-top: 1px solid var(--border);
}

.how h2 {
  font-family: var(--serif);
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 0;
}

.step-callout {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 16px;
  background: var(--accent-dim);
  border: 1px solid #00e5b030;
  border-radius: 8px;
  font-size: 13px;
  color: var(--accent);
}

.step-callout-icon { flex-shrink: 0; font-size: 14px; }

/* ——— FOOTER (updated) ——— */
.footer-links {
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
}

.footer-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-status:hover { color: var(--text); }

.status-dot-green {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  flex-shrink: 0;
  animation: pulse 3s infinite;
}

.footer-email {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-email:hover { color: var(--accent); }

/* ——— RESPONSIVE ——— */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 60px 32px 60px;
    gap: 40px;
  }
  .hero-left h1 br { display: none; }
  .how-inner { padding: 0 32px; }
  .how { padding: 60px 0; }
  .step { grid-template-columns: 60px 1fr; gap: 24px; }
  .sample-alert { padding: 60px 32px; }
  .comparison { padding: 60px 32px; }
  footer { padding: 40px 32px; }
  .footer-inner { flex-direction: column; gap: 20px; text-align: center; }
  .footer-links { justify-content: center; }
  .metric-row { grid-template-columns: repeat(2, 1fr); }
  .alert-metric-block { flex-direction: column; gap: 24px; }
  .comp-table th, .comp-table td { padding: 10px 12px; font-size: 12px; }
}

@media (max-width: 600px) {
  .metric-row { grid-template-columns: 1fr; }
  .hero-ctas { flex-direction: column; }
  .btn-primary, .btn-secondary { text-align: center; }
  .rec-item { flex-direction: column; }
  .rec-feedback { flex-direction: row; }
  .alert-card-header { flex-direction: column; align-items: flex-start; }
  .alert-metric-numbers { gap: 12px; }
}

/* ——— DEMO BUTTON ——— */
.btn-demo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: transparent;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--accent);
  border-radius: 6px;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 0.2s, color 0.2s, transform 0.15s;
  text-decoration: none;
}
.btn-demo:hover {
  background: var(--accent-dim);
  transform: translateY(-1px);
}
.btn-demo-inline {
  margin-right: 12px;
}

/* Hero integrations strip ("Works with PostHog and Mixpanel") */
.hero-integrations {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.hero-integrations-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.integration-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--surface);
}

.posthog-badge { border-color: #F54E0040; color: #F54E00; }
.mixpanel-badge { border-color: #7856FF40; color: #a088ff; }

/* Demo modal — Mixpanel scenario provider label */
.scenario-provider-tag {
  display: block;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #a088ff;
  margin-bottom: 2px;
  font-family: var(--mono);
}

.sample-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 36px;
}

/* ——— DEMO MODAL ——— */
.demo-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(10, 15, 30, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(4px);
  animation: overlayIn 0.2s ease-out;
}
.demo-modal-overlay[hidden] { display: none !important; }

@keyframes overlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.demo-modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 760px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: modalSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.demo-modal-close {
  position: absolute;
  top: 16px;
  right: 18px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  z-index: 10;
  transition: color 0.2s;
}
.demo-modal-close:hover { color: var(--text); }

.demo-modal-header {
  padding: 28px 28px 0;
}

.demo-eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.8;
  display: block;
  margin-bottom: 8px;
}

.demo-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
}

/* Scenario tabs */
.demo-scenarios {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.demo-scenario-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 16px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
  text-align: left;
  line-height: 1.4;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  min-width: 120px;
}
.demo-scenario-btn:hover {
  border-color: var(--accent-dim);
  color: var(--text);
}
.demo-scenario-btn.active {
  border-color: var(--accent);
  background: #0d2818;
  color: var(--text);
}
.scenario-stat {
  font-size: 15px;
  font-weight: 500;
  color: var(--fire);
  display: block;
  margin-top: 2px;
}
.demo-scenario-btn.active .scenario-stat { color: var(--fire); }

/* Demo card wrapper (reuses alert-card styles) */
.demo-card {
  margin: 0 20px 20px;
}

/* Sparkline path animations — scoped to demo modal */
.demo-sparkline-green {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
}
.demo-sparkline-red {
  fill: none;
  stroke: var(--fire);
  stroke-width: 1.5;
  stroke-dasharray: 300;
  stroke-dashoffset: 300;
}
.demo-sparkline-green.drawn {
  animation: drawDemoGreen 0.45s ease-out forwards;
}
.demo-sparkline-red.drawn {
  animation: drawDemoRed 0.25s ease-out 0.45s forwards;
}
@keyframes drawDemoGreen {
  to { stroke-dashoffset: 0; }
}
@keyframes drawDemoRed {
  to { stroke-dashoffset: 0; }
}

/* Cursor blink in explanation area */
.demo-cursor {
  display: inline-block;
  color: var(--accent);
  animation: cursorBlink 0.8s step-end infinite;
}
.demo-cursor.done { display: none; }
@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Rec items stagger slide-in */
.demo-rec-item {
  opacity: 0;
  transform: translateY(10px);
}
.demo-rec-item.visible {
  animation: recSlideIn 0.3s ease-out forwards;
}
@keyframes recSlideIn {
  to { opacity: 1; transform: translateY(0); }
}

/* Demo CTA */
.demo-modal-cta {
  padding: 20px 28px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  background: #0d1628;
}
.demo-cta-sub {
  font-size: 12px;
  color: var(--muted);
}

/* Count-up animation flag */
#demo-today, #demo-baseline {
  transition: color 0.3s;
}

@media (max-width: 640px) {
  .demo-modal-box { border-radius: 12px; }
  .demo-modal-header { padding: 20px 16px 0; }
  .demo-card { margin: 0 12px 16px; }
  .demo-scenarios { gap: 6px; }
  .demo-scenario-btn { min-width: 90px; padding: 8px 12px; }
  .demo-modal-cta { padding: 16px; flex-direction: column; align-items: flex-start; gap: 10px; }
}