/* ── Reset & base ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --slack-bg: #1a1d21;
  --slack-sidebar: #19171d;
  --slack-main: #1a1d21;
  --slack-border: #383838;
  --slack-text: #d1d2d3;
  --slack-muted: #9b9b9b;
  --slack-accent: #611f69;
  --slack-purple: #4a154b;
  --slack-link: #1d9bd1;
  --bot-green: #2bac76;
  --page-bg: #0f0f10;
  --card-bg: #18181b;
  --accent: #9b30ff;
  --accent-light: #c47fff;
  --text: #e4e4e7;
  --muted: #71717a;
  --border: #27272a;
}

html { scroll-behavior: smooth; }

body {
  background: var(--page-bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
}

/* ── Hero ─────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #0f0f10 0%, #1a0a2e 50%, #0f0f10 100%);
  border-bottom: 1px solid var(--border);
  padding: 48px 24px 40px;
}

.hero-inner {
  max-width: 900px;
  margin: 0 auto;
}

.project-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: 12px;
}

.hero h1 {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #e4e4e7 0%, var(--accent-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 14px;
}

.tagline {
  font-size: 15px;
  color: var(--muted);
  max-width: 600px;
  line-height: 1.7;
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.tech-stack span {
  background: rgba(155, 48, 255, 0.12);
  border: 1px solid rgba(155, 48, 255, 0.25);
  color: var(--accent-light);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}


/* ── Demo section ─────────────────────────────────────── */
.demo-section {
  padding: 64px 24px;
  border-bottom: 1px solid var(--border);
}

.demo-header {
  max-width: 900px;
  margin: 0 auto 40px;
}

.demo-header h2 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.demo-header p {
  color: var(--muted);
  font-size: 15px;
}

.demo-wrapper {
  max-width: 900px;
  margin: 0 auto;
}

/* ── Step nav ─────────────────────────────────────────── */
.step-nav {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 4px;
}

.step-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

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

.step-btn.active {
  background: rgba(155, 48, 255, 0.15);
  border-color: var(--accent);
  color: var(--accent-light);
}

.step-num {
  width: 20px;
  height: 20px;
  background: var(--border);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-btn.active .step-num {
  background: var(--accent);
  color: white;
}

.step-connector {
  height: 1px;
  width: 16px;
  background: var(--border);
  flex-shrink: 0;
}

/* ── Slack frame ──────────────────────────────────────── */
.slack-frame {
  display: flex;
  background: var(--slack-bg);
  border-radius: 12px;
  border: 1px solid var(--slack-border);
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
  min-height: 520px;
}

/* Sidebar */
.slack-sidebar {
  width: 220px;
  background: var(--slack-purple);
  flex-shrink: 0;
  padding: 16px 0;
  overflow: hidden;
}

.sidebar-workspace {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  padding: 4px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 8px;
}

.sidebar-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.5);
  padding: 8px 16px 4px;
}

.sidebar-dm {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  font-size: 14px;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  border-radius: 4px;
  margin: 1px 4px;
  position: relative;
}

.sidebar-dm.active {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

.dm-avatar {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
  color: white;
}

.dm-avatar.bot { background: var(--bot-green); border-radius: 50%; }
.dm-avatar.user { background: var(--slack-accent); }
.dm-avatar:not(.bot):not(.user) { background: #5865f2; }

.dm-avatar.small {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.dm-badge {
  background: #cd2553;
  color: white;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  padding: 0 5px;
  min-width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
}

/* Main area */
.slack-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.slack-topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--slack-border);
}

.topbar-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--slack-text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.bot-tag {
  background: rgba(255,255,255,0.15);
  color: var(--slack-muted);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
}

.slack-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  position: relative;
}

/* Messages */
.message-group {
  margin-bottom: 16px;
}

.msg-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.msg-author {
  font-size: 14px;
  font-weight: 700;
  color: var(--slack-text);
}

.app-tag {
  background: rgba(255,255,255,0.1);
  color: var(--slack-muted);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 3px;
}

.msg-time {
  font-size: 11px;
  color: var(--slack-muted);
}

.msg-body {
  padding-left: 36px;
}

.msg-bubble {
  display: inline-block;
  font-size: 14px;
  color: var(--slack-text);
  line-height: 1.5;
  max-width: 100%;
}

.cmd-bubble {
  font-family: 'SF Mono', Monaco, monospace;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 2px 8px;
  border-radius: 4px;
  color: #aaa;
  font-size: 13px;
}

.bot-bubble {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 12px 16px;
  border-radius: 8px;
  width: 100%;
  display: block;
}

.bot-bubble strong {
  color: #fff;
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
}


/* POC details */
.poc-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.detail-row {
  font-size: 13px;
  color: var(--slack-muted);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.detail-icon { flex-shrink: 0; }

.fake-link {
  color: var(--slack-link);
  text-decoration: underline;
  cursor: pointer;
}

.detail-row code {
  background: rgba(255,255,255,0.08);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 12px;
  color: #e2e8f0;
}

.detail-code {
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  padding: 10px 12px;
  margin-top: 4px;
}

.detail-code code {
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 12px;
  color: #a5f3fc;
  display: block;
  line-height: 1.7;
}

/* ── Demo step transitions ────────────────────────────── */
.demo-step { display: block; }
.demo-step.hidden { display: none; }

/* ── Glow animation on Next/tip buttons ──────────────── */
.tip-next-btn {
  animation: profGlow 1.6s ease-in-out infinite;
}

.tip-next-btn:disabled {
  animation: none;
}

@keyframes profGlow {
  0%, 100% { box-shadow: 0 0 8px 2px rgba(155, 48, 255, 0.5), 0 0 20px 4px rgba(155, 48, 255, 0.2); }
  50%       { box-shadow: 0 0 16px 4px rgba(196, 127, 255, 0.6), 0 0 32px 8px rgba(155, 48, 255, 0.25); }
}

/* ── Restart wrap ─────────────────────────────────────── */
.restart-wrap {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.next-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.next-btn:hover { background: #6d28d9; }

.restart-btn {
  background: var(--bot-green);
}

.restart-btn:hover { background: #22906a; }

/* ── Slack modal overlay ──────────────────────────────── */
.slack-modal-overlay {
  position: relative;
  margin: 8px 0 0;
  padding-left: 36px;
}

.slack-modal {
  background: #222529;
  border: 1px solid #3f3f46;
  border-radius: 12px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #3f3f46;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: #e8e8e8;
}

.modal-close {
  color: var(--slack-muted);
  cursor: pointer;
  font-size: 16px;
}

.modal-body {
  padding: 20px;
}

.modal-label {
  font-size: 13px;
  font-weight: 600;
  color: #c7c7c7;
  margin-bottom: 12px;
}

/* Action grid */
.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.action-btn {
  background: #2c2d31;
  border: 1px solid #3f3f46;
  border-radius: 8px;
  color: #c7c7c7;
  padding: 9px 12px;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}

.action-btn:hover {
  background: #383a40;
  border-color: var(--accent);
  color: #fff;
}

.action-btn.selected {
  background: rgba(155, 48, 255, 0.2);
  border-color: var(--accent);
  color: var(--accent-light);
}

/* Form modal */
.form-modal .modal-body { padding: 16px 20px; }

.form-field {
  margin-bottom: 14px;
}

.form-field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #c7c7c7;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-hint {
  font-size: 11px;
  color: var(--slack-muted);
  margin-bottom: 5px;
  line-height: 1.4;
}

.form-input {
  background: #1a1d21;
  border: 1px solid #3f3f46;
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 13px;
  color: var(--slack-muted);
  width: 100%;
}

.form-input.filled { color: #e8e8e8; }
.form-input.placeholder { color: #555; font-style: italic; }

input.text-input {
  color: #e8e8e8;
  outline: none;
  transition: border-color 0.15s;
}

input.text-input:focus {
  border-color: var(--accent);
}

input.text-input[type="number"] {
  -moz-appearance: textfield;
}

input.text-input[type="number"]::-webkit-inner-spin-button,
input.text-input[type="number"]::-webkit-outer-spin-button {
  opacity: 1;
  filter: invert(1) brightness(0.6);
}

.form-input.dropdown {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.caret { color: var(--slack-muted); }

.form-row {
  display: flex;
  gap: 10px;
}

.form-field.half { flex: 1; min-width: 0; }

.modal-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #3f3f46;
}

.modal-btn {
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s;
}

.modal-btn.secondary {
  background: #2c2d31;
  border: 1px solid #3f3f46;
  color: #c7c7c7;
}

.modal-btn.primary {
  background: var(--accent);
  color: white;
}

.modal-btn.primary:hover { background: #6d28d9; }

/* ── Message composer (step 0) ───────────────────────── */
.slack-composer-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 0 4px;
}

.slack-composer {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 10px 12px;
}

.composer-input {
  flex: 1;
  font-size: 14px;
  color: var(--slack-text);
  font-family: 'SF Mono', Monaco, monospace;
  display: flex;
  align-items: center;
}

.composer-cursor {
  display: inline-block;
  width: 2px;
  height: 16px;
  background: var(--slack-text);
  margin-left: 1px;
  animation: blink 1.1s step-start infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.composer-send {
  background: var(--accent);
  border: none;
  border-radius: 6px;
  color: white;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.1s;
  padding: 0;
}

.composer-send:hover {
  background: #6d28d9;
  transform: scale(1.05);
}

.composer-hint {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* ── Loading dots ────────────────────────────────────── */
.loading-dots span {
  animation: dotFade 1.4s infinite;
  opacity: 0;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotFade {
  0%, 80%, 100% { opacity: 0; }
  40% { opacity: 1; }
}

/* ── Pulsing CTA action button ───────────────────────── */
.action-btn-cta {
  /* glow moved to .tip-next-btn */
}

/* ── Custom select dropdowns ─────────────────────────── */
.custom-select {
  position: relative;
}

.custom-select .select-trigger {
  cursor: pointer;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.custom-select .select-trigger:hover {
  border-color: #6d6d6d;
}

.custom-select.open .select-trigger {
  border-color: var(--accent);
}

.custom-select.open .caret {
  display: inline-block;
  transform: rotate(180deg);
}

.select-options {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #2c2d31;
  border: 1px solid #4a4a50;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  z-index: 100;
  overflow: hidden;
  max-height: 200px;
  overflow-y: auto;
}

.custom-select.open .select-options {
  display: block;
}

.select-option {
  padding: 8px 12px;
  font-size: 13px;
  color: #c7c7c7;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.1s;
}

.select-option:hover {
  background: rgba(155, 48, 255, 0.15);
  color: #fff;
}

.select-option.selected {
  color: var(--accent-light);
}

.select-option.selected::after {
  content: '✓';
  margin-left: auto;
  font-size: 12px;
  color: var(--accent-light);
}

.select-option.user-option.selected::after {
  content: '✓';
}

/* User pill inside trigger */
.user-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #e8e8e8;
}

.dm-avatar.tiny {
  width: 20px;
  height: 20px;
  font-size: 9px;
  border-radius: 4px;
  flex-shrink: 0;
}

/* ── Architecture section ─────────────────────────────── */
.arch-section {
  padding: 64px 24px;
  border-bottom: 1px solid var(--border);
}

.arch-inner {
  max-width: 900px;
  margin: 0 auto;
}

.arch-inner h2 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 40px;
}

.arch-flow {
  display: flex;
  align-items: flex-start;
  gap: 0;
  flex-wrap: wrap;
}

.arch-node {
  flex: 1;
  min-width: 160px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

.arch-icon {
  font-size: 28px;
  margin-bottom: 10px;
}

.arch-name {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.arch-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.arch-arrow {
  font-size: 20px;
  color: var(--accent-light);
  padding: 20px 8px 0;
  flex-shrink: 0;
  align-self: center;
}

/* ── Footer ───────────────────────────────────────────── */
.project-footer {
  padding: 40px 24px;
  text-align: center;
}

.back-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

.back-link:hover { color: var(--accent-light); }

/* ── Walkthrough highlight blocks ────────────────────── */
.hl-block {
  transition: opacity 0.3s;
  margin-bottom: 4px;
}

.hl-block.hl-hidden { display: none; }

.hl-block.dimmed {
  opacity: 0.35;
  pointer-events: none;
}

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

.hl-block.revealed {
  animation: hlReveal 0.3s ease forwards;
}

.hl-content {
  border-radius: 6px;
  border: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}

.hl-block.revealed .hl-content {
  border-color: rgba(155, 48, 255, 0.35);
  background: rgba(155, 48, 255, 0.04);
}

.hl-block.dimmed .hl-content {
  border-color: transparent;
  background: transparent;
}

/* ── Spotlight tip card ───────────────────────────────── */
.spotlight-tip {
  display: none;
  align-items: flex-start;
  gap: 12px;
  background: rgba(155, 48, 255, 0.08);
  border: 1px solid rgba(155, 48, 255, 0.28);
  border-radius: 8px;
  padding: 11px 14px;
  margin-top: 10px;
}

.spotlight-tip.active { display: flex; }

.tip-text {
  font-size: 13px;
  color: var(--accent-light);
  line-height: 1.55;
  flex: 1;
}

.tip-text code {
  background: rgba(155, 48, 255, 0.2);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 12px;
  color: var(--accent-light);
}

.tip-text strong {
  color: #c4b5fd;
}

.tip-next-btn {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s;
}

.tip-next-btn:hover { background: #6d28d9; }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 640px) {
  .hero { padding: 48px 16px 40px; }
  .demo-section { padding: 32px 12px; }

  /* Hide sidebar entirely on mobile */
  .slack-sidebar { display: none; }

  /* Step nav */
  .step-label { display: none; }
  .step-connector { width: 8px; }

  /* Modals */
  .action-grid { grid-template-columns: 1fr; }
  .slack-modal { max-width: 100%; }
  .slack-modal-overlay { padding-left: 0; }

  /* Messages */
  .msg-body { padding-left: 0; }
  .bot-bubble { font-size: 13px; }

  /* Fix detail rows — let text wrap naturally, no hard flex layout */
  .detail-row {
    flex-wrap: wrap;
    word-break: break-word;
  }

  /* Fix code blocks overflowing */
  .detail-code {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .detail-code code {
    word-break: break-all;
    white-space: pre-wrap;
  }

  /* Fix inline code in detail rows */
  .detail-row code {
    word-break: break-all;
  }
}

/* ── Back button ────────────────────────────────────────── */
.back-btn {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.1rem;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.back-btn:hover {
  background: rgba(14,165,233,0.15);
  color: var(--accent);
  border-color: var(--accent);
}
