/* ===== PulseWise Sovereign Intelligence Design Language v2 ===== */
/* Institutional · Calm · Intelligent · Trusted · Executive-grade  */

:root {
  --bg:         #0A0F1A;
  --surface:    #111827;
  --surface-2:  #1A2332;
  --fg:         #FFFFFF;
  --fg-2:       #E8EBF0;
  --muted:      #8892A0;
  --muted-2:    #6B7280;
  --border:     #1E2A45;
  --accent:     #00E0FF;
  --accent-dim: rgba(0, 224, 255, 0.12);
  --blue:       #005CFF;
  --blue-dim:   rgba(0, 92, 255, 0.10);

  --font-display: 'Montserrat', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-body:    'Montserrat', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'SF Mono', ui-monospace, monospace;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --radius: 6px;
}

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

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg);
  font-family: var(--font-body);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== Stage ===== */
#app {
  width: 100vw; height: 100vh;
  position: relative;
  display: flex; align-items: center; justify-content: center;
}

#stage {
  width: 1920px; height: 1080px;
  position: relative;
  overflow: hidden;
  transform-origin: center center;
  background: var(--bg);
  will-change: transform;
}

/* ===== Slides ===== */
.slide {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  opacity: 0; visibility: hidden;
  transition: opacity 0.5s var(--ease-out), visibility 0.5s;
  padding: 80px 100px;
  overflow: hidden;
}
.slide.active {
  opacity: 1; visibility: visible;
}

/* Theme: light */
.slide.light {
  background: var(--fg);
  color: var(--bg);
}
.slide.light .muted { color: var(--muted-2); }
.slide.light .border-divider { background: rgba(10, 15, 26, 0.08); }
.slide.light .stat-value { color: var(--bg); }
.slide.light .stat-label { color: var(--muted-2); }
.slide.light .slide-number { color: rgba(10, 15, 26, 0.12); }
.slide.light .card { background: rgba(10, 15, 26, 0.03); border-color: rgba(10, 15, 26, 0.08); }
.slide.light .card:hover { background: rgba(10, 15, 26, 0.06); }
.slide.light .tag { background: rgba(10, 15, 26, 0.06); color: var(--muted-2); }
.slide.light .metric-card { background: var(--fg); border-color: rgba(10, 15, 26, 0.08); }
.slide.light .pill { background: rgba(10, 15, 26, 0.06); color: var(--muted-2); }

/* Theme: dark */
.slide.dark { background: var(--bg); color: var(--fg); }
.slide.dark .slide-number { color: rgba(255, 255, 255, 0.06); }
.slide.dark .card { background: var(--surface); border-color: var(--border); }
.slide.dark .card:hover { background: var(--surface-2); }
.slide.dark .tag { background: var(--surface); color: var(--muted); }
.slide.dark .metric-card { background: var(--surface); border-color: var(--border); }
.slide.dark .pill { background: var(--surface); color: var(--muted); }

/* Theme: hero dark */
.slide.hero-dark {
  background: var(--bg);
  color: var(--fg);
  justify-content: center;
  align-items: flex-start;
  padding: 120px 140px;
}
.slide.hero-dark .slide-number { color: rgba(255, 255, 255, 0.04); }
.slide.hero-dark .overline { color: var(--accent); letter-spacing: 0.12em; font-size: 13px; font-weight: 600; text-transform: uppercase; margin-bottom: 24px; }
.slide.hero-dark .accent-line { width: 60px; height: 2px; background: var(--accent); margin-bottom: 32px; }

/* Theme: hero light */
.slide.hero-light {
  background: var(--fg);
  color: var(--bg);
  justify-content: center;
  align-items: flex-start;
  padding: 120px 140px;
}
.slide.hero-light .slide-number { color: rgba(10, 15, 26, 0.06); }
.slide.hero-light .overline { color: var(--blue); letter-spacing: 0.12em; font-size: 13px; font-weight: 600; text-transform: uppercase; margin-bottom: 24px; }
.slide.hero-light .accent-line { width: 60px; height: 2px; background: var(--blue); margin-bottom: 32px; }

/* Slide background decorative gradient */
.slide.hero-dark::before {
  content: '';
  position: absolute; top: -50%; right: -30%;
  width: 800px; height: 800px;
  background: radial-gradient(circle, rgba(0, 224, 255, 0.03) 0%, transparent 70%);
  pointer-events: none;
}
.slide.hero-light::before {
  content: '';
  position: absolute; top: -40%; right: -20%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(0, 92, 255, 0.04) 0%, transparent 70%);
  pointer-events: none;
}

/* ===== Typography ===== */
.h-hero { font-family: var(--font-display); font-weight: 700; font-size: clamp(48px, 4vw, 72px); line-height: 1.1; letter-spacing: -0.02em; margin-bottom: 16px; }
.h-xl { font-family: var(--font-display); font-weight: 700; font-size: clamp(40px, 3.2vw, 56px); line-height: 1.15; letter-spacing: -0.02em; margin-bottom: 12px; }
.h-lg { font-family: var(--font-display); font-weight: 600; font-size: clamp(32px, 2.4vw, 42px); line-height: 1.2; letter-spacing: -0.015em; margin-bottom: 10px; }
.h-md { font-family: var(--font-display); font-weight: 600; font-size: clamp(22px, 1.6vw, 28px); line-height: 1.25; letter-spacing: -0.01em; margin-bottom: 8px; }
.h-sm { font-family: var(--font-display); font-weight: 600; font-size: clamp(18px, 1.2vw, 22px); line-height: 1.3; letter-spacing: -0.005em; }

.body-lg { font-size: clamp(18px, 1.2vw, 22px); line-height: 1.6; font-weight: 400; }
.body-md { font-size: clamp(16px, 1vw, 19px); line-height: 1.6; font-weight: 400; }
.body-sm { font-size: clamp(14px, 0.85vw, 16px); line-height: 1.5; font-weight: 400; }
.caption { font-size: 13px; line-height: 1.5; font-weight: 400; letter-spacing: 0.02em; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.accent { color: var(--accent); }
.blue { color: var(--blue); }
.muted { color: var(--muted); }

/* ===== Layout helpers ===== */
.slide-header {
  display: flex; align-items: baseline; gap: 16px;
  margin-bottom: 48px;
}
.slide-number {
  font-family: var(--font-mono);
  font-size: 14px; font-weight: 500;
  letter-spacing: 0.05em;
  min-width: 48px;
}
.slide-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 36px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.slide-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Grid layouts */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px; }
.grid-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 20px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 48px; }
.grid-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: 48px; }

.cols-2 { columns: 2; column-gap: 48px; }
.cols-3 { columns: 3; column-gap: 36px; }

/* Cards */
.card {
  padding: 24px; border-radius: var(--radius);
  border: 1px solid;
  transition: background 0.2s var(--ease-out);
}
.card-icon { font-size: 28px; margin-bottom: 12px; }

/* Stat display */
.stat-value { font-family: var(--font-display); font-weight: 700; font-size: 56px; line-height: 1; letter-spacing: -0.03em; margin-bottom: 4px; }
.stat-label { font-size: 15px; font-weight: 500; letter-spacing: 0.02em; }

/* Metric cards */
.metric-card {
  padding: 28px; border-radius: var(--radius);
  border: 1px solid;
  text-align: center;
}

/* Tags / pills */
.tag { display: inline-block; padding: 4px 12px; border-radius: 4px; font-size: 12px; font-weight: 500; letter-spacing: 0.03em; }
.pill { display: inline-block; padding: 4px 14px; border-radius: 20px; font-size: 12px; font-weight: 500; letter-spacing: 0.03em; }

/* Accent indicators */
.accent-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 10px; flex-shrink: 0; }
.accent-dot.cyan { background: var(--accent); }
.accent-dot.blue { background: var(--blue); }

/* ===== Slide-specific layouts ===== */

/* Cover */
#slide-01 .h-hero { font-size: clamp(56px, 5vw, 88px); margin-bottom: 20px; }
#slide-01 .cover-subtitle { font-size: clamp(20px, 1.4vw, 26px); font-weight: 400; color: var(--muted); max-width: 700px; line-height: 1.5; }

/* Agent cards — horizontal row */
.agent-grid {
  display: flex; gap: 12px; flex-wrap: wrap;
}
.agent-card {
  flex: 1; min-width: 160px; max-width: 200px;
  padding: 20px 16px;
  border-radius: var(--radius);
  border: 1px solid;
  text-align: center;
  transition: background 0.2s var(--ease-out);
}
.agent-card .agent-name { font-family: var(--font-display); font-weight: 600; font-size: 16px; margin-bottom: 4px; }
.agent-card .agent-desc { font-size: 12px; line-height: 1.4; }

/* Roadmap timeline */
.timeline { position: relative; padding-left: 32px; }
.timeline::before {
  content: ''; position: absolute; left: 10px; top: 8px; bottom: 8px;
  width: 1px; background: var(--border);
}
.timeline-item { position: relative; padding-bottom: 28px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: '';
  position: absolute; left: -26px; top: 6px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg);
}
.timeline-item.current::before { background: var(--blue); }
.timeline-item .tl-label { font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.timeline-item .tl-title { font-weight: 600; font-size: 18px; }

/* Comparison table */
.comparison-grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: 0; }
.comparison-header { padding: 14px 20px; font-weight: 600; font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase; }
.comparison-item { padding: 12px 20px; font-size: 15px; border-top: 1px solid; display: flex; align-items: center; gap: 10px; }
.comparison-item .check { color: var(--accent); }
.comparison-item .cross { color: var(--muted); opacity: 0.4; }

/* List with accent bullets */
.accent-list { list-style: none; }
.accent-list li {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 0;
  font-size: 17px; line-height: 1.5;
}
.accent-list li::before {
  content: '';
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); margin-top: 10px; flex-shrink: 0;
}

/* Ecosystem grid */
.ecosystem-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.eco-card {
  padding: 28px 24px; border-radius: var(--radius);
  border: 1px solid;
  text-align: center;
}
.eco-card .eco-icon { font-size: 36px; margin-bottom: 16px; }
.eco-card .eco-title { font-family: var(--font-display); font-weight: 700; font-size: 20px; margin-bottom: 8px; }

/* Business model */
.bm-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.bm-card {
  padding: 24px; border-radius: var(--radius);
  border: 1px solid;
  text-align: center;
}
.bm-card .bm-title { font-weight: 600; font-size: 15px; letter-spacing: 0.03em; text-transform: uppercase; margin-bottom: 12px; }
.bm-card .bm-value { font-family: var(--font-display); font-weight: 700; font-size: 28px; line-height: 1.2; margin-bottom: 6px; }
.bm-card .bm-desc { font-size: 13px; line-height: 1.4; }

/* Architecture flow */
.arch-row {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  flex-wrap: wrap;
}
.arch-node {
  padding: 12px 20px; border-radius: var(--radius);
  border: 1px solid; font-weight: 600; font-size: 14px;
  text-align: center;
}
.arch-arrow { color: var(--muted); font-size: 18px; font-weight: 300; }

/* Bar chart (simple CSS) */
.bar-chart { display: flex; flex-direction: column; gap: 16px; }
.bar-row { display: flex; align-items: center; gap: 16px; }
.bar-label { width: 120px; font-size: 14px; font-weight: 500; text-align: right; flex-shrink: 0; }
.bar-track { flex: 1; height: 28px; background: rgba(255,255,255,0.06); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; transition: width 0.6s var(--ease-out); }
.bar-value { width: 80px; font-size: 14px; font-weight: 600; font-family: var(--font-mono); }

/* ===== Controls ===== */
#controls {
  position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 20px;
  background: rgba(10, 15, 26, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 40px;
  padding: 8px 20px;
  z-index: 100;
  user-select: none;
}
#controls button {
  background: none; border: none; color: var(--fg);
  font-size: 18px; cursor: pointer; padding: 6px 8px;
  border-radius: 4px; transition: opacity 0.2s; opacity: 0.6;
  font-family: var(--font-body);
}
#controls button:hover { opacity: 1; }
#controls button:disabled { opacity: 0.2; cursor: default; }
#counter {
  font-family: var(--font-mono);
  font-size: 13px; color: var(--muted);
  min-width: 60px; text-align: center;
  letter-spacing: 0.03em;
}

#dots {
  display: flex; align-items: center; gap: 6px;
}
.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--muted); opacity: 0.3;
  cursor: pointer; transition: all 0.2s var(--ease-out);
}
.dot.active { opacity: 1; background: var(--accent); width: 20px; border-radius: 3px; }
.dot:hover { opacity: 0.6; }

/* ===== Progress bar (top) ===== */
#progress {
  position: fixed; top: 0; left: 0; height: 2px;
  background: var(--accent); z-index: 200;
  transition: width 0.4s var(--ease-out);
}

/* ===== Subtle entrance animation ===== */
.slide.active .slide-number,
.slide.active .slide-title,
.slide.active .slide-content > * {
  animation: slideFadeIn 0.6s var(--ease-out) both;
}
.slide.active .slide-number { animation-delay: 0.05s; }
.slide.active .slide-title { animation-delay: 0.1s; }
.slide.active .slide-content > *:nth-child(1) { animation-delay: 0.15s; }
.slide.active .slide-content > *:nth-child(2) { animation-delay: 0.2s; }
.slide.active .slide-content > *:nth-child(3) { animation-delay: 0.25s; }
.slide.active .slide-content > *:nth-child(4) { animation-delay: 0.3s; }
.slide.active .slide-content > *:nth-child(5) { animation-delay: 0.35s; }
.slide.active .slide-content > *:nth-child(6) { animation-delay: 0.4s; }

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

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .slide { padding: 40px 32px; }
  .slide.hero-dark, .slide.hero-light { padding: 60px 36px; }
  .h-hero { font-size: 32px !important; }
  .h-xl { font-size: 28px !important; }
  .h-lg { font-size: 24px !important; }
  .slide-title { font-size: 24px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; gap: 16px; }
  .agent-card { min-width: 100px; max-width: none; flex: 0 0 calc(50% - 8px); }
  .ecosystem-grid { grid-template-columns: 1fr; }
  .bm-grid { grid-template-columns: 1fr 1fr; }
  .cols-2, .cols-3 { columns: 1; }
  .comparison-grid { grid-template-columns: 1fr; }
  .slide-number { min-width: 32px; font-size: 12px; }
  .stat-value { font-size: 36px; }
  #controls { bottom: 16px; padding: 6px 14px; gap: 12px; }

  /* ===== Mobile presentation mode (activated via JS .mobile-mode) ===== */
  #app.mobile-mode #stage {
    width: 100vw;
    height: 100vh;
    transform: none !important;
    overflow: hidden;
  }
  #app.mobile-mode #track {
    display: flex;
    height: 100%;
    will-change: transform;
  }
  #app.mobile-mode .slide {
    position: relative !important;
    flex: 0 0 100vw;
    width: 100vw;
    height: 100vh;
    opacity: 1 !important;
    visibility: visible !important;
    padding: 40px calc(24px + env(safe-area-inset-right, 0px)) 40px calc(24px + env(safe-area-inset-left, 0px));
    padding-top: calc(40px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  #app.mobile-mode .slide.hero-dark,
  #app.mobile-mode .slide.hero-light {
    padding: 60px calc(24px + env(safe-area-inset-right, 0px)) 60px calc(24px + env(safe-area-inset-left, 0px));
    padding-top: calc(60px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px));
    justify-content: flex-start;
  }
  #app.mobile-mode .slide.hero-dark::before,
  #app.mobile-mode .slide.hero-light::before {
    display: none;
  }
  #app.mobile-mode .slide-header {
    margin-bottom: 24px;
  }
  #app.mobile-mode .slide-number {
    min-width: 36px;
    font-size: 12px;
  }
  #app.mobile-mode .slide-title {
    font-size: 26px;
  }

  /* Mobile controls — enlarged touch targets */
  #app.mobile-mode #controls {
    bottom: max(16px, env(safe-area-inset-bottom, 16px));
    padding: 10px 20px;
    gap: 18px;
    border-radius: 32px;
    background: rgba(10, 15, 26, 0.92);
    left: 50%;
    transform: translateX(-50%);
  }
  #app.mobile-mode #controls button {
    font-size: 24px;
    min-width: 48px;
    min-height: 48px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
  }
  #app.mobile-mode #counter {
    font-size: 14px;
    min-width: 72px;
  }

  /* Larger dots for tap targeting */
  #app.mobile-mode .dot {
    width: 10px;
    height: 10px;
    cursor: pointer;
  }
  #app.mobile-mode .dot.active {
    width: 32px;
    height: 10px;
    border-radius: 5px;
  }

  /* Thicker progress bar */
  #app.mobile-mode #progress {
    height: 3px;
    z-index: 300;
  }

  /* Zoom mode */
  #app.mobile-mode .slide.zoom-mode {
    transform: scale(2);
    transform-origin: center top;
    overflow-y: auto;
  }
}

@media print {
  #controls, #progress, #dots { display: none !important; }
  .slide { opacity: 1 !important; visibility: visible !important; position: relative !important; break-after: page; height: 1080px; }
  #stage { transform: none !important; width: 100%; height: auto; }
}
