/* ═══════════════════════════════════════════════════════
   ThreadSync Enterprise Design System — Components
   v1.0 — Cards, badges, buttons, lists, proof surfaces.
   Only 3 card types. Only 2 badge types. Consistency.
   ═══════════════════════════════════════════════════════ */

/* ════════════════════
   TYPOGRAPHY
   ════════════════════ */
.e-h1 {
  font-size: var(--h1);
  font-weight: var(--fw-black);
  line-height: var(--lh-tight);
  color: var(--text-primary);
  letter-spacing: var(--ls-tight);
}
.e-h2 {
  font-size: var(--h2);
  font-weight: var(--fw-bold);
  line-height: var(--lh-snug);
  color: var(--text-primary);
}
.e-h3 {
  font-size: var(--h3);
  font-weight: var(--fw-bold);
  line-height: var(--lh-snug);
  color: var(--text-primary);
}
.e-lead {
  font-size: var(--text-lead);
  line-height: var(--lh-body);
  color: var(--text-secondary);
}
.e-body {
  font-size: var(--text-base);
  line-height: var(--lh-body);
  color: var(--text-secondary);
}
.e-caption {
  font-size: var(--text-sm);
  line-height: var(--lh-body);
  color: var(--text-muted);
}
.e-gradient-text {
  background: linear-gradient(135deg, var(--green), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ════════════════════
   EYEBROW (section label)
   ════════════════════ */
.e-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--blue-bg);
  border: 1px solid var(--blue-border);
  border-radius: var(--radius-pill);
  padding: 0.375rem 1rem;
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  color: var(--blue);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}
.e-eyebrow--green {
  background: var(--green-bg);
  border-color: var(--green-border);
  color: var(--green);
}
.e-eyebrow--purple {
  background: var(--purple-bg);
  border-color: var(--purple-border);
  color: var(--purple);
}
.e-eyebrow i { font-size: 0.5rem; }

/* ════════════════════
   CARDS — 3 types only
   ════════════════════ */

/* Base card */
.e-card {
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 2vw, 2rem);
  transition: transform var(--duration-base) var(--ease-default),
              border-color var(--duration-base) var(--ease-default),
              box-shadow var(--duration-base) var(--ease-default);
}

/* Card: Border (default — subtle, grounded) */
.e-card--border {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
}
.e-card--border:hover {
  border-color: var(--border-default);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Card: Elevated (featured items, comparison) */
.e-card--elevated {
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}
.e-card--elevated:hover {
  border-color: var(--border-default);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Card: Frame (product screenshot / console mock) */
.e-card--frame {
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  position: relative;
  backdrop-filter: blur(16px);
}
.e-card--frame::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg,
    rgba(74,222,128,0.12),
    rgba(96,165,250,0.12),
    rgba(167,139,250,0.08));
  z-index: -1;
}

/* Card accent top border */
.e-card--accent-green  { border-top: 3px solid var(--green);  }
.e-card--accent-blue   { border-top: 3px solid var(--blue);   }
.e-card--accent-purple { border-top: 3px solid var(--purple);  }
.e-card--accent-amber  { border-top: 3px solid var(--amber);  }
.e-card--accent-pink   { border-top: 3px solid var(--pink);   }

/* Card hover glow bar */
.e-card[data-accent]::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-color, var(--blue)), transparent);
  opacity: 0;
  transition: opacity var(--duration-base);
}
.e-card[data-accent]:hover::after { opacity: 1; }

/* ════════════════════
   ICON CHIP
   ════════════════════ */
.e-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  flex-shrink: 0;
}
.e-icon--sm { width: 36px; height: 36px; font-size: 0.9375rem; }
.e-icon--lg { width: 56px; height: 56px; font-size: 1.375rem; }

/* ════════════════════
   FEATURE LIST (inside cards)
   ════════════════════ */
.e-feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.e-feature-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--text-base);
  line-height: var(--lh-body);
  color: var(--text-secondary);
}
.e-feature-list li::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-color, var(--blue));
  flex-shrink: 0;
  margin-top: 0.625rem;
}

/* Check list (trust sections) */
.e-check-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.e-check-list li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.e-check-list li i {
  color: var(--green);
  font-size: 0.625rem;
  flex-shrink: 0;
}

/* ════════════════════
   BADGE / CHIP
   ════════════════════ */
.e-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-pill);
}
.e-badge--green  { background: var(--green-bg);  color: var(--green);  border: 1px solid rgba(74,222,128,0.2); }
.e-badge--blue   { background: var(--blue-bg);   color: var(--blue);   border: 1px solid rgba(96,165,250,0.2); }
.e-badge--purple { background: var(--purple-bg); color: var(--purple); border: 1px solid rgba(167,139,250,0.2); }
.e-badge--amber  { background: var(--amber-bg);  color: var(--amber);  border: 1px solid rgba(251,191,36,0.2); }

/* Floating badge (on cards) */
.e-badge--float {
  position: absolute;
  top: -10px;
  left: 1.5rem;
  z-index: 1;
}

/* ════════════════════
   PROOF ROW (trust signals)
   ════════════════════ */
.e-proof-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1rem, 3vw, 2.5rem);
  flex-wrap: wrap;
}
.e-proof-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-muted);
  white-space: nowrap;
}
.e-proof-item i {
  color: var(--green);
  font-size: 0.75rem;
}

/* ════════════════════
   METRICS STRIP
   ════════════════════ */
.e-metric {
  text-align: center;
  position: relative;
}
.e-metric-value {
  font-size: clamp(1.75rem, 2.5vw, 2.5rem);
  font-weight: var(--fw-black);
  line-height: 1.2;
}
.e-metric-value--gradient {
  background: linear-gradient(135deg, var(--green), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.e-metric-label {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: var(--space-1);
  font-weight: var(--fw-medium);
}

/* Divider between metrics */
.e-metric + .e-metric::before {
  content: '';
  position: absolute;
  left: -0.75rem;
  top: 10%;
  height: 80%;
  width: 1px;
  background: var(--border-subtle);
}
@media (max-width: 768px) {
  .e-metric + .e-metric::before { display: none; }
}

/* ════════════════════
   COMPARISON (Before/After)
   ════════════════════ */
.e-compare {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  align-items: stretch;
}
.e-compare-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.e-compare-label {
  font-size: var(--text-xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: var(--ls-caps);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
}
.e-compare-label--red  { color: var(--red); }
.e-compare-label--green { color: var(--green); }

.e-compare-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  line-height: 1.5;
  color: #cbd5e1;
}
.e-compare-item i { margin-top: 0.15rem; flex-shrink: 0; }
.e-compare-item--bad {
  background: var(--red-bg);
  border: 1px solid rgba(248,113,113,0.12);
}
.e-compare-item--bad i { color: var(--red); }
.e-compare-item--good {
  background: rgba(74,222,128,0.06);
  border: 1px solid rgba(74,222,128,0.12);
}
.e-compare-item--good i { color: var(--green); }

.e-compare-divider {
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--border-strong), transparent);
  position: relative;
}
.e-compare-divider::after {
  content: '\f061';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  background: var(--bg-page);
  border: 1px solid var(--border-default);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
  font-size: var(--text-xs);
}

@media (max-width: 1024px) {
  .e-compare { grid-template-columns: 1fr; }
  .e-compare-divider { display: none; }
}

/* ════════════════════
   TIMELINE / STEPPER
   ════════════════════ */
.e-timeline {
  display: flex;
  position: relative;
  margin-top: var(--space-10);
}
.e-timeline::before {
  content: '';
  position: absolute;
  top: 40px;
  left: 80px;
  right: 80px;
  height: 2px;
  background: linear-gradient(90deg, var(--green), var(--blue), var(--purple));
}
.e-timeline-step {
  flex: 1;
  text-align: center;
  position: relative;
}
.e-timeline-num {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-5);
  font-size: 1.75rem;
  font-weight: var(--fw-black);
  position: relative;
  z-index: 1;
}
.e-timeline-title {
  font-size: var(--text-lg);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}
.e-timeline-desc {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: var(--lh-body);
  max-width: 280px;
  margin: 0 auto;
}
.e-timeline-artifact {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: var(--space-2);
  font-style: italic;
}

@media (max-width: 768px) {
  .e-timeline { flex-direction: column; gap: var(--space-8); }
  .e-timeline::before {
    top: 0; bottom: 0; left: 40px;
    width: 2px; height: auto; right: auto;
  }
  .e-timeline-step { text-align: left; padding-left: 5.5rem; }
  .e-timeline-num {
    position: absolute; left: 0;
    width: 56px; height: 56px;
    font-size: 1.25rem;
  }
  .e-timeline-desc { margin: 0; max-width: none; }
}

/* ════════════════════
   PRODUCT FRAME (console mockup)
   ════════════════════ */
.e-frame-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}
.e-frame-title {
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.e-frame-title i { color: var(--green); font-size: 0.5rem; }
.e-frame-status {
  font-size: var(--text-xs);
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 0.375rem;
}
.e-frame-status::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--green);
  border-radius: 50%;
  animation: e-pulse 2s ease-in-out infinite;
}
@keyframes e-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

/* KPI tiles inside frame */
.e-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.e-kpi {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  text-align: center;
}
.e-kpi-value {
  font-size: 1.375rem;
  font-weight: var(--fw-bold);
  font-family: var(--font-mono);
  margin-bottom: 0.125rem;
}
.e-kpi-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
}

/* Event feed inside frame */
.e-feed { display: flex; flex-direction: column; gap: var(--space-2); }
.e-feed-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.03);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  animation: e-feed-in 0.5s ease-out both;
}
.e-feed-item:nth-child(1) { animation-delay: 0.4s; }
.e-feed-item:nth-child(2) { animation-delay: 1.0s; }
.e-feed-item:nth-child(3) { animation-delay: 1.6s; }
.e-feed-item:nth-child(4) { animation-delay: 2.2s; }
@keyframes e-feed-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.e-feed-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.e-feed-dot--ok     { background: var(--green); }
.e-feed-dot--warn   { background: var(--amber); }
.e-feed-dot--action { background: var(--blue); }
.e-feed-time {
  margin-left: auto;
  font-size: var(--text-xs);
  color: var(--text-faint);
  white-space: nowrap;
  font-family: var(--font-mono);
}

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

/* ════════════════════
   FOOTNOTE / NOTE
   ════════════════════ */
.e-note {
  margin-top: var(--space-6);
  padding: var(--space-4) var(--space-5);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: var(--lh-body);
}
