/* ═══════════════════════════════════════════════════════════
   SOL-402 Demo  •  Design System & Theme
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Solana palette */
  --sol-purple: #9945FF;
  --sol-cyan:   #14F195;
  --sol-blue:   #00D1FF;
  --sol-pink:   #F037A5;
  --sol-orange: #FFA500;

  /* Surfaces */
  --bg-primary:   #0a0b0f;
  --bg-secondary: #12141c;
  --bg-card:      #181b27;
  --bg-hover:     #1f2235;
  --bg-glass:     rgba(24, 27, 39, 0.65);

  /* Text */
  --text-primary:   #e8eaf0;
  --text-secondary: #8a8fa8;
  --text-muted:     #545770;

  /* Borders */
  --border-subtle:  rgba(153, 69, 255, 0.12);
  --border-glow:    rgba(20, 241, 149, 0.25);

  /* Gradients */
  --grad-hero:    linear-gradient(135deg, #9945FF 0%, #14F195 100%);
  --grad-card:    linear-gradient(160deg, rgba(153,69,255,0.08) 0%, rgba(20,241,149,0.04) 100%);
  --grad-btn:     linear-gradient(135deg, #9945FF 0%, #7B3FE4 50%, #14F195 100%);
  --grad-badge:   linear-gradient(135deg, #14F195 0%, #00D1FF 100%);

  /* Shadows */
  --shadow-card:  0 4px 24px rgba(0,0,0,0.35), 0 0 0 1px var(--border-subtle);
  --shadow-glow:  0 0 30px rgba(153,69,255,0.15), 0 0 60px rgba(20,241,149,0.08);
  --shadow-btn:   0 4px 16px rgba(153,69,255,0.3);

  /* Radius */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-xl: 28px;

  /* Transitions */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.65;
  overflow-x: hidden;
}

/* ── Typography ─────────────────────────────────────── */

h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); letter-spacing: -0.02em; }
h3 { font-size: 1.25rem; }
code, .mono { font-family: 'JetBrains Mono', monospace; }

.gradient-text {
  background: var(--grad-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.badge-green  { background: rgba(20,241,149,0.12); color: var(--sol-cyan); }
.badge-purple { background: rgba(153,69,255,0.12); color: var(--sol-purple); }
.badge-blue   { background: rgba(0,209,255,0.12);  color: var(--sol-blue); }
.badge-pink   { background: rgba(240,55,165,0.12); color: var(--sol-pink); }

/* ── Layout ─────────────────────────────────────────── */

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.section   { padding: 100px 0; }

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sol-cyan);
}
.section-label::before {
  content: '';
  display: block;
  width: 20px;
  height: 2px;
  background: var(--sol-cyan);
  border-radius: 2px;
}

/* ── Cards ──────────────────────────────────────────── */

.card {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  border: 1px solid var(--border-subtle);
  padding: 28px;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out), border-color 0.35s;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
  border-color: var(--border-glow);
}

.glass {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.06);
}

/* ── Buttons ────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: all 0.3s var(--ease-out);
  text-decoration: none;
}
.btn-primary {
  background: var(--grad-btn);
  background-size: 200% 200%;
  color: #fff;
  box-shadow: var(--shadow-btn);
}
.btn-primary:hover {
  background-position: 100% 100%;
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(153,69,255,0.4);
}
.btn-secondary {
  background: var(--bg-hover);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}
.btn-secondary:hover {
  border-color: var(--sol-purple);
  background: rgba(153,69,255,0.08);
}
.btn-ghost {
  background: transparent;
  color: var(--sol-cyan);
  padding: 8px 16px;
}
.btn-ghost:hover { background: rgba(20,241,149,0.06); }

.btn-buy {
  background: var(--grad-badge);
  color: #0a0b0f;
  font-weight: 700;
  padding: 10px 24px;
  border-radius: var(--r-sm);
}
.btn-buy:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(20,241,149,0.3);
}
.btn-buy:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* ── Navbar ─────────────────────────────────────────── */

.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 16px 0;
  transition: background 0.4s, backdrop-filter 0.4s, padding 0.3s;
}
.navbar.scrolled {
  background: rgba(10,11,15,0.88);
  backdrop-filter: blur(16px);
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.2rem;
  text-decoration: none;
  color: var(--text-primary);
}
.nav-brand .logo {
  width: 32px; height: 32px;
  background: var(--grad-hero);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
}
.nav-links  { display: flex; gap: 8px; align-items: center; }
.nav-link   {
  padding: 8px 16px;
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s, background 0.2s;
}
.nav-link:hover { color: var(--text-primary); background: var(--bg-hover); }
.nav-link.active { color: var(--sol-cyan); }

/* ── Hero ───────────────────────────────────────────── */

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-bg .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.3;
  animation: float 12s ease-in-out infinite;
}
.hero-bg .orb-1 { width: 500px; height: 500px; background: var(--sol-purple); top: -100px; right: -100px; }
.hero-bg .orb-2 { width: 400px; height: 400px; background: var(--sol-cyan);   bottom: -80px; left: -60px; animation-delay: -4s; }
.hero-bg .orb-3 { width: 300px; height: 300px; background: var(--sol-blue);   top: 40%; left: 50%; animation-delay: -8s; }

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(30px, -30px) scale(1.05); }
  66%      { transform: translate(-20px, 20px) scale(0.95); }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
}
.hero-content h1 { margin-bottom: 20px; }
.hero-content p  { font-size: 1.15rem; color: var(--text-secondary); margin-bottom: 32px; max-width: 560px; }
.hero-actions     { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-stats {
  display: flex; gap: 40px;
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--border-subtle);
}
.hero-stat { text-align: left; }
.hero-stat .val { font-size: 1.8rem; font-weight: 800; }
.hero-stat .label { font-size: 0.8rem; color: var(--text-secondary); margin-top: 2px; }

/* ── Product Grid ───────────────────────────────────── */

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.product-card {
  position: relative;
  overflow: hidden;
}
.product-card .emoji {
  font-size: 3rem;
  margin-bottom: 16px;
  display: block;
}
.product-card .name  { font-weight: 700; font-size: 1.15rem; margin-bottom: 6px; }
.product-card .category {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}
.product-card .price {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--sol-cyan);
  margin-bottom: 16px;
}
.product-card .price .unit { font-size: 0.9rem; color: var(--text-secondary); font-weight: 400; }
.product-card .lamports {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  margin-top: -10px;
  margin-bottom: 16px;
}

/* ── Payment Flow ───────────────────────────────────── */

.flow-container {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 700px;
  margin: 0 auto;
}

.flow-step {
  display: flex;
  gap: 20px;
  padding: 20px 0;
  opacity: 0.35;
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
  transform: translateX(-8px);
}
.flow-step.active {
  opacity: 1;
  transform: translateX(0);
}
.flow-step.completed {
  opacity: 0.7;
  transform: translateX(0);
}
.flow-step.completed .step-icon { background: rgba(20,241,149,0.15); border-color: var(--sol-cyan); color: var(--sol-cyan); }

.step-icon {
  flex-shrink: 0;
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  background: var(--bg-hover);
  border: 2px solid var(--border-subtle);
  transition: all 0.4s;
}
.flow-step.active .step-icon {
  border-color: var(--sol-purple);
  background: rgba(153,69,255,0.15);
  box-shadow: 0 0 16px rgba(153,69,255,0.3);
  animation: pulse-icon 2s ease-in-out infinite;
}

@keyframes pulse-icon {
  0%, 100% { box-shadow: 0 0 16px rgba(153,69,255,0.3); }
  50%      { box-shadow: 0 0 28px rgba(153,69,255,0.5); }
}

.step-content { flex: 1; }
.step-content h4 { font-size: 0.95rem; font-weight: 600; margin-bottom: 4px; }
.step-content p  { font-size: 0.85rem; color: var(--text-secondary); }
.step-content .code-preview {
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--bg-primary);
  border-radius: var(--r-sm);
  border: 1px solid var(--border-subtle);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--sol-cyan);
  overflow-x: auto;
  white-space: pre;
}

.flow-line {
  width: 2px;
  height: 24px;
  background: var(--border-subtle);
  margin-left: 21px;
  transition: background 0.5s;
}
.flow-line.active { background: var(--sol-purple); }
.flow-line.completed { background: var(--sol-cyan); }

/* ── Architecture ───────────────────────────────────── */

.arch-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 768px) { .arch-grid { grid-template-columns: 1fr; } }

.arch-card .icon {
  width: 48px; height: 48px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 16px;
}
.arch-card .icon.purple { background: rgba(153,69,255,0.12); }
.arch-card .icon.cyan   { background: rgba(20,241,149,0.12); }
.arch-card .icon.blue   { background: rgba(0,209,255,0.12); }
.arch-card .icon.pink   { background: rgba(240,55,165,0.12); }
.arch-card .icon.orange { background: rgba(255,165,0,0.12); }

.arch-card h3 { margin-bottom: 8px; }
.arch-card p  { font-size: 0.9rem; color: var(--text-secondary); }

/* ── Comparison Table ───────────────────────────────── */

.compare-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--bg-card);
  border-radius: var(--r-lg);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}
.compare-table th, .compare-table td {
  padding: 14px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}
.compare-table th {
  background: var(--bg-hover);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}
.compare-table tr:last-child td { border-bottom: none; }
.compare-table td:first-child { font-weight: 600; }
.compare-table .evm     { color: var(--text-muted); }
.compare-table .solana  { color: var(--sol-cyan); font-weight: 600; }
.compare-table .improve { color: var(--sol-purple); font-weight: 700; font-family: 'JetBrains Mono', monospace; }

/* ── AI Chat ────────────────────────────────────────── */

.chat-panel {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 480px;
}
.chat-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-hover);
}
.chat-header .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--sol-cyan);
  animation: blink 2s infinite;
}
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
.chat-header span { font-weight: 600; font-size: 0.9rem; }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.msg {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: var(--r-md);
  font-size: 0.9rem;
  line-height: 1.5;
  animation: msg-in 0.3s var(--ease-out);
}
@keyframes msg-in { from { opacity: 0; transform: translateY(8px); } }

.msg.user  { align-self: flex-end; background: rgba(153,69,255,0.15); border: 1px solid rgba(153,69,255,0.2); }
.msg.agent { align-self: flex-start; background: var(--bg-hover); border: 1px solid var(--border-subtle); }
.msg.system {
  align-self: center;
  background: rgba(20,241,149,0.08);
  border: 1px solid rgba(20,241,149,0.15);
  color: var(--sol-cyan);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  text-align: center;
  max-width: 100%;
}
.msg .typing {
  display: inline-flex;
  gap: 4px;
}
.msg .typing span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-secondary);
  animation: typingDot 1.2s infinite;
}
.msg .typing span:nth-child(2) { animation-delay: 0.2s; }
.msg .typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot { 0%,60%,100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-4px); } }

.chat-input {
  display: flex;
  gap: 8px;
  padding: 14px 16px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
}
.chat-input input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}
.chat-input input:focus { border-color: var(--sol-purple); }
.chat-input input::placeholder { color: var(--text-muted); }
.chat-input button {
  background: var(--sol-purple);
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  padding: 10px 20px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.chat-input button:hover { background: #7B3FE4; }

/* ── Payment Modal ──────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s;
}
.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}
.modal {
  background: var(--bg-card);
  border-radius: var(--r-xl);
  border: 1px solid var(--border-subtle);
  padding: 36px;
  max-width: 480px;
  width: 90%;
  box-shadow: var(--shadow-glow);
  transform: scale(0.92);
  transition: transform 0.35s var(--ease-out);
}
.modal-overlay.show .modal { transform: scale(1); }

.modal h3 { margin-bottom: 6px; }
.modal .subtitle { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 24px; }

.modal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.9rem;
}
.modal-row:last-of-type { border-bottom: none; }
.modal-row .label { color: var(--text-secondary); }
.modal-row .value { font-weight: 600; font-family: 'JetBrains Mono', monospace; }
.modal-row .value.highlight { color: var(--sol-cyan); }

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}
.modal-actions .btn { flex: 1; }

/* ── Payment Status Bar ─────────────────────────────── */

.payment-status-bar {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(100px);
  z-index: 150;
  background: var(--bg-card);
  border-radius: var(--r-lg);
  border: 1px solid var(--border-glow);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-glow);
  transition: transform 0.5s var(--ease-out);
  max-width: 90vw;
}
.payment-status-bar.show { transform: translateX(-50%) translateY(0); }
.payment-status-bar .spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border-subtle);
  border-top-color: var(--sol-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.payment-status-bar .status-text { font-size: 0.85rem; font-weight: 500; }
.payment-status-bar .status-text .tx-link {
  color: var(--sol-cyan);
  text-decoration: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
}

/* ── Footer ─────────────────────────────────────────── */

.footer {
  padding: 48px 0 32px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 16px;
}
.footer a {
  display: block;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 4px 0;
  transition: color 0.2s;
}
.footer a:hover { color: var(--text-primary); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Scroll Animations ──────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive ─────────────────────────────────────── */

@media (max-width: 768px) {
  .section  { padding: 60px 0; }
  .hero-stats { gap: 24px; flex-wrap: wrap; }
  .product-grid { grid-template-columns: 1fr; }
  .arch-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .nav-links .nav-link { display: none; }
  .chat-panel { height: 400px; }
  .hero-actions { flex-direction: column; }
}

/* ── Wallet Connect Indicator ───────────────────────── */

.wallet-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.2s;
}
.wallet-indicator:hover { border-color: var(--sol-purple); }
.wallet-indicator .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
}
.wallet-indicator.connected .dot { background: var(--sol-cyan); }
.wallet-indicator.disconnected .dot { background: var(--sol-pink); }

/* ── Trust Badge ────────────────────────────────────── */

.trust-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.trust-badge {
  padding: 6px 14px;
  border-radius: var(--r-sm);
  font-size: 0.8rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-hover);
  border: 1px solid var(--border-subtle);
}

/* ── Scrollbar ──────────────────────────────────────── */

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--bg-hover); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Two-col layout ─────────────────────────────────── */

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}
@media (max-width: 768px) { .two-col { grid-template-columns: 1fr; } }
