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

:root {
  --bg: #0a0a0b;
  --bg-card: #111113;
  --bg-card-hover: #18181b;
  --bg-locked: #0d0d0e;
  --border: rgba(255,255,255,0.06);
  --border-hover: rgba(255,255,255,0.12);
  --text: #fafafa;
  --text-secondary: #8a8a8d;
  --text-muted: #5a5a5d;
  --accent: #c8a86e;
  --accent-dim: rgba(200,168,110,0.15);
  --green: #34d399;
  --green-dim: rgba(52,211,153,0.12);
  --amber: #fbbf24;
  --amber-dim: rgba(251,191,36,0.12);
  --red: #f87171;
  --red-dim: rgba(248,113,113,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 0 0 1px var(--border);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* === NAV === */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 10;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 2px;
}
.metis-mark {
  width: 32px; height: 32px;
  background: var(--accent);
  color: #0a0a0b;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px;
}
.nav-cta {
  padding: 8px 20px;
  border: 1px solid var(--border-hover);
  border-radius: 100px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}
.nav-cta:hover { border-color: var(--accent); color: var(--accent); }

/* === HERO === */
.hero {
  min-height: 55vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 120px 24px 48px;
  position: relative;
}
.hero::before {
  content: '';
  position: absolute;
  top: -100px; left: 50%; transform: translateX(-50%);
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(200,168,110,0.06) 0%, transparent 70%);
  pointer-events: none;
}
.hero-headline {
  font-size: clamp(36px, 6vw, 72px);
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1.05;
  max-width: 800px;
}
.hero-sub {
  margin-top: 20px;
  font-size: clamp(16px, 2vw, 20px);
  color: var(--text-secondary);
  font-weight: 400;
  max-width: 520px;
}

/* === VIDEO === */
.video-section { padding: 0 24px 60px; display: flex; justify-content: center; }
.video-container { width: 100%; max-width: 900px; }
.video-placeholder {
  aspect-ratio: 16/9;
  border: 1px dashed rgba(255,255,255,0.12);
  border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; color: var(--text-muted); font-size: 14px; letter-spacing: 1px;
  background: rgba(255,255,255,0.015);
}
.video-play-icon { opacity: 0.5; }

/* === DASHBOARD === */
.dashboard-section {
  min-height: 100vh;
  padding: 60px 24px 120px;
  max-width: 1200px;
  margin: 0 auto;
}
.dashboard-header { text-align: center; margin-bottom: 40px; }
.dashboard-header h2 {
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 700; letter-spacing: -1px;
}
.dashboard-sub { color: var(--text-secondary); margin-top: 8px; font-size: 15px; }

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}

/* === CARDS === */
.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
}
.dash-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
}
.dash-card:hover { border-color: var(--border-hover); }

/* Grid spans */
.card-span2 { grid-column: span 2; }
.card-span3 { grid-column: span 3; }
.card-span6 { grid-column: span 6; }

/* Locked state */
.card-locked {
  background: var(--bg-locked);
  opacity: 0.45;
  filter: saturate(0.3);
  pointer-events: none;
}
.card-locked .card-value,
.card-locked .card-detail { color: var(--text-muted); }

/* Active state */
.card-active {
  opacity: 1;
  filter: none;
  pointer-events: auto;
  animation: cardUnlock 0.6s ease;
}
@keyframes cardUnlock {
  0% { opacity: 0.45; filter: saturate(0.3); transform: scale(0.98); }
  50% { box-shadow: 0 0 20px rgba(200,168,110,0.08); }
  100% { opacity: 1; filter: none; transform: scale(1); }
}

/* Card elements */
.card-label {
  font-size: 11px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 1.5px;
  font-weight: 500; margin-bottom: 10px;
}
.card-value { font-size: 32px; font-weight: 700; letter-spacing: -1px; line-height: 1; }
.card-detail { font-size: 13px; color: var(--text-secondary); margin-top: 8px; }
.card-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.04);
}
.card-trend {
  display: flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--red);
  margin-top: 6px;
}

/* Data badge */
.card-badge {
  position: absolute;
  top: 12px; right: 12px;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 100px;
  border: 1px dashed rgba(255,255,255,0.15);
  color: var(--text-muted);
  letter-spacing: 0.5px;
  font-weight: 500;
}
.badge-verified {
  border: 1px solid var(--green);
  color: var(--green);
  background: var(--green-dim);
  border-style: solid;
}

/* Status colors */
.status-green .card-value { color: var(--green); }
.status-green .card-icon { background: var(--green-dim); color: var(--green); }
.status-amber .card-value { color: var(--amber); }
.status-amber .card-icon { background: var(--amber-dim); color: var(--amber); }
.status-red .card-value { color: var(--red); }
.status-red .card-icon { background: var(--red-dim); color: var(--red); }

/* === SCORE RING === */
.card-span2:first-child { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.score-ring { position: relative; width: 110px; height: 110px; margin: 4px 0; }
.score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score-arc { stroke: var(--text-muted); transition: stroke 0.5s ease; }
.score-value {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700;
}
.score-label { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* === REVENUE PROJECTION CHART === */
.chart-container { width: 100%; height: 220px; position: relative; margin-top: 8px; }
.chart-container canvas { position: absolute; inset: 0; }
.chart-legend {
  display: flex; gap: 20px; font-size: 11px; color: var(--text-muted);
}
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-line { display: inline-block; width: 20px; height: 2px; border-radius: 1px; }
.legend-current { background: rgba(255,255,255,0.2); border-top: 2px dashed rgba(255,255,255,0.2); height: 0; }
.legend-optimized { background: var(--accent); }

/* === FUNNEL === */
.funnel-container { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.funnel-stage { display: flex; align-items: center; gap: 12px; }
.funnel-bar {
  flex: 1; height: 28px;
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}
.funnel-fill {
  height: 100%; width: 0;
  border-radius: 6px;
  background: var(--accent);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.funnel-info {
  display: flex; justify-content: space-between;
  min-width: 100px;
  font-size: 12px;
}
.funnel-name { color: var(--text-secondary); }
.funnel-count { font-weight: 600; font-variant-numeric: tabular-nums; }
.funnel-dropoff {
  text-align: center;
  font-size: 10px; color: var(--red);
  padding: 0 0 0 40px;
  opacity: 0.7;
}

/* === BENCHMARK BARS === */
.benchmark-container { margin-top: 8px; display: flex; flex-direction: column; gap: 16px; }
.bench-row {}
.bench-label { font-size: 11px; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 1px; }
.bench-bars { display: flex; flex-direction: column; gap: 4px; }
.bench-bar-wrap {
  display: flex; align-items: center; gap: 8px;
  height: 20px;
}
.bench-bar {
  height: 8px;
  border-radius: 4px;
  width: 0;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}
.bench-yours { background: var(--accent); }
.bench-industry { background: rgba(255,255,255,0.12); }
.bench-val { font-size: 11px; color: var(--text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bench-legend {
  display: flex; gap: 16px; margin-top: 8px; font-size: 11px; color: var(--text-muted);
}
.legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.legend-dot-yours { background: var(--accent); }
.legend-dot-industry { background: rgba(255,255,255,0.12); }

/* === SPARKLINE === */
.sparkline-container { width: 100%; height: 100px; margin-top: 8px; }
.sparkline-container svg { width: 100%; height: 100%; }
.sparkline-labels {
  display: flex; justify-content: space-between;
  font-size: 10px; color: var(--text-muted);
  margin-top: 4px; padding: 0 2px;
}

/* === GAUGE === */
.gauge-container {
  display: flex; flex-direction: column; align-items: center;
  margin-top: 8px;
}
.gauge-container svg { width: 160px; height: 100px; }
.gauge-arc { stroke: var(--text-muted); transition: stroke 0.5s ease; }
.gauge-value { font-size: 32px; font-weight: 700; margin-top: -8px; }
.gauge-label { font-size: 12px; color: var(--text-muted); }

/* === CAC:LTV VISUAL === */
.cac-visual { margin: 12px 0 16px; }
.cac-bar-container {
  display: flex; height: 24px; border-radius: 6px; overflow: hidden;
  background: rgba(255,255,255,0.03);
}
.cac-segment {
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600; letter-spacing: 0.5px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden; white-space: nowrap;
}
.cac-segment-cac { background: var(--red-dim); color: var(--red); width: 50%; }
.cac-segment-ltv { background: var(--green-dim); color: var(--green); width: 50%; }

/* === RECOVERY === */
.recovery-icon { background: var(--green-dim); color: var(--green); }
.recovery-value { color: var(--green); font-size: 36px; }

/* === GAPS === */
.gaps-list { display: flex; flex-direction: column; gap: 12px; }
.gap-placeholder { color: var(--text-muted); font-size: 14px; padding: 20px 0; text-align: center; }
.gap-card {
  display: flex; gap: 16px; padding: 16px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  animation: gapSlideIn 0.5s ease forwards;
  opacity: 0; transform: translateY(10px);
}
@keyframes gapSlideIn { to { opacity: 1; transform: translateY(0); } }
.gap-indicator { width: 4px; border-radius: 4px; flex-shrink: 0; }
.gap-indicator.sev-red { background: var(--red); box-shadow: 0 0 12px var(--red-dim); }
.gap-indicator.sev-amber { background: var(--amber); box-shadow: 0 0 12px var(--amber-dim); }
.gap-indicator.sev-green { background: var(--green); box-shadow: 0 0 12px var(--green-dim); }
.gap-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.gap-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

/* === CHATBOT === */
.chatbot-trigger {
  position: fixed; bottom: 24px; right: 24px;
  width: 56px; height: 56px; cursor: pointer; z-index: 1000;
}
.trigger-pulse {
  position: absolute; inset: -6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.2;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 0.2; } 50% { transform: scale(1.3); opacity: 0; } }
.trigger-avatar {
  position: relative;
  width: 56px; height: 56px;
  background: var(--accent); color: #0a0a0b;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 20px;
  box-shadow: 0 4px 24px rgba(200,168,110,0.3);
  transition: transform 0.2s;
}
.trigger-avatar:hover { transform: scale(1.05); }

.chatbot-window {
  position: fixed; bottom: 96px; right: 24px;
  width: 380px; height: 520px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: none; flex-direction: column;
  z-index: 1001;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
  overflow: hidden;
  animation: chatIn 0.3s ease;
}
.chatbot-window.open { display: flex; }
@keyframes chatIn { from { opacity: 0; transform: translateY(12px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }

.chat-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}
.chat-header-left { display: flex; align-items: center; gap: 12px; }
.chat-avatar {
  width: 36px; height: 36px;
  background: var(--accent); color: #0a0a0b;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}
.chat-name { font-weight: 600; font-size: 14px; }
.chat-status { font-size: 11px; color: var(--green); }
.chat-close {
  background: none; border: none; color: var(--text-secondary);
  font-size: 24px; cursor: pointer; line-height: 1; padding: 0 4px;
}
.chat-close:hover { color: var(--text); }

.chat-body {
  flex: 1; overflow-y: auto; padding: 20px;
  display: flex; flex-direction: column; gap: 16px;
}
.chat-body::-webkit-scrollbar { width: 4px; }
.chat-body::-webkit-scrollbar-track { background: transparent; }
.chat-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.chat-msg { max-width: 90%; animation: msgIn 0.3s ease; }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.msg-bot {
  background: rgba(255,255,255,0.04);
  border-radius: 12px 12px 12px 4px;
  padding: 12px 16px; font-size: 14px; line-height: 1.5; color: var(--text-secondary);
}
.msg-user {
  align-self: flex-end;
  background: var(--accent); color: #0a0a0b;
  border-radius: 12px 12px 4px 12px;
  padding: 10px 16px; font-size: 14px; font-weight: 500;
}
.chat-options { display: flex; flex-wrap: wrap; gap: 8px; animation: msgIn 0.3s ease; }
.chat-opt {
  padding: 8px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-secondary);
  font-size: 13px; cursor: pointer;
  transition: all 0.2s; font-family: inherit;
}
.chat-opt:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

/* CRM guide */
.crm-guide { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.crm-step { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--text-secondary); line-height: 1.4; }
.crm-step-num {
  width: 22px; height: 22px;
  background: var(--accent-dim); color: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.upload-area {
  margin-top: 12px; padding: 20px;
  border: 1px dashed rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  text-align: center; cursor: pointer;
  transition: all 0.2s;
  font-size: 13px; color: var(--text-muted);
}
.upload-area:hover { border-color: var(--accent); background: var(--accent-dim); color: var(--accent); }
.upload-area input { display: none; }

/* Typing */
.typing-dots {
  display: flex; gap: 4px; padding: 12px 16px;
  background: rgba(255,255,255,0.04);
  border-radius: 12px 12px 12px 4px; width: fit-content;
}
.typing-dots span {
  width: 6px; height: 6px;
  background: var(--text-muted); border-radius: 50%;
  animation: typingDot 1.2s ease-in-out infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }

/* === CTA === */
.cta-section { margin-top: 48px; text-align: center; animation: ctaIn 0.8s ease; }
@keyframes ctaIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.cta-inner {
  padding: 48px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(200,168,110,0.04), rgba(200,168,110,0.01));
}
.cta-inner h3 { font-size: 24px; font-weight: 700; letter-spacing: -0.5px; margin-bottom: 8px; }
.cta-inner p { color: var(--text-secondary); font-size: 15px; margin-bottom: 28px; }
.cta-button {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 32px;
  background: var(--accent); color: #0a0a0b;
  border: none; border-radius: 100px;
  font-size: 15px; font-weight: 600;
  text-decoration: none; cursor: pointer;
  transition: all 0.2s; font-family: inherit;
}
.cta-button:hover { transform: translateY(-1px); box-shadow: 0 8px 32px rgba(200,168,110,0.3); }

/* === CURRENCY TOGGLE === */
.currency-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 12px;
  font-size: 12px; color: var(--text-muted);
}
.currency-toggle select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px;
  padding: 4px 8px;
  cursor: pointer;
}
.currency-toggle select:hover { border-color: var(--border-hover); }

/* === INSUFFICIENT DATA === */
.gap-insufficient {
  opacity: 0.6;
  border-style: dashed;
}
.gap-indicator.sev-muted {
  background: var(--text-muted);
  box-shadow: none;
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
  .card-span2 { grid-column: span 1; }
  .card-span3 { grid-column: span 1; }
  .card-span6 { grid-column: span 2; }
}
/* === ROAS Card === */
.roas-header {
  display: flex;
  gap: 24px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.roas-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.roas-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.roas-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}
.roas-stat-main .roas-stat-value {
  font-size: 28px;
  color: var(--accent);
}
.roas-bar-container {
  display: flex;
  gap: 4px;
  height: 36px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.roas-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: rgba(0,0,0,0.7);
  border-radius: var(--radius-sm);
  transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
  min-width: 40px;
}
.roas-bar-revenue {
  background: var(--green);
}
.roas-bar-spend {
  background: var(--red);
}

@media (max-width: 768px) {
  .nav { padding: 16px 20px; }
  .hero { padding: 100px 20px 40px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .card-span2, .card-span3, .card-span6 { grid-column: span 1; }
  .chatbot-window {
    bottom: 0; right: 0; left: 0;
    width: 100%; height: 70vh;
    border-radius: 16px 16px 0 0;
  }
  .cta-inner { padding: 32px 20px; }
  .chart-container { height: 180px; }
}
@media (max-width: 480px) {
  .hero-headline { font-size: 28px; letter-spacing: -1px; }
  .dashboard-section { padding: 40px 12px 80px; }
  .chatbot-window { height: 80vh; }
  .chart-container { height: 150px; }
}
