/* =========================
   HOW IT WORKS PAGE
   ========================= */

body {
  margin: 0;
  color: var(--ink);
}

/* ---------- Layout ---------- */

.container {
  width: min(1100px, 92%);
  margin: 0 auto;
}

/* ---------- HERO ---------- */

.how-hero {
  padding: 80px 0 40px;
}

.how-hero h1 {
  font-size: clamp(38px, 5vw, 64px);
  line-height: 1.05;
  margin: 0 0 18px;
}

.how-hero p {
  max-width: 720px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

/* ---------- SECTIONS ---------- */

.how-section {
  padding: 70px 0;
}

.how-section.alt {
  background: rgba(0,0,0,0.02);
}

.grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
  align-items: center;
}

/* ---------- TEXT ---------- */

.text h2 {
  font-size: 28px;
  margin: 0 0 14px;
}

.text p {
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 18px;
}

/* ---------- MINI CARDS ---------- */

.card-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mini-card {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--ink);
  
  transition: transform 0.25s cubic-bezier(0.25, 0.8, 0.25, 1), 
              box-shadow 0.25s cubic-bezier(0.25, 0.8, 0.25, 1),
              border-color 0.2s ease;
}

.mini-card:hover {
  transform: translateY(-4px);
  
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12), 
              0 4px 6px rgba(0, 0, 0, 0.08);
              
  border-color: rgba(255, 255, 255, 0.2);
}

/* ---------- VISUAL BOX ---------- */

.visual {
  display: flex;
  justify-content: center;
}

.diagram-box {
  width: 100%;
  height: 220px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(124,58,237,0.08), rgba(0,0,0,0.02));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--muted);
}

.diagram-box.highlight {
  border-color: rgba(124,58,237,0.35);
  background: linear-gradient(135deg, rgba(124,58,237,0.12), rgba(0,0,0,0.02));
}

/* ---------- CTA ---------- */

.how-cta {
  padding: 80px 0;
  text-align: center;
}

.how-cta h2 {
  font-size: 32px;
  margin-bottom: 10px;
}

.how-cta p {
  color: var(--muted);
  margin-bottom: 20px;
}

.cta-button {
  display: inline-block;
  padding: 12px 18px;
  border-radius: 10px;
  background: var(--purple);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

/* ---------- RESPONSIVE ---------- */

@media (max-width: 900px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .visual {
    order: -1;
  }
}

/* General Diagram enhancements */
.diagram-box {
  background: #0f172a;
  color: #f8fafc;
  border-radius: 12px;
  padding: 20px;
  font-family: monospace;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
}

/* Section 1: Dropzone & Streams */
.dropzone {
  cursor: pointer;
  border: 2px dashed #334155;
  transition: border-color 0.3s;
}
.dropzone:hover { border-color: #3b82f6; }
.upload-icon { font-size: 2.5rem; margin-bottom: 10px; animation: float 3s ease-in-out infinite; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.data-particle {
  position: absolute;
  background: #3b82f6;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  animation: streamUp 1.5s linear forwards;
}
@keyframes streamUp {
  0% { transform: translateY(100px) scale(0.8); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateY(-150px) scale(1); opacity: 0; }
}

/* Section 2: Terminal */
.terminal-box { align-items: flex-start; justify-content: flex-start; background: #020617; }
.terminal-header { display: flex; align-items: center; gap: 6px; width: 100%; border-bottom: 1px solid #1e293b; padding-bottom: 8px; margin-bottom: 10px; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.red { background: #ef4444; } .yellow { background: #f59e0b; } .green { background: #10b981; }
.terminal-title { color: #64748b; font-size: 12px; margin-left: 4px; }
.terminal-body { width: 100%; font-size: 13px; color: #38bdf8; text-align: left; overflow-y: hidden; height: 150px; }
.log-line { margin-bottom: 4px; opacity: 0; animation: fadeIn 0.3s forwards; }
@keyframes fadeIn { to { opacity: 1; } }

/* Section 3: Metrics */
.results-box { flex-direction: row; gap: 20px; background: linear-gradient(135deg, #0f172a, #1e1b4b); }
.metric-card { background: rgba(255,255,255,0.05); padding: 20px; border-radius: 8px; text-align: center; flex: 1; border: 1px solid rgba(255,255,255,0.1); }
.metric-label { display: block; font-size: 12px; color: #94a3b8; text-transform: uppercase; margin-bottom: 8px; font-family: sans-serif;}
.metric-value { font-size: 2rem; font-weight: bold; color: #10b981; }
